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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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