org.killbill.billing.client.api.gen.AccountApi Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of killbill-client-java Show documentation
Show all versions of killbill-client-java Show documentation
Kill Bill Java client library
The newest version!
/*
* Copyright 2010-2014 Ning, Inc.
* Copyright 2014-2020 Groupon, Inc
* Copyright 2020-2021 Equinix, Inc
* Copyright 2014-2021 The Billing Project, LLC
*
* The Billing Project licenses this file to you under the Apache License, version 2.0
* (the "License"); you may not use this file except in compliance with the
* License. You may obtain a copy of the License at:
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations
* under the License.
*/
package org.killbill.billing.client.api.gen;
import java.util.Objects;
import org.killbill.billing.client.model.gen.Account;
import org.killbill.billing.client.model.gen.AccountEmail;
import org.killbill.billing.client.model.gen.AccountTimeline;
import org.killbill.billing.client.model.gen.AuditLog;
import java.math.BigDecimal;
import org.killbill.billing.client.model.gen.BlockingState;
import org.killbill.billing.client.model.gen.Bundle;
import org.killbill.billing.client.model.gen.CustomField;
import org.killbill.billing.client.model.gen.Invoice;
import org.killbill.billing.client.model.gen.InvoicePayment;
import org.joda.time.LocalDate;
import org.killbill.billing.client.model.gen.OverdueState;
import org.killbill.billing.client.model.gen.Payment;
import org.killbill.billing.client.model.gen.PaymentMethod;
import org.killbill.billing.client.model.gen.PaymentTransaction;
import org.killbill.billing.client.model.gen.Tag;
import java.util.UUID;
import org.killbill.billing.client.model.BlockingStates;
import java.util.List;
import java.util.Map;
import org.killbill.billing.client.model.AccountEmails;
import org.killbill.billing.client.model.CustomFields;
import org.killbill.billing.client.model.Tags;
import org.killbill.billing.util.api.AuditLevel;
import org.killbill.billing.client.model.AuditLogs;
import org.killbill.billing.client.model.Bundles;
import org.killbill.billing.client.model.Accounts;
import org.killbill.billing.ObjectType;
import org.killbill.billing.entitlement.api.BlockingStateType;
import org.killbill.billing.client.model.InvoicePayments;
import org.killbill.billing.client.model.Invoices;
import org.killbill.billing.client.model.PaymentMethods;
import org.killbill.billing.client.model.Payments;
import org.killbill.billing.client.Converter;
import org.killbill.billing.client.KillBillClientException;
import org.killbill.billing.client.KillBillHttpClient;
import org.killbill.billing.client.RequestOptions;
import org.killbill.billing.client.RequestOptions.RequestOptionsBuilder;
import org.killbill.billing.client.util.Preconditions;
import org.killbill.billing.client.util.Multimap;
import org.killbill.billing.client.util.TreeMapSetMultimap;
/**
* DO NOT EDIT !!!
*
* This code has been generated by the Kill Bill swagger generator.
* @See https://github.com/killbill/killbill-swagger-coden
*/
public class AccountApi {
private final KillBillHttpClient httpClient;
public AccountApi() {
this(new KillBillHttpClient());
}
public AccountApi(final KillBillHttpClient httpClient) {
this.httpClient = httpClient;
}
public BlockingStates addAccountBlockingState(final UUID accountId, final BlockingState body, final LocalDate requestedDate, final Map pluginProperty, final RequestOptions inputOptions) throws KillBillClientException {
Preconditions.checkNotNull(accountId, "Missing the required parameter 'accountId' when calling addAccountBlockingState");
Preconditions.checkNotNull(body, "Missing the required parameter 'body' when calling addAccountBlockingState");
final String uri = "/1.0/kb/accounts/{accountId}/block"
.replaceAll("\\{" + "accountId" + "\\}", accountId.toString());
final Multimap queryParams = new TreeMapSetMultimap<>(inputOptions.getQueryParams());
if (requestedDate != null) {
queryParams.put("requestedDate", String.valueOf(requestedDate));
}
if (pluginProperty != null) {
queryParams.putAll("pluginProperty", Converter.convertPluginPropertyMap(pluginProperty));
}
final RequestOptionsBuilder inputOptionsBuilder = inputOptions.extend();
final Boolean followLocation = Objects.requireNonNullElse(inputOptions.getFollowLocation(), Boolean.TRUE);
inputOptionsBuilder.withFollowLocation(followLocation);
inputOptionsBuilder.withQueryParams(queryParams.asMap());
inputOptionsBuilder.withHeader(KillBillHttpClient.HTTP_HEADER_CONTENT_TYPE, "application/json");
final RequestOptions requestOptions = inputOptionsBuilder.build();
return httpClient.doPost(uri, body, BlockingStates.class, requestOptions);
}
public AccountEmails addEmail(final UUID accountId, final AccountEmail body, final RequestOptions inputOptions) throws KillBillClientException {
Preconditions.checkNotNull(accountId, "Missing the required parameter 'accountId' when calling addEmail");
Preconditions.checkNotNull(body, "Missing the required parameter 'body' when calling addEmail");
final String uri = "/1.0/kb/accounts/{accountId}/emails"
.replaceAll("\\{" + "accountId" + "\\}", accountId.toString());
final RequestOptionsBuilder inputOptionsBuilder = inputOptions.extend();
final Boolean followLocation = Objects.requireNonNullElse(inputOptions.getFollowLocation(), Boolean.TRUE);
inputOptionsBuilder.withFollowLocation(followLocation);
inputOptionsBuilder.withHeader(KillBillHttpClient.HTTP_HEADER_ACCEPT, "application/json");
inputOptionsBuilder.withHeader(KillBillHttpClient.HTTP_HEADER_CONTENT_TYPE, "application/json");
final RequestOptions requestOptions = inputOptionsBuilder.build();
return httpClient.doPost(uri, body, AccountEmails.class, requestOptions);
}
public void closeAccount(final UUID accountId, final RequestOptions inputOptions) throws KillBillClientException {
closeAccount(accountId, Boolean.valueOf(false), Boolean.valueOf(false), Boolean.valueOf(false), Boolean.valueOf(true), inputOptions);
}
public void closeAccount(final UUID accountId, final Boolean cancelAllSubscriptions, final Boolean writeOffUnpaidInvoices, final Boolean itemAdjustUnpaidInvoices, final Boolean removeFutureNotifications, final RequestOptions inputOptions) throws KillBillClientException {
Preconditions.checkNotNull(accountId, "Missing the required parameter 'accountId' when calling closeAccount");
final String uri = "/1.0/kb/accounts/{accountId}"
.replaceAll("\\{" + "accountId" + "\\}", accountId.toString());
final Multimap queryParams = new TreeMapSetMultimap<>(inputOptions.getQueryParams());
if (cancelAllSubscriptions != null) {
queryParams.put("cancelAllSubscriptions", String.valueOf(cancelAllSubscriptions));
}
if (writeOffUnpaidInvoices != null) {
queryParams.put("writeOffUnpaidInvoices", String.valueOf(writeOffUnpaidInvoices));
}
if (itemAdjustUnpaidInvoices != null) {
queryParams.put("itemAdjustUnpaidInvoices", String.valueOf(itemAdjustUnpaidInvoices));
}
if (removeFutureNotifications != null) {
queryParams.put("removeFutureNotifications", String.valueOf(removeFutureNotifications));
}
final RequestOptionsBuilder inputOptionsBuilder = inputOptions.extend();
inputOptionsBuilder.withQueryParams(queryParams.asMap());
inputOptionsBuilder.withHeader(KillBillHttpClient.HTTP_HEADER_ACCEPT, "application/json");
final RequestOptions requestOptions = inputOptionsBuilder.build();
httpClient.doDelete(uri, requestOptions);
}
public Account createAccount(final Account body, final RequestOptions inputOptions) throws KillBillClientException {
Preconditions.checkNotNull(body, "Missing the required parameter 'body' when calling createAccount");
final String uri = "/1.0/kb/accounts";
final RequestOptionsBuilder inputOptionsBuilder = inputOptions.extend();
final Boolean followLocation = Objects.requireNonNullElse(inputOptions.getFollowLocation(), Boolean.TRUE);
inputOptionsBuilder.withFollowLocation(followLocation);
inputOptionsBuilder.withHeader(KillBillHttpClient.HTTP_HEADER_ACCEPT, "application/json");
inputOptionsBuilder.withHeader(KillBillHttpClient.HTTP_HEADER_CONTENT_TYPE, "application/json");
final RequestOptions requestOptions = inputOptionsBuilder.build();
return httpClient.doPost(uri, body, Account.class, requestOptions);
}
public CustomFields createAccountCustomFields(final UUID accountId, final CustomFields body, final RequestOptions inputOptions) throws KillBillClientException {
Preconditions.checkNotNull(accountId, "Missing the required parameter 'accountId' when calling createAccountCustomFields");
Preconditions.checkNotNull(body, "Missing the required parameter 'body' when calling createAccountCustomFields");
final String uri = "/1.0/kb/accounts/{accountId}/customFields"
.replaceAll("\\{" + "accountId" + "\\}", accountId.toString());
final RequestOptionsBuilder inputOptionsBuilder = inputOptions.extend();
final Boolean followLocation = Objects.requireNonNullElse(inputOptions.getFollowLocation(), Boolean.TRUE);
inputOptionsBuilder.withFollowLocation(followLocation);
inputOptionsBuilder.withHeader(KillBillHttpClient.HTTP_HEADER_ACCEPT, "application/json");
inputOptionsBuilder.withHeader(KillBillHttpClient.HTTP_HEADER_CONTENT_TYPE, "application/json");
final RequestOptions requestOptions = inputOptionsBuilder.build();
return httpClient.doPost(uri, body, CustomFields.class, requestOptions);
}
public Tags createAccountTags(final UUID accountId, final List body, final RequestOptions inputOptions) throws KillBillClientException {
Preconditions.checkNotNull(accountId, "Missing the required parameter 'accountId' when calling createAccountTags");
Preconditions.checkNotNull(body, "Missing the required parameter 'body' when calling createAccountTags");
final String uri = "/1.0/kb/accounts/{accountId}/tags"
.replaceAll("\\{" + "accountId" + "\\}", accountId.toString());
final RequestOptionsBuilder inputOptionsBuilder = inputOptions.extend();
final Boolean followLocation = Objects.requireNonNullElse(inputOptions.getFollowLocation(), Boolean.TRUE);
inputOptionsBuilder.withFollowLocation(followLocation);
inputOptionsBuilder.withHeader(KillBillHttpClient.HTTP_HEADER_ACCEPT, "application/json");
inputOptionsBuilder.withHeader(KillBillHttpClient.HTTP_HEADER_CONTENT_TYPE, "application/json");
final RequestOptions requestOptions = inputOptionsBuilder.build();
return httpClient.doPost(uri, body, Tags.class, requestOptions);
}
public PaymentMethod createPaymentMethod(final UUID accountId, final PaymentMethod body, final List controlPluginName, final Map pluginProperty, final RequestOptions inputOptions) throws KillBillClientException {
return createPaymentMethod(accountId, body, Boolean.valueOf(false), Boolean.valueOf(false), controlPluginName, pluginProperty, inputOptions);
}
public PaymentMethod createPaymentMethod(final UUID accountId, final PaymentMethod body, final Boolean isDefault, final Boolean payAllUnpaidInvoices, final List controlPluginName, final Map pluginProperty, final RequestOptions inputOptions) throws KillBillClientException {
Preconditions.checkNotNull(accountId, "Missing the required parameter 'accountId' when calling createPaymentMethod");
Preconditions.checkNotNull(body, "Missing the required parameter 'body' when calling createPaymentMethod");
final String uri = "/1.0/kb/accounts/{accountId}/paymentMethods"
.replaceAll("\\{" + "accountId" + "\\}", accountId.toString());
final Multimap queryParams = new TreeMapSetMultimap<>(inputOptions.getQueryParams());
if (isDefault != null) {
queryParams.put("isDefault", String.valueOf(isDefault));
}
if (payAllUnpaidInvoices != null) {
queryParams.put("payAllUnpaidInvoices", String.valueOf(payAllUnpaidInvoices));
}
if (controlPluginName != null) {
queryParams.putAll("controlPluginName", controlPluginName);
}
if (pluginProperty != null) {
queryParams.putAll("pluginProperty", Converter.convertPluginPropertyMap(pluginProperty));
}
final RequestOptionsBuilder inputOptionsBuilder = inputOptions.extend();
final Boolean followLocation = Objects.requireNonNullElse(inputOptions.getFollowLocation(), Boolean.TRUE);
inputOptionsBuilder.withFollowLocation(followLocation);
inputOptionsBuilder.withQueryParams(queryParams.asMap());
inputOptionsBuilder.withHeader(KillBillHttpClient.HTTP_HEADER_ACCEPT, "application/json");
inputOptionsBuilder.withHeader(KillBillHttpClient.HTTP_HEADER_CONTENT_TYPE, "application/json");
final RequestOptions requestOptions = inputOptionsBuilder.build();
return httpClient.doPost(uri, body, PaymentMethod.class, requestOptions);
}
public void deleteAccountCustomFields(final UUID accountId, final List customField, final RequestOptions inputOptions) throws KillBillClientException {
Preconditions.checkNotNull(accountId, "Missing the required parameter 'accountId' when calling deleteAccountCustomFields");
final String uri = "/1.0/kb/accounts/{accountId}/customFields"
.replaceAll("\\{" + "accountId" + "\\}", accountId.toString());
final Multimap queryParams = new TreeMapSetMultimap<>(inputOptions.getQueryParams());
if (customField != null) {
queryParams.putAll("customField", Converter.convertUUIDListToStringList(customField));
}
final RequestOptionsBuilder inputOptionsBuilder = inputOptions.extend();
inputOptionsBuilder.withQueryParams(queryParams.asMap());
inputOptionsBuilder.withHeader(KillBillHttpClient.HTTP_HEADER_ACCEPT, "application/json");
inputOptionsBuilder.withHeader(KillBillHttpClient.HTTP_HEADER_CONTENT_TYPE, "application/json");
final RequestOptions requestOptions = inputOptionsBuilder.build();
httpClient.doDelete(uri, requestOptions);
}
public void deleteAccountTags(final UUID accountId, final List tagDef, final RequestOptions inputOptions) throws KillBillClientException {
Preconditions.checkNotNull(accountId, "Missing the required parameter 'accountId' when calling deleteAccountTags");
final String uri = "/1.0/kb/accounts/{accountId}/tags"
.replaceAll("\\{" + "accountId" + "\\}", accountId.toString());
final Multimap queryParams = new TreeMapSetMultimap<>(inputOptions.getQueryParams());
if (tagDef != null) {
queryParams.putAll("tagDef", Converter.convertUUIDListToStringList(tagDef));
}
final RequestOptionsBuilder inputOptionsBuilder = inputOptions.extend();
inputOptionsBuilder.withQueryParams(queryParams.asMap());
inputOptionsBuilder.withHeader(KillBillHttpClient.HTTP_HEADER_ACCEPT, "application/json");
inputOptionsBuilder.withHeader(KillBillHttpClient.HTTP_HEADER_CONTENT_TYPE, "application/json");
final RequestOptions requestOptions = inputOptionsBuilder.build();
httpClient.doDelete(uri, requestOptions);
}
public Account getAccount(final UUID accountId, final RequestOptions inputOptions) throws KillBillClientException {
return getAccount(accountId, Boolean.valueOf(false), Boolean.valueOf(false), AuditLevel.NONE, inputOptions);
}
public Account getAccount(final UUID accountId, final Boolean accountWithBalance, final Boolean accountWithBalanceAndCBA, final AuditLevel audit, final RequestOptions inputOptions) throws KillBillClientException {
Preconditions.checkNotNull(accountId, "Missing the required parameter 'accountId' when calling getAccount");
final String uri = "/1.0/kb/accounts/{accountId}"
.replaceAll("\\{" + "accountId" + "\\}", accountId.toString());
final Multimap queryParams = new TreeMapSetMultimap<>(inputOptions.getQueryParams());
if (accountWithBalance != null) {
queryParams.put("accountWithBalance", String.valueOf(accountWithBalance));
}
if (accountWithBalanceAndCBA != null) {
queryParams.put("accountWithBalanceAndCBA", String.valueOf(accountWithBalanceAndCBA));
}
if (audit != null) {
queryParams.put("audit", String.valueOf(audit));
}
final RequestOptionsBuilder inputOptionsBuilder = inputOptions.extend();
inputOptionsBuilder.withQueryParams(queryParams.asMap());
inputOptionsBuilder.withHeader(KillBillHttpClient.HTTP_HEADER_ACCEPT, "application/json");
final RequestOptions requestOptions = inputOptionsBuilder.build();
return httpClient.doGet(uri, Account.class, requestOptions);
}
public AuditLogs getAccountAuditLogs(final UUID accountId, final RequestOptions inputOptions) throws KillBillClientException {
Preconditions.checkNotNull(accountId, "Missing the required parameter 'accountId' when calling getAccountAuditLogs");
final String uri = "/1.0/kb/accounts/{accountId}/auditLogs"
.replaceAll("\\{" + "accountId" + "\\}", accountId.toString());
final RequestOptionsBuilder inputOptionsBuilder = inputOptions.extend();
inputOptionsBuilder.withHeader(KillBillHttpClient.HTTP_HEADER_ACCEPT, "application/json");
final RequestOptions requestOptions = inputOptionsBuilder.build();
return httpClient.doGet(uri, AuditLogs.class, requestOptions);
}
public AuditLogs getAccountAuditLogsWithHistory(final UUID accountId, final RequestOptions inputOptions) throws KillBillClientException {
Preconditions.checkNotNull(accountId, "Missing the required parameter 'accountId' when calling getAccountAuditLogsWithHistory");
final String uri = "/1.0/kb/accounts/{accountId}/auditLogsWithHistory"
.replaceAll("\\{" + "accountId" + "\\}", accountId.toString());
final RequestOptionsBuilder inputOptionsBuilder = inputOptions.extend();
inputOptionsBuilder.withHeader(KillBillHttpClient.HTTP_HEADER_ACCEPT, "application/json");
final RequestOptions requestOptions = inputOptionsBuilder.build();
return httpClient.doGet(uri, AuditLogs.class, requestOptions);
}
public Bundles getAccountBundles(final UUID accountId, final String externalKey, final String bundlesFilter, final RequestOptions inputOptions) throws KillBillClientException {
return getAccountBundles(accountId, externalKey, bundlesFilter, AuditLevel.NONE, inputOptions);
}
public Bundles getAccountBundles(final UUID accountId, final String externalKey, final String bundlesFilter, final AuditLevel audit, final RequestOptions inputOptions) throws KillBillClientException {
Preconditions.checkNotNull(accountId, "Missing the required parameter 'accountId' when calling getAccountBundles");
final String uri = "/1.0/kb/accounts/{accountId}/bundles"
.replaceAll("\\{" + "accountId" + "\\}", accountId.toString());
final Multimap queryParams = new TreeMapSetMultimap<>(inputOptions.getQueryParams());
if (externalKey != null) {
queryParams.put("externalKey", String.valueOf(externalKey));
}
if (bundlesFilter != null) {
queryParams.put("bundlesFilter", String.valueOf(bundlesFilter));
}
if (audit != null) {
queryParams.put("audit", String.valueOf(audit));
}
final RequestOptionsBuilder inputOptionsBuilder = inputOptions.extend();
inputOptionsBuilder.withQueryParams(queryParams.asMap());
inputOptionsBuilder.withHeader(KillBillHttpClient.HTTP_HEADER_ACCEPT, "application/json");
final RequestOptions requestOptions = inputOptionsBuilder.build();
return httpClient.doGet(uri, Bundles.class, requestOptions);
}
public Bundles getAccountBundlesPaginated(final UUID accountId, final RequestOptions inputOptions) throws KillBillClientException {
return getAccountBundlesPaginated(accountId, Long.valueOf(0), Long.valueOf(100), AuditLevel.NONE, inputOptions);
}
public Bundles getAccountBundlesPaginated(final UUID accountId, final Long offset, final Long limit, final AuditLevel audit, final RequestOptions inputOptions) throws KillBillClientException {
Preconditions.checkNotNull(accountId, "Missing the required parameter 'accountId' when calling getAccountBundlesPaginated");
final String uri = "/1.0/kb/accounts/{accountId}/bundles/pagination"
.replaceAll("\\{" + "accountId" + "\\}", accountId.toString());
final Multimap queryParams = new TreeMapSetMultimap<>(inputOptions.getQueryParams());
if (offset != null) {
queryParams.put("offset", String.valueOf(offset));
}
if (limit != null) {
queryParams.put("limit", String.valueOf(limit));
}
if (audit != null) {
queryParams.put("audit", String.valueOf(audit));
}
final RequestOptionsBuilder inputOptionsBuilder = inputOptions.extend();
inputOptionsBuilder.withQueryParams(queryParams.asMap());
inputOptionsBuilder.withHeader(KillBillHttpClient.HTTP_HEADER_ACCEPT, "application/json");
final RequestOptions requestOptions = inputOptionsBuilder.build();
return httpClient.doGet(uri, Bundles.class, requestOptions);
}
public Account getAccountByKey(final String externalKey, final RequestOptions inputOptions) throws KillBillClientException {
return getAccountByKey(externalKey, Boolean.valueOf(false), Boolean.valueOf(false), AuditLevel.NONE, inputOptions);
}
public Account getAccountByKey(final String externalKey, final Boolean accountWithBalance, final Boolean accountWithBalanceAndCBA, final AuditLevel audit, final RequestOptions inputOptions) throws KillBillClientException {
Preconditions.checkNotNull(externalKey, "Missing the required parameter 'externalKey' when calling getAccountByKey");
final String uri = "/1.0/kb/accounts";
final Multimap queryParams = new TreeMapSetMultimap<>(inputOptions.getQueryParams());
if (externalKey != null) {
queryParams.put("externalKey", String.valueOf(externalKey));
}
if (accountWithBalance != null) {
queryParams.put("accountWithBalance", String.valueOf(accountWithBalance));
}
if (accountWithBalanceAndCBA != null) {
queryParams.put("accountWithBalanceAndCBA", String.valueOf(accountWithBalanceAndCBA));
}
if (audit != null) {
queryParams.put("audit", String.valueOf(audit));
}
final RequestOptionsBuilder inputOptionsBuilder = inputOptions.extend();
inputOptionsBuilder.withQueryParams(queryParams.asMap());
inputOptionsBuilder.withHeader(KillBillHttpClient.HTTP_HEADER_ACCEPT, "application/json");
final RequestOptions requestOptions = inputOptionsBuilder.build();
return httpClient.doGet(uri, Account.class, requestOptions);
}
public CustomFields getAccountCustomFields(final UUID accountId, final RequestOptions inputOptions) throws KillBillClientException {
return getAccountCustomFields(accountId, AuditLevel.NONE, inputOptions);
}
public CustomFields getAccountCustomFields(final UUID accountId, final AuditLevel audit, final RequestOptions inputOptions) throws KillBillClientException {
Preconditions.checkNotNull(accountId, "Missing the required parameter 'accountId' when calling getAccountCustomFields");
final String uri = "/1.0/kb/accounts/{accountId}/customFields"
.replaceAll("\\{" + "accountId" + "\\}", accountId.toString());
final Multimap queryParams = new TreeMapSetMultimap<>(inputOptions.getQueryParams());
if (audit != null) {
queryParams.put("audit", String.valueOf(audit));
}
final RequestOptionsBuilder inputOptionsBuilder = inputOptions.extend();
inputOptionsBuilder.withQueryParams(queryParams.asMap());
inputOptionsBuilder.withHeader(KillBillHttpClient.HTTP_HEADER_ACCEPT, "application/json");
final RequestOptions requestOptions = inputOptionsBuilder.build();
return httpClient.doGet(uri, CustomFields.class, requestOptions);
}
public AuditLogs getAccountEmailAuditLogsWithHistory(final UUID accountId, final UUID accountEmailId, final RequestOptions inputOptions) throws KillBillClientException {
Preconditions.checkNotNull(accountId, "Missing the required parameter 'accountId' when calling getAccountEmailAuditLogsWithHistory");
Preconditions.checkNotNull(accountEmailId, "Missing the required parameter 'accountEmailId' when calling getAccountEmailAuditLogsWithHistory");
final String uri = "/1.0/kb/accounts/{accountId}/emails/{accountEmailId}/auditLogsWithHistory"
.replaceAll("\\{" + "accountId" + "\\}", accountId.toString())
.replaceAll("\\{" + "accountEmailId" + "\\}", accountEmailId.toString());
final RequestOptionsBuilder inputOptionsBuilder = inputOptions.extend();
inputOptionsBuilder.withHeader(KillBillHttpClient.HTTP_HEADER_ACCEPT, "application/json");
final RequestOptions requestOptions = inputOptionsBuilder.build();
return httpClient.doGet(uri, AuditLogs.class, requestOptions);
}
public Tags getAccountTags(final UUID accountId, final RequestOptions inputOptions) throws KillBillClientException {
return getAccountTags(accountId, Boolean.valueOf(false), AuditLevel.NONE, inputOptions);
}
public Tags getAccountTags(final UUID accountId, final Boolean includedDeleted, final AuditLevel audit, final RequestOptions inputOptions) throws KillBillClientException {
Preconditions.checkNotNull(accountId, "Missing the required parameter 'accountId' when calling getAccountTags");
final String uri = "/1.0/kb/accounts/{accountId}/tags"
.replaceAll("\\{" + "accountId" + "\\}", accountId.toString());
final Multimap queryParams = new TreeMapSetMultimap<>(inputOptions.getQueryParams());
if (includedDeleted != null) {
queryParams.put("includedDeleted", String.valueOf(includedDeleted));
}
if (audit != null) {
queryParams.put("audit", String.valueOf(audit));
}
final RequestOptionsBuilder inputOptionsBuilder = inputOptions.extend();
inputOptionsBuilder.withQueryParams(queryParams.asMap());
inputOptionsBuilder.withHeader(KillBillHttpClient.HTTP_HEADER_ACCEPT, "application/json");
final RequestOptions requestOptions = inputOptionsBuilder.build();
return httpClient.doGet(uri, Tags.class, requestOptions);
}
public AccountTimeline getAccountTimeline(final UUID accountId, final RequestOptions inputOptions) throws KillBillClientException {
return getAccountTimeline(accountId, Boolean.valueOf(false), AuditLevel.NONE, inputOptions);
}
public AccountTimeline getAccountTimeline(final UUID accountId, final Boolean parallel, final AuditLevel audit, final RequestOptions inputOptions) throws KillBillClientException {
Preconditions.checkNotNull(accountId, "Missing the required parameter 'accountId' when calling getAccountTimeline");
final String uri = "/1.0/kb/accounts/{accountId}/timeline"
.replaceAll("\\{" + "accountId" + "\\}", accountId.toString());
final Multimap queryParams = new TreeMapSetMultimap<>(inputOptions.getQueryParams());
if (parallel != null) {
queryParams.put("parallel", String.valueOf(parallel));
}
if (audit != null) {
queryParams.put("audit", String.valueOf(audit));
}
final RequestOptionsBuilder inputOptionsBuilder = inputOptions.extend();
inputOptionsBuilder.withQueryParams(queryParams.asMap());
inputOptionsBuilder.withHeader(KillBillHttpClient.HTTP_HEADER_ACCEPT, "application/json");
final RequestOptions requestOptions = inputOptionsBuilder.build();
return httpClient.doGet(uri, AccountTimeline.class, requestOptions);
}
public Accounts getAccounts(final RequestOptions inputOptions) throws KillBillClientException {
return getAccounts(Long.valueOf(0), Long.valueOf(100), Boolean.valueOf(false), Boolean.valueOf(false), AuditLevel.NONE, inputOptions);
}
public Accounts getAccounts(final Long offset, final Long limit, final Boolean accountWithBalance, final Boolean accountWithBalanceAndCBA, final AuditLevel audit, final RequestOptions inputOptions) throws KillBillClientException {
final String uri = "/1.0/kb/accounts/pagination";
final Multimap queryParams = new TreeMapSetMultimap<>(inputOptions.getQueryParams());
if (offset != null) {
queryParams.put("offset", String.valueOf(offset));
}
if (limit != null) {
queryParams.put("limit", String.valueOf(limit));
}
if (accountWithBalance != null) {
queryParams.put("accountWithBalance", String.valueOf(accountWithBalance));
}
if (accountWithBalanceAndCBA != null) {
queryParams.put("accountWithBalanceAndCBA", String.valueOf(accountWithBalanceAndCBA));
}
if (audit != null) {
queryParams.put("audit", String.valueOf(audit));
}
final RequestOptionsBuilder inputOptionsBuilder = inputOptions.extend();
inputOptionsBuilder.withQueryParams(queryParams.asMap());
inputOptionsBuilder.withHeader(KillBillHttpClient.HTTP_HEADER_ACCEPT, "application/json");
final RequestOptions requestOptions = inputOptionsBuilder.build();
return httpClient.doGet(uri, Accounts.class, requestOptions);
}
public CustomFields getAllCustomFields(final UUID accountId, final ObjectType objectType, final RequestOptions inputOptions) throws KillBillClientException {
return getAllCustomFields(accountId, objectType, AuditLevel.NONE, inputOptions);
}
public CustomFields getAllCustomFields(final UUID accountId, final ObjectType objectType, final AuditLevel audit, final RequestOptions inputOptions) throws KillBillClientException {
Preconditions.checkNotNull(accountId, "Missing the required parameter 'accountId' when calling getAllCustomFields");
final String uri = "/1.0/kb/accounts/{accountId}/allCustomFields"
.replaceAll("\\{" + "accountId" + "\\}", accountId.toString());
final Multimap queryParams = new TreeMapSetMultimap<>(inputOptions.getQueryParams());
if (objectType != null) {
queryParams.put("objectType", String.valueOf(objectType));
}
if (audit != null) {
queryParams.put("audit", String.valueOf(audit));
}
final RequestOptionsBuilder inputOptionsBuilder = inputOptions.extend();
inputOptionsBuilder.withQueryParams(queryParams.asMap());
inputOptionsBuilder.withHeader(KillBillHttpClient.HTTP_HEADER_ACCEPT, "application/json");
final RequestOptions requestOptions = inputOptionsBuilder.build();
return httpClient.doGet(uri, CustomFields.class, requestOptions);
}
public Tags getAllTags(final UUID accountId, final ObjectType objectType, final RequestOptions inputOptions) throws KillBillClientException {
return getAllTags(accountId, objectType, Boolean.valueOf(false), AuditLevel.NONE, inputOptions);
}
public Tags getAllTags(final UUID accountId, final ObjectType objectType, final Boolean includedDeleted, final AuditLevel audit, final RequestOptions inputOptions) throws KillBillClientException {
Preconditions.checkNotNull(accountId, "Missing the required parameter 'accountId' when calling getAllTags");
final String uri = "/1.0/kb/accounts/{accountId}/allTags"
.replaceAll("\\{" + "accountId" + "\\}", accountId.toString());
final Multimap queryParams = new TreeMapSetMultimap<>(inputOptions.getQueryParams());
if (objectType != null) {
queryParams.put("objectType", String.valueOf(objectType));
}
if (includedDeleted != null) {
queryParams.put("includedDeleted", String.valueOf(includedDeleted));
}
if (audit != null) {
queryParams.put("audit", String.valueOf(audit));
}
final RequestOptionsBuilder inputOptionsBuilder = inputOptions.extend();
inputOptionsBuilder.withQueryParams(queryParams.asMap());
inputOptionsBuilder.withHeader(KillBillHttpClient.HTTP_HEADER_ACCEPT, "application/json");
final RequestOptions requestOptions = inputOptionsBuilder.build();
return httpClient.doGet(uri, Tags.class, requestOptions);
}
public AuditLogs getBlockingStateAuditLogsWithHistory(final UUID blockingId, final RequestOptions inputOptions) throws KillBillClientException {
Preconditions.checkNotNull(blockingId, "Missing the required parameter 'blockingId' when calling getBlockingStateAuditLogsWithHistory");
final String uri = "/1.0/kb/accounts/block/{blockingId}/auditLogsWithHistory"
.replaceAll("\\{" + "blockingId" + "\\}", blockingId.toString());
final RequestOptionsBuilder inputOptionsBuilder = inputOptions.extend();
inputOptionsBuilder.withHeader(KillBillHttpClient.HTTP_HEADER_ACCEPT, "application/json");
final RequestOptions requestOptions = inputOptionsBuilder.build();
return httpClient.doGet(uri, AuditLogs.class, requestOptions);
}
public BlockingStates getBlockingStates(final UUID accountId, final List blockingStateTypes, final List blockingStateSvcs, final RequestOptions inputOptions) throws KillBillClientException {
return getBlockingStates(accountId, blockingStateTypes, blockingStateSvcs, AuditLevel.NONE, inputOptions);
}
public BlockingStates getBlockingStates(final UUID accountId, final List blockingStateTypes, final List blockingStateSvcs, final AuditLevel audit, final RequestOptions inputOptions) throws KillBillClientException {
Preconditions.checkNotNull(accountId, "Missing the required parameter 'accountId' when calling getBlockingStates");
final String uri = "/1.0/kb/accounts/{accountId}/block"
.replaceAll("\\{" + "accountId" + "\\}", accountId.toString());
final Multimap queryParams = new TreeMapSetMultimap<>(inputOptions.getQueryParams());
if (blockingStateTypes != null) {
queryParams.putAll("blockingStateTypes", Converter.convertEnumListToStringList(blockingStateTypes));
}
if (blockingStateSvcs != null) {
queryParams.putAll("blockingStateSvcs", blockingStateSvcs);
}
if (audit != null) {
queryParams.put("audit", String.valueOf(audit));
}
final RequestOptionsBuilder inputOptionsBuilder = inputOptions.extend();
inputOptionsBuilder.withQueryParams(queryParams.asMap());
inputOptionsBuilder.withHeader(KillBillHttpClient.HTTP_HEADER_ACCEPT, "application/json");
final RequestOptions requestOptions = inputOptionsBuilder.build();
return httpClient.doGet(uri, BlockingStates.class, requestOptions);
}
public Accounts getChildrenAccounts(final UUID accountId, final RequestOptions inputOptions) throws KillBillClientException {
return getChildrenAccounts(accountId, Boolean.valueOf(false), Boolean.valueOf(false), AuditLevel.NONE, inputOptions);
}
public Accounts getChildrenAccounts(final UUID accountId, final Boolean accountWithBalance, final Boolean accountWithBalanceAndCBA, final AuditLevel audit, final RequestOptions inputOptions) throws KillBillClientException {
Preconditions.checkNotNull(accountId, "Missing the required parameter 'accountId' when calling getChildrenAccounts");
final String uri = "/1.0/kb/accounts/{accountId}/children"
.replaceAll("\\{" + "accountId" + "\\}", accountId.toString());
final Multimap queryParams = new TreeMapSetMultimap<>(inputOptions.getQueryParams());
if (accountWithBalance != null) {
queryParams.put("accountWithBalance", String.valueOf(accountWithBalance));
}
if (accountWithBalanceAndCBA != null) {
queryParams.put("accountWithBalanceAndCBA", String.valueOf(accountWithBalanceAndCBA));
}
if (audit != null) {
queryParams.put("audit", String.valueOf(audit));
}
final RequestOptionsBuilder inputOptionsBuilder = inputOptions.extend();
inputOptionsBuilder.withQueryParams(queryParams.asMap());
inputOptionsBuilder.withHeader(KillBillHttpClient.HTTP_HEADER_ACCEPT, "application/json");
final RequestOptions requestOptions = inputOptionsBuilder.build();
return httpClient.doGet(uri, Accounts.class, requestOptions);
}
public AccountEmails getEmails(final UUID accountId, final RequestOptions inputOptions) throws KillBillClientException {
Preconditions.checkNotNull(accountId, "Missing the required parameter 'accountId' when calling getEmails");
final String uri = "/1.0/kb/accounts/{accountId}/emails"
.replaceAll("\\{" + "accountId" + "\\}", accountId.toString());
final RequestOptionsBuilder inputOptionsBuilder = inputOptions.extend();
inputOptionsBuilder.withHeader(KillBillHttpClient.HTTP_HEADER_ACCEPT, "application/json");
final RequestOptions requestOptions = inputOptionsBuilder.build();
return httpClient.doGet(uri, AccountEmails.class, requestOptions);
}
public InvoicePayments getInvoicePayments(final UUID accountId, final Map pluginProperty, final RequestOptions inputOptions) throws KillBillClientException {
return getInvoicePayments(accountId, Boolean.valueOf(false), Boolean.valueOf(false), pluginProperty, AuditLevel.NONE, inputOptions);
}
public InvoicePayments getInvoicePayments(final UUID accountId, final Boolean withPluginInfo, final Boolean withAttempts, final Map pluginProperty, final AuditLevel audit, final RequestOptions inputOptions) throws KillBillClientException {
Preconditions.checkNotNull(accountId, "Missing the required parameter 'accountId' when calling getInvoicePayments");
final String uri = "/1.0/kb/accounts/{accountId}/invoicePayments"
.replaceAll("\\{" + "accountId" + "\\}", accountId.toString());
final Multimap queryParams = new TreeMapSetMultimap<>(inputOptions.getQueryParams());
if (withPluginInfo != null) {
queryParams.put("withPluginInfo", String.valueOf(withPluginInfo));
}
if (withAttempts != null) {
queryParams.put("withAttempts", String.valueOf(withAttempts));
}
if (pluginProperty != null) {
queryParams.putAll("pluginProperty", Converter.convertPluginPropertyMap(pluginProperty));
}
if (audit != null) {
queryParams.put("audit", String.valueOf(audit));
}
final RequestOptionsBuilder inputOptionsBuilder = inputOptions.extend();
inputOptionsBuilder.withQueryParams(queryParams.asMap());
inputOptionsBuilder.withHeader(KillBillHttpClient.HTTP_HEADER_ACCEPT, "application/json");
final RequestOptions requestOptions = inputOptionsBuilder.build();
return httpClient.doGet(uri, InvoicePayments.class, requestOptions);
}
public Invoices getInvoicesForAccount(final UUID accountId, final LocalDate startDate, final LocalDate endDate, final String invoicesFilter, final RequestOptions inputOptions) throws KillBillClientException {
return getInvoicesForAccount(accountId, startDate, endDate, Boolean.valueOf(false), Boolean.valueOf(false), Boolean.valueOf(false), Boolean.valueOf(false), invoicesFilter, AuditLevel.NONE, inputOptions);
}
public Invoices getInvoicesForAccount(final UUID accountId, final LocalDate startDate, final LocalDate endDate, final Boolean withMigrationInvoices, final Boolean unpaidInvoicesOnly, final Boolean includeVoidedInvoices, final Boolean includeInvoiceComponents, final String invoicesFilter, final AuditLevel audit, final RequestOptions inputOptions) throws KillBillClientException {
Preconditions.checkNotNull(accountId, "Missing the required parameter 'accountId' when calling getInvoicesForAccount");
final String uri = "/1.0/kb/accounts/{accountId}/invoices"
.replaceAll("\\{" + "accountId" + "\\}", accountId.toString());
final Multimap queryParams = new TreeMapSetMultimap<>(inputOptions.getQueryParams());
if (startDate != null) {
queryParams.put("startDate", String.valueOf(startDate));
}
if (endDate != null) {
queryParams.put("endDate", String.valueOf(endDate));
}
if (withMigrationInvoices != null) {
queryParams.put("withMigrationInvoices", String.valueOf(withMigrationInvoices));
}
if (unpaidInvoicesOnly != null) {
queryParams.put("unpaidInvoicesOnly", String.valueOf(unpaidInvoicesOnly));
}
if (includeVoidedInvoices != null) {
queryParams.put("includeVoidedInvoices", String.valueOf(includeVoidedInvoices));
}
if (includeInvoiceComponents != null) {
queryParams.put("includeInvoiceComponents", String.valueOf(includeInvoiceComponents));
}
if (invoicesFilter != null) {
queryParams.put("invoicesFilter", String.valueOf(invoicesFilter));
}
if (audit != null) {
queryParams.put("audit", String.valueOf(audit));
}
final RequestOptionsBuilder inputOptionsBuilder = inputOptions.extend();
inputOptionsBuilder.withQueryParams(queryParams.asMap());
inputOptionsBuilder.withHeader(KillBillHttpClient.HTTP_HEADER_ACCEPT, "application/json");
final RequestOptions requestOptions = inputOptionsBuilder.build();
return httpClient.doGet(uri, Invoices.class, requestOptions);
}
public Invoices getInvoicesForAccountPaginated(final UUID accountId, final RequestOptions inputOptions) throws KillBillClientException {
return getInvoicesForAccountPaginated(accountId, Long.valueOf(0), Long.valueOf(100), AuditLevel.NONE, inputOptions);
}
public Invoices getInvoicesForAccountPaginated(final UUID accountId, final Long offset, final Long limit, final AuditLevel audit, final RequestOptions inputOptions) throws KillBillClientException {
Preconditions.checkNotNull(accountId, "Missing the required parameter 'accountId' when calling getInvoicesForAccountPaginated");
final String uri = "/1.0/kb/accounts/{accountId}/invoices/pagination"
.replaceAll("\\{" + "accountId" + "\\}", accountId.toString());
final Multimap queryParams = new TreeMapSetMultimap<>(inputOptions.getQueryParams());
if (offset != null) {
queryParams.put("offset", String.valueOf(offset));
}
if (limit != null) {
queryParams.put("limit", String.valueOf(limit));
}
if (audit != null) {
queryParams.put("audit", String.valueOf(audit));
}
final RequestOptionsBuilder inputOptionsBuilder = inputOptions.extend();
inputOptionsBuilder.withQueryParams(queryParams.asMap());
inputOptionsBuilder.withHeader(KillBillHttpClient.HTTP_HEADER_ACCEPT, "application/json");
final RequestOptions requestOptions = inputOptionsBuilder.build();
return httpClient.doGet(uri, Invoices.class, requestOptions);
}
public OverdueState getOverdueAccount(final UUID accountId, final RequestOptions inputOptions) throws KillBillClientException {
Preconditions.checkNotNull(accountId, "Missing the required parameter 'accountId' when calling getOverdueAccount");
final String uri = "/1.0/kb/accounts/{accountId}/overdue"
.replaceAll("\\{" + "accountId" + "\\}", accountId.toString());
final RequestOptionsBuilder inputOptionsBuilder = inputOptions.extend();
inputOptionsBuilder.withHeader(KillBillHttpClient.HTTP_HEADER_ACCEPT, "application/json");
final RequestOptions requestOptions = inputOptionsBuilder.build();
return httpClient.doGet(uri, OverdueState.class, requestOptions);
}
public PaymentMethods getPaymentMethodsForAccount(final UUID accountId, final Map pluginProperty, final RequestOptions inputOptions) throws KillBillClientException {
return getPaymentMethodsForAccount(accountId, Boolean.valueOf(false), Boolean.valueOf(false), pluginProperty, AuditLevel.NONE, inputOptions);
}
public PaymentMethods getPaymentMethodsForAccount(final UUID accountId, final Boolean withPluginInfo, final Boolean includedDeleted, final Map pluginProperty, final AuditLevel audit, final RequestOptions inputOptions) throws KillBillClientException {
Preconditions.checkNotNull(accountId, "Missing the required parameter 'accountId' when calling getPaymentMethodsForAccount");
final String uri = "/1.0/kb/accounts/{accountId}/paymentMethods"
.replaceAll("\\{" + "accountId" + "\\}", accountId.toString());
final Multimap queryParams = new TreeMapSetMultimap<>(inputOptions.getQueryParams());
if (withPluginInfo != null) {
queryParams.put("withPluginInfo", String.valueOf(withPluginInfo));
}
if (includedDeleted != null) {
queryParams.put("includedDeleted", String.valueOf(includedDeleted));
}
if (pluginProperty != null) {
queryParams.putAll("pluginProperty", Converter.convertPluginPropertyMap(pluginProperty));
}
if (audit != null) {
queryParams.put("audit", String.valueOf(audit));
}
final RequestOptionsBuilder inputOptionsBuilder = inputOptions.extend();
inputOptionsBuilder.withQueryParams(queryParams.asMap());
inputOptionsBuilder.withHeader(KillBillHttpClient.HTTP_HEADER_ACCEPT, "application/json");
final RequestOptions requestOptions = inputOptionsBuilder.build();
return httpClient.doGet(uri, PaymentMethods.class, requestOptions);
}
public Payments getPaymentsForAccount(final UUID accountId, final Map pluginProperty, final RequestOptions inputOptions) throws KillBillClientException {
return getPaymentsForAccount(accountId, Boolean.valueOf(false), Boolean.valueOf(false), pluginProperty, AuditLevel.NONE, inputOptions);
}
public Payments getPaymentsForAccount(final UUID accountId, final Boolean withAttempts, final Boolean withPluginInfo, final Map pluginProperty, final AuditLevel audit, final RequestOptions inputOptions) throws KillBillClientException {
Preconditions.checkNotNull(accountId, "Missing the required parameter 'accountId' when calling getPaymentsForAccount");
final String uri = "/1.0/kb/accounts/{accountId}/payments"
.replaceAll("\\{" + "accountId" + "\\}", accountId.toString());
final Multimap queryParams = new TreeMapSetMultimap<>(inputOptions.getQueryParams());
if (withAttempts != null) {
queryParams.put("withAttempts", String.valueOf(withAttempts));
}
if (withPluginInfo != null) {
queryParams.put("withPluginInfo", String.valueOf(withPluginInfo));
}
if (pluginProperty != null) {
queryParams.putAll("pluginProperty", Converter.convertPluginPropertyMap(pluginProperty));
}
if (audit != null) {
queryParams.put("audit", String.valueOf(audit));
}
final RequestOptionsBuilder inputOptionsBuilder = inputOptions.extend();
inputOptionsBuilder.withQueryParams(queryParams.asMap());
inputOptionsBuilder.withHeader(KillBillHttpClient.HTTP_HEADER_ACCEPT, "application/json");
final RequestOptions requestOptions = inputOptionsBuilder.build();
return httpClient.doGet(uri, Payments.class, requestOptions);
}
public void modifyAccountCustomFields(final UUID accountId, final CustomFields body, final RequestOptions inputOptions) throws KillBillClientException {
Preconditions.checkNotNull(accountId, "Missing the required parameter 'accountId' when calling modifyAccountCustomFields");
Preconditions.checkNotNull(body, "Missing the required parameter 'body' when calling modifyAccountCustomFields");
final String uri = "/1.0/kb/accounts/{accountId}/customFields"
.replaceAll("\\{" + "accountId" + "\\}", accountId.toString());
final RequestOptionsBuilder inputOptionsBuilder = inputOptions.extend();
inputOptionsBuilder.withHeader(KillBillHttpClient.HTTP_HEADER_ACCEPT, "application/json");
inputOptionsBuilder.withHeader(KillBillHttpClient.HTTP_HEADER_CONTENT_TYPE, "application/json");
final RequestOptions requestOptions = inputOptionsBuilder.build();
httpClient.doPut(uri, body, requestOptions);
}
public Invoices payAllInvoices(final UUID accountId, final UUID paymentMethodId, final BigDecimal paymentAmount, final LocalDate targetDate, final Map pluginProperty, final RequestOptions inputOptions) throws KillBillClientException {
return payAllInvoices(accountId, paymentMethodId, Boolean.valueOf(false), paymentAmount, targetDate, pluginProperty, inputOptions);
}
public Invoices payAllInvoices(final UUID accountId, final UUID paymentMethodId, final Boolean externalPayment, final BigDecimal paymentAmount, final LocalDate targetDate, final Map pluginProperty, final RequestOptions inputOptions) throws KillBillClientException {
Preconditions.checkNotNull(accountId, "Missing the required parameter 'accountId' when calling payAllInvoices");
final String uri = "/1.0/kb/accounts/{accountId}/invoicePayments"
.replaceAll("\\{" + "accountId" + "\\}", accountId.toString());
final Multimap queryParams = new TreeMapSetMultimap<>(inputOptions.getQueryParams());
if (paymentMethodId != null) {
queryParams.put("paymentMethodId", String.valueOf(paymentMethodId));
}
if (externalPayment != null) {
queryParams.put("externalPayment", String.valueOf(externalPayment));
}
if (paymentAmount != null) {
queryParams.put("paymentAmount", String.valueOf(paymentAmount));
}
if (targetDate != null) {
queryParams.put("targetDate", String.valueOf(targetDate));
}
if (pluginProperty != null) {
queryParams.putAll("pluginProperty", Converter.convertPluginPropertyMap(pluginProperty));
}
final RequestOptionsBuilder inputOptionsBuilder = inputOptions.extend();
final Boolean followLocation = Objects.requireNonNullElse(inputOptions.getFollowLocation(), Boolean.TRUE);
inputOptionsBuilder.withFollowLocation(followLocation);
inputOptionsBuilder.withQueryParams(queryParams.asMap());
inputOptionsBuilder.withHeader(KillBillHttpClient.HTTP_HEADER_ACCEPT, "application/json");
inputOptionsBuilder.withHeader(KillBillHttpClient.HTTP_HEADER_CONTENT_TYPE, "application/json");
final RequestOptions requestOptions = inputOptionsBuilder.build();
return httpClient.doPost(uri, null, Invoices.class, requestOptions);
}
public Payment processPayment(final UUID accountId, final PaymentTransaction body, final UUID paymentMethodId, final List controlPluginName, final Map pluginProperty, final RequestOptions inputOptions) throws KillBillClientException {
Preconditions.checkNotNull(accountId, "Missing the required parameter 'accountId' when calling processPayment");
Preconditions.checkNotNull(body, "Missing the required parameter 'body' when calling processPayment");
final String uri = "/1.0/kb/accounts/{accountId}/payments"
.replaceAll("\\{" + "accountId" + "\\}", accountId.toString());
final Multimap queryParams = new TreeMapSetMultimap<>(inputOptions.getQueryParams());
if (paymentMethodId != null) {
queryParams.put("paymentMethodId", String.valueOf(paymentMethodId));
}
if (controlPluginName != null) {
queryParams.putAll("controlPluginName", controlPluginName);
}
if (pluginProperty != null) {
queryParams.putAll("pluginProperty", Converter.convertPluginPropertyMap(pluginProperty));
}
final RequestOptionsBuilder inputOptionsBuilder = inputOptions.extend();
final Boolean followLocation = Objects.requireNonNullElse(inputOptions.getFollowLocation(), Boolean.TRUE);
inputOptionsBuilder.withFollowLocation(followLocation);
inputOptionsBuilder.withQueryParams(queryParams.asMap());
inputOptionsBuilder.withHeader(KillBillHttpClient.HTTP_HEADER_ACCEPT, "application/json");
inputOptionsBuilder.withHeader(KillBillHttpClient.HTTP_HEADER_CONTENT_TYPE, "application/json");
final RequestOptions requestOptions = inputOptionsBuilder.build();
return httpClient.doPost(uri, body, Payment.class, requestOptions);
}
public Payment processPaymentByExternalKey(final PaymentTransaction body, final String externalKey, final UUID paymentMethodId, final List controlPluginName, final Map pluginProperty, final RequestOptions inputOptions) throws KillBillClientException {
Preconditions.checkNotNull(body, "Missing the required parameter 'body' when calling processPaymentByExternalKey");
Preconditions.checkNotNull(externalKey, "Missing the required parameter 'externalKey' when calling processPaymentByExternalKey");
final String uri = "/1.0/kb/accounts/payments";
final Multimap queryParams = new TreeMapSetMultimap<>(inputOptions.getQueryParams());
if (externalKey != null) {
queryParams.put("externalKey", String.valueOf(externalKey));
}
if (paymentMethodId != null) {
queryParams.put("paymentMethodId", String.valueOf(paymentMethodId));
}
if (controlPluginName != null) {
queryParams.putAll("controlPluginName", controlPluginName);
}
if (pluginProperty != null) {
queryParams.putAll("pluginProperty", Converter.convertPluginPropertyMap(pluginProperty));
}
final RequestOptionsBuilder inputOptionsBuilder = inputOptions.extend();
final Boolean followLocation = Objects.requireNonNullElse(inputOptions.getFollowLocation(), Boolean.TRUE);
inputOptionsBuilder.withFollowLocation(followLocation);
inputOptionsBuilder.withQueryParams(queryParams.asMap());
inputOptionsBuilder.withHeader(KillBillHttpClient.HTTP_HEADER_ACCEPT, "application/json");
inputOptionsBuilder.withHeader(KillBillHttpClient.HTTP_HEADER_CONTENT_TYPE, "application/json");
final RequestOptions requestOptions = inputOptionsBuilder.build();
return httpClient.doPost(uri, body, Payment.class, requestOptions);
}
public void rebalanceExistingCBAOnAccount(final UUID accountId, final RequestOptions inputOptions) throws KillBillClientException {
Preconditions.checkNotNull(accountId, "Missing the required parameter 'accountId' when calling rebalanceExistingCBAOnAccount");
final String uri = "/1.0/kb/accounts/{accountId}/cbaRebalancing"
.replaceAll("\\{" + "accountId" + "\\}", accountId.toString());
final RequestOptionsBuilder inputOptionsBuilder = inputOptions.extend();
inputOptionsBuilder.withHeader(KillBillHttpClient.HTTP_HEADER_ACCEPT, "application/json");
inputOptionsBuilder.withHeader(KillBillHttpClient.HTTP_HEADER_CONTENT_TYPE, "application/json");
final RequestOptions requestOptions = inputOptionsBuilder.build();
httpClient.doPut(uri, null, requestOptions);
}
public void refreshPaymentMethods(final UUID accountId, final String pluginName, final Map pluginProperty, final RequestOptions inputOptions) throws KillBillClientException {
Preconditions.checkNotNull(accountId, "Missing the required parameter 'accountId' when calling refreshPaymentMethods");
final String uri = "/1.0/kb/accounts/{accountId}/paymentMethods/refresh"
.replaceAll("\\{" + "accountId" + "\\}", accountId.toString());
final Multimap queryParams = new TreeMapSetMultimap<>(inputOptions.getQueryParams());
if (pluginName != null) {
queryParams.put("pluginName", String.valueOf(pluginName));
}
if (pluginProperty != null) {
queryParams.putAll("pluginProperty", Converter.convertPluginPropertyMap(pluginProperty));
}
final RequestOptionsBuilder inputOptionsBuilder = inputOptions.extend();
inputOptionsBuilder.withQueryParams(queryParams.asMap());
inputOptionsBuilder.withHeader(KillBillHttpClient.HTTP_HEADER_ACCEPT, "application/json");
final RequestOptions requestOptions = inputOptionsBuilder.build();
httpClient.doPut(uri, null, requestOptions);
}
public void removeEmail(final UUID accountId, final String email, final RequestOptions inputOptions) throws KillBillClientException {
Preconditions.checkNotNull(accountId, "Missing the required parameter 'accountId' when calling removeEmail");
Preconditions.checkNotNull(email, "Missing the required parameter 'email' when calling removeEmail");
final String uri = "/1.0/kb/accounts/{accountId}/emails/{email}"
.replaceAll("\\{" + "accountId" + "\\}", accountId.toString())
.replaceAll("\\{" + "email" + "\\}", email.toString());
final RequestOptionsBuilder inputOptionsBuilder = inputOptions.extend();
inputOptionsBuilder.withHeader(KillBillHttpClient.HTTP_HEADER_ACCEPT, "application/json");
final RequestOptions requestOptions = inputOptionsBuilder.build();
httpClient.doDelete(uri, requestOptions);
}
public Accounts searchAccounts(final String searchKey, final RequestOptions inputOptions) throws KillBillClientException {
return searchAccounts(searchKey, Long.valueOf(0), Long.valueOf(100), Boolean.valueOf(false), Boolean.valueOf(false), AuditLevel.NONE, inputOptions);
}
public Accounts searchAccounts(final String searchKey, final Long offset, final Long limit, final Boolean accountWithBalance, final Boolean accountWithBalanceAndCBA, final AuditLevel audit, final RequestOptions inputOptions) throws KillBillClientException {
Preconditions.checkNotNull(searchKey, "Missing the required parameter 'searchKey' when calling searchAccounts");
final String uri = "/1.0/kb/accounts/search/{searchKey}"
.replaceAll("\\{" + "searchKey" + "\\}", searchKey.toString());
final Multimap queryParams = new TreeMapSetMultimap<>(inputOptions.getQueryParams());
if (offset != null) {
queryParams.put("offset", String.valueOf(offset));
}
if (limit != null) {
queryParams.put("limit", String.valueOf(limit));
}
if (accountWithBalance != null) {
queryParams.put("accountWithBalance", String.valueOf(accountWithBalance));
}
if (accountWithBalanceAndCBA != null) {
queryParams.put("accountWithBalanceAndCBA", String.valueOf(accountWithBalanceAndCBA));
}
if (audit != null) {
queryParams.put("audit", String.valueOf(audit));
}
final RequestOptionsBuilder inputOptionsBuilder = inputOptions.extend();
inputOptionsBuilder.withQueryParams(queryParams.asMap());
inputOptionsBuilder.withHeader(KillBillHttpClient.HTTP_HEADER_ACCEPT, "application/json");
final RequestOptions requestOptions = inputOptionsBuilder.build();
return httpClient.doGet(uri, Accounts.class, requestOptions);
}
public void setDefaultPaymentMethod(final UUID accountId, final UUID paymentMethodId, final Map pluginProperty, final RequestOptions inputOptions) throws KillBillClientException {
setDefaultPaymentMethod(accountId, paymentMethodId, Boolean.valueOf(false), pluginProperty, inputOptions);
}
public void setDefaultPaymentMethod(final UUID accountId, final UUID paymentMethodId, final Boolean payAllUnpaidInvoices, final Map pluginProperty, final RequestOptions inputOptions) throws KillBillClientException {
Preconditions.checkNotNull(accountId, "Missing the required parameter 'accountId' when calling setDefaultPaymentMethod");
Preconditions.checkNotNull(paymentMethodId, "Missing the required parameter 'paymentMethodId' when calling setDefaultPaymentMethod");
final String uri = "/1.0/kb/accounts/{accountId}/paymentMethods/{paymentMethodId}/setDefault"
.replaceAll("\\{" + "accountId" + "\\}", accountId.toString())
.replaceAll("\\{" + "paymentMethodId" + "\\}", paymentMethodId.toString());
final Multimap queryParams = new TreeMapSetMultimap<>(inputOptions.getQueryParams());
if (payAllUnpaidInvoices != null) {
queryParams.put("payAllUnpaidInvoices", String.valueOf(payAllUnpaidInvoices));
}
if (pluginProperty != null) {
queryParams.putAll("pluginProperty", Converter.convertPluginPropertyMap(pluginProperty));
}
final RequestOptionsBuilder inputOptionsBuilder = inputOptions.extend();
inputOptionsBuilder.withQueryParams(queryParams.asMap());
inputOptionsBuilder.withHeader(KillBillHttpClient.HTTP_HEADER_ACCEPT, "application/json");
inputOptionsBuilder.withHeader(KillBillHttpClient.HTTP_HEADER_CONTENT_TYPE, "application/json");
final RequestOptions requestOptions = inputOptionsBuilder.build();
httpClient.doPut(uri, null, requestOptions);
}
public void transferChildCreditToParent(final UUID childAccountId, final RequestOptions inputOptions) throws KillBillClientException {
Preconditions.checkNotNull(childAccountId, "Missing the required parameter 'childAccountId' when calling transferChildCreditToParent");
final String uri = "/1.0/kb/accounts/{childAccountId}/transferCredit"
.replaceAll("\\{" + "childAccountId" + "\\}", childAccountId.toString());
final RequestOptionsBuilder inputOptionsBuilder = inputOptions.extend();
inputOptionsBuilder.withHeader(KillBillHttpClient.HTTP_HEADER_ACCEPT, "application/json");
inputOptionsBuilder.withHeader(KillBillHttpClient.HTTP_HEADER_CONTENT_TYPE, "application/json");
final RequestOptions requestOptions = inputOptionsBuilder.build();
httpClient.doPut(uri, null, requestOptions);
}
public void updateAccount(final UUID accountId, final Account body, final RequestOptions inputOptions) throws KillBillClientException {
updateAccount(accountId, body, Boolean.valueOf(false), inputOptions);
}
public void updateAccount(final UUID accountId, final Account body, final Boolean treatNullAsReset, final RequestOptions inputOptions) throws KillBillClientException {
Preconditions.checkNotNull(accountId, "Missing the required parameter 'accountId' when calling updateAccount");
Preconditions.checkNotNull(body, "Missing the required parameter 'body' when calling updateAccount");
final String uri = "/1.0/kb/accounts/{accountId}"
.replaceAll("\\{" + "accountId" + "\\}", accountId.toString());
final Multimap queryParams = new TreeMapSetMultimap<>(inputOptions.getQueryParams());
if (treatNullAsReset != null) {
queryParams.put("treatNullAsReset", String.valueOf(treatNullAsReset));
}
final RequestOptionsBuilder inputOptionsBuilder = inputOptions.extend();
inputOptionsBuilder.withQueryParams(queryParams.asMap());
inputOptionsBuilder.withHeader(KillBillHttpClient.HTTP_HEADER_ACCEPT, "application/json");
inputOptionsBuilder.withHeader(KillBillHttpClient.HTTP_HEADER_CONTENT_TYPE, "application/json");
final RequestOptions requestOptions = inputOptionsBuilder.build();
httpClient.doPut(uri, body, requestOptions);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy