() {};
+ HttpResponse response =
+ createFeedConnectionsForExistingAccountsForHttpResponse(
+ accessToken, xeroTenantId, existingAccountFeedConnectionsRequest);
+ return apiClient.getObjectMapper().readValue(response.getContent(), typeRef);
+ } catch (HttpResponseException e) {
+ if (logger.isDebugEnabled()) {
+ logger.debug(
+ "------------------ HttpResponseException "
+ + e.getStatusCode()
+ + " : createFeedConnectionsForExistingAccounts -------------------");
+ logger.debug(e.toString());
+ }
+ XeroApiExceptionHandler handler = new XeroApiExceptionHandler();
+ handler.execute(e);
+ } catch (IOException ioe) {
+ throw ioe;
+ }
+ return null;
+ }
+
+ /**
+ * Connect feeds to Xero Bank Accounts that already exist Creates Feed Connections against Xero
+ * Bank Accounts the Organisation already has. Each item must include the `accountId` of
+ * the account it connects to. Xero performs no matching of its own, and `accountNumber`
+ * and `accountName` are ignored if supplied. Use this endpoint whenever the customer
+ * has chosen an account, including when they are reconnecting a feed that was previously
+ * terminated. Each item is processed independently, and the response has one result per request
+ * item in request order.
+ *
+ * 200 - All items are 2xx: each one reached its desired state, and there is nothing
+ * left for you to do. A created item has `status` `SUCCESS` and
+ * `statusCode` `201`. A response that mixes successful items with rejected or
+ * partially failed ones is a `207`, not a `200`.
+ *
+ *
207 - Some items did not reach their desired state. Each item has its own result, so
+ * read the `items` array rather than the envelope. Partial failures are rare, and
+ * nearly all are recoverable by your app. On this endpoint a partial failure is
+ * `partial-failure-previous-connection-deletion` or
+ * `partial-failure-connection-creation`: resend the same item.
+ * `error.accountId` and `error.connectionId` identify the account and
+ * connection; `error.subtype` is optional diagnostics. If the resend returns 409
+ * `feed-already-connected-in-current-organisation`, the earlier attempt was recorded:
+ * treat the item as created. A connection an earlier attempt left in Xero without a feed
+ * connection never causes that 409: the resend replaces it. See
+ * https://developer.xero.com/documentation/api/bankfeeds/feedconnections-2-0-errors/#partial-failures
+ * . `207` means the item codes were neither all 2xx nor all 4xx. A
+ * `PARTIAL_FAILURE` item has `statusCode` `500`: the item did not
+ * complete, and the state it left behind needs attention or could not be confirmed.
+ * `error.subtype` says which. A `REJECTED` item whose error is
+ * `internal-error` or `too-many-requests` also has `statusCode`
+ * `500`, so it makes the response a `207` (as does a batch in which all items
+ * are like that): something unexpected went wrong for that item, and nothing was written, or Xero
+ * confirmed that nothing took effect, so resend that item as it is.
+ *
+ *
400 - All items are 4xx: either the request wrote nothing at all, or the request
+ * itself could not be processed. A `400` guarantees that none of the items was written
+ * and none reached its desired state. A batch in which any item was partly written has at least
+ * one `500` item code, so it is a `207`, never a `400`. When the
+ * request itself was at fault — an unreadable body, an empty `items` array, more than
+ * 50 items, or a missing header — the body is a problem object and there is no `items`
+ * array at all.
+ *
+ *
401 - The request did not include a valid Xero Identity bearer token. A request
+ * missing both a token and a required header is answered `400`, because headers are
+ * checked first.
+ *
+ *
403 - The Application, the Organisation, or the user is not permitted to make this
+ * request. Read `type` to distinguish the cases.
+ *
+ *
415 - The request did not use `Content-Type: application/json`. V1 rewrote
+ * a wrong value for one legacy Application; V2 does not.
+ *
+ *
500 - An error occurred inside Xero part-way through the request, and there is no
+ * `items` array to say how far it reached. Some items may already have been applied.
+ * Recover by re-sending the identical request. On a create, items already created come back as
+ * `feed-already-connected-in-current-organisation`; on a termination, items already
+ * terminated come back as `feed-not-found-or-already-deleted`. In both cases the
+ * remaining items are processed.
+ *
+ * @param xeroTenantId Xero identifier for Tenant
+ * @param existingAccountFeedConnectionsRequest The existingAccountFeedConnectionsRequest
+ * parameter
+ * @param accessToken Authorization token for user set in header of each request
+ * @return HttpResponse
+ * @throws IOException if an error occurs while attempting to invoke the API Partial-failure
+ * recovery by error type
+ * @see Connect
+ * feeds to Xero Bank Accounts that already exist Documentation
+ */
+ public HttpResponse createFeedConnectionsForExistingAccountsForHttpResponse(
+ String accessToken,
+ String xeroTenantId,
+ ExistingAccountFeedConnectionsRequest existingAccountFeedConnectionsRequest)
+ throws IOException {
+ // verify the required parameter 'xeroTenantId' is set
+ if (xeroTenantId == null) {
+ throw new IllegalArgumentException(
+ "Missing the required parameter 'xeroTenantId' when calling"
+ + " createFeedConnectionsForExistingAccounts");
+ } // verify the required parameter 'existingAccountFeedConnectionsRequest' is set
+ if (existingAccountFeedConnectionsRequest == null) {
+ throw new IllegalArgumentException(
+ "Missing the required parameter 'existingAccountFeedConnectionsRequest' when calling"
+ + " createFeedConnectionsForExistingAccounts");
+ }
+ if (accessToken == null) {
+ throw new IllegalArgumentException(
+ "Missing the required parameter 'accessToken' when calling"
+ + " createFeedConnectionsForExistingAccounts");
+ }
+ HttpHeaders headers = new HttpHeaders();
+ headers.set("Xero-Tenant-Id", xeroTenantId);
+ headers.setAccept("application/json;application/problem+json");
+ headers.setUserAgent(this.getUserAgent());
+ UriBuilder uriBuilder =
+ UriBuilder.fromUri(apiClient.getBasePath() + "/FeedConnections/ExistingAccount");
+ String url = uriBuilder.build().toString();
+ GenericUrl genericUrl = new GenericUrl(url);
+ if (logger.isDebugEnabled()) {
+ logger.debug("POST " + genericUrl.toString());
+ }
+
+ HttpContent content = null;
+ content = apiClient.new JacksonJsonHttpContent(existingAccountFeedConnectionsRequest);
+
+ Credential credential =
+ new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken);
+ HttpTransport transport = apiClient.getHttpTransport();
+ HttpRequestFactory requestFactory = transport.createRequestFactory(credential);
+ return requestFactory
+ .buildRequest(HttpMethods.POST, genericUrl, content)
+ .setHeaders(headers)
+ .setConnectTimeout(apiClient.getConnectionTimeout())
+ .setReadTimeout(apiClient.getReadTimeout())
+ .execute();
+ }
+
+ /**
+ * Create Xero Bank Accounts and connect feeds to them Creates a new Xero Bank Account for each
+ * item and connects a feed to it. `accountId` must not be supplied. An item that
+ * includes one — including an all-zeros GUID, or a value that is not a GUID at all — is rejected,
+ * because supplying an account identifier means the Application intends to connect an account
+ * that already exists, which is what `/FeedConnections/ExistingAccount` is for.
+ * `accountNumber` and `accountName` are required here, since they describe
+ * the account being created. If the Organisation already has an account with the requested name,
+ * the item is rejected with `account-name-already-exists` naming that account, and no
+ * account is created. The same applies to a second item in the same request that uses a name an
+ * earlier item has just taken.
+ *
+ *
200 - All items are 2xx: each one reached its desired state, and there is nothing
+ * left for you to do. A created item has `status` `SUCCESS` and
+ * `statusCode` `201`. A response that mixes successful items with rejected or
+ * partially failed ones is a `207`, not a `200`.
+ *
+ *
207 - Some items did not reach their desired state. Each item has its own result, so
+ * read the `items` array rather than the envelope. Partial failures are rare, and
+ * nearly all are recoverable by your app. On this endpoint two types apply. With
+ * `partial-failure-new-account-creation` the account was created: do not resend the
+ * same NewAccount item, because its `accountName` is now taken. Connect the created
+ * `error.accountId` through ExistingAccount instead. If that request returns 409
+ * `feed-already-connected-in-current-organisation`, the earlier attempt was recorded:
+ * treat the item as created. With `partial-failure-new-account-existence-not-confirmed`
+ * the account may or may not have been created, and nothing else was set up for it. The error has
+ * `error.accountName`, but no `error.accountId` or
+ * `error.connectionId`. Use the Accounting API to check whether an account named
+ * `error.accountName` exists. If it does, connect it through ExistingAccount. If it
+ * does not, resend the item. If your app has a user, you can show them this message instead:
+ * \"Something went wrong. Please check whether your chosen account name now exists. If it
+ * does, connect it. If not, try creating the new one again.\" `error.subtype` is
+ * optional diagnostics. See
+ * https://developer.xero.com/documentation/api/bankfeeds/feedconnections-2-0-errors/#partial-failures
+ * . `207` means the item codes were neither all 2xx nor all 4xx. A
+ * `PARTIAL_FAILURE` item has `statusCode` `500`: the item did not
+ * complete, and the state it left behind needs attention or could not be confirmed.
+ * `error.subtype` says which. A `REJECTED` item whose error is
+ * `internal-error` or `too-many-requests` also has `statusCode`
+ * `500`, so it makes the response a `207` (as does a batch in which all items
+ * are like that): something unexpected went wrong for that item, and nothing was written, or Xero
+ * confirmed that nothing took effect, so resend that item as it is.
+ *
+ *
400 - All items are 4xx: either the request wrote nothing at all, or the request
+ * itself could not be processed. A `400` guarantees that none of the items was written
+ * and none reached its desired state. A batch in which any item was partly written has at least
+ * one `500` item code, so it is a `207`, never a `400`. When the
+ * request itself was at fault — an unreadable body, an empty `items` array, more than
+ * 50 items, or a missing header — the body is a problem object and there is no `items`
+ * array at all.
+ *
+ *
401 - The request did not include a valid Xero Identity bearer token. A request
+ * missing both a token and a required header is answered `400`, because headers are
+ * checked first.
+ *
+ *
403 - The Application, the Organisation, or the user is not permitted to make this
+ * request. Read `type` to distinguish the cases.
+ *
+ *
415 - The request did not use `Content-Type: application/json`. V1 rewrote
+ * a wrong value for one legacy Application; V2 does not.
+ *
+ *
500 - An error occurred inside Xero part-way through the request, and there is no
+ * `items` array to say how far it reached. Some items may already have been applied.
+ * Recover by re-sending the identical request. On a create, items already created come back as
+ * `feed-already-connected-in-current-organisation`; on a termination, items already
+ * terminated come back as `feed-not-found-or-already-deleted`. In both cases the
+ * remaining items are processed.
+ *
+ * @param xeroTenantId Xero identifier for Tenant
+ * @param newAccountFeedConnectionsRequest The newAccountFeedConnectionsRequest parameter
+ * @param accessToken Authorization token for user set in header of each request
+ * @return BulkFeedConnectionResponse
+ * @throws IOException if an error occurs while attempting to invoke the API Partial-failure
+ * recovery by error type
+ * @see Create
+ * Xero Bank Accounts and connect feeds to them Documentation
+ */
+ public BulkFeedConnectionResponse createFeedConnectionsForNewAccounts(
+ String accessToken,
+ String xeroTenantId,
+ NewAccountFeedConnectionsRequest newAccountFeedConnectionsRequest)
+ throws IOException {
+ try {
+ TypeReference typeRef =
+ new TypeReference() {};
+ HttpResponse response =
+ createFeedConnectionsForNewAccountsForHttpResponse(
+ accessToken, xeroTenantId, newAccountFeedConnectionsRequest);
+ return apiClient.getObjectMapper().readValue(response.getContent(), typeRef);
+ } catch (HttpResponseException e) {
+ if (logger.isDebugEnabled()) {
+ logger.debug(
+ "------------------ HttpResponseException "
+ + e.getStatusCode()
+ + " : createFeedConnectionsForNewAccounts -------------------");
+ logger.debug(e.toString());
+ }
+ XeroApiExceptionHandler handler = new XeroApiExceptionHandler();
+ handler.execute(e);
+ } catch (IOException ioe) {
+ throw ioe;
+ }
+ return null;
+ }
+
+ /**
+ * Create Xero Bank Accounts and connect feeds to them Creates a new Xero Bank Account for each
+ * item and connects a feed to it. `accountId` must not be supplied. An item that
+ * includes one — including an all-zeros GUID, or a value that is not a GUID at all — is rejected,
+ * because supplying an account identifier means the Application intends to connect an account
+ * that already exists, which is what `/FeedConnections/ExistingAccount` is for.
+ * `accountNumber` and `accountName` are required here, since they describe
+ * the account being created. If the Organisation already has an account with the requested name,
+ * the item is rejected with `account-name-already-exists` naming that account, and no
+ * account is created. The same applies to a second item in the same request that uses a name an
+ * earlier item has just taken.
+ *
+ * 200 - All items are 2xx: each one reached its desired state, and there is nothing
+ * left for you to do. A created item has `status` `SUCCESS` and
+ * `statusCode` `201`. A response that mixes successful items with rejected or
+ * partially failed ones is a `207`, not a `200`.
+ *
+ *
207 - Some items did not reach their desired state. Each item has its own result, so
+ * read the `items` array rather than the envelope. Partial failures are rare, and
+ * nearly all are recoverable by your app. On this endpoint two types apply. With
+ * `partial-failure-new-account-creation` the account was created: do not resend the
+ * same NewAccount item, because its `accountName` is now taken. Connect the created
+ * `error.accountId` through ExistingAccount instead. If that request returns 409
+ * `feed-already-connected-in-current-organisation`, the earlier attempt was recorded:
+ * treat the item as created. With `partial-failure-new-account-existence-not-confirmed`
+ * the account may or may not have been created, and nothing else was set up for it. The error has
+ * `error.accountName`, but no `error.accountId` or
+ * `error.connectionId`. Use the Accounting API to check whether an account named
+ * `error.accountName` exists. If it does, connect it through ExistingAccount. If it
+ * does not, resend the item. If your app has a user, you can show them this message instead:
+ * \"Something went wrong. Please check whether your chosen account name now exists. If it
+ * does, connect it. If not, try creating the new one again.\" `error.subtype` is
+ * optional diagnostics. See
+ * https://developer.xero.com/documentation/api/bankfeeds/feedconnections-2-0-errors/#partial-failures
+ * . `207` means the item codes were neither all 2xx nor all 4xx. A
+ * `PARTIAL_FAILURE` item has `statusCode` `500`: the item did not
+ * complete, and the state it left behind needs attention or could not be confirmed.
+ * `error.subtype` says which. A `REJECTED` item whose error is
+ * `internal-error` or `too-many-requests` also has `statusCode`
+ * `500`, so it makes the response a `207` (as does a batch in which all items
+ * are like that): something unexpected went wrong for that item, and nothing was written, or Xero
+ * confirmed that nothing took effect, so resend that item as it is.
+ *
+ *
400 - All items are 4xx: either the request wrote nothing at all, or the request
+ * itself could not be processed. A `400` guarantees that none of the items was written
+ * and none reached its desired state. A batch in which any item was partly written has at least
+ * one `500` item code, so it is a `207`, never a `400`. When the
+ * request itself was at fault — an unreadable body, an empty `items` array, more than
+ * 50 items, or a missing header — the body is a problem object and there is no `items`
+ * array at all.
+ *
+ *
401 - The request did not include a valid Xero Identity bearer token. A request
+ * missing both a token and a required header is answered `400`, because headers are
+ * checked first.
+ *
+ *
403 - The Application, the Organisation, or the user is not permitted to make this
+ * request. Read `type` to distinguish the cases.
+ *
+ *
415 - The request did not use `Content-Type: application/json`. V1 rewrote
+ * a wrong value for one legacy Application; V2 does not.
+ *
+ *
500 - An error occurred inside Xero part-way through the request, and there is no
+ * `items` array to say how far it reached. Some items may already have been applied.
+ * Recover by re-sending the identical request. On a create, items already created come back as
+ * `feed-already-connected-in-current-organisation`; on a termination, items already
+ * terminated come back as `feed-not-found-or-already-deleted`. In both cases the
+ * remaining items are processed.
+ *
+ * @param xeroTenantId Xero identifier for Tenant
+ * @param newAccountFeedConnectionsRequest The newAccountFeedConnectionsRequest parameter
+ * @param accessToken Authorization token for user set in header of each request
+ * @return HttpResponse
+ * @throws IOException if an error occurs while attempting to invoke the API Partial-failure
+ * recovery by error type
+ * @see Create
+ * Xero Bank Accounts and connect feeds to them Documentation
+ */
+ public HttpResponse createFeedConnectionsForNewAccountsForHttpResponse(
+ String accessToken,
+ String xeroTenantId,
+ NewAccountFeedConnectionsRequest newAccountFeedConnectionsRequest)
+ throws IOException {
+ // verify the required parameter 'xeroTenantId' is set
+ if (xeroTenantId == null) {
+ throw new IllegalArgumentException(
+ "Missing the required parameter 'xeroTenantId' when calling"
+ + " createFeedConnectionsForNewAccounts");
+ } // verify the required parameter 'newAccountFeedConnectionsRequest' is set
+ if (newAccountFeedConnectionsRequest == null) {
+ throw new IllegalArgumentException(
+ "Missing the required parameter 'newAccountFeedConnectionsRequest' when calling"
+ + " createFeedConnectionsForNewAccounts");
+ }
+ if (accessToken == null) {
+ throw new IllegalArgumentException(
+ "Missing the required parameter 'accessToken' when calling"
+ + " createFeedConnectionsForNewAccounts");
+ }
+ HttpHeaders headers = new HttpHeaders();
+ headers.set("Xero-Tenant-Id", xeroTenantId);
+ headers.setAccept("application/json;application/problem+json");
+ headers.setUserAgent(this.getUserAgent());
+ UriBuilder uriBuilder =
+ UriBuilder.fromUri(apiClient.getBasePath() + "/FeedConnections/NewAccount");
+ String url = uriBuilder.build().toString();
+ GenericUrl genericUrl = new GenericUrl(url);
+ if (logger.isDebugEnabled()) {
+ logger.debug("POST " + genericUrl.toString());
+ }
+
+ HttpContent content = null;
+ content = apiClient.new JacksonJsonHttpContent(newAccountFeedConnectionsRequest);
+
+ Credential credential =
+ new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken);
+ HttpTransport transport = apiClient.getHttpTransport();
+ HttpRequestFactory requestFactory = transport.createRequestFactory(credential);
+ return requestFactory
+ .buildRequest(HttpMethods.POST, genericUrl, content)
+ .setHeaders(headers)
+ .setConnectTimeout(apiClient.getConnectionTimeout())
+ .setReadTimeout(apiClient.getReadTimeout())
+ .execute();
+ }
+
+ /**
+ * Terminate Feed Connections Terminates the Feed Connections named in the request. Terminating a
+ * Feed Connection discontinues the bank feed, and does not otherwise affect the customer's
+ * data in Xero. Each item is identified by the Feed Connection `id` alone. An item
+ * naming a Feed Connection that does not exist, has already been terminated, or belongs to a
+ * different Application is reported as `feed-not-found-or-already-deleted` with
+ * `status` `SUCCESS` and `statusCode` `204` — there was
+ * nothing to terminate, which is not a failure, and is reported the same way a real termination
+ * is. The same identifier may not appear twice in one request. Re-sending a completed delete is
+ * idempotent. If an item reports `PARTIAL_FAILURE`, or the original response was lost,
+ * resend the same DeleteRequests item. The retry checks whether the connection remains and
+ * terminates it if needed. A `SUCCESS` item on the resend means the deletion is
+ * complete, including `feed-not-found-or-already-deleted` at `statusCode`
+ * `204`. If a retry keeps reporting `PARTIAL_FAILURE`, contact Xero support
+ * with the connection id in `error.connectionId`.
+ *
+ *
200 - All items are 2xx: each one reached its desired state, and there is nothing
+ * left for you to do. This includes a request in which none of the identifiers matched a
+ * connection to terminate, since `feed-not-found-or-already-deleted` is reported at
+ * `statusCode` `204` — the requested final state already holds, which is not
+ * a failure. A response that mixes these with rejected or partially failed items is a
+ * `207`.
+ *
+ *
207 - Some items did not reach their desired state. Each item has its own result, so
+ * read the `items` array rather than the envelope. Partial failures are rare, and
+ * nearly all are recoverable by your app. On this endpoint only
+ * `partial-failure-connection-deletion` applies: resend the same DeleteRequests item.
+ * It checks whether the connection remains and terminates it if needed. A `SUCCESS`
+ * item on the resend means the deletion is complete, including
+ * `feed-not-found-or-already-deleted` at `statusCode` `204`, which
+ * means the earlier attempt had already finished it. `error.subtype` is optional
+ * diagnostics. If it keeps reporting `PARTIAL_FAILURE`, contact Xero support with the
+ * connection id from `error.connectionId`. See
+ * https://developer.xero.com/documentation/api/bankfeeds/feedconnections-2-0-errors/#partial-failures
+ * . `207` means the item codes were neither all 2xx nor all 4xx. A
+ * `PARTIAL_FAILURE` item has `statusCode` `500`: the item did not
+ * complete, and the state it left behind needs attention or could not be confirmed.
+ * `error.subtype` says which. A `REJECTED` item whose error is
+ * `internal-error` or `too-many-requests` also has `statusCode`
+ * `500`, so it makes the response a `207`: something unexpected went wrong
+ * for that item before anything was deleted, so resending the item is safe. After a
+ * `partial-failure-connection-deletion`, the Feed Connection no longer appears in GET
+ * or delivers statements, but may still appear connected in Xero.
+ *
+ *
400 - All items are 4xx: either the request wrote nothing at all, or the request
+ * itself could not be processed. **A `400` guarantees that none of the items was
+ * written and none reached its desired state**, so a corrected request may be re-sent safely. An
+ * item reported as `feed-not-found-or-already-deleted` does not count towards this: its
+ * `statusCode` is `204`, so a request made up only of unknown identifiers is
+ * answered `200`, not `400`. Only items rejected outright — a missing or
+ * unusable `id` — have a 4xx code, so only they can produce a `400` envelope,
+ * and **a batch in which any item was partly deleted has a `500` item code, making it a
+ * `207`**. A request-level failure — an unreadable body, an empty `items`
+ * array, more than 50 items, the same identifier twice, or a missing header — returns a problem
+ * object with no `items` array.
+ *
+ *
401 - The request did not include a valid Xero Identity bearer token. A request
+ * missing both a token and a required header is answered `400`, because headers are
+ * checked first.
+ *
+ *
403 - The Application, the Organisation, or the user is not permitted to make this
+ * request. Read `type` to distinguish the cases.
+ *
+ *
415 - The request did not use `Content-Type: application/json`. V1 rewrote
+ * a wrong value for one legacy Application; V2 does not.
+ *
+ *
500 - An error occurred inside Xero part-way through the request, and there is no
+ * `items` array to say how far it reached. Some items may already have been applied.
+ * Recover by re-sending the identical request. On a create, items already created come back as
+ * `feed-already-connected-in-current-organisation`; on a termination, items already
+ * terminated come back as `feed-not-found-or-already-deleted`. In both cases the
+ * remaining items are processed.
+ *
+ * @param xeroTenantId Xero identifier for Tenant
+ * @param deleteFeedConnectionsRequest The deleteFeedConnectionsRequest parameter
+ * @param accessToken Authorization token for user set in header of each request
+ * @return BulkFeedConnectionResponse
+ * @throws IOException if an error occurs while attempting to invoke the API Partial-failure
+ * recovery by error type
+ * @see Terminate
+ * Feed Connections Documentation
+ */
+ public BulkFeedConnectionResponse deleteFeedConnections(
+ String accessToken,
+ String xeroTenantId,
+ DeleteFeedConnectionsRequest deleteFeedConnectionsRequest)
+ throws IOException {
+ try {
+ TypeReference typeRef =
+ new TypeReference() {};
+ HttpResponse response =
+ deleteFeedConnectionsForHttpResponse(
+ accessToken, xeroTenantId, deleteFeedConnectionsRequest);
+ return apiClient.getObjectMapper().readValue(response.getContent(), typeRef);
+ } catch (HttpResponseException e) {
+ if (logger.isDebugEnabled()) {
+ logger.debug(
+ "------------------ HttpResponseException "
+ + e.getStatusCode()
+ + " : deleteFeedConnections -------------------");
+ logger.debug(e.toString());
+ }
+ XeroApiExceptionHandler handler = new XeroApiExceptionHandler();
+ handler.execute(e);
+ } catch (IOException ioe) {
+ throw ioe;
+ }
+ return null;
+ }
+
+ /**
+ * Terminate Feed Connections Terminates the Feed Connections named in the request. Terminating a
+ * Feed Connection discontinues the bank feed, and does not otherwise affect the customer's
+ * data in Xero. Each item is identified by the Feed Connection `id` alone. An item
+ * naming a Feed Connection that does not exist, has already been terminated, or belongs to a
+ * different Application is reported as `feed-not-found-or-already-deleted` with
+ * `status` `SUCCESS` and `statusCode` `204` — there was
+ * nothing to terminate, which is not a failure, and is reported the same way a real termination
+ * is. The same identifier may not appear twice in one request. Re-sending a completed delete is
+ * idempotent. If an item reports `PARTIAL_FAILURE`, or the original response was lost,
+ * resend the same DeleteRequests item. The retry checks whether the connection remains and
+ * terminates it if needed. A `SUCCESS` item on the resend means the deletion is
+ * complete, including `feed-not-found-or-already-deleted` at `statusCode`
+ * `204`. If a retry keeps reporting `PARTIAL_FAILURE`, contact Xero support
+ * with the connection id in `error.connectionId`.
+ *
+ * 200 - All items are 2xx: each one reached its desired state, and there is nothing
+ * left for you to do. This includes a request in which none of the identifiers matched a
+ * connection to terminate, since `feed-not-found-or-already-deleted` is reported at
+ * `statusCode` `204` — the requested final state already holds, which is not
+ * a failure. A response that mixes these with rejected or partially failed items is a
+ * `207`.
+ *
+ *
207 - Some items did not reach their desired state. Each item has its own result, so
+ * read the `items` array rather than the envelope. Partial failures are rare, and
+ * nearly all are recoverable by your app. On this endpoint only
+ * `partial-failure-connection-deletion` applies: resend the same DeleteRequests item.
+ * It checks whether the connection remains and terminates it if needed. A `SUCCESS`
+ * item on the resend means the deletion is complete, including
+ * `feed-not-found-or-already-deleted` at `statusCode` `204`, which
+ * means the earlier attempt had already finished it. `error.subtype` is optional
+ * diagnostics. If it keeps reporting `PARTIAL_FAILURE`, contact Xero support with the
+ * connection id from `error.connectionId`. See
+ * https://developer.xero.com/documentation/api/bankfeeds/feedconnections-2-0-errors/#partial-failures
+ * . `207` means the item codes were neither all 2xx nor all 4xx. A
+ * `PARTIAL_FAILURE` item has `statusCode` `500`: the item did not
+ * complete, and the state it left behind needs attention or could not be confirmed.
+ * `error.subtype` says which. A `REJECTED` item whose error is
+ * `internal-error` or `too-many-requests` also has `statusCode`
+ * `500`, so it makes the response a `207`: something unexpected went wrong
+ * for that item before anything was deleted, so resending the item is safe. After a
+ * `partial-failure-connection-deletion`, the Feed Connection no longer appears in GET
+ * or delivers statements, but may still appear connected in Xero.
+ *
+ *
400 - All items are 4xx: either the request wrote nothing at all, or the request
+ * itself could not be processed. **A `400` guarantees that none of the items was
+ * written and none reached its desired state**, so a corrected request may be re-sent safely. An
+ * item reported as `feed-not-found-or-already-deleted` does not count towards this: its
+ * `statusCode` is `204`, so a request made up only of unknown identifiers is
+ * answered `200`, not `400`. Only items rejected outright — a missing or
+ * unusable `id` — have a 4xx code, so only they can produce a `400` envelope,
+ * and **a batch in which any item was partly deleted has a `500` item code, making it a
+ * `207`**. A request-level failure — an unreadable body, an empty `items`
+ * array, more than 50 items, the same identifier twice, or a missing header — returns a problem
+ * object with no `items` array.
+ *
+ *
401 - The request did not include a valid Xero Identity bearer token. A request
+ * missing both a token and a required header is answered `400`, because headers are
+ * checked first.
+ *
+ *
403 - The Application, the Organisation, or the user is not permitted to make this
+ * request. Read `type` to distinguish the cases.
+ *
+ *
415 - The request did not use `Content-Type: application/json`. V1 rewrote
+ * a wrong value for one legacy Application; V2 does not.
+ *
+ *
500 - An error occurred inside Xero part-way through the request, and there is no
+ * `items` array to say how far it reached. Some items may already have been applied.
+ * Recover by re-sending the identical request. On a create, items already created come back as
+ * `feed-already-connected-in-current-organisation`; on a termination, items already
+ * terminated come back as `feed-not-found-or-already-deleted`. In both cases the
+ * remaining items are processed.
+ *
+ * @param xeroTenantId Xero identifier for Tenant
+ * @param deleteFeedConnectionsRequest The deleteFeedConnectionsRequest parameter
+ * @param accessToken Authorization token for user set in header of each request
+ * @return HttpResponse
+ * @throws IOException if an error occurs while attempting to invoke the API Partial-failure
+ * recovery by error type
+ * @see Terminate
+ * Feed Connections Documentation
+ */
+ public HttpResponse deleteFeedConnectionsForHttpResponse(
+ String accessToken,
+ String xeroTenantId,
+ DeleteFeedConnectionsRequest deleteFeedConnectionsRequest)
+ throws IOException {
+ // verify the required parameter 'xeroTenantId' is set
+ if (xeroTenantId == null) {
+ throw new IllegalArgumentException(
+ "Missing the required parameter 'xeroTenantId' when calling deleteFeedConnections");
+ } // verify the required parameter 'deleteFeedConnectionsRequest' is set
+ if (deleteFeedConnectionsRequest == null) {
+ throw new IllegalArgumentException(
+ "Missing the required parameter 'deleteFeedConnectionsRequest' when calling"
+ + " deleteFeedConnections");
+ }
+ if (accessToken == null) {
+ throw new IllegalArgumentException(
+ "Missing the required parameter 'accessToken' when calling deleteFeedConnections");
+ }
+ HttpHeaders headers = new HttpHeaders();
+ headers.set("Xero-Tenant-Id", xeroTenantId);
+ headers.setAccept("application/json;application/problem+json");
+ headers.setUserAgent(this.getUserAgent());
+ UriBuilder uriBuilder =
+ UriBuilder.fromUri(apiClient.getBasePath() + "/FeedConnections/DeleteRequests");
+ String url = uriBuilder.build().toString();
+ GenericUrl genericUrl = new GenericUrl(url);
+ if (logger.isDebugEnabled()) {
+ logger.debug("POST " + genericUrl.toString());
+ }
+
+ HttpContent content = null;
+ content = apiClient.new JacksonJsonHttpContent(deleteFeedConnectionsRequest);
+
+ Credential credential =
+ new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken);
+ HttpTransport transport = apiClient.getHttpTransport();
+ HttpRequestFactory requestFactory = transport.createRequestFactory(credential);
+ return requestFactory
+ .buildRequest(HttpMethods.POST, genericUrl, content)
+ .setHeaders(headers)
+ .setConnectTimeout(apiClient.getConnectionTimeout())
+ .setReadTimeout(apiClient.getReadTimeout())
+ .execute();
+ }
+
+ /**
+ * Retrieve a single Feed Connection Returns one Feed Connection, as a bare object rather than
+ * inside an envelope. The response is `404 bank-feed-not-found` when the identifier
+ * names no Feed Connection, when it names one belonging to a different Application, when it is an
+ * all-zeros GUID, and when it is not a GUID at all. These cases are deliberately
+ * indistinguishable from one another, so an Application cannot use this endpoint to discover what
+ * another Application has.
+ *
+ *
200 - The Feed Connection.
+ *
+ *
400 - A required header was absent.
+ *
+ *
401 - The request did not include a valid Xero Identity bearer token. A request
+ * missing both a token and a required header is answered `400`, because headers are
+ * checked first.
+ *
+ *
403 - The Application, the Organisation, or the user is not permitted to make this
+ * request. Read `type` to distinguish the cases.
+ *
+ *
404 - No Feed Connection with this identifier is visible to this Application.
+ *
+ *
500 - An error occurred inside Xero. The request should be retried.
+ *
+ * @param id The Feed Connection identifier.
+ * @param xeroTenantId Xero identifier for Tenant
+ * @param accessToken Authorization token for user set in header of each request
+ * @return FeedConnection
+ * @throws IOException if an error occurs while attempting to invoke the API *
+ */
+ public FeedConnection getFeedConnection(String accessToken, UUID id, String xeroTenantId)
+ throws IOException {
+ try {
+ TypeReference typeRef = new TypeReference() {};
+ HttpResponse response = getFeedConnectionForHttpResponse(accessToken, id, xeroTenantId);
+ return apiClient.getObjectMapper().readValue(response.getContent(), typeRef);
+ } catch (HttpResponseException e) {
+ if (logger.isDebugEnabled()) {
+ logger.debug(
+ "------------------ HttpResponseException "
+ + e.getStatusCode()
+ + " : getFeedConnection -------------------");
+ logger.debug(e.toString());
+ }
+ XeroApiExceptionHandler handler = new XeroApiExceptionHandler();
+ handler.execute(e);
+ } catch (IOException ioe) {
+ throw ioe;
+ }
+ return null;
+ }
+
+ /**
+ * Retrieve a single Feed Connection Returns one Feed Connection, as a bare object rather than
+ * inside an envelope. The response is `404 bank-feed-not-found` when the identifier
+ * names no Feed Connection, when it names one belonging to a different Application, when it is an
+ * all-zeros GUID, and when it is not a GUID at all. These cases are deliberately
+ * indistinguishable from one another, so an Application cannot use this endpoint to discover what
+ * another Application has.
+ *
+ * 200 - The Feed Connection.
+ *
+ *
400 - A required header was absent.
+ *
+ *
401 - The request did not include a valid Xero Identity bearer token. A request
+ * missing both a token and a required header is answered `400`, because headers are
+ * checked first.
+ *
+ *
403 - The Application, the Organisation, or the user is not permitted to make this
+ * request. Read `type` to distinguish the cases.
+ *
+ *
404 - No Feed Connection with this identifier is visible to this Application.
+ *
+ *
500 - An error occurred inside Xero. The request should be retried.
+ *
+ * @param id The Feed Connection identifier.
+ * @param xeroTenantId Xero identifier for Tenant
+ * @param accessToken Authorization token for user set in header of each request
+ * @return HttpResponse
+ * @throws IOException if an error occurs while attempting to invoke the API
+ */
+ public HttpResponse getFeedConnectionForHttpResponse(
+ String accessToken, UUID id, String xeroTenantId) throws IOException {
+ // verify the required parameter 'id' is set
+ if (id == null) {
+ throw new IllegalArgumentException(
+ "Missing the required parameter 'id' when calling getFeedConnection");
+ } // verify the required parameter 'xeroTenantId' is set
+ if (xeroTenantId == null) {
+ throw new IllegalArgumentException(
+ "Missing the required parameter 'xeroTenantId' when calling getFeedConnection");
+ }
+ if (accessToken == null) {
+ throw new IllegalArgumentException(
+ "Missing the required parameter 'accessToken' when calling getFeedConnection");
+ }
+ HttpHeaders headers = new HttpHeaders();
+ headers.set("Xero-Tenant-Id", xeroTenantId);
+ headers.setAccept("application/json;application/problem+json");
+ headers.setUserAgent(this.getUserAgent());
+ // create a map of path variables
+ final Map uriVariables = new HashMap();
+ uriVariables.put("id", id);
+
+ UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/FeedConnections/{id}");
+ String url = uriBuilder.buildFromMap(uriVariables).toString();
+ GenericUrl genericUrl = new GenericUrl(url);
+ if (logger.isDebugEnabled()) {
+ logger.debug("GET " + genericUrl.toString());
+ }
+
+ HttpContent content = null;
+ Credential credential =
+ new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken);
+ HttpTransport transport = apiClient.getHttpTransport();
+ HttpRequestFactory requestFactory = transport.createRequestFactory(credential);
+ return requestFactory
+ .buildRequest(HttpMethods.GET, genericUrl, content)
+ .setHeaders(headers)
+ .setConnectTimeout(apiClient.getConnectionTimeout())
+ .setReadTimeout(apiClient.getReadTimeout())
+ .execute();
+ }
+
+ /**
+ * Retrieve the Feed Connections for an Organisation Returns the Feed Connections belonging to
+ * both the Organisation in `Xero-Tenant-Id` and the Application associated with the
+ * OAuth client. Connections belonging to another Application are not returned, and there is no
+ * way to observe that they exist. A `page` beyond the end of the collection returns an
+ * empty `items` array rather than an error.
+ *
+ * 200 - The requested page of Feed Connections.
+ *
+ *
400 - A required header was absent.
+ *
+ *
401 - The request did not include a valid Xero Identity bearer token. A request
+ * missing both a token and a required header is answered `400`, because headers are
+ * checked first.
+ *
+ *
403 - The Application, the Organisation, or the user is not permitted to make this
+ * request. Read `type` to distinguish the cases.
+ *
+ *
500 - An error occurred inside Xero. The request should be retried.
+ *
+ * @param xeroTenantId Xero identifier for Tenant
+ * @param page The page to return, counting from 1.
+ * @param pageSize How many Feed Connections to return per page. No maximum is enforced.
+ * @param accessToken Authorization token for user set in header of each request
+ * @return PagedFeedConnections
+ * @throws IOException if an error occurs while attempting to invoke the API *
+ */
+ public PagedFeedConnections getFeedConnections(
+ String accessToken, String xeroTenantId, Integer page, Integer pageSize) throws IOException {
+ try {
+ TypeReference typeRef = new TypeReference() {};
+ HttpResponse response =
+ getFeedConnectionsForHttpResponse(accessToken, xeroTenantId, page, pageSize);
+ return apiClient.getObjectMapper().readValue(response.getContent(), typeRef);
+ } catch (HttpResponseException e) {
+ if (logger.isDebugEnabled()) {
+ logger.debug(
+ "------------------ HttpResponseException "
+ + e.getStatusCode()
+ + " : getFeedConnections -------------------");
+ logger.debug(e.toString());
+ }
+ XeroApiExceptionHandler handler = new XeroApiExceptionHandler();
+ handler.execute(e);
+ } catch (IOException ioe) {
+ throw ioe;
+ }
+ return null;
+ }
+
+ /**
+ * Retrieve the Feed Connections for an Organisation Returns the Feed Connections belonging to
+ * both the Organisation in `Xero-Tenant-Id` and the Application associated with the
+ * OAuth client. Connections belonging to another Application are not returned, and there is no
+ * way to observe that they exist. A `page` beyond the end of the collection returns an
+ * empty `items` array rather than an error.
+ *
+ * 200 - The requested page of Feed Connections.
+ *
+ *
400 - A required header was absent.
+ *
+ *
401 - The request did not include a valid Xero Identity bearer token. A request
+ * missing both a token and a required header is answered `400`, because headers are
+ * checked first.
+ *
+ *
403 - The Application, the Organisation, or the user is not permitted to make this
+ * request. Read `type` to distinguish the cases.
+ *
+ *
500 - An error occurred inside Xero. The request should be retried.
+ *
+ * @param xeroTenantId Xero identifier for Tenant
+ * @param page The page to return, counting from 1.
+ * @param pageSize How many Feed Connections to return per page. No maximum is enforced.
+ * @param accessToken Authorization token for user set in header of each request
+ * @return HttpResponse
+ * @throws IOException if an error occurs while attempting to invoke the API
+ */
+ public HttpResponse getFeedConnectionsForHttpResponse(
+ String accessToken, String xeroTenantId, Integer page, Integer pageSize) throws IOException {
+ // verify the required parameter 'xeroTenantId' is set
+ if (xeroTenantId == null) {
+ throw new IllegalArgumentException(
+ "Missing the required parameter 'xeroTenantId' when calling getFeedConnections");
+ }
+ if (accessToken == null) {
+ throw new IllegalArgumentException(
+ "Missing the required parameter 'accessToken' when calling getFeedConnections");
+ }
+ HttpHeaders headers = new HttpHeaders();
+ headers.set("Xero-Tenant-Id", xeroTenantId);
+ headers.setAccept("application/json;application/problem+json");
+ headers.setUserAgent(this.getUserAgent());
+ UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/FeedConnections");
+ if (page != null) {
+ String key = "page";
+ Object value = page;
+ if (value instanceof Collection) {
+ List valueList = new ArrayList<>((Collection) value);
+ if (!valueList.isEmpty() && valueList.get(0) instanceof UUID) {
+ List list = new ArrayList();
+ for (int i = 0; i < valueList.size(); i++) {
+ list.add(valueList.get(i).toString());
+ }
+ uriBuilder = uriBuilder.queryParam(key, String.join(",", list));
+ } else {
+ uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList));
+ }
+ } else if (value instanceof Object[]) {
+ uriBuilder = uriBuilder.queryParam(key, (Object[]) value);
+ } else {
+ uriBuilder = uriBuilder.queryParam(key, value);
+ }
+ }
+ if (pageSize != null) {
+ String key = "pageSize";
+ Object value = pageSize;
+ if (value instanceof Collection) {
+ List valueList = new ArrayList<>((Collection) value);
+ if (!valueList.isEmpty() && valueList.get(0) instanceof UUID) {
+ List list = new ArrayList();
+ for (int i = 0; i < valueList.size(); i++) {
+ list.add(valueList.get(i).toString());
+ }
+ uriBuilder = uriBuilder.queryParam(key, String.join(",", list));
+ } else {
+ uriBuilder = uriBuilder.queryParam(key, String.join(",", valueList));
+ }
+ } else if (value instanceof Object[]) {
+ uriBuilder = uriBuilder.queryParam(key, (Object[]) value);
+ } else {
+ uriBuilder = uriBuilder.queryParam(key, value);
+ }
+ }
+ String url = uriBuilder.build().toString();
+ GenericUrl genericUrl = new GenericUrl(url);
+ if (logger.isDebugEnabled()) {
+ logger.debug("GET " + genericUrl.toString());
+ }
+
+ HttpContent content = null;
+ Credential credential =
+ new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken);
+ HttpTransport transport = apiClient.getHttpTransport();
+ HttpRequestFactory requestFactory = transport.createRequestFactory(credential);
+ return requestFactory
+ .buildRequest(HttpMethods.GET, genericUrl, content)
+ .setHeaders(headers)
+ .setConnectTimeout(apiClient.getConnectionTimeout())
+ .setReadTimeout(apiClient.getReadTimeout())
+ .execute();
+ }
+
+ /**
+ * convert intput to byte array
+ *
+ * @param is InputStream the server status code returned
+ * @return byteArrayInputStream a ByteArrayInputStream
+ * @throws IOException for failed or interrupted I/O operations
+ */
+ public ByteArrayInputStream convertInputToByteArray(InputStream is) throws IOException {
+ byte[] bytes = IOUtils.toByteArray(is);
+ try {
+ // Process the input stream..
+ ByteArrayInputStream byteArrayInputStream = new ByteArrayInputStream(bytes);
+ return byteArrayInputStream;
+ } finally {
+ is.close();
+ }
+ }
+}
diff --git a/src/main/java/com/xero/api/client/FilesApi.java b/src/main/java/com/xero/api/client/FilesApi.java
index 18f5eac3..8ddc5b5e 100644
--- a/src/main/java/com/xero/api/client/FilesApi.java
+++ b/src/main/java/com/xero/api/client/FilesApi.java
@@ -2,7 +2,7 @@
* Xero Files API
* These endpoints are specific to Xero Files API
*
- * The version of the OpenAPI document: 20.0.1
+ * The version of the OpenAPI document: 20.1.0
* Contact: api@xero.com
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
@@ -54,7 +54,7 @@ public class FilesApi {
private ApiClient apiClient;
private static FilesApi instance = null;
private String userAgent = "Default";
- private String version = "18.4.0";
+ private String version = "18.5.0";
static final Logger logger = LoggerFactory.getLogger(FilesApi.class);
/** FilesApi */
diff --git a/src/main/java/com/xero/api/client/FinanceApi.java b/src/main/java/com/xero/api/client/FinanceApi.java
index 0cc2ac2d..483fd1c2 100644
--- a/src/main/java/com/xero/api/client/FinanceApi.java
+++ b/src/main/java/com/xero/api/client/FinanceApi.java
@@ -2,7 +2,7 @@
* Xero Finance API
* The Finance API is a collection of endpoints which customers can use in the course of a loan application, which may assist lenders to gain the confidence they need to provide capital.
*
- * The version of the OpenAPI document: 20.0.1
+ * The version of the OpenAPI document: 20.1.0
* Contact: api@xero.com
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
@@ -49,7 +49,7 @@ public class FinanceApi {
private ApiClient apiClient;
private static FinanceApi instance = null;
private String userAgent = "Default";
- private String version = "18.4.0";
+ private String version = "18.5.0";
static final Logger logger = LoggerFactory.getLogger(FinanceApi.class);
/** FinanceApi */
diff --git a/src/main/java/com/xero/api/client/IdentityApi.java b/src/main/java/com/xero/api/client/IdentityApi.java
index 93461240..5d030f18 100644
--- a/src/main/java/com/xero/api/client/IdentityApi.java
+++ b/src/main/java/com/xero/api/client/IdentityApi.java
@@ -2,7 +2,7 @@
* Xero OAuth 2 Identity Service API
* These endpoints are related to managing authentication tokens and identity for Xero API
*
- * The version of the OpenAPI document: 20.0.1
+ * The version of the OpenAPI document: 20.1.0
* Contact: api@xero.com
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
@@ -45,7 +45,7 @@ public class IdentityApi {
private ApiClient apiClient;
private static IdentityApi instance = null;
private String userAgent = "Default";
- private String version = "18.4.0";
+ private String version = "18.5.0";
static final Logger logger = LoggerFactory.getLogger(IdentityApi.class);
/** IdentityApi */
diff --git a/src/main/java/com/xero/api/client/PayrollAuApi.java b/src/main/java/com/xero/api/client/PayrollAuApi.java
index 98269c5b..c6aba010 100644
--- a/src/main/java/com/xero/api/client/PayrollAuApi.java
+++ b/src/main/java/com/xero/api/client/PayrollAuApi.java
@@ -2,7 +2,7 @@
* Xero Payroll AU API
* This is the Xero Payroll API for orgs in Australia region.
*
- * The version of the OpenAPI document: 20.0.1
+ * The version of the OpenAPI document: 20.1.0
* Contact: api@xero.com
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
@@ -65,7 +65,7 @@ public class PayrollAuApi {
private ApiClient apiClient;
private static PayrollAuApi instance = null;
private String userAgent = "Default";
- private String version = "18.4.0";
+ private String version = "18.5.0";
static final Logger logger = LoggerFactory.getLogger(PayrollAuApi.class);
/** PayrollAuApi */
diff --git a/src/main/java/com/xero/api/client/PayrollAuV2Api.java b/src/main/java/com/xero/api/client/PayrollAuV2Api.java
index 824100f2..173b4efd 100644
--- a/src/main/java/com/xero/api/client/PayrollAuV2Api.java
+++ b/src/main/java/com/xero/api/client/PayrollAuV2Api.java
@@ -2,7 +2,7 @@
* Xero Payroll AU API 2.0
* This is the Xero Payroll API 2.0 for orgs in Australia region.
*
- * The version of the OpenAPI document: 20.0.1
+ * The version of the OpenAPI document: 20.1.0
* Contact: api@xero.com
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
@@ -49,7 +49,7 @@ public class PayrollAuV2Api {
private ApiClient apiClient;
private static PayrollAuV2Api instance = null;
private String userAgent = "Default";
- private String version = "18.4.0";
+ private String version = "18.5.0";
static final Logger logger = LoggerFactory.getLogger(PayrollAuV2Api.class);
/** PayrollAuV2Api */
diff --git a/src/main/java/com/xero/api/client/PayrollNzApi.java b/src/main/java/com/xero/api/client/PayrollNzApi.java
index 902d04e3..2a34f38b 100644
--- a/src/main/java/com/xero/api/client/PayrollNzApi.java
+++ b/src/main/java/com/xero/api/client/PayrollNzApi.java
@@ -2,7 +2,7 @@
* Xero Payroll NZ
* This is the Xero Payroll API for orgs in the NZ region.
*
- * The version of the OpenAPI document: 20.0.1
+ * The version of the OpenAPI document: 20.1.0
* Contact: api@xero.com
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
@@ -109,7 +109,7 @@ public class PayrollNzApi {
private ApiClient apiClient;
private static PayrollNzApi instance = null;
private String userAgent = "Default";
- private String version = "18.4.0";
+ private String version = "18.5.0";
static final Logger logger = LoggerFactory.getLogger(PayrollNzApi.class);
/** PayrollNzApi */
diff --git a/src/main/java/com/xero/api/client/PayrollUkApi.java b/src/main/java/com/xero/api/client/PayrollUkApi.java
index 645cd5f8..7d87020f 100644
--- a/src/main/java/com/xero/api/client/PayrollUkApi.java
+++ b/src/main/java/com/xero/api/client/PayrollUkApi.java
@@ -2,7 +2,7 @@
* Xero Payroll UK
* This is the Xero Payroll API for orgs in the UK region.
*
- * The version of the OpenAPI document: 20.0.1
+ * The version of the OpenAPI document: 20.1.0
* Contact: api@xero.com
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
@@ -105,7 +105,7 @@ public class PayrollUkApi {
private ApiClient apiClient;
private static PayrollUkApi instance = null;
private String userAgent = "Default";
- private String version = "18.4.0";
+ private String version = "18.5.0";
static final Logger logger = LoggerFactory.getLogger(PayrollUkApi.class);
/** PayrollUkApi */
diff --git a/src/main/java/com/xero/api/client/ProjectApi.java b/src/main/java/com/xero/api/client/ProjectApi.java
index 46b4947f..e31ba83a 100644
--- a/src/main/java/com/xero/api/client/ProjectApi.java
+++ b/src/main/java/com/xero/api/client/ProjectApi.java
@@ -2,7 +2,7 @@
* Xero Projects API
* This is the Xero Projects API
*
- * The version of the OpenAPI document: 20.0.1
+ * The version of the OpenAPI document: 20.1.0
* Contact: api@xero.com
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
@@ -57,7 +57,7 @@ public class ProjectApi {
private ApiClient apiClient;
private static ProjectApi instance = null;
private String userAgent = "Default";
- private String version = "18.4.0";
+ private String version = "18.5.0";
static final Logger logger = LoggerFactory.getLogger(ProjectApi.class);
/** ProjectApi */
diff --git a/src/main/java/com/xero/models/accounting/Budget.java b/src/main/java/com/xero/models/accounting/Budget.java
index 89db7120..f7b04925 100644
--- a/src/main/java/com/xero/models/accounting/Budget.java
+++ b/src/main/java/com/xero/models/accounting/Budget.java
@@ -30,6 +30,59 @@ public class Budget {
@JsonProperty("BudgetID")
private UUID budgetID;
+ /** The tool used to create the budget */
+ public enum CreatedInEnum {
+ /** XERO_ANALYTICS */
+ XERO_ANALYTICS("XERO_ANALYTICS"),
+
+ /** BUDGETS_MANAGER */
+ BUDGETS_MANAGER("BUDGETS_MANAGER");
+
+ private String value;
+
+ CreatedInEnum(String value) {
+ this.value = value;
+ }
+
+ /**
+ * getValue
+ *
+ * @return String value
+ */
+ @JsonValue
+ public String getValue() {
+ return value;
+ }
+
+ /**
+ * toString
+ *
+ * @return String value
+ */
+ @Override
+ public String toString() {
+ return String.valueOf(value);
+ }
+
+ /**
+ * fromValue
+ *
+ * @param value String
+ */
+ @JsonCreator
+ public static CreatedInEnum fromValue(String value) {
+ for (CreatedInEnum b : CreatedInEnum.values()) {
+ if (b.value.equals(value)) {
+ return b;
+ }
+ }
+ throw new IllegalArgumentException("Unexpected value '" + value + "'");
+ }
+ }
+
+ @JsonProperty("CreatedIn")
+ private CreatedInEnum createdIn;
+
/** Type of Budget. OVERALL or TRACKING */
public enum TypeEnum {
/** OVERALL */
@@ -130,6 +183,41 @@ public void setBudgetID(UUID budgetID) {
this.budgetID = budgetID;
}
+ /**
+ * The tool used to create the budget
+ *
+ * @param createdIn CreatedInEnum
+ * @return Budget
+ */
+ public Budget createdIn(CreatedInEnum createdIn) {
+ this.createdIn = createdIn;
+ return this;
+ }
+
+ /**
+ * The tool used to create the budget
+ *
+ * @return createdIn
+ */
+ @ApiModelProperty(value = "The tool used to create the budget")
+ /**
+ * The tool used to create the budget
+ *
+ * @return createdIn CreatedInEnum
+ */
+ public CreatedInEnum getCreatedIn() {
+ return createdIn;
+ }
+
+ /**
+ * The tool used to create the budget
+ *
+ * @param createdIn CreatedInEnum
+ */
+ public void setCreatedIn(CreatedInEnum createdIn) {
+ this.createdIn = createdIn;
+ }
+
/**
* Type of Budget. OVERALL or TRACKING
*
@@ -341,6 +429,7 @@ public boolean equals(java.lang.Object o) {
}
Budget budget = (Budget) o;
return Objects.equals(this.budgetID, budget.budgetID)
+ && Objects.equals(this.createdIn, budget.createdIn)
&& Objects.equals(this.type, budget.type)
&& Objects.equals(this.description, budget.description)
&& Objects.equals(this.updatedDateUTC, budget.updatedDateUTC)
@@ -350,7 +439,8 @@ public boolean equals(java.lang.Object o) {
@Override
public int hashCode() {
- return Objects.hash(budgetID, type, description, updatedDateUTC, budgetLines, tracking);
+ return Objects.hash(
+ budgetID, createdIn, type, description, updatedDateUTC, budgetLines, tracking);
}
@Override
@@ -358,6 +448,7 @@ public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class Budget {\n");
sb.append(" budgetID: ").append(toIndentedString(budgetID)).append("\n");
+ sb.append(" createdIn: ").append(toIndentedString(createdIn)).append("\n");
sb.append(" type: ").append(toIndentedString(type)).append("\n");
sb.append(" description: ").append(toIndentedString(description)).append("\n");
sb.append(" updatedDateUTC: ").append(toIndentedString(updatedDateUTC)).append("\n");
diff --git a/src/main/java/com/xero/models/accounting/BudgetBalance.java b/src/main/java/com/xero/models/accounting/BudgetBalance.java
index 13e8ba14..9dc8937c 100644
--- a/src/main/java/com/xero/models/accounting/BudgetBalance.java
+++ b/src/main/java/com/xero/models/accounting/BudgetBalance.java
@@ -30,12 +30,6 @@ public class BudgetBalance {
@JsonProperty("Amount")
private Double amount;
- @JsonProperty("UnitAmount")
- private Double unitAmount;
-
- @JsonProperty("Notes")
- private String notes;
-
/**
* Period the amount applies to (e.g. “2019-08”)
*
@@ -135,76 +129,6 @@ public void setAmount(Double amount) {
this.amount = amount;
}
- /**
- * Budgeted amount
- *
- * @param unitAmount Double
- * @return BudgetBalance
- */
- public BudgetBalance unitAmount(Double unitAmount) {
- this.unitAmount = unitAmount;
- return this;
- }
-
- /**
- * Budgeted amount
- *
- * @return unitAmount
- */
- @ApiModelProperty(value = "Budgeted amount")
- /**
- * Budgeted amount
- *
- * @return unitAmount Double
- */
- public Double getUnitAmount() {
- return unitAmount;
- }
-
- /**
- * Budgeted amount
- *
- * @param unitAmount Double
- */
- public void setUnitAmount(Double unitAmount) {
- this.unitAmount = unitAmount;
- }
-
- /**
- * Any footnotes associated with this balance
- *
- * @param notes String
- * @return BudgetBalance
- */
- public BudgetBalance notes(String notes) {
- this.notes = notes;
- return this;
- }
-
- /**
- * Any footnotes associated with this balance
- *
- * @return notes
- */
- @ApiModelProperty(value = "Any footnotes associated with this balance")
- /**
- * Any footnotes associated with this balance
- *
- * @return notes String
- */
- public String getNotes() {
- return notes;
- }
-
- /**
- * Any footnotes associated with this balance
- *
- * @param notes String
- */
- public void setNotes(String notes) {
- this.notes = notes;
- }
-
@Override
public boolean equals(java.lang.Object o) {
if (this == o) {
@@ -215,14 +139,12 @@ public boolean equals(java.lang.Object o) {
}
BudgetBalance budgetBalance = (BudgetBalance) o;
return Objects.equals(this.period, budgetBalance.period)
- && Objects.equals(this.amount, budgetBalance.amount)
- && Objects.equals(this.unitAmount, budgetBalance.unitAmount)
- && Objects.equals(this.notes, budgetBalance.notes);
+ && Objects.equals(this.amount, budgetBalance.amount);
}
@Override
public int hashCode() {
- return Objects.hash(period, amount, unitAmount, notes);
+ return Objects.hash(period, amount);
}
@Override
@@ -231,8 +153,6 @@ public String toString() {
sb.append("class BudgetBalance {\n");
sb.append(" period: ").append(toIndentedString(period)).append("\n");
sb.append(" amount: ").append(toIndentedString(amount)).append("\n");
- sb.append(" unitAmount: ").append(toIndentedString(unitAmount)).append("\n");
- sb.append(" notes: ").append(toIndentedString(notes)).append("\n");
sb.append("}");
return sb.toString();
}
diff --git a/src/main/java/com/xero/models/bankfeedsv2/AccountType.java b/src/main/java/com/xero/models/bankfeedsv2/AccountType.java
new file mode 100644
index 00000000..4564a95d
--- /dev/null
+++ b/src/main/java/com/xero/models/bankfeedsv2/AccountType.java
@@ -0,0 +1,68 @@
+/*
+ * Xero Bank Feeds API v2
+ * The Bank Feeds API is available to financial institutions with a Xero partnership and approved app partners. For non-bank apps, it automates statement imports into Xero bank and credit card accounts; it does not create a direct bank feed. Feed Connections 2.0 is intended to replace 1.0. The customer chooses whether to connect an existing Xero account or create a new one. Use ExistingAccount with the chosen accountId, or NewAccount to create an account; Xero does not guess which account to connect or silently change an account name. The GET and delete operations also use 2.0. Statements continue to use 1.0. Partial failures are rare, and nearly all are recoverable by your app with no need to contact Xero support. If an item in a write response has `status` `PARTIAL_FAILURE`, handle only that item and read its `error.type`. For `partial-failure-new-account-creation`, do not resend the NewAccount item: connect `error.accountId` with `POST /FeedConnections/ExistingAccount`. For `partial-failure-new-account-existence-not-confirmed`, the account named in `error.accountName` may or may not exist. Use the Accounting API to check whether an account with that name exists. If it does, connect it with `POST /FeedConnections/ExistingAccount`. If it does not, resend the NewAccount item. If your app has a user, you can show them this message instead: \"Something went wrong. Please check whether your chosen account name now exists. If it does, connect it. If not, try creating the new one again.\" For any other `partial-failure-*` type, resend the same item. If the recovery request for `partial-failure-new-account-creation`, `partial-failure-previous-connection-deletion` or `partial-failure-connection-creation` returns 409 `feed-already-connected-in-current-organisation`, the earlier attempt succeeded: treat the item as created and use `GET /FeedConnections` to find its `id`. `error.subtype` is optional diagnostics; do not branch on it, and never parse `title` or `detail`. Full detail: https://developer.xero.com/documentation/api/bankfeeds/feedconnections-2-0-errors/#partial-failures
+ *
+ * Contact: api@xero.com
+ *
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
+ * https://openapi-generator.tech
+ * Do not edit the class manually.
+ */
+
+package com.xero.models.bankfeedsv2;
+
+
+import com.fasterxml.jackson.annotation.JsonCreator;
+import com.fasterxml.jackson.annotation.JsonValue;
+
+/**
+ * The high-level type of the account. `BANK` covers every account type other than a
+ * credit card.
+ */
+public enum AccountType {
+
+ /** BANK */
+ BANK("BANK"),
+
+ /** CREDITCARD */
+ CREDITCARD("CREDITCARD");
+
+ private String value;
+
+ AccountType(String value) {
+ this.value = value;
+ }
+
+ /**
+ * @return String value
+ */
+ @JsonValue
+ public String getValue() {
+ return value;
+ }
+
+ /**
+ * toString
+ *
+ * @return String value
+ */
+ @Override
+ public String toString() {
+ return String.valueOf(value);
+ }
+
+ /**
+ * fromValue
+ *
+ * @param value String
+ */
+ @JsonCreator
+ public static AccountType fromValue(String value) {
+ for (AccountType b : AccountType.values()) {
+ if (b.value.equals(value)) {
+ return b;
+ }
+ }
+ throw new IllegalArgumentException("Unexpected value '" + value + "'");
+ }
+}
diff --git a/src/main/java/com/xero/models/bankfeedsv2/BulkFeedConnectionResponse.java b/src/main/java/com/xero/models/bankfeedsv2/BulkFeedConnectionResponse.java
new file mode 100644
index 00000000..e37ac9fb
--- /dev/null
+++ b/src/main/java/com/xero/models/bankfeedsv2/BulkFeedConnectionResponse.java
@@ -0,0 +1,114 @@
+/*
+ * Xero Bank Feeds API v2
+ * The Bank Feeds API is available to financial institutions with a Xero partnership and approved app partners. For non-bank apps, it automates statement imports into Xero bank and credit card accounts; it does not create a direct bank feed. Feed Connections 2.0 is intended to replace 1.0. The customer chooses whether to connect an existing Xero account or create a new one. Use ExistingAccount with the chosen accountId, or NewAccount to create an account; Xero does not guess which account to connect or silently change an account name. The GET and delete operations also use 2.0. Statements continue to use 1.0. Partial failures are rare, and nearly all are recoverable by your app with no need to contact Xero support. If an item in a write response has `status` `PARTIAL_FAILURE`, handle only that item and read its `error.type`. For `partial-failure-new-account-creation`, do not resend the NewAccount item: connect `error.accountId` with `POST /FeedConnections/ExistingAccount`. For `partial-failure-new-account-existence-not-confirmed`, the account named in `error.accountName` may or may not exist. Use the Accounting API to check whether an account with that name exists. If it does, connect it with `POST /FeedConnections/ExistingAccount`. If it does not, resend the NewAccount item. If your app has a user, you can show them this message instead: \"Something went wrong. Please check whether your chosen account name now exists. If it does, connect it. If not, try creating the new one again.\" For any other `partial-failure-*` type, resend the same item. If the recovery request for `partial-failure-new-account-creation`, `partial-failure-previous-connection-deletion` or `partial-failure-connection-creation` returns 409 `feed-already-connected-in-current-organisation`, the earlier attempt succeeded: treat the item as created and use `GET /FeedConnections` to find its `id`. `error.subtype` is optional diagnostics; do not branch on it, and never parse `title` or `detail`. Full detail: https://developer.xero.com/documentation/api/bankfeeds/feedconnections-2-0-errors/#partial-failures
+ *
+ * Contact: api@xero.com
+ *
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
+ * https://openapi-generator.tech
+ * Do not edit the class manually.
+ */
+
+package com.xero.models.bankfeedsv2;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+import com.xero.api.StringUtil;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Objects;
+
+/** One result per request item, in request order. */
+@ApiModel(description = "One result per request item, in request order.")
+public class BulkFeedConnectionResponse {
+ StringUtil util = new StringUtil();
+
+ @JsonProperty("items")
+ private List items = new ArrayList();
+
+ /**
+ * items
+ *
+ * @param items List<BulkFeedConnectionResult>
+ * @return BulkFeedConnectionResponse
+ */
+ public BulkFeedConnectionResponse items(List items) {
+ this.items = items;
+ return this;
+ }
+
+ /**
+ * items
+ *
+ * @param itemsItem BulkFeedConnectionResult
+ * @return BulkFeedConnectionResponse
+ */
+ public BulkFeedConnectionResponse addItemsItem(BulkFeedConnectionResult itemsItem) {
+ if (this.items == null) {
+ this.items = new ArrayList();
+ }
+ this.items.add(itemsItem);
+ return this;
+ }
+
+ /**
+ * Get items
+ *
+ * @return items
+ */
+ @ApiModelProperty(value = "")
+ /**
+ * items
+ *
+ * @return items List
+ */
+ public List getItems() {
+ return items;
+ }
+
+ /**
+ * items
+ *
+ * @param items List<BulkFeedConnectionResult>
+ */
+ public void setItems(List items) {
+ this.items = items;
+ }
+
+ @Override
+ public boolean equals(java.lang.Object o) {
+ if (this == o) {
+ return true;
+ }
+ if (o == null || getClass() != o.getClass()) {
+ return false;
+ }
+ BulkFeedConnectionResponse bulkFeedConnectionResponse = (BulkFeedConnectionResponse) o;
+ return Objects.equals(this.items, bulkFeedConnectionResponse.items);
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hash(items);
+ }
+
+ @Override
+ public String toString() {
+ StringBuilder sb = new StringBuilder();
+ sb.append("class BulkFeedConnectionResponse {\n");
+ sb.append(" items: ").append(toIndentedString(items)).append("\n");
+ sb.append("}");
+ return sb.toString();
+ }
+
+ /**
+ * Convert the given object to string with each line indented by 4 spaces (except the first line).
+ */
+ private String toIndentedString(java.lang.Object o) {
+ if (o == null) {
+ return "null";
+ }
+ return o.toString().replace("\n", "\n ");
+ }
+}
diff --git a/src/main/java/com/xero/models/bankfeedsv2/BulkFeedConnectionResult.java b/src/main/java/com/xero/models/bankfeedsv2/BulkFeedConnectionResult.java
new file mode 100644
index 00000000..aecc295c
--- /dev/null
+++ b/src/main/java/com/xero/models/bankfeedsv2/BulkFeedConnectionResult.java
@@ -0,0 +1,463 @@
+/*
+ * Xero Bank Feeds API v2
+ * The Bank Feeds API is available to financial institutions with a Xero partnership and approved app partners. For non-bank apps, it automates statement imports into Xero bank and credit card accounts; it does not create a direct bank feed. Feed Connections 2.0 is intended to replace 1.0. The customer chooses whether to connect an existing Xero account or create a new one. Use ExistingAccount with the chosen accountId, or NewAccount to create an account; Xero does not guess which account to connect or silently change an account name. The GET and delete operations also use 2.0. Statements continue to use 1.0. Partial failures are rare, and nearly all are recoverable by your app with no need to contact Xero support. If an item in a write response has `status` `PARTIAL_FAILURE`, handle only that item and read its `error.type`. For `partial-failure-new-account-creation`, do not resend the NewAccount item: connect `error.accountId` with `POST /FeedConnections/ExistingAccount`. For `partial-failure-new-account-existence-not-confirmed`, the account named in `error.accountName` may or may not exist. Use the Accounting API to check whether an account with that name exists. If it does, connect it with `POST /FeedConnections/ExistingAccount`. If it does not, resend the NewAccount item. If your app has a user, you can show them this message instead: \"Something went wrong. Please check whether your chosen account name now exists. If it does, connect it. If not, try creating the new one again.\" For any other `partial-failure-*` type, resend the same item. If the recovery request for `partial-failure-new-account-creation`, `partial-failure-previous-connection-deletion` or `partial-failure-connection-creation` returns 409 `feed-already-connected-in-current-organisation`, the earlier attempt succeeded: treat the item as created and use `GET /FeedConnections` to find its `id`. `error.subtype` is optional diagnostics; do not branch on it, and never parse `title` or `detail`. Full detail: https://developer.xero.com/documentation/api/bankfeeds/feedconnections-2-0-errors/#partial-failures
+ *
+ * Contact: api@xero.com
+ *
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
+ * https://openapi-generator.tech
+ * Do not edit the class manually.
+ */
+
+package com.xero.models.bankfeedsv2;
+
+import com.fasterxml.jackson.annotation.JsonCreator;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import com.fasterxml.jackson.annotation.JsonValue;
+import com.xero.api.StringUtil;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import java.util.Objects;
+import java.util.UUID;
+
+/**
+ * The outcome for a single request item. Read `status` rather than inferring the outcome
+ * from the presence of `error`. On a termination an item can have both
+ * `SUCCESS` and an `error`, when the identifier did not match a connection to
+ * terminate. Read `statusCode` per item as well, rather than deriving it from the
+ * envelope: it is the number the envelope itself is computed from. A `statusCode` of
+ * `204` is an idempotent no-op, not a failure; one of `500` on a
+ * `partial-failure-*` type is not a server fault to retry blindly. The item's
+ * `error` does not repeat the number as `status`.
+ */
+@ApiModel(
+ description =
+ "The outcome for a single request item. Read `status` rather than inferring the outcome"
+ + " from the presence of `error`. On a termination an item can have both `SUCCESS` and"
+ + " an `error`, when the identifier did not match a connection to terminate. Read"
+ + " `statusCode` per item as well, rather than deriving it from the envelope: it is the"
+ + " number the envelope itself is computed from. A `statusCode` of `204` is an"
+ + " idempotent no-op, not a failure; one of `500` on a `partial-failure-*` type is not"
+ + " a server fault to retry blindly. The item's `error` does not repeat the number as"
+ + " `status`. ")
+public class BulkFeedConnectionResult {
+ StringUtil util = new StringUtil();
+
+ @JsonProperty("id")
+ private UUID id;
+
+ @JsonProperty("accountToken")
+ private String accountToken;
+
+ /**
+ * `SUCCESS` means the item reached the state the request asked for — on a create the
+ * connection exists, on a termination it is gone, including the idempotent case where it was
+ * already gone. `REJECTED` means nothing was written, or Xero confirmed that nothing
+ * took effect. A `4xx` item needs correcting before it is sent again, and a
+ * `500` item can be resent as it is. `error` says why.
+ * `PARTIAL_FAILURE` means the item did not complete, and the state it left behind needs
+ * attention or could not be confirmed. `error.subtype` says which,
+ * `error.detail` describes it, and the item needs attention that neither of the other
+ * two values implies. A client deserialising this into a closed set of `SUCCESS` and
+ * `REJECTED` will fail on `PARTIAL_FAILURE`. That is intended rather than an
+ * oversight: binding it silently to either of the other two would hide state that the partner has
+ * to act on.
+ */
+ public enum StatusEnum {
+ /** SUCCESS */
+ SUCCESS("SUCCESS"),
+
+ /** REJECTED */
+ REJECTED("REJECTED"),
+
+ /** PARTIAL_FAILURE */
+ PARTIAL_FAILURE("PARTIAL_FAILURE");
+
+ private String value;
+
+ StatusEnum(String value) {
+ this.value = value;
+ }
+
+ /**
+ * getValue
+ *
+ * @return String value
+ */
+ @JsonValue
+ public String getValue() {
+ return value;
+ }
+
+ /**
+ * toString
+ *
+ * @return String value
+ */
+ @Override
+ public String toString() {
+ return String.valueOf(value);
+ }
+
+ /**
+ * fromValue
+ *
+ * @param value String
+ */
+ @JsonCreator
+ public static StatusEnum fromValue(String value) {
+ for (StatusEnum b : StatusEnum.values()) {
+ if (b.value.equals(value)) {
+ return b;
+ }
+ }
+ throw new IllegalArgumentException("Unexpected value '" + value + "'");
+ }
+ }
+
+ @JsonProperty("status")
+ private StatusEnum status;
+
+ @JsonProperty("statusCode")
+ private Integer statusCode;
+
+ @JsonProperty("error")
+ private ItemError error;
+
+ /**
+ * On a create, Xero's identifier for the new Feed Connection; absent when the item was
+ * rejected, since nothing was created. On a termination, the identifier supplied in the request,
+ * echoed back; absent only when the item did not include a usable identifier.
+ *
+ * @param id UUID
+ * @return BulkFeedConnectionResult
+ */
+ public BulkFeedConnectionResult id(UUID id) {
+ this.id = id;
+ return this;
+ }
+
+ /**
+ * On a create, Xero's identifier for the new Feed Connection; absent when the item was
+ * rejected, since nothing was created. On a termination, the identifier supplied in the request,
+ * echoed back; absent only when the item did not include a usable identifier.
+ *
+ * @return id
+ */
+ @ApiModelProperty(
+ value =
+ "On a create, Xero's identifier for the new Feed Connection; absent when the item was"
+ + " rejected, since nothing was created. On a termination, the identifier supplied"
+ + " in the request, echoed back; absent only when the item did not include a usable"
+ + " identifier. ")
+ /**
+ * On a create, Xero's identifier for the new Feed Connection; absent when the item was
+ * rejected, since nothing was created. On a termination, the identifier supplied in the request,
+ * echoed back; absent only when the item did not include a usable identifier.
+ *
+ * @return id UUID
+ */
+ public UUID getId() {
+ return id;
+ }
+
+ /**
+ * On a create, Xero's identifier for the new Feed Connection; absent when the item was
+ * rejected, since nothing was created. On a termination, the identifier supplied in the request,
+ * echoed back; absent only when the item did not include a usable identifier.
+ *
+ * @param id UUID
+ */
+ public void setId(UUID id) {
+ this.id = id;
+ }
+
+ /**
+ * The `accountToken` supplied in the request, echoed back, including on a rejected
+ * item. Not returned on a termination.
+ *
+ * @param accountToken String
+ * @return BulkFeedConnectionResult
+ */
+ public BulkFeedConnectionResult accountToken(String accountToken) {
+ this.accountToken = accountToken;
+ return this;
+ }
+
+ /**
+ * The `accountToken` supplied in the request, echoed back, including on a rejected
+ * item. Not returned on a termination.
+ *
+ * @return accountToken
+ */
+ @ApiModelProperty(
+ value =
+ "The `accountToken` supplied in the request, echoed back, including on a rejected item."
+ + " Not returned on a termination. ")
+ /**
+ * The `accountToken` supplied in the request, echoed back, including on a rejected
+ * item. Not returned on a termination.
+ *
+ * @return accountToken String
+ */
+ public String getAccountToken() {
+ return accountToken;
+ }
+
+ /**
+ * The `accountToken` supplied in the request, echoed back, including on a rejected
+ * item. Not returned on a termination.
+ *
+ * @param accountToken String
+ */
+ public void setAccountToken(String accountToken) {
+ this.accountToken = accountToken;
+ }
+
+ /**
+ * `SUCCESS` means the item reached the state the request asked for — on a create the
+ * connection exists, on a termination it is gone, including the idempotent case where it was
+ * already gone. `REJECTED` means nothing was written, or Xero confirmed that nothing
+ * took effect. A `4xx` item needs correcting before it is sent again, and a
+ * `500` item can be resent as it is. `error` says why.
+ * `PARTIAL_FAILURE` means the item did not complete, and the state it left behind needs
+ * attention or could not be confirmed. `error.subtype` says which,
+ * `error.detail` describes it, and the item needs attention that neither of the other
+ * two values implies. A client deserialising this into a closed set of `SUCCESS` and
+ * `REJECTED` will fail on `PARTIAL_FAILURE`. That is intended rather than an
+ * oversight: binding it silently to either of the other two would hide state that the partner has
+ * to act on.
+ *
+ * @param status StatusEnum
+ * @return BulkFeedConnectionResult
+ */
+ public BulkFeedConnectionResult status(StatusEnum status) {
+ this.status = status;
+ return this;
+ }
+
+ /**
+ * `SUCCESS` means the item reached the state the request asked for — on a create the
+ * connection exists, on a termination it is gone, including the idempotent case where it was
+ * already gone. `REJECTED` means nothing was written, or Xero confirmed that nothing
+ * took effect. A `4xx` item needs correcting before it is sent again, and a
+ * `500` item can be resent as it is. `error` says why.
+ * `PARTIAL_FAILURE` means the item did not complete, and the state it left behind needs
+ * attention or could not be confirmed. `error.subtype` says which,
+ * `error.detail` describes it, and the item needs attention that neither of the other
+ * two values implies. A client deserialising this into a closed set of `SUCCESS` and
+ * `REJECTED` will fail on `PARTIAL_FAILURE`. That is intended rather than an
+ * oversight: binding it silently to either of the other two would hide state that the partner has
+ * to act on.
+ *
+ * @return status
+ */
+ @ApiModelProperty(
+ value =
+ "`SUCCESS` means the item reached the state the request asked for — on a create the"
+ + " connection exists, on a termination it is gone, including the idempotent case"
+ + " where it was already gone. `REJECTED` means nothing was written, or Xero"
+ + " confirmed that nothing took effect. A `4xx` item needs correcting before it is"
+ + " sent again, and a `500` item can be resent as it is. `error` says why."
+ + " `PARTIAL_FAILURE` means the item did not complete, and the state it left behind"
+ + " needs attention or could not be confirmed. `error.subtype` says which,"
+ + " `error.detail` describes it, and the item needs attention that neither of the"
+ + " other two values implies. A client deserialising this into a closed set of"
+ + " `SUCCESS` and `REJECTED` will fail on `PARTIAL_FAILURE`. That is intended rather"
+ + " than an oversight: binding it silently to either of the other two would hide"
+ + " state that the partner has to act on. ")
+ /**
+ * `SUCCESS` means the item reached the state the request asked for — on a create the
+ * connection exists, on a termination it is gone, including the idempotent case where it was
+ * already gone. `REJECTED` means nothing was written, or Xero confirmed that nothing
+ * took effect. A `4xx` item needs correcting before it is sent again, and a
+ * `500` item can be resent as it is. `error` says why.
+ * `PARTIAL_FAILURE` means the item did not complete, and the state it left behind needs
+ * attention or could not be confirmed. `error.subtype` says which,
+ * `error.detail` describes it, and the item needs attention that neither of the other
+ * two values implies. A client deserialising this into a closed set of `SUCCESS` and
+ * `REJECTED` will fail on `PARTIAL_FAILURE`. That is intended rather than an
+ * oversight: binding it silently to either of the other two would hide state that the partner has
+ * to act on.
+ *
+ * @return status StatusEnum
+ */
+ public StatusEnum getStatus() {
+ return status;
+ }
+
+ /**
+ * `SUCCESS` means the item reached the state the request asked for — on a create the
+ * connection exists, on a termination it is gone, including the idempotent case where it was
+ * already gone. `REJECTED` means nothing was written, or Xero confirmed that nothing
+ * took effect. A `4xx` item needs correcting before it is sent again, and a
+ * `500` item can be resent as it is. `error` says why.
+ * `PARTIAL_FAILURE` means the item did not complete, and the state it left behind needs
+ * attention or could not be confirmed. `error.subtype` says which,
+ * `error.detail` describes it, and the item needs attention that neither of the other
+ * two values implies. A client deserialising this into a closed set of `SUCCESS` and
+ * `REJECTED` will fail on `PARTIAL_FAILURE`. That is intended rather than an
+ * oversight: binding it silently to either of the other two would hide state that the partner has
+ * to act on.
+ *
+ * @param status StatusEnum
+ */
+ public void setStatus(StatusEnum status) {
+ this.status = status;
+ }
+
+ /**
+ * The numeric status of this item: `201` on a created connection, `204` on a
+ * terminated or already-absent one, a 4xx on a rejection, `500` on a partial failure or
+ * on a rejection whose error is `internal-error` or `too-many-requests`. The
+ * response envelope is computed from the items' `statusCode` values: all 2xx is
+ * `200`, all 4xx is `400`, anything else is `207`. So a partner can
+ * size up one item without reading `status` and `error` together. Never
+ * `202` and never `207`: those are envelope-only, and an item-level
+ * `207` would be numerically inside 2xx, so a batch of partial failures could be
+ * reported as `200`.
+ *
+ * @param statusCode Integer
+ * @return BulkFeedConnectionResult
+ */
+ public BulkFeedConnectionResult statusCode(Integer statusCode) {
+ this.statusCode = statusCode;
+ return this;
+ }
+
+ /**
+ * The numeric status of this item: `201` on a created connection, `204` on a
+ * terminated or already-absent one, a 4xx on a rejection, `500` on a partial failure or
+ * on a rejection whose error is `internal-error` or `too-many-requests`. The
+ * response envelope is computed from the items' `statusCode` values: all 2xx is
+ * `200`, all 4xx is `400`, anything else is `207`. So a partner can
+ * size up one item without reading `status` and `error` together. Never
+ * `202` and never `207`: those are envelope-only, and an item-level
+ * `207` would be numerically inside 2xx, so a batch of partial failures could be
+ * reported as `200`.
+ *
+ * @return statusCode
+ */
+ @ApiModelProperty(
+ value =
+ "The numeric status of this item: `201` on a created connection, `204` on a terminated or"
+ + " already-absent one, a 4xx on a rejection, `500` on a partial failure or on a"
+ + " rejection whose error is `internal-error` or `too-many-requests`. The response"
+ + " envelope is computed from the items' `statusCode` values: all 2xx is `200`, all"
+ + " 4xx is `400`, anything else is `207`. So a partner can size up one item without"
+ + " reading `status` and `error` together. Never `202` and never `207`: those are"
+ + " envelope-only, and an item-level `207` would be numerically inside 2xx, so a"
+ + " batch of partial failures could be reported as `200`. ")
+ /**
+ * The numeric status of this item: `201` on a created connection, `204` on a
+ * terminated or already-absent one, a 4xx on a rejection, `500` on a partial failure or
+ * on a rejection whose error is `internal-error` or `too-many-requests`. The
+ * response envelope is computed from the items' `statusCode` values: all 2xx is
+ * `200`, all 4xx is `400`, anything else is `207`. So a partner can
+ * size up one item without reading `status` and `error` together. Never
+ * `202` and never `207`: those are envelope-only, and an item-level
+ * `207` would be numerically inside 2xx, so a batch of partial failures could be
+ * reported as `200`.
+ *
+ * @return statusCode Integer
+ */
+ public Integer getStatusCode() {
+ return statusCode;
+ }
+
+ /**
+ * The numeric status of this item: `201` on a created connection, `204` on a
+ * terminated or already-absent one, a 4xx on a rejection, `500` on a partial failure or
+ * on a rejection whose error is `internal-error` or `too-many-requests`. The
+ * response envelope is computed from the items' `statusCode` values: all 2xx is
+ * `200`, all 4xx is `400`, anything else is `207`. So a partner can
+ * size up one item without reading `status` and `error` together. Never
+ * `202` and never `207`: those are envelope-only, and an item-level
+ * `207` would be numerically inside 2xx, so a batch of partial failures could be
+ * reported as `200`.
+ *
+ * @param statusCode Integer
+ */
+ public void setStatusCode(Integer statusCode) {
+ this.statusCode = statusCode;
+ }
+
+ /**
+ * error
+ *
+ * @param error ItemError
+ * @return BulkFeedConnectionResult
+ */
+ public BulkFeedConnectionResult error(ItemError error) {
+ this.error = error;
+ return this;
+ }
+
+ /**
+ * Get error
+ *
+ * @return error
+ */
+ @ApiModelProperty(value = "")
+ /**
+ * error
+ *
+ * @return error ItemError
+ */
+ public ItemError getError() {
+ return error;
+ }
+
+ /**
+ * error
+ *
+ * @param error ItemError
+ */
+ public void setError(ItemError error) {
+ this.error = error;
+ }
+
+ @Override
+ public boolean equals(java.lang.Object o) {
+ if (this == o) {
+ return true;
+ }
+ if (o == null || getClass() != o.getClass()) {
+ return false;
+ }
+ BulkFeedConnectionResult bulkFeedConnectionResult = (BulkFeedConnectionResult) o;
+ return Objects.equals(this.id, bulkFeedConnectionResult.id)
+ && Objects.equals(this.accountToken, bulkFeedConnectionResult.accountToken)
+ && Objects.equals(this.status, bulkFeedConnectionResult.status)
+ && Objects.equals(this.statusCode, bulkFeedConnectionResult.statusCode)
+ && Objects.equals(this.error, bulkFeedConnectionResult.error);
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hash(id, accountToken, status, statusCode, error);
+ }
+
+ @Override
+ public String toString() {
+ StringBuilder sb = new StringBuilder();
+ sb.append("class BulkFeedConnectionResult {\n");
+ sb.append(" id: ").append(toIndentedString(id)).append("\n");
+ sb.append(" accountToken: ").append(toIndentedString(accountToken)).append("\n");
+ sb.append(" status: ").append(toIndentedString(status)).append("\n");
+ sb.append(" statusCode: ").append(toIndentedString(statusCode)).append("\n");
+ sb.append(" error: ").append(toIndentedString(error)).append("\n");
+ sb.append("}");
+ return sb.toString();
+ }
+
+ /**
+ * Convert the given object to string with each line indented by 4 spaces (except the first line).
+ */
+ private String toIndentedString(java.lang.Object o) {
+ if (o == null) {
+ return "null";
+ }
+ return o.toString().replace("\n", "\n ");
+ }
+}
diff --git a/src/main/java/com/xero/models/bankfeedsv2/DeleteFeedConnectionsRequest.java b/src/main/java/com/xero/models/bankfeedsv2/DeleteFeedConnectionsRequest.java
new file mode 100644
index 00000000..e73dc6aa
--- /dev/null
+++ b/src/main/java/com/xero/models/bankfeedsv2/DeleteFeedConnectionsRequest.java
@@ -0,0 +1,118 @@
+/*
+ * Xero Bank Feeds API v2
+ * The Bank Feeds API is available to financial institutions with a Xero partnership and approved app partners. For non-bank apps, it automates statement imports into Xero bank and credit card accounts; it does not create a direct bank feed. Feed Connections 2.0 is intended to replace 1.0. The customer chooses whether to connect an existing Xero account or create a new one. Use ExistingAccount with the chosen accountId, or NewAccount to create an account; Xero does not guess which account to connect or silently change an account name. The GET and delete operations also use 2.0. Statements continue to use 1.0. Partial failures are rare, and nearly all are recoverable by your app with no need to contact Xero support. If an item in a write response has `status` `PARTIAL_FAILURE`, handle only that item and read its `error.type`. For `partial-failure-new-account-creation`, do not resend the NewAccount item: connect `error.accountId` with `POST /FeedConnections/ExistingAccount`. For `partial-failure-new-account-existence-not-confirmed`, the account named in `error.accountName` may or may not exist. Use the Accounting API to check whether an account with that name exists. If it does, connect it with `POST /FeedConnections/ExistingAccount`. If it does not, resend the NewAccount item. If your app has a user, you can show them this message instead: \"Something went wrong. Please check whether your chosen account name now exists. If it does, connect it. If not, try creating the new one again.\" For any other `partial-failure-*` type, resend the same item. If the recovery request for `partial-failure-new-account-creation`, `partial-failure-previous-connection-deletion` or `partial-failure-connection-creation` returns 409 `feed-already-connected-in-current-organisation`, the earlier attempt succeeded: treat the item as created and use `GET /FeedConnections` to find its `id`. `error.subtype` is optional diagnostics; do not branch on it, and never parse `title` or `detail`. Full detail: https://developer.xero.com/documentation/api/bankfeeds/feedconnections-2-0-errors/#partial-failures
+ *
+ * Contact: api@xero.com
+ *
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
+ * https://openapi-generator.tech
+ * Do not edit the class manually.
+ */
+
+package com.xero.models.bankfeedsv2;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+import com.xero.api.StringUtil;
+import io.swagger.annotations.ApiModelProperty;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Objects;
+
+/** DeleteFeedConnectionsRequest */
+public class DeleteFeedConnectionsRequest {
+ StringUtil util = new StringUtil();
+
+ @JsonProperty("items")
+ private List items = new ArrayList();
+
+ /**
+ * Between 1 and 50 Feed Connections to terminate. No element may be null, and no identifier may
+ * appear twice.
+ *
+ * @param items List<FeedConnectionToDelete>
+ * @return DeleteFeedConnectionsRequest
+ */
+ public DeleteFeedConnectionsRequest items(List items) {
+ this.items = items;
+ return this;
+ }
+
+ /**
+ * Between 1 and 50 Feed Connections to terminate. No element may be null, and no identifier may
+ * appear twice.
+ *
+ * @param itemsItem FeedConnectionToDelete
+ * @return DeleteFeedConnectionsRequest
+ */
+ public DeleteFeedConnectionsRequest addItemsItem(FeedConnectionToDelete itemsItem) {
+ this.items.add(itemsItem);
+ return this;
+ }
+
+ /**
+ * Between 1 and 50 Feed Connections to terminate. No element may be null, and no identifier may
+ * appear twice.
+ *
+ * @return items
+ */
+ @ApiModelProperty(
+ required = true,
+ value =
+ "Between 1 and 50 Feed Connections to terminate. No element may be null, and no"
+ + " identifier may appear twice. ")
+ /**
+ * Between 1 and 50 Feed Connections to terminate. No element may be null, and no identifier may
+ * appear twice.
+ *
+ * @return items List
+ */
+ public List getItems() {
+ return items;
+ }
+
+ /**
+ * Between 1 and 50 Feed Connections to terminate. No element may be null, and no identifier may
+ * appear twice.
+ *
+ * @param items List<FeedConnectionToDelete>
+ */
+ public void setItems(List items) {
+ this.items = items;
+ }
+
+ @Override
+ public boolean equals(java.lang.Object o) {
+ if (this == o) {
+ return true;
+ }
+ if (o == null || getClass() != o.getClass()) {
+ return false;
+ }
+ DeleteFeedConnectionsRequest deleteFeedConnectionsRequest = (DeleteFeedConnectionsRequest) o;
+ return Objects.equals(this.items, deleteFeedConnectionsRequest.items);
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hash(items);
+ }
+
+ @Override
+ public String toString() {
+ StringBuilder sb = new StringBuilder();
+ sb.append("class DeleteFeedConnectionsRequest {\n");
+ sb.append(" items: ").append(toIndentedString(items)).append("\n");
+ sb.append("}");
+ return sb.toString();
+ }
+
+ /**
+ * Convert the given object to string with each line indented by 4 spaces (except the first line).
+ */
+ private String toIndentedString(java.lang.Object o) {
+ if (o == null) {
+ return "null";
+ }
+ return o.toString().replace("\n", "\n ");
+ }
+}
diff --git a/src/main/java/com/xero/models/bankfeedsv2/ExistingAccountFeedConnection.java b/src/main/java/com/xero/models/bankfeedsv2/ExistingAccountFeedConnection.java
new file mode 100644
index 00000000..e668635c
--- /dev/null
+++ b/src/main/java/com/xero/models/bankfeedsv2/ExistingAccountFeedConnection.java
@@ -0,0 +1,370 @@
+/*
+ * Xero Bank Feeds API v2
+ * The Bank Feeds API is available to financial institutions with a Xero partnership and approved app partners. For non-bank apps, it automates statement imports into Xero bank and credit card accounts; it does not create a direct bank feed. Feed Connections 2.0 is intended to replace 1.0. The customer chooses whether to connect an existing Xero account or create a new one. Use ExistingAccount with the chosen accountId, or NewAccount to create an account; Xero does not guess which account to connect or silently change an account name. The GET and delete operations also use 2.0. Statements continue to use 1.0. Partial failures are rare, and nearly all are recoverable by your app with no need to contact Xero support. If an item in a write response has `status` `PARTIAL_FAILURE`, handle only that item and read its `error.type`. For `partial-failure-new-account-creation`, do not resend the NewAccount item: connect `error.accountId` with `POST /FeedConnections/ExistingAccount`. For `partial-failure-new-account-existence-not-confirmed`, the account named in `error.accountName` may or may not exist. Use the Accounting API to check whether an account with that name exists. If it does, connect it with `POST /FeedConnections/ExistingAccount`. If it does not, resend the NewAccount item. If your app has a user, you can show them this message instead: \"Something went wrong. Please check whether your chosen account name now exists. If it does, connect it. If not, try creating the new one again.\" For any other `partial-failure-*` type, resend the same item. If the recovery request for `partial-failure-new-account-creation`, `partial-failure-previous-connection-deletion` or `partial-failure-connection-creation` returns 409 `feed-already-connected-in-current-organisation`, the earlier attempt succeeded: treat the item as created and use `GET /FeedConnections` to find its `id`. `error.subtype` is optional diagnostics; do not branch on it, and never parse `title` or `detail`. Full detail: https://developer.xero.com/documentation/api/bankfeeds/feedconnections-2-0-errors/#partial-failures
+ *
+ * Contact: api@xero.com
+ *
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
+ * https://openapi-generator.tech
+ * Do not edit the class manually.
+ */
+
+package com.xero.models.bankfeedsv2;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+import com.xero.api.StringUtil;
+import io.swagger.annotations.ApiModelProperty;
+import java.util.Objects;
+import java.util.UUID;
+
+/** ExistingAccountFeedConnection */
+public class ExistingAccountFeedConnection {
+ StringUtil util = new StringUtil();
+
+ @JsonProperty("accountId")
+ private UUID accountId;
+
+ @JsonProperty("accountToken")
+ private String accountToken;
+
+ @JsonProperty("accountType")
+ private AccountType accountType;
+
+ @JsonProperty("currency")
+ private String currency;
+
+ @JsonProperty("country")
+ private String country;
+
+ @JsonProperty("accountNumber")
+ private String accountNumber;
+
+ @JsonProperty("accountName")
+ private String accountName;
+
+ /**
+ * The Xero Bank Account to connect the feed to. Required. An all-zeros GUID is treated as though
+ * the field were absent.
+ *
+ * @param accountId UUID
+ * @return ExistingAccountFeedConnection
+ */
+ public ExistingAccountFeedConnection accountId(UUID accountId) {
+ this.accountId = accountId;
+ return this;
+ }
+
+ /**
+ * The Xero Bank Account to connect the feed to. Required. An all-zeros GUID is treated as though
+ * the field were absent.
+ *
+ * @return accountId
+ */
+ @ApiModelProperty(
+ required = true,
+ value =
+ "The Xero Bank Account to connect the feed to. Required. An all-zeros GUID is treated as"
+ + " though the field were absent. ")
+ /**
+ * The Xero Bank Account to connect the feed to. Required. An all-zeros GUID is treated as though
+ * the field were absent.
+ *
+ * @return accountId UUID
+ */
+ public UUID getAccountId() {
+ return accountId;
+ }
+
+ /**
+ * The Xero Bank Account to connect the feed to. Required. An all-zeros GUID is treated as though
+ * the field were absent.
+ *
+ * @param accountId UUID
+ */
+ public void setAccountId(UUID accountId) {
+ this.accountId = accountId;
+ }
+
+ /**
+ * The financial institute's identifier for the account. Must be unique within your financial
+ * institute. Some financial institutes additionally constrain its format.
+ *
+ * @param accountToken String
+ * @return ExistingAccountFeedConnection
+ */
+ public ExistingAccountFeedConnection accountToken(String accountToken) {
+ this.accountToken = accountToken;
+ return this;
+ }
+
+ /**
+ * The financial institute's identifier for the account. Must be unique within your financial
+ * institute. Some financial institutes additionally constrain its format.
+ *
+ * @return accountToken
+ */
+ @ApiModelProperty(
+ required = true,
+ value =
+ "The financial institute's identifier for the account. Must be unique within your"
+ + " financial institute. Some financial institutes additionally constrain its format."
+ + " ")
+ /**
+ * The financial institute's identifier for the account. Must be unique within your financial
+ * institute. Some financial institutes additionally constrain its format.
+ *
+ * @return accountToken String
+ */
+ public String getAccountToken() {
+ return accountToken;
+ }
+
+ /**
+ * The financial institute's identifier for the account. Must be unique within your financial
+ * institute. Some financial institutes additionally constrain its format.
+ *
+ * @param accountToken String
+ */
+ public void setAccountToken(String accountToken) {
+ this.accountToken = accountToken;
+ }
+
+ /**
+ * accountType
+ *
+ * @param accountType AccountType
+ * @return ExistingAccountFeedConnection
+ */
+ public ExistingAccountFeedConnection accountType(AccountType accountType) {
+ this.accountType = accountType;
+ return this;
+ }
+
+ /**
+ * Get accountType
+ *
+ * @return accountType
+ */
+ @ApiModelProperty(required = true, value = "")
+ /**
+ * accountType
+ *
+ * @return accountType AccountType
+ */
+ public AccountType getAccountType() {
+ return accountType;
+ }
+
+ /**
+ * accountType
+ *
+ * @param accountType AccountType
+ */
+ public void setAccountType(AccountType accountType) {
+ this.accountType = accountType;
+ }
+
+ /**
+ * ISO-4217 currency code. Must match the currency of the Xero Bank Account named by
+ * `accountId`, and must be a currency the Organisation has.
+ *
+ * @param currency String
+ * @return ExistingAccountFeedConnection
+ */
+ public ExistingAccountFeedConnection currency(String currency) {
+ this.currency = currency;
+ return this;
+ }
+
+ /**
+ * ISO-4217 currency code. Must match the currency of the Xero Bank Account named by
+ * `accountId`, and must be a currency the Organisation has.
+ *
+ * @return currency
+ */
+ @ApiModelProperty(
+ required = true,
+ value =
+ "ISO-4217 currency code. Must match the currency of the Xero Bank Account named by"
+ + " `accountId`, and must be a currency the Organisation has. ")
+ /**
+ * ISO-4217 currency code. Must match the currency of the Xero Bank Account named by
+ * `accountId`, and must be a currency the Organisation has.
+ *
+ * @return currency String
+ */
+ public String getCurrency() {
+ return currency;
+ }
+
+ /**
+ * ISO-4217 currency code. Must match the currency of the Xero Bank Account named by
+ * `accountId`, and must be a currency the Organisation has.
+ *
+ * @param currency String
+ */
+ public void setCurrency(String currency) {
+ this.currency = currency;
+ }
+
+ /**
+ * ISO-3166 alpha-2 country code. Required only when the Application supports multiple regions.
+ * Talk to your Partner Manager to confirm whether this applies to you.
+ *
+ * @param country String
+ * @return ExistingAccountFeedConnection
+ */
+ public ExistingAccountFeedConnection country(String country) {
+ this.country = country;
+ return this;
+ }
+
+ /**
+ * ISO-3166 alpha-2 country code. Required only when the Application supports multiple regions.
+ * Talk to your Partner Manager to confirm whether this applies to you.
+ *
+ * @return country
+ */
+ @ApiModelProperty(
+ value =
+ "ISO-3166 alpha-2 country code. Required only when the Application supports multiple"
+ + " regions. Talk to your Partner Manager to confirm whether this applies to you. ")
+ /**
+ * ISO-3166 alpha-2 country code. Required only when the Application supports multiple regions.
+ * Talk to your Partner Manager to confirm whether this applies to you.
+ *
+ * @return country String
+ */
+ public String getCountry() {
+ return country;
+ }
+
+ /**
+ * ISO-3166 alpha-2 country code. Required only when the Application supports multiple regions.
+ * Talk to your Partner Manager to confirm whether this applies to you.
+ *
+ * @param country String
+ */
+ public void setCountry(String country) {
+ this.country = country;
+ }
+
+ /**
+ * Ignored. Taken from the Xero Bank Account named by `accountId`.
+ *
+ * @param accountNumber String
+ * @return ExistingAccountFeedConnection
+ */
+ public ExistingAccountFeedConnection accountNumber(String accountNumber) {
+ this.accountNumber = accountNumber;
+ return this;
+ }
+
+ /**
+ * Ignored. Taken from the Xero Bank Account named by `accountId`.
+ *
+ * @return accountNumber
+ */
+ @ApiModelProperty(value = "Ignored. Taken from the Xero Bank Account named by `accountId`.")
+ /**
+ * Ignored. Taken from the Xero Bank Account named by `accountId`.
+ *
+ * @return accountNumber String
+ */
+ public String getAccountNumber() {
+ return accountNumber;
+ }
+
+ /**
+ * Ignored. Taken from the Xero Bank Account named by `accountId`.
+ *
+ * @param accountNumber String
+ */
+ public void setAccountNumber(String accountNumber) {
+ this.accountNumber = accountNumber;
+ }
+
+ /**
+ * Ignored. Taken from the Xero Bank Account named by `accountId`.
+ *
+ * @param accountName String
+ * @return ExistingAccountFeedConnection
+ */
+ public ExistingAccountFeedConnection accountName(String accountName) {
+ this.accountName = accountName;
+ return this;
+ }
+
+ /**
+ * Ignored. Taken from the Xero Bank Account named by `accountId`.
+ *
+ * @return accountName
+ */
+ @ApiModelProperty(value = "Ignored. Taken from the Xero Bank Account named by `accountId`.")
+ /**
+ * Ignored. Taken from the Xero Bank Account named by `accountId`.
+ *
+ * @return accountName String
+ */
+ public String getAccountName() {
+ return accountName;
+ }
+
+ /**
+ * Ignored. Taken from the Xero Bank Account named by `accountId`.
+ *
+ * @param accountName String
+ */
+ public void setAccountName(String accountName) {
+ this.accountName = accountName;
+ }
+
+ @Override
+ public boolean equals(java.lang.Object o) {
+ if (this == o) {
+ return true;
+ }
+ if (o == null || getClass() != o.getClass()) {
+ return false;
+ }
+ ExistingAccountFeedConnection existingAccountFeedConnection = (ExistingAccountFeedConnection) o;
+ return Objects.equals(this.accountId, existingAccountFeedConnection.accountId)
+ && Objects.equals(this.accountToken, existingAccountFeedConnection.accountToken)
+ && Objects.equals(this.accountType, existingAccountFeedConnection.accountType)
+ && Objects.equals(this.currency, existingAccountFeedConnection.currency)
+ && Objects.equals(this.country, existingAccountFeedConnection.country)
+ && Objects.equals(this.accountNumber, existingAccountFeedConnection.accountNumber)
+ && Objects.equals(this.accountName, existingAccountFeedConnection.accountName);
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hash(
+ accountId, accountToken, accountType, currency, country, accountNumber, accountName);
+ }
+
+ @Override
+ public String toString() {
+ StringBuilder sb = new StringBuilder();
+ sb.append("class ExistingAccountFeedConnection {\n");
+ sb.append(" accountId: ").append(toIndentedString(accountId)).append("\n");
+ sb.append(" accountToken: ").append(toIndentedString(accountToken)).append("\n");
+ sb.append(" accountType: ").append(toIndentedString(accountType)).append("\n");
+ sb.append(" currency: ").append(toIndentedString(currency)).append("\n");
+ sb.append(" country: ").append(toIndentedString(country)).append("\n");
+ sb.append(" accountNumber: ").append(toIndentedString(accountNumber)).append("\n");
+ sb.append(" accountName: ").append(toIndentedString(accountName)).append("\n");
+ sb.append("}");
+ return sb.toString();
+ }
+
+ /**
+ * Convert the given object to string with each line indented by 4 spaces (except the first line).
+ */
+ private String toIndentedString(java.lang.Object o) {
+ if (o == null) {
+ return "null";
+ }
+ return o.toString().replace("\n", "\n ");
+ }
+}
diff --git a/src/main/java/com/xero/models/bankfeedsv2/ExistingAccountFeedConnectionsRequest.java b/src/main/java/com/xero/models/bankfeedsv2/ExistingAccountFeedConnectionsRequest.java
new file mode 100644
index 00000000..a8d1b31e
--- /dev/null
+++ b/src/main/java/com/xero/models/bankfeedsv2/ExistingAccountFeedConnectionsRequest.java
@@ -0,0 +1,114 @@
+/*
+ * Xero Bank Feeds API v2
+ * The Bank Feeds API is available to financial institutions with a Xero partnership and approved app partners. For non-bank apps, it automates statement imports into Xero bank and credit card accounts; it does not create a direct bank feed. Feed Connections 2.0 is intended to replace 1.0. The customer chooses whether to connect an existing Xero account or create a new one. Use ExistingAccount with the chosen accountId, or NewAccount to create an account; Xero does not guess which account to connect or silently change an account name. The GET and delete operations also use 2.0. Statements continue to use 1.0. Partial failures are rare, and nearly all are recoverable by your app with no need to contact Xero support. If an item in a write response has `status` `PARTIAL_FAILURE`, handle only that item and read its `error.type`. For `partial-failure-new-account-creation`, do not resend the NewAccount item: connect `error.accountId` with `POST /FeedConnections/ExistingAccount`. For `partial-failure-new-account-existence-not-confirmed`, the account named in `error.accountName` may or may not exist. Use the Accounting API to check whether an account with that name exists. If it does, connect it with `POST /FeedConnections/ExistingAccount`. If it does not, resend the NewAccount item. If your app has a user, you can show them this message instead: \"Something went wrong. Please check whether your chosen account name now exists. If it does, connect it. If not, try creating the new one again.\" For any other `partial-failure-*` type, resend the same item. If the recovery request for `partial-failure-new-account-creation`, `partial-failure-previous-connection-deletion` or `partial-failure-connection-creation` returns 409 `feed-already-connected-in-current-organisation`, the earlier attempt succeeded: treat the item as created and use `GET /FeedConnections` to find its `id`. `error.subtype` is optional diagnostics; do not branch on it, and never parse `title` or `detail`. Full detail: https://developer.xero.com/documentation/api/bankfeeds/feedconnections-2-0-errors/#partial-failures
+ *
+ * Contact: api@xero.com
+ *
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
+ * https://openapi-generator.tech
+ * Do not edit the class manually.
+ */
+
+package com.xero.models.bankfeedsv2;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+import com.xero.api.StringUtil;
+import io.swagger.annotations.ApiModelProperty;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Objects;
+
+/** ExistingAccountFeedConnectionsRequest */
+public class ExistingAccountFeedConnectionsRequest {
+ StringUtil util = new StringUtil();
+
+ @JsonProperty("items")
+ private List items =
+ new ArrayList();
+
+ /**
+ * Between 1 and 50 Feed Connections to create. No element may be null.
+ *
+ * @param items List<ExistingAccountFeedConnection>
+ * @return ExistingAccountFeedConnectionsRequest
+ */
+ public ExistingAccountFeedConnectionsRequest items(List items) {
+ this.items = items;
+ return this;
+ }
+
+ /**
+ * Between 1 and 50 Feed Connections to create. No element may be null.
+ *
+ * @param itemsItem ExistingAccountFeedConnection
+ * @return ExistingAccountFeedConnectionsRequest
+ */
+ public ExistingAccountFeedConnectionsRequest addItemsItem(
+ ExistingAccountFeedConnection itemsItem) {
+ this.items.add(itemsItem);
+ return this;
+ }
+
+ /**
+ * Between 1 and 50 Feed Connections to create. No element may be null.
+ *
+ * @return items
+ */
+ @ApiModelProperty(
+ required = true,
+ value = "Between 1 and 50 Feed Connections to create. No element may be null.")
+ /**
+ * Between 1 and 50 Feed Connections to create. No element may be null.
+ *
+ * @return items List
+ */
+ public List getItems() {
+ return items;
+ }
+
+ /**
+ * Between 1 and 50 Feed Connections to create. No element may be null.
+ *
+ * @param items List<ExistingAccountFeedConnection>
+ */
+ public void setItems(List items) {
+ this.items = items;
+ }
+
+ @Override
+ public boolean equals(java.lang.Object o) {
+ if (this == o) {
+ return true;
+ }
+ if (o == null || getClass() != o.getClass()) {
+ return false;
+ }
+ ExistingAccountFeedConnectionsRequest existingAccountFeedConnectionsRequest =
+ (ExistingAccountFeedConnectionsRequest) o;
+ return Objects.equals(this.items, existingAccountFeedConnectionsRequest.items);
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hash(items);
+ }
+
+ @Override
+ public String toString() {
+ StringBuilder sb = new StringBuilder();
+ sb.append("class ExistingAccountFeedConnectionsRequest {\n");
+ sb.append(" items: ").append(toIndentedString(items)).append("\n");
+ sb.append("}");
+ return sb.toString();
+ }
+
+ /**
+ * Convert the given object to string with each line indented by 4 spaces (except the first line).
+ */
+ private String toIndentedString(java.lang.Object o) {
+ if (o == null) {
+ return "null";
+ }
+ return o.toString().replace("\n", "\n ");
+ }
+}
diff --git a/src/main/java/com/xero/models/bankfeedsv2/FeedConnection.java b/src/main/java/com/xero/models/bankfeedsv2/FeedConnection.java
new file mode 100644
index 00000000..665b8b91
--- /dev/null
+++ b/src/main/java/com/xero/models/bankfeedsv2/FeedConnection.java
@@ -0,0 +1,380 @@
+/*
+ * Xero Bank Feeds API v2
+ * The Bank Feeds API is available to financial institutions with a Xero partnership and approved app partners. For non-bank apps, it automates statement imports into Xero bank and credit card accounts; it does not create a direct bank feed. Feed Connections 2.0 is intended to replace 1.0. The customer chooses whether to connect an existing Xero account or create a new one. Use ExistingAccount with the chosen accountId, or NewAccount to create an account; Xero does not guess which account to connect or silently change an account name. The GET and delete operations also use 2.0. Statements continue to use 1.0. Partial failures are rare, and nearly all are recoverable by your app with no need to contact Xero support. If an item in a write response has `status` `PARTIAL_FAILURE`, handle only that item and read its `error.type`. For `partial-failure-new-account-creation`, do not resend the NewAccount item: connect `error.accountId` with `POST /FeedConnections/ExistingAccount`. For `partial-failure-new-account-existence-not-confirmed`, the account named in `error.accountName` may or may not exist. Use the Accounting API to check whether an account with that name exists. If it does, connect it with `POST /FeedConnections/ExistingAccount`. If it does not, resend the NewAccount item. If your app has a user, you can show them this message instead: \"Something went wrong. Please check whether your chosen account name now exists. If it does, connect it. If not, try creating the new one again.\" For any other `partial-failure-*` type, resend the same item. If the recovery request for `partial-failure-new-account-creation`, `partial-failure-previous-connection-deletion` or `partial-failure-connection-creation` returns 409 `feed-already-connected-in-current-organisation`, the earlier attempt succeeded: treat the item as created and use `GET /FeedConnections` to find its `id`. `error.subtype` is optional diagnostics; do not branch on it, and never parse `title` or `detail`. Full detail: https://developer.xero.com/documentation/api/bankfeeds/feedconnections-2-0-errors/#partial-failures
+ *
+ * Contact: api@xero.com
+ *
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
+ * https://openapi-generator.tech
+ * Do not edit the class manually.
+ */
+
+package com.xero.models.bankfeedsv2;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+import com.xero.api.StringUtil;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import java.util.Objects;
+import java.util.UUID;
+
+/** A Feed Connection as Xero records it. */
+@ApiModel(description = "A Feed Connection as Xero records it.")
+public class FeedConnection {
+ StringUtil util = new StringUtil();
+
+ @JsonProperty("id")
+ private UUID id;
+
+ @JsonProperty("accountToken")
+ private String accountToken;
+
+ @JsonProperty("accountType")
+ private AccountType accountType;
+
+ @JsonProperty("accountNumber")
+ private String accountNumber;
+
+ @JsonProperty("accountName")
+ private String accountName;
+
+ @JsonProperty("accountId")
+ private UUID accountId;
+
+ @JsonProperty("currency")
+ private String currency;
+
+ @JsonProperty("country")
+ private String country;
+
+ /**
+ * Xero's identifier for the Feed Connection.
+ *
+ * @param id UUID
+ * @return FeedConnection
+ */
+ public FeedConnection id(UUID id) {
+ this.id = id;
+ return this;
+ }
+
+ /**
+ * Xero's identifier for the Feed Connection.
+ *
+ * @return id
+ */
+ @ApiModelProperty(value = "Xero's identifier for the Feed Connection.")
+ /**
+ * Xero's identifier for the Feed Connection.
+ *
+ * @return id UUID
+ */
+ public UUID getId() {
+ return id;
+ }
+
+ /**
+ * Xero's identifier for the Feed Connection.
+ *
+ * @param id UUID
+ */
+ public void setId(UUID id) {
+ this.id = id;
+ }
+
+ /**
+ * The financial institute's identifier for the account.
+ *
+ * @param accountToken String
+ * @return FeedConnection
+ */
+ public FeedConnection accountToken(String accountToken) {
+ this.accountToken = accountToken;
+ return this;
+ }
+
+ /**
+ * The financial institute's identifier for the account.
+ *
+ * @return accountToken
+ */
+ @ApiModelProperty(value = "The financial institute's identifier for the account.")
+ /**
+ * The financial institute's identifier for the account.
+ *
+ * @return accountToken String
+ */
+ public String getAccountToken() {
+ return accountToken;
+ }
+
+ /**
+ * The financial institute's identifier for the account.
+ *
+ * @param accountToken String
+ */
+ public void setAccountToken(String accountToken) {
+ this.accountToken = accountToken;
+ }
+
+ /**
+ * accountType
+ *
+ * @param accountType AccountType
+ * @return FeedConnection
+ */
+ public FeedConnection accountType(AccountType accountType) {
+ this.accountType = accountType;
+ return this;
+ }
+
+ /**
+ * Get accountType
+ *
+ * @return accountType
+ */
+ @ApiModelProperty(value = "")
+ /**
+ * accountType
+ *
+ * @return accountType AccountType
+ */
+ public AccountType getAccountType() {
+ return accountType;
+ }
+
+ /**
+ * accountType
+ *
+ * @param accountType AccountType
+ */
+ public void setAccountType(AccountType accountType) {
+ this.accountType = accountType;
+ }
+
+ /**
+ * The account number the feed is connected to.
+ *
+ * @param accountNumber String
+ * @return FeedConnection
+ */
+ public FeedConnection accountNumber(String accountNumber) {
+ this.accountNumber = accountNumber;
+ return this;
+ }
+
+ /**
+ * The account number the feed is connected to.
+ *
+ * @return accountNumber
+ */
+ @ApiModelProperty(value = "The account number the feed is connected to.")
+ /**
+ * The account number the feed is connected to.
+ *
+ * @return accountNumber String
+ */
+ public String getAccountNumber() {
+ return accountNumber;
+ }
+
+ /**
+ * The account number the feed is connected to.
+ *
+ * @param accountNumber String
+ */
+ public void setAccountNumber(String accountNumber) {
+ this.accountNumber = accountNumber;
+ }
+
+ /**
+ * The name of the Xero Bank Account.
+ *
+ * @param accountName String
+ * @return FeedConnection
+ */
+ public FeedConnection accountName(String accountName) {
+ this.accountName = accountName;
+ return this;
+ }
+
+ /**
+ * The name of the Xero Bank Account.
+ *
+ * @return accountName
+ */
+ @ApiModelProperty(value = "The name of the Xero Bank Account.")
+ /**
+ * The name of the Xero Bank Account.
+ *
+ * @return accountName String
+ */
+ public String getAccountName() {
+ return accountName;
+ }
+
+ /**
+ * The name of the Xero Bank Account.
+ *
+ * @param accountName String
+ */
+ public void setAccountName(String accountName) {
+ this.accountName = accountName;
+ }
+
+ /**
+ * Xero's identifier for the Xero Bank Account.
+ *
+ * @param accountId UUID
+ * @return FeedConnection
+ */
+ public FeedConnection accountId(UUID accountId) {
+ this.accountId = accountId;
+ return this;
+ }
+
+ /**
+ * Xero's identifier for the Xero Bank Account.
+ *
+ * @return accountId
+ */
+ @ApiModelProperty(value = "Xero's identifier for the Xero Bank Account.")
+ /**
+ * Xero's identifier for the Xero Bank Account.
+ *
+ * @return accountId UUID
+ */
+ public UUID getAccountId() {
+ return accountId;
+ }
+
+ /**
+ * Xero's identifier for the Xero Bank Account.
+ *
+ * @param accountId UUID
+ */
+ public void setAccountId(UUID accountId) {
+ this.accountId = accountId;
+ }
+
+ /**
+ * ISO-4217 currency code.
+ *
+ * @param currency String
+ * @return FeedConnection
+ */
+ public FeedConnection currency(String currency) {
+ this.currency = currency;
+ return this;
+ }
+
+ /**
+ * ISO-4217 currency code.
+ *
+ * @return currency
+ */
+ @ApiModelProperty(value = "ISO-4217 currency code.")
+ /**
+ * ISO-4217 currency code.
+ *
+ * @return currency String
+ */
+ public String getCurrency() {
+ return currency;
+ }
+
+ /**
+ * ISO-4217 currency code.
+ *
+ * @param currency String
+ */
+ public void setCurrency(String currency) {
+ this.currency = currency;
+ }
+
+ /**
+ * ISO-3166 alpha-2 country code.
+ *
+ * @param country String
+ * @return FeedConnection
+ */
+ public FeedConnection country(String country) {
+ this.country = country;
+ return this;
+ }
+
+ /**
+ * ISO-3166 alpha-2 country code.
+ *
+ * @return country
+ */
+ @ApiModelProperty(value = "ISO-3166 alpha-2 country code.")
+ /**
+ * ISO-3166 alpha-2 country code.
+ *
+ * @return country String
+ */
+ public String getCountry() {
+ return country;
+ }
+
+ /**
+ * ISO-3166 alpha-2 country code.
+ *
+ * @param country String
+ */
+ public void setCountry(String country) {
+ this.country = country;
+ }
+
+ @Override
+ public boolean equals(java.lang.Object o) {
+ if (this == o) {
+ return true;
+ }
+ if (o == null || getClass() != o.getClass()) {
+ return false;
+ }
+ FeedConnection feedConnection = (FeedConnection) o;
+ return Objects.equals(this.id, feedConnection.id)
+ && Objects.equals(this.accountToken, feedConnection.accountToken)
+ && Objects.equals(this.accountType, feedConnection.accountType)
+ && Objects.equals(this.accountNumber, feedConnection.accountNumber)
+ && Objects.equals(this.accountName, feedConnection.accountName)
+ && Objects.equals(this.accountId, feedConnection.accountId)
+ && Objects.equals(this.currency, feedConnection.currency)
+ && Objects.equals(this.country, feedConnection.country);
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hash(
+ id, accountToken, accountType, accountNumber, accountName, accountId, currency, country);
+ }
+
+ @Override
+ public String toString() {
+ StringBuilder sb = new StringBuilder();
+ sb.append("class FeedConnection {\n");
+ sb.append(" id: ").append(toIndentedString(id)).append("\n");
+ sb.append(" accountToken: ").append(toIndentedString(accountToken)).append("\n");
+ sb.append(" accountType: ").append(toIndentedString(accountType)).append("\n");
+ sb.append(" accountNumber: ").append(toIndentedString(accountNumber)).append("\n");
+ sb.append(" accountName: ").append(toIndentedString(accountName)).append("\n");
+ sb.append(" accountId: ").append(toIndentedString(accountId)).append("\n");
+ sb.append(" currency: ").append(toIndentedString(currency)).append("\n");
+ sb.append(" country: ").append(toIndentedString(country)).append("\n");
+ sb.append("}");
+ return sb.toString();
+ }
+
+ /**
+ * Convert the given object to string with each line indented by 4 spaces (except the first line).
+ */
+ private String toIndentedString(java.lang.Object o) {
+ if (o == null) {
+ return "null";
+ }
+ return o.toString().replace("\n", "\n ");
+ }
+}
diff --git a/src/main/java/com/xero/models/bankfeedsv2/FeedConnectionToDelete.java b/src/main/java/com/xero/models/bankfeedsv2/FeedConnectionToDelete.java
new file mode 100644
index 00000000..bab54e74
--- /dev/null
+++ b/src/main/java/com/xero/models/bankfeedsv2/FeedConnectionToDelete.java
@@ -0,0 +1,110 @@
+/*
+ * Xero Bank Feeds API v2
+ * The Bank Feeds API is available to financial institutions with a Xero partnership and approved app partners. For non-bank apps, it automates statement imports into Xero bank and credit card accounts; it does not create a direct bank feed. Feed Connections 2.0 is intended to replace 1.0. The customer chooses whether to connect an existing Xero account or create a new one. Use ExistingAccount with the chosen accountId, or NewAccount to create an account; Xero does not guess which account to connect or silently change an account name. The GET and delete operations also use 2.0. Statements continue to use 1.0. Partial failures are rare, and nearly all are recoverable by your app with no need to contact Xero support. If an item in a write response has `status` `PARTIAL_FAILURE`, handle only that item and read its `error.type`. For `partial-failure-new-account-creation`, do not resend the NewAccount item: connect `error.accountId` with `POST /FeedConnections/ExistingAccount`. For `partial-failure-new-account-existence-not-confirmed`, the account named in `error.accountName` may or may not exist. Use the Accounting API to check whether an account with that name exists. If it does, connect it with `POST /FeedConnections/ExistingAccount`. If it does not, resend the NewAccount item. If your app has a user, you can show them this message instead: \"Something went wrong. Please check whether your chosen account name now exists. If it does, connect it. If not, try creating the new one again.\" For any other `partial-failure-*` type, resend the same item. If the recovery request for `partial-failure-new-account-creation`, `partial-failure-previous-connection-deletion` or `partial-failure-connection-creation` returns 409 `feed-already-connected-in-current-organisation`, the earlier attempt succeeded: treat the item as created and use `GET /FeedConnections` to find its `id`. `error.subtype` is optional diagnostics; do not branch on it, and never parse `title` or `detail`. Full detail: https://developer.xero.com/documentation/api/bankfeeds/feedconnections-2-0-errors/#partial-failures
+ *
+ * Contact: api@xero.com
+ *
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
+ * https://openapi-generator.tech
+ * Do not edit the class manually.
+ */
+
+package com.xero.models.bankfeedsv2;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+import com.xero.api.StringUtil;
+import io.swagger.annotations.ApiModelProperty;
+import java.util.Objects;
+import java.util.UUID;
+
+/** FeedConnectionToDelete */
+public class FeedConnectionToDelete {
+ StringUtil util = new StringUtil();
+
+ @JsonProperty("id")
+ private UUID id;
+
+ /**
+ * The Feed Connection to terminate. Required; an all-zeros GUID is treated as though the field
+ * were absent. `accountToken`, `accountType` and `country`, which
+ * V1 accepted here, are not supported.
+ *
+ * @param id UUID
+ * @return FeedConnectionToDelete
+ */
+ public FeedConnectionToDelete id(UUID id) {
+ this.id = id;
+ return this;
+ }
+
+ /**
+ * The Feed Connection to terminate. Required; an all-zeros GUID is treated as though the field
+ * were absent. `accountToken`, `accountType` and `country`, which
+ * V1 accepted here, are not supported.
+ *
+ * @return id
+ */
+ @ApiModelProperty(
+ required = true,
+ value =
+ "The Feed Connection to terminate. Required; an all-zeros GUID is treated as though the"
+ + " field were absent. `accountToken`, `accountType` and `country`, which V1 accepted"
+ + " here, are not supported. ")
+ /**
+ * The Feed Connection to terminate. Required; an all-zeros GUID is treated as though the field
+ * were absent. `accountToken`, `accountType` and `country`, which
+ * V1 accepted here, are not supported.
+ *
+ * @return id UUID
+ */
+ public UUID getId() {
+ return id;
+ }
+
+ /**
+ * The Feed Connection to terminate. Required; an all-zeros GUID is treated as though the field
+ * were absent. `accountToken`, `accountType` and `country`, which
+ * V1 accepted here, are not supported.
+ *
+ * @param id UUID
+ */
+ public void setId(UUID id) {
+ this.id = id;
+ }
+
+ @Override
+ public boolean equals(java.lang.Object o) {
+ if (this == o) {
+ return true;
+ }
+ if (o == null || getClass() != o.getClass()) {
+ return false;
+ }
+ FeedConnectionToDelete feedConnectionToDelete = (FeedConnectionToDelete) o;
+ return Objects.equals(this.id, feedConnectionToDelete.id);
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hash(id);
+ }
+
+ @Override
+ public String toString() {
+ StringBuilder sb = new StringBuilder();
+ sb.append("class FeedConnectionToDelete {\n");
+ sb.append(" id: ").append(toIndentedString(id)).append("\n");
+ sb.append("}");
+ return sb.toString();
+ }
+
+ /**
+ * Convert the given object to string with each line indented by 4 spaces (except the first line).
+ */
+ private String toIndentedString(java.lang.Object o) {
+ if (o == null) {
+ return "null";
+ }
+ return o.toString().replace("\n", "\n ");
+ }
+}
diff --git a/src/main/java/com/xero/models/bankfeedsv2/ItemError.java b/src/main/java/com/xero/models/bankfeedsv2/ItemError.java
new file mode 100644
index 00000000..37116508
--- /dev/null
+++ b/src/main/java/com/xero/models/bankfeedsv2/ItemError.java
@@ -0,0 +1,649 @@
+/*
+ * Xero Bank Feeds API v2
+ * The Bank Feeds API is available to financial institutions with a Xero partnership and approved app partners. For non-bank apps, it automates statement imports into Xero bank and credit card accounts; it does not create a direct bank feed. Feed Connections 2.0 is intended to replace 1.0. The customer chooses whether to connect an existing Xero account or create a new one. Use ExistingAccount with the chosen accountId, or NewAccount to create an account; Xero does not guess which account to connect or silently change an account name. The GET and delete operations also use 2.0. Statements continue to use 1.0. Partial failures are rare, and nearly all are recoverable by your app with no need to contact Xero support. If an item in a write response has `status` `PARTIAL_FAILURE`, handle only that item and read its `error.type`. For `partial-failure-new-account-creation`, do not resend the NewAccount item: connect `error.accountId` with `POST /FeedConnections/ExistingAccount`. For `partial-failure-new-account-existence-not-confirmed`, the account named in `error.accountName` may or may not exist. Use the Accounting API to check whether an account with that name exists. If it does, connect it with `POST /FeedConnections/ExistingAccount`. If it does not, resend the NewAccount item. If your app has a user, you can show them this message instead: \"Something went wrong. Please check whether your chosen account name now exists. If it does, connect it. If not, try creating the new one again.\" For any other `partial-failure-*` type, resend the same item. If the recovery request for `partial-failure-new-account-creation`, `partial-failure-previous-connection-deletion` or `partial-failure-connection-creation` returns 409 `feed-already-connected-in-current-organisation`, the earlier attempt succeeded: treat the item as created and use `GET /FeedConnections` to find its `id`. `error.subtype` is optional diagnostics; do not branch on it, and never parse `title` or `detail`. Full detail: https://developer.xero.com/documentation/api/bankfeeds/feedconnections-2-0-errors/#partial-failures
+ *
+ * Contact: api@xero.com
+ *
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
+ * https://openapi-generator.tech
+ * Do not edit the class manually.
+ */
+
+package com.xero.models.bankfeedsv2;
+
+import com.fasterxml.jackson.annotation.JsonCreator;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import com.fasterxml.jackson.annotation.JsonValue;
+import com.xero.api.StringUtil;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import java.util.Objects;
+import java.util.UUID;
+
+/**
+ * The `error` of an item result. It has the same fields as `Problem`, except
+ * `status`: the item's own `statusCode` is its HTTP status, so it is not
+ * repeated here.
+ */
+@ApiModel(
+ description =
+ "The `error` of an item result. It has the same fields as `Problem`, except `status`: the"
+ + " item's own `statusCode` is its HTTP status, so it is not repeated here. ")
+public class ItemError {
+ StringUtil util = new StringUtil();
+
+ /** Identifies the error. */
+ public enum TypeEnum {
+ /** INVALID_REQUEST */
+ INVALID_REQUEST("invalid-request"),
+
+ /** INVALID_APPLICATION */
+ INVALID_APPLICATION("invalid-application"),
+
+ /** SUSPENDED_OR_TERMINATED_APPLICATION */
+ SUSPENDED_OR_TERMINATED_APPLICATION("suspended-or-terminated-application"),
+
+ /** INVALID_ORGANISATION_BANK_FEEDS */
+ INVALID_ORGANISATION_BANK_FEEDS("invalid-organisation-bank-feeds"),
+
+ /** INVALID_ORGANISATION_MULTI_CURRENCY */
+ INVALID_ORGANISATION_MULTI_CURRENCY("invalid-organisation-multi-currency"),
+
+ /** INVALID_FEED_CONNECTION_FOR_ORGANISATION */
+ INVALID_FEED_CONNECTION_FOR_ORGANISATION("invalid-feed-connection-for-organisation"),
+
+ /** INVALID_USER_ROLE */
+ INVALID_USER_ROLE("invalid-user-role"),
+
+ /** INVALID_ACCOUNT_TOKEN */
+ INVALID_ACCOUNT_TOKEN("invalid-account-token"),
+
+ /** MISSING_IDENTIFYING_FIELDS */
+ MISSING_IDENTIFYING_FIELDS("missing-identifying-fields"),
+
+ /** INVALID_COUNTRY_SPECIFIED */
+ INVALID_COUNTRY_SPECIFIED("invalid-country-specified"),
+
+ /** ACCOUNT_NOT_VALID */
+ ACCOUNT_NOT_VALID("account-not-valid"),
+
+ /** FEED_ALREADY_CONNECTED_IN_CURRENT_ORGANISATION */
+ FEED_ALREADY_CONNECTED_IN_CURRENT_ORGANISATION(
+ "feed-already-connected-in-current-organisation"),
+
+ /** ACCOUNT_NAME_ALREADY_EXISTS */
+ ACCOUNT_NAME_ALREADY_EXISTS("account-name-already-exists"),
+
+ /** BANK_FEED_NOT_FOUND */
+ BANK_FEED_NOT_FOUND("bank-feed-not-found"),
+
+ /** FEED_NOT_FOUND_OR_ALREADY_DELETED */
+ FEED_NOT_FOUND_OR_ALREADY_DELETED("feed-not-found-or-already-deleted"),
+
+ /** PARTIAL_FAILURE_NEW_ACCOUNT_CREATION */
+ PARTIAL_FAILURE_NEW_ACCOUNT_CREATION("partial-failure-new-account-creation"),
+
+ /** PARTIAL_FAILURE_PREVIOUS_CONNECTION_DELETION */
+ PARTIAL_FAILURE_PREVIOUS_CONNECTION_DELETION("partial-failure-previous-connection-deletion"),
+
+ /** PARTIAL_FAILURE_CONNECTION_CREATION */
+ PARTIAL_FAILURE_CONNECTION_CREATION("partial-failure-connection-creation"),
+
+ /** PARTIAL_FAILURE_CONNECTION_DELETION */
+ PARTIAL_FAILURE_CONNECTION_DELETION("partial-failure-connection-deletion"),
+
+ /** PARTIAL_FAILURE_NEW_ACCOUNT_EXISTENCE_NOT_CONFIRMED */
+ PARTIAL_FAILURE_NEW_ACCOUNT_EXISTENCE_NOT_CONFIRMED(
+ "partial-failure-new-account-existence-not-confirmed"),
+
+ /** TOO_MANY_REQUESTS */
+ TOO_MANY_REQUESTS("too-many-requests"),
+
+ /** INTERNAL_ERROR */
+ INTERNAL_ERROR("internal-error");
+
+ private String value;
+
+ TypeEnum(String value) {
+ this.value = value;
+ }
+
+ /**
+ * getValue
+ *
+ * @return String value
+ */
+ @JsonValue
+ public String getValue() {
+ return value;
+ }
+
+ /**
+ * toString
+ *
+ * @return String value
+ */
+ @Override
+ public String toString() {
+ return String.valueOf(value);
+ }
+
+ /**
+ * fromValue
+ *
+ * @param value String
+ */
+ @JsonCreator
+ public static TypeEnum fromValue(String value) {
+ for (TypeEnum b : TypeEnum.values()) {
+ if (b.value.equals(value)) {
+ return b;
+ }
+ }
+ throw new IllegalArgumentException("Unexpected value '" + value + "'");
+ }
+ }
+
+ @JsonProperty("type")
+ private TypeEnum type;
+
+ /**
+ * Present only on a partial failure (a `partial-failure-*` `type`). Names the
+ * exact cause within the `type`. Reading it is optional: the `type` alone
+ * fixes the recovery action and which identifier fields are present, so branch on
+ * `type` and use `subtype` for diagnostics.
+ */
+ public enum SubtypeEnum {
+ /** CONNECTION_PHASE_FAILED */
+ CONNECTION_PHASE_FAILED("connection-phase-failed"),
+
+ /** DELETION_PHASE_FAILED */
+ DELETION_PHASE_FAILED("deletion-phase-failed"),
+
+ /** DELETION_PHASE_NOT_CONFIRMED */
+ DELETION_PHASE_NOT_CONFIRMED("deletion-phase-not-confirmed"),
+
+ /** CONNECTION_EXISTENCE_NOT_CONFIRMED */
+ CONNECTION_EXISTENCE_NOT_CONFIRMED("connection-existence-not-confirmed"),
+
+ /** CONNECTION_EXISTS_WITHOUT_FEED_CONNECTION */
+ CONNECTION_EXISTS_WITHOUT_FEED_CONNECTION("connection-exists-without-feed-connection"),
+
+ /** FEED_CONNECTION_EXISTENCE_NOT_CONFIRMED_CAN_CHECK_OR_RETRY */
+ FEED_CONNECTION_EXISTENCE_NOT_CONFIRMED_CAN_CHECK_OR_RETRY(
+ "feed-connection-existence-not-confirmed-can-check-or-retry"),
+
+ /** CHECK_ACCOUNTS_OR_PROMPT_USER_RETRY */
+ CHECK_ACCOUNTS_OR_PROMPT_USER_RETRY("check-accounts-or-prompt-user-retry");
+
+ private String value;
+
+ SubtypeEnum(String value) {
+ this.value = value;
+ }
+
+ /**
+ * getValue
+ *
+ * @return String value
+ */
+ @JsonValue
+ public String getValue() {
+ return value;
+ }
+
+ /**
+ * toString
+ *
+ * @return String value
+ */
+ @Override
+ public String toString() {
+ return String.valueOf(value);
+ }
+
+ /**
+ * fromValue
+ *
+ * @param value String
+ */
+ @JsonCreator
+ public static SubtypeEnum fromValue(String value) {
+ for (SubtypeEnum b : SubtypeEnum.values()) {
+ if (b.value.equals(value)) {
+ return b;
+ }
+ }
+ throw new IllegalArgumentException("Unexpected value '" + value + "'");
+ }
+ }
+
+ @JsonProperty("subtype")
+ private SubtypeEnum subtype;
+
+ @JsonProperty("title")
+ private String title;
+
+ @JsonProperty("detail")
+ private String detail;
+
+ @JsonProperty("accountId")
+ private UUID accountId;
+
+ @JsonProperty("accountName")
+ private String accountName;
+
+ @JsonProperty("connectionId")
+ private UUID connectionId;
+
+ /**
+ * Identifies the error.
+ *
+ * @param type TypeEnum
+ * @return ItemError
+ */
+ public ItemError type(TypeEnum type) {
+ this.type = type;
+ return this;
+ }
+
+ /**
+ * Identifies the error.
+ *
+ * @return type
+ */
+ @ApiModelProperty(value = "Identifies the error.")
+ /**
+ * Identifies the error.
+ *
+ * @return type TypeEnum
+ */
+ public TypeEnum getType() {
+ return type;
+ }
+
+ /**
+ * Identifies the error.
+ *
+ * @param type TypeEnum
+ */
+ public void setType(TypeEnum type) {
+ this.type = type;
+ }
+
+ /**
+ * Present only on a partial failure (a `partial-failure-*` `type`). Names the
+ * exact cause within the `type`. Reading it is optional: the `type` alone
+ * fixes the recovery action and which identifier fields are present, so branch on
+ * `type` and use `subtype` for diagnostics.
+ *
+ * @param subtype SubtypeEnum
+ * @return ItemError
+ */
+ public ItemError subtype(SubtypeEnum subtype) {
+ this.subtype = subtype;
+ return this;
+ }
+
+ /**
+ * Present only on a partial failure (a `partial-failure-*` `type`). Names the
+ * exact cause within the `type`. Reading it is optional: the `type` alone
+ * fixes the recovery action and which identifier fields are present, so branch on
+ * `type` and use `subtype` for diagnostics.
+ *
+ * @return subtype
+ */
+ @ApiModelProperty(
+ value =
+ "Present only on a partial failure (a `partial-failure-*` `type`). Names the exact cause"
+ + " within the `type`. Reading it is optional: the `type` alone fixes the recovery"
+ + " action and which identifier fields are present, so branch on `type` and use"
+ + " `subtype` for diagnostics. ")
+ /**
+ * Present only on a partial failure (a `partial-failure-*` `type`). Names the
+ * exact cause within the `type`. Reading it is optional: the `type` alone
+ * fixes the recovery action and which identifier fields are present, so branch on
+ * `type` and use `subtype` for diagnostics.
+ *
+ * @return subtype SubtypeEnum
+ */
+ public SubtypeEnum getSubtype() {
+ return subtype;
+ }
+
+ /**
+ * Present only on a partial failure (a `partial-failure-*` `type`). Names the
+ * exact cause within the `type`. Reading it is optional: the `type` alone
+ * fixes the recovery action and which identifier fields are present, so branch on
+ * `type` and use `subtype` for diagnostics.
+ *
+ * @param subtype SubtypeEnum
+ */
+ public void setSubtype(SubtypeEnum subtype) {
+ this.subtype = subtype;
+ }
+
+ /**
+ * A short human-readable summary of the error.
+ *
+ * @param title String
+ * @return ItemError
+ */
+ public ItemError title(String title) {
+ this.title = title;
+ return this;
+ }
+
+ /**
+ * A short human-readable summary of the error.
+ *
+ * @return title
+ */
+ @ApiModelProperty(value = "A short human-readable summary of the error.")
+ /**
+ * A short human-readable summary of the error.
+ *
+ * @return title String
+ */
+ public String getTitle() {
+ return title;
+ }
+
+ /**
+ * A short human-readable summary of the error.
+ *
+ * @param title String
+ */
+ public void setTitle(String title) {
+ this.title = title;
+ }
+
+ /**
+ * A human-readable explanation specific to this occurrence.
+ *
+ * @param detail String
+ * @return ItemError
+ */
+ public ItemError detail(String detail) {
+ this.detail = detail;
+ return this;
+ }
+
+ /**
+ * A human-readable explanation specific to this occurrence.
+ *
+ * @return detail
+ */
+ @ApiModelProperty(value = "A human-readable explanation specific to this occurrence.")
+ /**
+ * A human-readable explanation specific to this occurrence.
+ *
+ * @return detail String
+ */
+ public String getDetail() {
+ return detail;
+ }
+
+ /**
+ * A human-readable explanation specific to this occurrence.
+ *
+ * @param detail String
+ */
+ public void setDetail(String detail) {
+ this.detail = detail;
+ }
+
+ /**
+ * Present only on a partial failure. The Xero Bank Account the item concerns. On
+ * `partial-failure-new-account-creation`, the account that was created: connect it
+ * through `POST /FeedConnections/ExistingAccount`. On
+ * `partial-failure-previous-connection-deletion` and
+ * `partial-failure-connection-creation`, the account being connected. Absent on
+ * `partial-failure-connection-deletion` and
+ * `partial-failure-new-account-existence-not-confirmed`, where the account may not
+ * exist.
+ *
+ * @param accountId UUID
+ * @return ItemError
+ */
+ public ItemError accountId(UUID accountId) {
+ this.accountId = accountId;
+ return this;
+ }
+
+ /**
+ * Present only on a partial failure. The Xero Bank Account the item concerns. On
+ * `partial-failure-new-account-creation`, the account that was created: connect it
+ * through `POST /FeedConnections/ExistingAccount`. On
+ * `partial-failure-previous-connection-deletion` and
+ * `partial-failure-connection-creation`, the account being connected. Absent on
+ * `partial-failure-connection-deletion` and
+ * `partial-failure-new-account-existence-not-confirmed`, where the account may not
+ * exist.
+ *
+ * @return accountId
+ */
+ @ApiModelProperty(
+ value =
+ "Present only on a partial failure. The Xero Bank Account the item concerns. On"
+ + " `partial-failure-new-account-creation`, the account that was created: connect it"
+ + " through `POST /FeedConnections/ExistingAccount`. On"
+ + " `partial-failure-previous-connection-deletion` and"
+ + " `partial-failure-connection-creation`, the account being connected. Absent on"
+ + " `partial-failure-connection-deletion` and"
+ + " `partial-failure-new-account-existence-not-confirmed`, where the account may not"
+ + " exist. ")
+ /**
+ * Present only on a partial failure. The Xero Bank Account the item concerns. On
+ * `partial-failure-new-account-creation`, the account that was created: connect it
+ * through `POST /FeedConnections/ExistingAccount`. On
+ * `partial-failure-previous-connection-deletion` and
+ * `partial-failure-connection-creation`, the account being connected. Absent on
+ * `partial-failure-connection-deletion` and
+ * `partial-failure-new-account-existence-not-confirmed`, where the account may not
+ * exist.
+ *
+ * @return accountId UUID
+ */
+ public UUID getAccountId() {
+ return accountId;
+ }
+
+ /**
+ * Present only on a partial failure. The Xero Bank Account the item concerns. On
+ * `partial-failure-new-account-creation`, the account that was created: connect it
+ * through `POST /FeedConnections/ExistingAccount`. On
+ * `partial-failure-previous-connection-deletion` and
+ * `partial-failure-connection-creation`, the account being connected. Absent on
+ * `partial-failure-connection-deletion` and
+ * `partial-failure-new-account-existence-not-confirmed`, where the account may not
+ * exist.
+ *
+ * @param accountId UUID
+ */
+ public void setAccountId(UUID accountId) {
+ this.accountId = accountId;
+ }
+
+ /**
+ * Present only on a partial failure of type `partial-failure-new-account-creation` or
+ * `partial-failure-new-account-existence-not-confirmed`. The name of the account that
+ * was created, which is now taken; on
+ * `partial-failure-new-account-existence-not-confirmed`, the name of the account that
+ * may have been created.
+ *
+ * @param accountName String
+ * @return ItemError
+ */
+ public ItemError accountName(String accountName) {
+ this.accountName = accountName;
+ return this;
+ }
+
+ /**
+ * Present only on a partial failure of type `partial-failure-new-account-creation` or
+ * `partial-failure-new-account-existence-not-confirmed`. The name of the account that
+ * was created, which is now taken; on
+ * `partial-failure-new-account-existence-not-confirmed`, the name of the account that
+ * may have been created.
+ *
+ * @return accountName
+ */
+ @ApiModelProperty(
+ value =
+ "Present only on a partial failure of type `partial-failure-new-account-creation` or"
+ + " `partial-failure-new-account-existence-not-confirmed`. The name of the account"
+ + " that was created, which is now taken; on"
+ + " `partial-failure-new-account-existence-not-confirmed`, the name of the account"
+ + " that may have been created. ")
+ /**
+ * Present only on a partial failure of type `partial-failure-new-account-creation` or
+ * `partial-failure-new-account-existence-not-confirmed`. The name of the account that
+ * was created, which is now taken; on
+ * `partial-failure-new-account-existence-not-confirmed`, the name of the account that
+ * may have been created.
+ *
+ * @return accountName String
+ */
+ public String getAccountName() {
+ return accountName;
+ }
+
+ /**
+ * Present only on a partial failure of type `partial-failure-new-account-creation` or
+ * `partial-failure-new-account-existence-not-confirmed`. The name of the account that
+ * was created, which is now taken; on
+ * `partial-failure-new-account-existence-not-confirmed`, the name of the account that
+ * may have been created.
+ *
+ * @param accountName String
+ */
+ public void setAccountName(String accountName) {
+ this.accountName = accountName;
+ }
+
+ /**
+ * Present only on a partial failure. On `partial-failure-previous-connection-deletion`,
+ * the previous connection on the account (removed, or being removed). On
+ * `partial-failure-connection-creation`, the connection this request created or was
+ * creating: the id it was given before the create (the Feed Connection `id` if it was
+ * recorded). When the subtype is `connection-existence-not-confirmed`, the create's
+ * outcome is unknown and the connection may not exist in Xero. On
+ * `partial-failure-connection-deletion`, the connection being deleted (the item
+ * `id` also echoes it). Absent on `partial-failure-new-account-creation` and
+ * `partial-failure-new-account-existence-not-confirmed`.
+ *
+ * @param connectionId UUID
+ * @return ItemError
+ */
+ public ItemError connectionId(UUID connectionId) {
+ this.connectionId = connectionId;
+ return this;
+ }
+
+ /**
+ * Present only on a partial failure. On `partial-failure-previous-connection-deletion`,
+ * the previous connection on the account (removed, or being removed). On
+ * `partial-failure-connection-creation`, the connection this request created or was
+ * creating: the id it was given before the create (the Feed Connection `id` if it was
+ * recorded). When the subtype is `connection-existence-not-confirmed`, the create's
+ * outcome is unknown and the connection may not exist in Xero. On
+ * `partial-failure-connection-deletion`, the connection being deleted (the item
+ * `id` also echoes it). Absent on `partial-failure-new-account-creation` and
+ * `partial-failure-new-account-existence-not-confirmed`.
+ *
+ * @return connectionId
+ */
+ @ApiModelProperty(
+ value =
+ "Present only on a partial failure. On `partial-failure-previous-connection-deletion`,"
+ + " the previous connection on the account (removed, or being removed). On"
+ + " `partial-failure-connection-creation`, the connection this request created or was"
+ + " creating: the id it was given before the create (the Feed Connection `id` if it"
+ + " was recorded). When the subtype is `connection-existence-not-confirmed`, the"
+ + " create's outcome is unknown and the connection may not exist in Xero. On"
+ + " `partial-failure-connection-deletion`, the connection being deleted (the item"
+ + " `id` also echoes it). Absent on `partial-failure-new-account-creation` and"
+ + " `partial-failure-new-account-existence-not-confirmed`. ")
+ /**
+ * Present only on a partial failure. On `partial-failure-previous-connection-deletion`,
+ * the previous connection on the account (removed, or being removed). On
+ * `partial-failure-connection-creation`, the connection this request created or was
+ * creating: the id it was given before the create (the Feed Connection `id` if it was
+ * recorded). When the subtype is `connection-existence-not-confirmed`, the create's
+ * outcome is unknown and the connection may not exist in Xero. On
+ * `partial-failure-connection-deletion`, the connection being deleted (the item
+ * `id` also echoes it). Absent on `partial-failure-new-account-creation` and
+ * `partial-failure-new-account-existence-not-confirmed`.
+ *
+ * @return connectionId UUID
+ */
+ public UUID getConnectionId() {
+ return connectionId;
+ }
+
+ /**
+ * Present only on a partial failure. On `partial-failure-previous-connection-deletion`,
+ * the previous connection on the account (removed, or being removed). On
+ * `partial-failure-connection-creation`, the connection this request created or was
+ * creating: the id it was given before the create (the Feed Connection `id` if it was
+ * recorded). When the subtype is `connection-existence-not-confirmed`, the create's
+ * outcome is unknown and the connection may not exist in Xero. On
+ * `partial-failure-connection-deletion`, the connection being deleted (the item
+ * `id` also echoes it). Absent on `partial-failure-new-account-creation` and
+ * `partial-failure-new-account-existence-not-confirmed`.
+ *
+ * @param connectionId UUID
+ */
+ public void setConnectionId(UUID connectionId) {
+ this.connectionId = connectionId;
+ }
+
+ @Override
+ public boolean equals(java.lang.Object o) {
+ if (this == o) {
+ return true;
+ }
+ if (o == null || getClass() != o.getClass()) {
+ return false;
+ }
+ ItemError itemError = (ItemError) o;
+ return Objects.equals(this.type, itemError.type)
+ && Objects.equals(this.subtype, itemError.subtype)
+ && Objects.equals(this.title, itemError.title)
+ && Objects.equals(this.detail, itemError.detail)
+ && Objects.equals(this.accountId, itemError.accountId)
+ && Objects.equals(this.accountName, itemError.accountName)
+ && Objects.equals(this.connectionId, itemError.connectionId);
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hash(type, subtype, title, detail, accountId, accountName, connectionId);
+ }
+
+ @Override
+ public String toString() {
+ StringBuilder sb = new StringBuilder();
+ sb.append("class ItemError {\n");
+ sb.append(" type: ").append(toIndentedString(type)).append("\n");
+ sb.append(" subtype: ").append(toIndentedString(subtype)).append("\n");
+ sb.append(" title: ").append(toIndentedString(title)).append("\n");
+ sb.append(" detail: ").append(toIndentedString(detail)).append("\n");
+ sb.append(" accountId: ").append(toIndentedString(accountId)).append("\n");
+ sb.append(" accountName: ").append(toIndentedString(accountName)).append("\n");
+ sb.append(" connectionId: ").append(toIndentedString(connectionId)).append("\n");
+ sb.append("}");
+ return sb.toString();
+ }
+
+ /**
+ * Convert the given object to string with each line indented by 4 spaces (except the first line).
+ */
+ private String toIndentedString(java.lang.Object o) {
+ if (o == null) {
+ return "null";
+ }
+ return o.toString().replace("\n", "\n ");
+ }
+}
diff --git a/src/main/java/com/xero/models/bankfeedsv2/NewAccountFeedConnection.java b/src/main/java/com/xero/models/bankfeedsv2/NewAccountFeedConnection.java
new file mode 100644
index 00000000..cc5f09bb
--- /dev/null
+++ b/src/main/java/com/xero/models/bankfeedsv2/NewAccountFeedConnection.java
@@ -0,0 +1,330 @@
+/*
+ * Xero Bank Feeds API v2
+ * The Bank Feeds API is available to financial institutions with a Xero partnership and approved app partners. For non-bank apps, it automates statement imports into Xero bank and credit card accounts; it does not create a direct bank feed. Feed Connections 2.0 is intended to replace 1.0. The customer chooses whether to connect an existing Xero account or create a new one. Use ExistingAccount with the chosen accountId, or NewAccount to create an account; Xero does not guess which account to connect or silently change an account name. The GET and delete operations also use 2.0. Statements continue to use 1.0. Partial failures are rare, and nearly all are recoverable by your app with no need to contact Xero support. If an item in a write response has `status` `PARTIAL_FAILURE`, handle only that item and read its `error.type`. For `partial-failure-new-account-creation`, do not resend the NewAccount item: connect `error.accountId` with `POST /FeedConnections/ExistingAccount`. For `partial-failure-new-account-existence-not-confirmed`, the account named in `error.accountName` may or may not exist. Use the Accounting API to check whether an account with that name exists. If it does, connect it with `POST /FeedConnections/ExistingAccount`. If it does not, resend the NewAccount item. If your app has a user, you can show them this message instead: \"Something went wrong. Please check whether your chosen account name now exists. If it does, connect it. If not, try creating the new one again.\" For any other `partial-failure-*` type, resend the same item. If the recovery request for `partial-failure-new-account-creation`, `partial-failure-previous-connection-deletion` or `partial-failure-connection-creation` returns 409 `feed-already-connected-in-current-organisation`, the earlier attempt succeeded: treat the item as created and use `GET /FeedConnections` to find its `id`. `error.subtype` is optional diagnostics; do not branch on it, and never parse `title` or `detail`. Full detail: https://developer.xero.com/documentation/api/bankfeeds/feedconnections-2-0-errors/#partial-failures
+ *
+ * Contact: api@xero.com
+ *
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
+ * https://openapi-generator.tech
+ * Do not edit the class manually.
+ */
+
+package com.xero.models.bankfeedsv2;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+import com.xero.api.StringUtil;
+import io.swagger.annotations.ApiModelProperty;
+import java.util.Objects;
+
+/** NewAccountFeedConnection */
+public class NewAccountFeedConnection {
+ StringUtil util = new StringUtil();
+
+ @JsonProperty("accountToken")
+ private String accountToken;
+
+ @JsonProperty("accountType")
+ private AccountType accountType;
+
+ @JsonProperty("accountNumber")
+ private String accountNumber;
+
+ @JsonProperty("accountName")
+ private String accountName;
+
+ @JsonProperty("currency")
+ private String currency;
+
+ @JsonProperty("country")
+ private String country;
+
+ /**
+ * The financial institute's identifier for the account. Must be unique within your financial
+ * institute.
+ *
+ * @param accountToken String
+ * @return NewAccountFeedConnection
+ */
+ public NewAccountFeedConnection accountToken(String accountToken) {
+ this.accountToken = accountToken;
+ return this;
+ }
+
+ /**
+ * The financial institute's identifier for the account. Must be unique within your financial
+ * institute.
+ *
+ * @return accountToken
+ */
+ @ApiModelProperty(
+ required = true,
+ value =
+ "The financial institute's identifier for the account. Must be unique within your"
+ + " financial institute. ")
+ /**
+ * The financial institute's identifier for the account. Must be unique within your financial
+ * institute.
+ *
+ * @return accountToken String
+ */
+ public String getAccountToken() {
+ return accountToken;
+ }
+
+ /**
+ * The financial institute's identifier for the account. Must be unique within your financial
+ * institute.
+ *
+ * @param accountToken String
+ */
+ public void setAccountToken(String accountToken) {
+ this.accountToken = accountToken;
+ }
+
+ /**
+ * accountType
+ *
+ * @param accountType AccountType
+ * @return NewAccountFeedConnection
+ */
+ public NewAccountFeedConnection accountType(AccountType accountType) {
+ this.accountType = accountType;
+ return this;
+ }
+
+ /**
+ * Get accountType
+ *
+ * @return accountType
+ */
+ @ApiModelProperty(required = true, value = "")
+ /**
+ * accountType
+ *
+ * @return accountType AccountType
+ */
+ public AccountType getAccountType() {
+ return accountType;
+ }
+
+ /**
+ * accountType
+ *
+ * @param accountType AccountType
+ */
+ public void setAccountType(AccountType accountType) {
+ this.accountType = accountType;
+ }
+
+ /**
+ * The account number for the Xero Bank Account being created. Up to 40 characters when
+ * `accountType` is `BANK`. When `accountType` is
+ * `CREDITCARD`, supply only the last four digits, and digits only.
+ *
+ * @param accountNumber String
+ * @return NewAccountFeedConnection
+ */
+ public NewAccountFeedConnection accountNumber(String accountNumber) {
+ this.accountNumber = accountNumber;
+ return this;
+ }
+
+ /**
+ * The account number for the Xero Bank Account being created. Up to 40 characters when
+ * `accountType` is `BANK`. When `accountType` is
+ * `CREDITCARD`, supply only the last four digits, and digits only.
+ *
+ * @return accountNumber
+ */
+ @ApiModelProperty(
+ required = true,
+ value =
+ "The account number for the Xero Bank Account being created. Up to 40 characters when"
+ + " `accountType` is `BANK`. When `accountType` is `CREDITCARD`, supply only the last"
+ + " four digits, and digits only. ")
+ /**
+ * The account number for the Xero Bank Account being created. Up to 40 characters when
+ * `accountType` is `BANK`. When `accountType` is
+ * `CREDITCARD`, supply only the last four digits, and digits only.
+ *
+ * @return accountNumber String
+ */
+ public String getAccountNumber() {
+ return accountNumber;
+ }
+
+ /**
+ * The account number for the Xero Bank Account being created. Up to 40 characters when
+ * `accountType` is `BANK`. When `accountType` is
+ * `CREDITCARD`, supply only the last four digits, and digits only.
+ *
+ * @param accountNumber String
+ */
+ public void setAccountNumber(String accountNumber) {
+ this.accountNumber = accountNumber;
+ }
+
+ /**
+ * The name for the Xero Bank Account being created. Rejected if the Organisation already has an
+ * account with this name.
+ *
+ * @param accountName String
+ * @return NewAccountFeedConnection
+ */
+ public NewAccountFeedConnection accountName(String accountName) {
+ this.accountName = accountName;
+ return this;
+ }
+
+ /**
+ * The name for the Xero Bank Account being created. Rejected if the Organisation already has an
+ * account with this name.
+ *
+ * @return accountName
+ */
+ @ApiModelProperty(
+ required = true,
+ value =
+ "The name for the Xero Bank Account being created. Rejected if the Organisation already"
+ + " has an account with this name. ")
+ /**
+ * The name for the Xero Bank Account being created. Rejected if the Organisation already has an
+ * account with this name.
+ *
+ * @return accountName String
+ */
+ public String getAccountName() {
+ return accountName;
+ }
+
+ /**
+ * The name for the Xero Bank Account being created. Rejected if the Organisation already has an
+ * account with this name.
+ *
+ * @param accountName String
+ */
+ public void setAccountName(String accountName) {
+ this.accountName = accountName;
+ }
+
+ /**
+ * ISO-4217 currency code. Must be a currency the Organisation has.
+ *
+ * @param currency String
+ * @return NewAccountFeedConnection
+ */
+ public NewAccountFeedConnection currency(String currency) {
+ this.currency = currency;
+ return this;
+ }
+
+ /**
+ * ISO-4217 currency code. Must be a currency the Organisation has.
+ *
+ * @return currency
+ */
+ @ApiModelProperty(
+ required = true,
+ value = "ISO-4217 currency code. Must be a currency the Organisation has.")
+ /**
+ * ISO-4217 currency code. Must be a currency the Organisation has.
+ *
+ * @return currency String
+ */
+ public String getCurrency() {
+ return currency;
+ }
+
+ /**
+ * ISO-4217 currency code. Must be a currency the Organisation has.
+ *
+ * @param currency String
+ */
+ public void setCurrency(String currency) {
+ this.currency = currency;
+ }
+
+ /**
+ * ISO-3166 alpha-2 country code. Required only when the Application supports multiple regions.
+ *
+ * @param country String
+ * @return NewAccountFeedConnection
+ */
+ public NewAccountFeedConnection country(String country) {
+ this.country = country;
+ return this;
+ }
+
+ /**
+ * ISO-3166 alpha-2 country code. Required only when the Application supports multiple regions.
+ *
+ * @return country
+ */
+ @ApiModelProperty(
+ value =
+ "ISO-3166 alpha-2 country code. Required only when the Application supports multiple"
+ + " regions. ")
+ /**
+ * ISO-3166 alpha-2 country code. Required only when the Application supports multiple regions.
+ *
+ * @return country String
+ */
+ public String getCountry() {
+ return country;
+ }
+
+ /**
+ * ISO-3166 alpha-2 country code. Required only when the Application supports multiple regions.
+ *
+ * @param country String
+ */
+ public void setCountry(String country) {
+ this.country = country;
+ }
+
+ @Override
+ public boolean equals(java.lang.Object o) {
+ if (this == o) {
+ return true;
+ }
+ if (o == null || getClass() != o.getClass()) {
+ return false;
+ }
+ NewAccountFeedConnection newAccountFeedConnection = (NewAccountFeedConnection) o;
+ return Objects.equals(this.accountToken, newAccountFeedConnection.accountToken)
+ && Objects.equals(this.accountType, newAccountFeedConnection.accountType)
+ && Objects.equals(this.accountNumber, newAccountFeedConnection.accountNumber)
+ && Objects.equals(this.accountName, newAccountFeedConnection.accountName)
+ && Objects.equals(this.currency, newAccountFeedConnection.currency)
+ && Objects.equals(this.country, newAccountFeedConnection.country);
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hash(accountToken, accountType, accountNumber, accountName, currency, country);
+ }
+
+ @Override
+ public String toString() {
+ StringBuilder sb = new StringBuilder();
+ sb.append("class NewAccountFeedConnection {\n");
+ sb.append(" accountToken: ").append(toIndentedString(accountToken)).append("\n");
+ sb.append(" accountType: ").append(toIndentedString(accountType)).append("\n");
+ sb.append(" accountNumber: ").append(toIndentedString(accountNumber)).append("\n");
+ sb.append(" accountName: ").append(toIndentedString(accountName)).append("\n");
+ sb.append(" currency: ").append(toIndentedString(currency)).append("\n");
+ sb.append(" country: ").append(toIndentedString(country)).append("\n");
+ sb.append("}");
+ return sb.toString();
+ }
+
+ /**
+ * Convert the given object to string with each line indented by 4 spaces (except the first line).
+ */
+ private String toIndentedString(java.lang.Object o) {
+ if (o == null) {
+ return "null";
+ }
+ return o.toString().replace("\n", "\n ");
+ }
+}
diff --git a/src/main/java/com/xero/models/bankfeedsv2/NewAccountFeedConnectionsRequest.java b/src/main/java/com/xero/models/bankfeedsv2/NewAccountFeedConnectionsRequest.java
new file mode 100644
index 00000000..a1900bc9
--- /dev/null
+++ b/src/main/java/com/xero/models/bankfeedsv2/NewAccountFeedConnectionsRequest.java
@@ -0,0 +1,112 @@
+/*
+ * Xero Bank Feeds API v2
+ * The Bank Feeds API is available to financial institutions with a Xero partnership and approved app partners. For non-bank apps, it automates statement imports into Xero bank and credit card accounts; it does not create a direct bank feed. Feed Connections 2.0 is intended to replace 1.0. The customer chooses whether to connect an existing Xero account or create a new one. Use ExistingAccount with the chosen accountId, or NewAccount to create an account; Xero does not guess which account to connect or silently change an account name. The GET and delete operations also use 2.0. Statements continue to use 1.0. Partial failures are rare, and nearly all are recoverable by your app with no need to contact Xero support. If an item in a write response has `status` `PARTIAL_FAILURE`, handle only that item and read its `error.type`. For `partial-failure-new-account-creation`, do not resend the NewAccount item: connect `error.accountId` with `POST /FeedConnections/ExistingAccount`. For `partial-failure-new-account-existence-not-confirmed`, the account named in `error.accountName` may or may not exist. Use the Accounting API to check whether an account with that name exists. If it does, connect it with `POST /FeedConnections/ExistingAccount`. If it does not, resend the NewAccount item. If your app has a user, you can show them this message instead: \"Something went wrong. Please check whether your chosen account name now exists. If it does, connect it. If not, try creating the new one again.\" For any other `partial-failure-*` type, resend the same item. If the recovery request for `partial-failure-new-account-creation`, `partial-failure-previous-connection-deletion` or `partial-failure-connection-creation` returns 409 `feed-already-connected-in-current-organisation`, the earlier attempt succeeded: treat the item as created and use `GET /FeedConnections` to find its `id`. `error.subtype` is optional diagnostics; do not branch on it, and never parse `title` or `detail`. Full detail: https://developer.xero.com/documentation/api/bankfeeds/feedconnections-2-0-errors/#partial-failures
+ *
+ * Contact: api@xero.com
+ *
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
+ * https://openapi-generator.tech
+ * Do not edit the class manually.
+ */
+
+package com.xero.models.bankfeedsv2;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+import com.xero.api.StringUtil;
+import io.swagger.annotations.ApiModelProperty;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Objects;
+
+/** NewAccountFeedConnectionsRequest */
+public class NewAccountFeedConnectionsRequest {
+ StringUtil util = new StringUtil();
+
+ @JsonProperty("items")
+ private List items = new ArrayList();
+
+ /**
+ * Between 1 and 50 Feed Connections to create. No element may be null.
+ *
+ * @param items List<NewAccountFeedConnection>
+ * @return NewAccountFeedConnectionsRequest
+ */
+ public NewAccountFeedConnectionsRequest items(List items) {
+ this.items = items;
+ return this;
+ }
+
+ /**
+ * Between 1 and 50 Feed Connections to create. No element may be null.
+ *
+ * @param itemsItem NewAccountFeedConnection
+ * @return NewAccountFeedConnectionsRequest
+ */
+ public NewAccountFeedConnectionsRequest addItemsItem(NewAccountFeedConnection itemsItem) {
+ this.items.add(itemsItem);
+ return this;
+ }
+
+ /**
+ * Between 1 and 50 Feed Connections to create. No element may be null.
+ *
+ * @return items
+ */
+ @ApiModelProperty(
+ required = true,
+ value = "Between 1 and 50 Feed Connections to create. No element may be null.")
+ /**
+ * Between 1 and 50 Feed Connections to create. No element may be null.
+ *
+ * @return items List
+ */
+ public List getItems() {
+ return items;
+ }
+
+ /**
+ * Between 1 and 50 Feed Connections to create. No element may be null.
+ *
+ * @param items List<NewAccountFeedConnection>
+ */
+ public void setItems(List items) {
+ this.items = items;
+ }
+
+ @Override
+ public boolean equals(java.lang.Object o) {
+ if (this == o) {
+ return true;
+ }
+ if (o == null || getClass() != o.getClass()) {
+ return false;
+ }
+ NewAccountFeedConnectionsRequest newAccountFeedConnectionsRequest =
+ (NewAccountFeedConnectionsRequest) o;
+ return Objects.equals(this.items, newAccountFeedConnectionsRequest.items);
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hash(items);
+ }
+
+ @Override
+ public String toString() {
+ StringBuilder sb = new StringBuilder();
+ sb.append("class NewAccountFeedConnectionsRequest {\n");
+ sb.append(" items: ").append(toIndentedString(items)).append("\n");
+ sb.append("}");
+ return sb.toString();
+ }
+
+ /**
+ * Convert the given object to string with each line indented by 4 spaces (except the first line).
+ */
+ private String toIndentedString(java.lang.Object o) {
+ if (o == null) {
+ return "null";
+ }
+ return o.toString().replace("\n", "\n ");
+ }
+}
diff --git a/src/main/java/com/xero/models/bankfeedsv2/PagedFeedConnections.java b/src/main/java/com/xero/models/bankfeedsv2/PagedFeedConnections.java
new file mode 100644
index 00000000..55f0ea6a
--- /dev/null
+++ b/src/main/java/com/xero/models/bankfeedsv2/PagedFeedConnections.java
@@ -0,0 +1,152 @@
+/*
+ * Xero Bank Feeds API v2
+ * The Bank Feeds API is available to financial institutions with a Xero partnership and approved app partners. For non-bank apps, it automates statement imports into Xero bank and credit card accounts; it does not create a direct bank feed. Feed Connections 2.0 is intended to replace 1.0. The customer chooses whether to connect an existing Xero account or create a new one. Use ExistingAccount with the chosen accountId, or NewAccount to create an account; Xero does not guess which account to connect or silently change an account name. The GET and delete operations also use 2.0. Statements continue to use 1.0. Partial failures are rare, and nearly all are recoverable by your app with no need to contact Xero support. If an item in a write response has `status` `PARTIAL_FAILURE`, handle only that item and read its `error.type`. For `partial-failure-new-account-creation`, do not resend the NewAccount item: connect `error.accountId` with `POST /FeedConnections/ExistingAccount`. For `partial-failure-new-account-existence-not-confirmed`, the account named in `error.accountName` may or may not exist. Use the Accounting API to check whether an account with that name exists. If it does, connect it with `POST /FeedConnections/ExistingAccount`. If it does not, resend the NewAccount item. If your app has a user, you can show them this message instead: \"Something went wrong. Please check whether your chosen account name now exists. If it does, connect it. If not, try creating the new one again.\" For any other `partial-failure-*` type, resend the same item. If the recovery request for `partial-failure-new-account-creation`, `partial-failure-previous-connection-deletion` or `partial-failure-connection-creation` returns 409 `feed-already-connected-in-current-organisation`, the earlier attempt succeeded: treat the item as created and use `GET /FeedConnections` to find its `id`. `error.subtype` is optional diagnostics; do not branch on it, and never parse `title` or `detail`. Full detail: https://developer.xero.com/documentation/api/bankfeeds/feedconnections-2-0-errors/#partial-failures
+ *
+ * Contact: api@xero.com
+ *
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
+ * https://openapi-generator.tech
+ * Do not edit the class manually.
+ */
+
+package com.xero.models.bankfeedsv2;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+import com.xero.api.StringUtil;
+import io.swagger.annotations.ApiModelProperty;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Objects;
+
+/** PagedFeedConnections */
+public class PagedFeedConnections {
+ StringUtil util = new StringUtil();
+
+ @JsonProperty("pagination")
+ private Pagination pagination;
+
+ @JsonProperty("items")
+ private List items = new ArrayList();
+
+ /**
+ * pagination
+ *
+ * @param pagination Pagination
+ * @return PagedFeedConnections
+ */
+ public PagedFeedConnections pagination(Pagination pagination) {
+ this.pagination = pagination;
+ return this;
+ }
+
+ /**
+ * Get pagination
+ *
+ * @return pagination
+ */
+ @ApiModelProperty(value = "")
+ /**
+ * pagination
+ *
+ * @return pagination Pagination
+ */
+ public Pagination getPagination() {
+ return pagination;
+ }
+
+ /**
+ * pagination
+ *
+ * @param pagination Pagination
+ */
+ public void setPagination(Pagination pagination) {
+ this.pagination = pagination;
+ }
+
+ /**
+ * items
+ *
+ * @param items List<FeedConnection>
+ * @return PagedFeedConnections
+ */
+ public PagedFeedConnections items(List items) {
+ this.items = items;
+ return this;
+ }
+
+ /**
+ * items
+ *
+ * @param itemsItem FeedConnection
+ * @return PagedFeedConnections
+ */
+ public PagedFeedConnections addItemsItem(FeedConnection itemsItem) {
+ if (this.items == null) {
+ this.items = new ArrayList();
+ }
+ this.items.add(itemsItem);
+ return this;
+ }
+
+ /**
+ * Get items
+ *
+ * @return items
+ */
+ @ApiModelProperty(value = "")
+ /**
+ * items
+ *
+ * @return items List
+ */
+ public List getItems() {
+ return items;
+ }
+
+ /**
+ * items
+ *
+ * @param items List<FeedConnection>
+ */
+ public void setItems(List items) {
+ this.items = items;
+ }
+
+ @Override
+ public boolean equals(java.lang.Object o) {
+ if (this == o) {
+ return true;
+ }
+ if (o == null || getClass() != o.getClass()) {
+ return false;
+ }
+ PagedFeedConnections pagedFeedConnections = (PagedFeedConnections) o;
+ return Objects.equals(this.pagination, pagedFeedConnections.pagination)
+ && Objects.equals(this.items, pagedFeedConnections.items);
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hash(pagination, items);
+ }
+
+ @Override
+ public String toString() {
+ StringBuilder sb = new StringBuilder();
+ sb.append("class PagedFeedConnections {\n");
+ sb.append(" pagination: ").append(toIndentedString(pagination)).append("\n");
+ sb.append(" items: ").append(toIndentedString(items)).append("\n");
+ sb.append("}");
+ return sb.toString();
+ }
+
+ /**
+ * Convert the given object to string with each line indented by 4 spaces (except the first line).
+ */
+ private String toIndentedString(java.lang.Object o) {
+ if (o == null) {
+ return "null";
+ }
+ return o.toString().replace("\n", "\n ");
+ }
+}
diff --git a/src/main/java/com/xero/models/bankfeedsv2/Pagination.java b/src/main/java/com/xero/models/bankfeedsv2/Pagination.java
new file mode 100644
index 00000000..f4775c1a
--- /dev/null
+++ b/src/main/java/com/xero/models/bankfeedsv2/Pagination.java
@@ -0,0 +1,223 @@
+/*
+ * Xero Bank Feeds API v2
+ * The Bank Feeds API is available to financial institutions with a Xero partnership and approved app partners. For non-bank apps, it automates statement imports into Xero bank and credit card accounts; it does not create a direct bank feed. Feed Connections 2.0 is intended to replace 1.0. The customer chooses whether to connect an existing Xero account or create a new one. Use ExistingAccount with the chosen accountId, or NewAccount to create an account; Xero does not guess which account to connect or silently change an account name. The GET and delete operations also use 2.0. Statements continue to use 1.0. Partial failures are rare, and nearly all are recoverable by your app with no need to contact Xero support. If an item in a write response has `status` `PARTIAL_FAILURE`, handle only that item and read its `error.type`. For `partial-failure-new-account-creation`, do not resend the NewAccount item: connect `error.accountId` with `POST /FeedConnections/ExistingAccount`. For `partial-failure-new-account-existence-not-confirmed`, the account named in `error.accountName` may or may not exist. Use the Accounting API to check whether an account with that name exists. If it does, connect it with `POST /FeedConnections/ExistingAccount`. If it does not, resend the NewAccount item. If your app has a user, you can show them this message instead: \"Something went wrong. Please check whether your chosen account name now exists. If it does, connect it. If not, try creating the new one again.\" For any other `partial-failure-*` type, resend the same item. If the recovery request for `partial-failure-new-account-creation`, `partial-failure-previous-connection-deletion` or `partial-failure-connection-creation` returns 409 `feed-already-connected-in-current-organisation`, the earlier attempt succeeded: treat the item as created and use `GET /FeedConnections` to find its `id`. `error.subtype` is optional diagnostics; do not branch on it, and never parse `title` or `detail`. Full detail: https://developer.xero.com/documentation/api/bankfeeds/feedconnections-2-0-errors/#partial-failures
+ *
+ * Contact: api@xero.com
+ *
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
+ * https://openapi-generator.tech
+ * Do not edit the class manually.
+ */
+
+package com.xero.models.bankfeedsv2;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+import com.xero.api.StringUtil;
+import io.swagger.annotations.ApiModelProperty;
+import java.util.Objects;
+
+/** Pagination */
+public class Pagination {
+ StringUtil util = new StringUtil();
+
+ @JsonProperty("page")
+ private Integer page;
+
+ @JsonProperty("pageCount")
+ private Integer pageCount;
+
+ @JsonProperty("pageSize")
+ private Integer pageSize;
+
+ @JsonProperty("itemCount")
+ private Integer itemCount;
+
+ /**
+ * The page returned, echoing the request.
+ *
+ * @param page Integer
+ * @return Pagination
+ */
+ public Pagination page(Integer page) {
+ this.page = page;
+ return this;
+ }
+
+ /**
+ * The page returned, echoing the request.
+ *
+ * @return page
+ */
+ @ApiModelProperty(value = "The page returned, echoing the request.")
+ /**
+ * The page returned, echoing the request.
+ *
+ * @return page Integer
+ */
+ public Integer getPage() {
+ return page;
+ }
+
+ /**
+ * The page returned, echoing the request.
+ *
+ * @param page Integer
+ */
+ public void setPage(Integer page) {
+ this.page = page;
+ }
+
+ /**
+ * How many pages the collection spans in total.
+ *
+ * @param pageCount Integer
+ * @return Pagination
+ */
+ public Pagination pageCount(Integer pageCount) {
+ this.pageCount = pageCount;
+ return this;
+ }
+
+ /**
+ * How many pages the collection spans in total.
+ *
+ * @return pageCount
+ */
+ @ApiModelProperty(value = "How many pages the collection spans in total.")
+ /**
+ * How many pages the collection spans in total.
+ *
+ * @return pageCount Integer
+ */
+ public Integer getPageCount() {
+ return pageCount;
+ }
+
+ /**
+ * How many pages the collection spans in total.
+ *
+ * @param pageCount Integer
+ */
+ public void setPageCount(Integer pageCount) {
+ this.pageCount = pageCount;
+ }
+
+ /**
+ * The page size used, echoing the request.
+ *
+ * @param pageSize Integer
+ * @return Pagination
+ */
+ public Pagination pageSize(Integer pageSize) {
+ this.pageSize = pageSize;
+ return this;
+ }
+
+ /**
+ * The page size used, echoing the request.
+ *
+ * @return pageSize
+ */
+ @ApiModelProperty(value = "The page size used, echoing the request.")
+ /**
+ * The page size used, echoing the request.
+ *
+ * @return pageSize Integer
+ */
+ public Integer getPageSize() {
+ return pageSize;
+ }
+
+ /**
+ * The page size used, echoing the request.
+ *
+ * @param pageSize Integer
+ */
+ public void setPageSize(Integer pageSize) {
+ this.pageSize = pageSize;
+ }
+
+ /**
+ * How many Feed Connections are on this page. This is not the size of the whole collection, which
+ * is not returned.
+ *
+ * @param itemCount Integer
+ * @return Pagination
+ */
+ public Pagination itemCount(Integer itemCount) {
+ this.itemCount = itemCount;
+ return this;
+ }
+
+ /**
+ * How many Feed Connections are on this page. This is not the size of the whole collection, which
+ * is not returned.
+ *
+ * @return itemCount
+ */
+ @ApiModelProperty(
+ value =
+ "How many Feed Connections are on this page. This is not the size of the whole"
+ + " collection, which is not returned. ")
+ /**
+ * How many Feed Connections are on this page. This is not the size of the whole collection, which
+ * is not returned.
+ *
+ * @return itemCount Integer
+ */
+ public Integer getItemCount() {
+ return itemCount;
+ }
+
+ /**
+ * How many Feed Connections are on this page. This is not the size of the whole collection, which
+ * is not returned.
+ *
+ * @param itemCount Integer
+ */
+ public void setItemCount(Integer itemCount) {
+ this.itemCount = itemCount;
+ }
+
+ @Override
+ public boolean equals(java.lang.Object o) {
+ if (this == o) {
+ return true;
+ }
+ if (o == null || getClass() != o.getClass()) {
+ return false;
+ }
+ Pagination pagination = (Pagination) o;
+ return Objects.equals(this.page, pagination.page)
+ && Objects.equals(this.pageCount, pagination.pageCount)
+ && Objects.equals(this.pageSize, pagination.pageSize)
+ && Objects.equals(this.itemCount, pagination.itemCount);
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hash(page, pageCount, pageSize, itemCount);
+ }
+
+ @Override
+ public String toString() {
+ StringBuilder sb = new StringBuilder();
+ sb.append("class Pagination {\n");
+ sb.append(" page: ").append(toIndentedString(page)).append("\n");
+ sb.append(" pageCount: ").append(toIndentedString(pageCount)).append("\n");
+ sb.append(" pageSize: ").append(toIndentedString(pageSize)).append("\n");
+ sb.append(" itemCount: ").append(toIndentedString(itemCount)).append("\n");
+ sb.append("}");
+ return sb.toString();
+ }
+
+ /**
+ * Convert the given object to string with each line indented by 4 spaces (except the first line).
+ */
+ private String toIndentedString(java.lang.Object o) {
+ if (o == null) {
+ return "null";
+ }
+ return o.toString().replace("\n", "\n ");
+ }
+}
diff --git a/src/main/java/com/xero/models/bankfeedsv2/Problem.java b/src/main/java/com/xero/models/bankfeedsv2/Problem.java
new file mode 100644
index 00000000..9f0860b2
--- /dev/null
+++ b/src/main/java/com/xero/models/bankfeedsv2/Problem.java
@@ -0,0 +1,701 @@
+/*
+ * Xero Bank Feeds API v2
+ * The Bank Feeds API is available to financial institutions with a Xero partnership and approved app partners. For non-bank apps, it automates statement imports into Xero bank and credit card accounts; it does not create a direct bank feed. Feed Connections 2.0 is intended to replace 1.0. The customer chooses whether to connect an existing Xero account or create a new one. Use ExistingAccount with the chosen accountId, or NewAccount to create an account; Xero does not guess which account to connect or silently change an account name. The GET and delete operations also use 2.0. Statements continue to use 1.0. Partial failures are rare, and nearly all are recoverable by your app with no need to contact Xero support. If an item in a write response has `status` `PARTIAL_FAILURE`, handle only that item and read its `error.type`. For `partial-failure-new-account-creation`, do not resend the NewAccount item: connect `error.accountId` with `POST /FeedConnections/ExistingAccount`. For `partial-failure-new-account-existence-not-confirmed`, the account named in `error.accountName` may or may not exist. Use the Accounting API to check whether an account with that name exists. If it does, connect it with `POST /FeedConnections/ExistingAccount`. If it does not, resend the NewAccount item. If your app has a user, you can show them this message instead: \"Something went wrong. Please check whether your chosen account name now exists. If it does, connect it. If not, try creating the new one again.\" For any other `partial-failure-*` type, resend the same item. If the recovery request for `partial-failure-new-account-creation`, `partial-failure-previous-connection-deletion` or `partial-failure-connection-creation` returns 409 `feed-already-connected-in-current-organisation`, the earlier attempt succeeded: treat the item as created and use `GET /FeedConnections` to find its `id`. `error.subtype` is optional diagnostics; do not branch on it, and never parse `title` or `detail`. Full detail: https://developer.xero.com/documentation/api/bankfeeds/feedconnections-2-0-errors/#partial-failures
+ *
+ * Contact: api@xero.com
+ *
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
+ * https://openapi-generator.tech
+ * Do not edit the class manually.
+ */
+
+package com.xero.models.bankfeedsv2;
+
+import com.fasterxml.jackson.annotation.JsonCreator;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import com.fasterxml.jackson.annotation.JsonValue;
+import com.xero.api.StringUtil;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import java.util.Objects;
+import java.util.UUID;
+
+/**
+ * An error. Served as `application/problem+json` when it describes the request as a
+ * whole. The `error` of an item result is an `ItemError`, which has the same
+ * fields except `status`.
+ */
+@ApiModel(
+ description =
+ "An error. Served as `application/problem+json` when it describes the request as a whole."
+ + " The `error` of an item result is an `ItemError`, which has the same fields except"
+ + " `status`. ")
+public class Problem {
+ StringUtil util = new StringUtil();
+
+ /** Identifies the error. */
+ public enum TypeEnum {
+ /** INVALID_REQUEST */
+ INVALID_REQUEST("invalid-request"),
+
+ /** INVALID_APPLICATION */
+ INVALID_APPLICATION("invalid-application"),
+
+ /** SUSPENDED_OR_TERMINATED_APPLICATION */
+ SUSPENDED_OR_TERMINATED_APPLICATION("suspended-or-terminated-application"),
+
+ /** INVALID_ORGANISATION_BANK_FEEDS */
+ INVALID_ORGANISATION_BANK_FEEDS("invalid-organisation-bank-feeds"),
+
+ /** INVALID_ORGANISATION_MULTI_CURRENCY */
+ INVALID_ORGANISATION_MULTI_CURRENCY("invalid-organisation-multi-currency"),
+
+ /** INVALID_FEED_CONNECTION_FOR_ORGANISATION */
+ INVALID_FEED_CONNECTION_FOR_ORGANISATION("invalid-feed-connection-for-organisation"),
+
+ /** INVALID_USER_ROLE */
+ INVALID_USER_ROLE("invalid-user-role"),
+
+ /** INVALID_ACCOUNT_TOKEN */
+ INVALID_ACCOUNT_TOKEN("invalid-account-token"),
+
+ /** MISSING_IDENTIFYING_FIELDS */
+ MISSING_IDENTIFYING_FIELDS("missing-identifying-fields"),
+
+ /** INVALID_COUNTRY_SPECIFIED */
+ INVALID_COUNTRY_SPECIFIED("invalid-country-specified"),
+
+ /** ACCOUNT_NOT_VALID */
+ ACCOUNT_NOT_VALID("account-not-valid"),
+
+ /** FEED_ALREADY_CONNECTED_IN_CURRENT_ORGANISATION */
+ FEED_ALREADY_CONNECTED_IN_CURRENT_ORGANISATION(
+ "feed-already-connected-in-current-organisation"),
+
+ /** ACCOUNT_NAME_ALREADY_EXISTS */
+ ACCOUNT_NAME_ALREADY_EXISTS("account-name-already-exists"),
+
+ /** BANK_FEED_NOT_FOUND */
+ BANK_FEED_NOT_FOUND("bank-feed-not-found"),
+
+ /** FEED_NOT_FOUND_OR_ALREADY_DELETED */
+ FEED_NOT_FOUND_OR_ALREADY_DELETED("feed-not-found-or-already-deleted"),
+
+ /** PARTIAL_FAILURE_NEW_ACCOUNT_CREATION */
+ PARTIAL_FAILURE_NEW_ACCOUNT_CREATION("partial-failure-new-account-creation"),
+
+ /** PARTIAL_FAILURE_PREVIOUS_CONNECTION_DELETION */
+ PARTIAL_FAILURE_PREVIOUS_CONNECTION_DELETION("partial-failure-previous-connection-deletion"),
+
+ /** PARTIAL_FAILURE_CONNECTION_CREATION */
+ PARTIAL_FAILURE_CONNECTION_CREATION("partial-failure-connection-creation"),
+
+ /** PARTIAL_FAILURE_CONNECTION_DELETION */
+ PARTIAL_FAILURE_CONNECTION_DELETION("partial-failure-connection-deletion"),
+
+ /** PARTIAL_FAILURE_NEW_ACCOUNT_EXISTENCE_NOT_CONFIRMED */
+ PARTIAL_FAILURE_NEW_ACCOUNT_EXISTENCE_NOT_CONFIRMED(
+ "partial-failure-new-account-existence-not-confirmed"),
+
+ /** TOO_MANY_REQUESTS */
+ TOO_MANY_REQUESTS("too-many-requests"),
+
+ /** INTERNAL_ERROR */
+ INTERNAL_ERROR("internal-error");
+
+ private String value;
+
+ TypeEnum(String value) {
+ this.value = value;
+ }
+
+ /**
+ * getValue
+ *
+ * @return String value
+ */
+ @JsonValue
+ public String getValue() {
+ return value;
+ }
+
+ /**
+ * toString
+ *
+ * @return String value
+ */
+ @Override
+ public String toString() {
+ return String.valueOf(value);
+ }
+
+ /**
+ * fromValue
+ *
+ * @param value String
+ */
+ @JsonCreator
+ public static TypeEnum fromValue(String value) {
+ for (TypeEnum b : TypeEnum.values()) {
+ if (b.value.equals(value)) {
+ return b;
+ }
+ }
+ throw new IllegalArgumentException("Unexpected value '" + value + "'");
+ }
+ }
+
+ @JsonProperty("type")
+ private TypeEnum type;
+
+ /**
+ * Present only on a partial failure (a `partial-failure-*` `type`). Names the
+ * exact cause within the `type`. Reading it is optional: the `type` alone
+ * fixes the recovery action and which identifier fields are present, so branch on
+ * `type` and use `subtype` for diagnostics.
+ */
+ public enum SubtypeEnum {
+ /** CONNECTION_PHASE_FAILED */
+ CONNECTION_PHASE_FAILED("connection-phase-failed"),
+
+ /** DELETION_PHASE_FAILED */
+ DELETION_PHASE_FAILED("deletion-phase-failed"),
+
+ /** DELETION_PHASE_NOT_CONFIRMED */
+ DELETION_PHASE_NOT_CONFIRMED("deletion-phase-not-confirmed"),
+
+ /** CONNECTION_EXISTENCE_NOT_CONFIRMED */
+ CONNECTION_EXISTENCE_NOT_CONFIRMED("connection-existence-not-confirmed"),
+
+ /** CONNECTION_EXISTS_WITHOUT_FEED_CONNECTION */
+ CONNECTION_EXISTS_WITHOUT_FEED_CONNECTION("connection-exists-without-feed-connection"),
+
+ /** FEED_CONNECTION_EXISTENCE_NOT_CONFIRMED_CAN_CHECK_OR_RETRY */
+ FEED_CONNECTION_EXISTENCE_NOT_CONFIRMED_CAN_CHECK_OR_RETRY(
+ "feed-connection-existence-not-confirmed-can-check-or-retry"),
+
+ /** CHECK_ACCOUNTS_OR_PROMPT_USER_RETRY */
+ CHECK_ACCOUNTS_OR_PROMPT_USER_RETRY("check-accounts-or-prompt-user-retry");
+
+ private String value;
+
+ SubtypeEnum(String value) {
+ this.value = value;
+ }
+
+ /**
+ * getValue
+ *
+ * @return String value
+ */
+ @JsonValue
+ public String getValue() {
+ return value;
+ }
+
+ /**
+ * toString
+ *
+ * @return String value
+ */
+ @Override
+ public String toString() {
+ return String.valueOf(value);
+ }
+
+ /**
+ * fromValue
+ *
+ * @param value String
+ */
+ @JsonCreator
+ public static SubtypeEnum fromValue(String value) {
+ for (SubtypeEnum b : SubtypeEnum.values()) {
+ if (b.value.equals(value)) {
+ return b;
+ }
+ }
+ throw new IllegalArgumentException("Unexpected value '" + value + "'");
+ }
+ }
+
+ @JsonProperty("subtype")
+ private SubtypeEnum subtype;
+
+ @JsonProperty("title")
+ private String title;
+
+ @JsonProperty("status")
+ private Integer status;
+
+ @JsonProperty("detail")
+ private String detail;
+
+ @JsonProperty("accountId")
+ private UUID accountId;
+
+ @JsonProperty("accountName")
+ private String accountName;
+
+ @JsonProperty("connectionId")
+ private UUID connectionId;
+
+ /**
+ * Identifies the error.
+ *
+ * @param type TypeEnum
+ * @return Problem
+ */
+ public Problem type(TypeEnum type) {
+ this.type = type;
+ return this;
+ }
+
+ /**
+ * Identifies the error.
+ *
+ * @return type
+ */
+ @ApiModelProperty(value = "Identifies the error.")
+ /**
+ * Identifies the error.
+ *
+ * @return type TypeEnum
+ */
+ public TypeEnum getType() {
+ return type;
+ }
+
+ /**
+ * Identifies the error.
+ *
+ * @param type TypeEnum
+ */
+ public void setType(TypeEnum type) {
+ this.type = type;
+ }
+
+ /**
+ * Present only on a partial failure (a `partial-failure-*` `type`). Names the
+ * exact cause within the `type`. Reading it is optional: the `type` alone
+ * fixes the recovery action and which identifier fields are present, so branch on
+ * `type` and use `subtype` for diagnostics.
+ *
+ * @param subtype SubtypeEnum
+ * @return Problem
+ */
+ public Problem subtype(SubtypeEnum subtype) {
+ this.subtype = subtype;
+ return this;
+ }
+
+ /**
+ * Present only on a partial failure (a `partial-failure-*` `type`). Names the
+ * exact cause within the `type`. Reading it is optional: the `type` alone
+ * fixes the recovery action and which identifier fields are present, so branch on
+ * `type` and use `subtype` for diagnostics.
+ *
+ * @return subtype
+ */
+ @ApiModelProperty(
+ value =
+ "Present only on a partial failure (a `partial-failure-*` `type`). Names the exact cause"
+ + " within the `type`. Reading it is optional: the `type` alone fixes the recovery"
+ + " action and which identifier fields are present, so branch on `type` and use"
+ + " `subtype` for diagnostics. ")
+ /**
+ * Present only on a partial failure (a `partial-failure-*` `type`). Names the
+ * exact cause within the `type`. Reading it is optional: the `type` alone
+ * fixes the recovery action and which identifier fields are present, so branch on
+ * `type` and use `subtype` for diagnostics.
+ *
+ * @return subtype SubtypeEnum
+ */
+ public SubtypeEnum getSubtype() {
+ return subtype;
+ }
+
+ /**
+ * Present only on a partial failure (a `partial-failure-*` `type`). Names the
+ * exact cause within the `type`. Reading it is optional: the `type` alone
+ * fixes the recovery action and which identifier fields are present, so branch on
+ * `type` and use `subtype` for diagnostics.
+ *
+ * @param subtype SubtypeEnum
+ */
+ public void setSubtype(SubtypeEnum subtype) {
+ this.subtype = subtype;
+ }
+
+ /**
+ * A short human-readable summary of the error.
+ *
+ * @param title String
+ * @return Problem
+ */
+ public Problem title(String title) {
+ this.title = title;
+ return this;
+ }
+
+ /**
+ * A short human-readable summary of the error.
+ *
+ * @return title
+ */
+ @ApiModelProperty(value = "A short human-readable summary of the error.")
+ /**
+ * A short human-readable summary of the error.
+ *
+ * @return title String
+ */
+ public String getTitle() {
+ return title;
+ }
+
+ /**
+ * A short human-readable summary of the error.
+ *
+ * @param title String
+ */
+ public void setTitle(String title) {
+ this.title = title;
+ }
+
+ /**
+ * The HTTP status this error corresponds to. It is the status of the response. An item result
+ * does not repeat it in its `error`: read the item's `statusCode`
+ * instead.
+ *
+ * @param status Integer
+ * @return Problem
+ */
+ public Problem status(Integer status) {
+ this.status = status;
+ return this;
+ }
+
+ /**
+ * The HTTP status this error corresponds to. It is the status of the response. An item result
+ * does not repeat it in its `error`: read the item's `statusCode`
+ * instead.
+ *
+ * @return status
+ */
+ @ApiModelProperty(
+ value =
+ "The HTTP status this error corresponds to. It is the status of the response. An item"
+ + " result does not repeat it in its `error`: read the item's `statusCode` instead. ")
+ /**
+ * The HTTP status this error corresponds to. It is the status of the response. An item result
+ * does not repeat it in its `error`: read the item's `statusCode`
+ * instead.
+ *
+ * @return status Integer
+ */
+ public Integer getStatus() {
+ return status;
+ }
+
+ /**
+ * The HTTP status this error corresponds to. It is the status of the response. An item result
+ * does not repeat it in its `error`: read the item's `statusCode`
+ * instead.
+ *
+ * @param status Integer
+ */
+ public void setStatus(Integer status) {
+ this.status = status;
+ }
+
+ /**
+ * A human-readable explanation specific to this occurrence.
+ *
+ * @param detail String
+ * @return Problem
+ */
+ public Problem detail(String detail) {
+ this.detail = detail;
+ return this;
+ }
+
+ /**
+ * A human-readable explanation specific to this occurrence.
+ *
+ * @return detail
+ */
+ @ApiModelProperty(value = "A human-readable explanation specific to this occurrence.")
+ /**
+ * A human-readable explanation specific to this occurrence.
+ *
+ * @return detail String
+ */
+ public String getDetail() {
+ return detail;
+ }
+
+ /**
+ * A human-readable explanation specific to this occurrence.
+ *
+ * @param detail String
+ */
+ public void setDetail(String detail) {
+ this.detail = detail;
+ }
+
+ /**
+ * Present only on a partial failure. The Xero Bank Account the item concerns. On
+ * `partial-failure-new-account-creation`, the account that was created: connect it
+ * through `POST /FeedConnections/ExistingAccount`. On
+ * `partial-failure-previous-connection-deletion` and
+ * `partial-failure-connection-creation`, the account being connected. Absent on
+ * `partial-failure-connection-deletion` and
+ * `partial-failure-new-account-existence-not-confirmed`, where the account may not
+ * exist.
+ *
+ * @param accountId UUID
+ * @return Problem
+ */
+ public Problem accountId(UUID accountId) {
+ this.accountId = accountId;
+ return this;
+ }
+
+ /**
+ * Present only on a partial failure. The Xero Bank Account the item concerns. On
+ * `partial-failure-new-account-creation`, the account that was created: connect it
+ * through `POST /FeedConnections/ExistingAccount`. On
+ * `partial-failure-previous-connection-deletion` and
+ * `partial-failure-connection-creation`, the account being connected. Absent on
+ * `partial-failure-connection-deletion` and
+ * `partial-failure-new-account-existence-not-confirmed`, where the account may not
+ * exist.
+ *
+ * @return accountId
+ */
+ @ApiModelProperty(
+ value =
+ "Present only on a partial failure. The Xero Bank Account the item concerns. On"
+ + " `partial-failure-new-account-creation`, the account that was created: connect it"
+ + " through `POST /FeedConnections/ExistingAccount`. On"
+ + " `partial-failure-previous-connection-deletion` and"
+ + " `partial-failure-connection-creation`, the account being connected. Absent on"
+ + " `partial-failure-connection-deletion` and"
+ + " `partial-failure-new-account-existence-not-confirmed`, where the account may not"
+ + " exist. ")
+ /**
+ * Present only on a partial failure. The Xero Bank Account the item concerns. On
+ * `partial-failure-new-account-creation`, the account that was created: connect it
+ * through `POST /FeedConnections/ExistingAccount`. On
+ * `partial-failure-previous-connection-deletion` and
+ * `partial-failure-connection-creation`, the account being connected. Absent on
+ * `partial-failure-connection-deletion` and
+ * `partial-failure-new-account-existence-not-confirmed`, where the account may not
+ * exist.
+ *
+ * @return accountId UUID
+ */
+ public UUID getAccountId() {
+ return accountId;
+ }
+
+ /**
+ * Present only on a partial failure. The Xero Bank Account the item concerns. On
+ * `partial-failure-new-account-creation`, the account that was created: connect it
+ * through `POST /FeedConnections/ExistingAccount`. On
+ * `partial-failure-previous-connection-deletion` and
+ * `partial-failure-connection-creation`, the account being connected. Absent on
+ * `partial-failure-connection-deletion` and
+ * `partial-failure-new-account-existence-not-confirmed`, where the account may not
+ * exist.
+ *
+ * @param accountId UUID
+ */
+ public void setAccountId(UUID accountId) {
+ this.accountId = accountId;
+ }
+
+ /**
+ * Present only on a partial failure of type `partial-failure-new-account-creation` or
+ * `partial-failure-new-account-existence-not-confirmed`. The name of the account that
+ * was created, which is now taken; on
+ * `partial-failure-new-account-existence-not-confirmed`, the name of the account that
+ * may have been created.
+ *
+ * @param accountName String
+ * @return Problem
+ */
+ public Problem accountName(String accountName) {
+ this.accountName = accountName;
+ return this;
+ }
+
+ /**
+ * Present only on a partial failure of type `partial-failure-new-account-creation` or
+ * `partial-failure-new-account-existence-not-confirmed`. The name of the account that
+ * was created, which is now taken; on
+ * `partial-failure-new-account-existence-not-confirmed`, the name of the account that
+ * may have been created.
+ *
+ * @return accountName
+ */
+ @ApiModelProperty(
+ value =
+ "Present only on a partial failure of type `partial-failure-new-account-creation` or"
+ + " `partial-failure-new-account-existence-not-confirmed`. The name of the account"
+ + " that was created, which is now taken; on"
+ + " `partial-failure-new-account-existence-not-confirmed`, the name of the account"
+ + " that may have been created. ")
+ /**
+ * Present only on a partial failure of type `partial-failure-new-account-creation` or
+ * `partial-failure-new-account-existence-not-confirmed`. The name of the account that
+ * was created, which is now taken; on
+ * `partial-failure-new-account-existence-not-confirmed`, the name of the account that
+ * may have been created.
+ *
+ * @return accountName String
+ */
+ public String getAccountName() {
+ return accountName;
+ }
+
+ /**
+ * Present only on a partial failure of type `partial-failure-new-account-creation` or
+ * `partial-failure-new-account-existence-not-confirmed`. The name of the account that
+ * was created, which is now taken; on
+ * `partial-failure-new-account-existence-not-confirmed`, the name of the account that
+ * may have been created.
+ *
+ * @param accountName String
+ */
+ public void setAccountName(String accountName) {
+ this.accountName = accountName;
+ }
+
+ /**
+ * Present only on a partial failure. On `partial-failure-previous-connection-deletion`,
+ * the previous connection on the account (removed, or being removed). On
+ * `partial-failure-connection-creation`, the connection this request created or was
+ * creating: the id it was given before the create (the Feed Connection `id` if it was
+ * recorded). When the subtype is `connection-existence-not-confirmed`, the create's
+ * outcome is unknown and the connection may not exist in Xero. On
+ * `partial-failure-connection-deletion`, the connection being deleted (the item
+ * `id` also echoes it). Absent on `partial-failure-new-account-creation` and
+ * `partial-failure-new-account-existence-not-confirmed`.
+ *
+ * @param connectionId UUID
+ * @return Problem
+ */
+ public Problem connectionId(UUID connectionId) {
+ this.connectionId = connectionId;
+ return this;
+ }
+
+ /**
+ * Present only on a partial failure. On `partial-failure-previous-connection-deletion`,
+ * the previous connection on the account (removed, or being removed). On
+ * `partial-failure-connection-creation`, the connection this request created or was
+ * creating: the id it was given before the create (the Feed Connection `id` if it was
+ * recorded). When the subtype is `connection-existence-not-confirmed`, the create's
+ * outcome is unknown and the connection may not exist in Xero. On
+ * `partial-failure-connection-deletion`, the connection being deleted (the item
+ * `id` also echoes it). Absent on `partial-failure-new-account-creation` and
+ * `partial-failure-new-account-existence-not-confirmed`.
+ *
+ * @return connectionId
+ */
+ @ApiModelProperty(
+ value =
+ "Present only on a partial failure. On `partial-failure-previous-connection-deletion`,"
+ + " the previous connection on the account (removed, or being removed). On"
+ + " `partial-failure-connection-creation`, the connection this request created or was"
+ + " creating: the id it was given before the create (the Feed Connection `id` if it"
+ + " was recorded). When the subtype is `connection-existence-not-confirmed`, the"
+ + " create's outcome is unknown and the connection may not exist in Xero. On"
+ + " `partial-failure-connection-deletion`, the connection being deleted (the item"
+ + " `id` also echoes it). Absent on `partial-failure-new-account-creation` and"
+ + " `partial-failure-new-account-existence-not-confirmed`. ")
+ /**
+ * Present only on a partial failure. On `partial-failure-previous-connection-deletion`,
+ * the previous connection on the account (removed, or being removed). On
+ * `partial-failure-connection-creation`, the connection this request created or was
+ * creating: the id it was given before the create (the Feed Connection `id` if it was
+ * recorded). When the subtype is `connection-existence-not-confirmed`, the create's
+ * outcome is unknown and the connection may not exist in Xero. On
+ * `partial-failure-connection-deletion`, the connection being deleted (the item
+ * `id` also echoes it). Absent on `partial-failure-new-account-creation` and
+ * `partial-failure-new-account-existence-not-confirmed`.
+ *
+ * @return connectionId UUID
+ */
+ public UUID getConnectionId() {
+ return connectionId;
+ }
+
+ /**
+ * Present only on a partial failure. On `partial-failure-previous-connection-deletion`,
+ * the previous connection on the account (removed, or being removed). On
+ * `partial-failure-connection-creation`, the connection this request created or was
+ * creating: the id it was given before the create (the Feed Connection `id` if it was
+ * recorded). When the subtype is `connection-existence-not-confirmed`, the create's
+ * outcome is unknown and the connection may not exist in Xero. On
+ * `partial-failure-connection-deletion`, the connection being deleted (the item
+ * `id` also echoes it). Absent on `partial-failure-new-account-creation` and
+ * `partial-failure-new-account-existence-not-confirmed`.
+ *
+ * @param connectionId UUID
+ */
+ public void setConnectionId(UUID connectionId) {
+ this.connectionId = connectionId;
+ }
+
+ @Override
+ public boolean equals(java.lang.Object o) {
+ if (this == o) {
+ return true;
+ }
+ if (o == null || getClass() != o.getClass()) {
+ return false;
+ }
+ Problem problem = (Problem) o;
+ return Objects.equals(this.type, problem.type)
+ && Objects.equals(this.subtype, problem.subtype)
+ && Objects.equals(this.title, problem.title)
+ && Objects.equals(this.status, problem.status)
+ && Objects.equals(this.detail, problem.detail)
+ && Objects.equals(this.accountId, problem.accountId)
+ && Objects.equals(this.accountName, problem.accountName)
+ && Objects.equals(this.connectionId, problem.connectionId);
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hash(type, subtype, title, status, detail, accountId, accountName, connectionId);
+ }
+
+ @Override
+ public String toString() {
+ StringBuilder sb = new StringBuilder();
+ sb.append("class Problem {\n");
+ sb.append(" type: ").append(toIndentedString(type)).append("\n");
+ sb.append(" subtype: ").append(toIndentedString(subtype)).append("\n");
+ sb.append(" title: ").append(toIndentedString(title)).append("\n");
+ sb.append(" status: ").append(toIndentedString(status)).append("\n");
+ sb.append(" detail: ").append(toIndentedString(detail)).append("\n");
+ sb.append(" accountId: ").append(toIndentedString(accountId)).append("\n");
+ sb.append(" accountName: ").append(toIndentedString(accountName)).append("\n");
+ sb.append(" connectionId: ").append(toIndentedString(connectionId)).append("\n");
+ sb.append("}");
+ return sb.toString();
+ }
+
+ /**
+ * Convert the given object to string with each line indented by 4 spaces (except the first line).
+ */
+ private String toIndentedString(java.lang.Object o) {
+ if (o == null) {
+ return "null";
+ }
+ return o.toString().replace("\n", "\n ");
+ }
+}