Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance. Project price only 1 $
You can buy this project and download/modify it how often you want.
/*
* Quickstart API Reference
* Zuora Quickstart API is the API that helps you achieve fundamental use cases.
* It provides a much simplified object model and improved performance, enabling developers to easily learn and use.
*/
package org.openapitools.client.api;
import org.openapitools.client.ApiCallback;
import org.openapitools.client.ApiClient;
import org.openapitools.client.ApiException;
import org.openapitools.client.model.Headers;
import org.openapitools.client.model.ListQueryParams;
import org.openapitools.client.model.GetByIdQueryParams;
import org.openapitools.client.ApiResponse;
import org.openapitools.client.Configuration;
import org.openapitools.client.Pair;
import org.openapitools.client.ProgressRequestBody;
import org.openapitools.client.ProgressResponseBody;
import com.google.gson.reflect.TypeToken;
import java.io.IOException;
import org.openapitools.client.model.Account;
import org.openapitools.client.model.AccountCreateRequest;
import org.openapitools.client.model.AccountPatchRequest;
import org.openapitools.client.model.AccountPreviewRequest;
import org.openapitools.client.model.AccountPreviewResponse;
import java.math.BigDecimal;
import org.openapitools.client.model.ErrorResponse;
import org.openapitools.client.model.GenerateBillingDocumentsAccountRequest;
import org.openapitools.client.model.GenerateBillingDocumentsAccountResponse;
import org.openapitools.client.model.ListAccountResponse;
import org.openapitools.client.model.ErrorResponse;
import java.lang.reflect.Type;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
public class AccountsApi {
private ApiClient localVarApiClient;
private int localHostIndex;
private String localCustomBaseUrl;
public AccountsApi() {
this(Configuration.getDefaultApiClient());
}
public AccountsApi(ApiClient apiClient) {
this.localVarApiClient = apiClient;
}
public ApiClient getApiClient() {
return localVarApiClient;
}
public void setApiClient(ApiClient apiClient) {
this.localVarApiClient = apiClient;
}
public int getHostIndex() {
return localHostIndex;
}
public void setHostIndex(int hostIndex) {
this.localHostIndex = hostIndex;
}
public String getCustomBaseUrl() {
return localCustomBaseUrl;
}
public void setCustomBaseUrl(String customBaseUrl) {
this.localCustomBaseUrl = customBaseUrl;
}
private okhttp3.Call createAccountCall(AccountCreateRequest accountCreateRequest, List fields, List accountFields, List subscriptionsFields, List subscriptionPlansFields, List subscriptionItemsFields, List invoiceOwnerAccountFields, List planFields, List paymentMethodsFields, List paymentsFields, List billingDocumentsFields, List billingDocumentItemsFields, List billToFields, List soldToFields, List defaultPaymentMethodFields, List usageRecordsFields, List invoicesFields, List creditMemosFields, List debitMemosFields, List prepaidBalanceFields, List transactionsFields, List expand, List filter, Integer pageSize, String zuoraTrackId, Boolean async, Boolean zuoraCacheEnabled, String zuoraEntityIds, String idempotencyKey, String acceptEncoding, String contentEncoding, String zuoraOrgIds, final ApiCallback _callback) throws ApiException {
String basePath = null;
// Operation Servers
String[] localBasePaths = new String[] { };
// Determine Base Path to Use
if (localCustomBaseUrl != null){
basePath = localCustomBaseUrl;
} else if ( localBasePaths.length > 0 ) {
basePath = localBasePaths[localHostIndex];
} else {
basePath = null;
}
Object localVarPostBody = accountCreateRequest;
// create path and map variables
String localVarPath = "/accounts";
List localVarQueryParams = new ArrayList();
List localVarCollectionQueryParams = new ArrayList();
Map localVarHeaderParams = new HashMap();
Map localVarCookieParams = new HashMap();
Map localVarFormParams = new HashMap();
if (fields != null) {
localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "fields[]", fields));
}
if (accountFields != null) {
localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "account.fields[]", accountFields));
}
if (subscriptionsFields != null) {
localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "subscriptions.fields[]", subscriptionsFields));
}
if (subscriptionPlansFields != null) {
localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "subscription_plans.fields[]", subscriptionPlansFields));
}
if (subscriptionItemsFields != null) {
localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "subscription_items.fields[]", subscriptionItemsFields));
}
if (invoiceOwnerAccountFields != null) {
localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "invoice_owner_account.fields[]", invoiceOwnerAccountFields));
}
if (planFields != null) {
localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "plan.fields[]", planFields));
}
if (paymentMethodsFields != null) {
localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "payment_methods.fields[]", paymentMethodsFields));
}
if (paymentsFields != null) {
localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "payments.fields[]", paymentsFields));
}
if (billingDocumentsFields != null) {
localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "billing_documents.fields[]", billingDocumentsFields));
}
if (billingDocumentItemsFields != null) {
localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "billing_document_items.fields[]", billingDocumentItemsFields));
}
if (billToFields != null) {
localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "bill_to.fields[]", billToFields));
}
if (soldToFields != null) {
localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "sold_to.fields[]", soldToFields));
}
if (defaultPaymentMethodFields != null) {
localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "default_payment_method.fields[]", defaultPaymentMethodFields));
}
if (usageRecordsFields != null) {
localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "usage_records.fields[]", usageRecordsFields));
}
if (invoicesFields != null) {
localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "invoices.fields[]", invoicesFields));
}
if (creditMemosFields != null) {
localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "credit_memos.fields[]", creditMemosFields));
}
if (debitMemosFields != null) {
localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "debit_memos.fields[]", debitMemosFields));
}
if (prepaidBalanceFields != null) {
localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "prepaid_balance.fields[]", prepaidBalanceFields));
}
if (transactionsFields != null) {
localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "transactions.fields[]", transactionsFields));
}
if (expand != null) {
localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "expand[]", expand));
}
if (filter != null) {
localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "filter[]", filter));
}
if (pageSize != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("page_size", pageSize));
}
if (zuoraTrackId != null) {
localVarHeaderParams.put("zuora-track-id", localVarApiClient.parameterToString(zuoraTrackId));
}
if (async != null) {
localVarHeaderParams.put("async", localVarApiClient.parameterToString(async));
}
if (zuoraCacheEnabled != null) {
localVarHeaderParams.put("zuora-cache-enabled", localVarApiClient.parameterToString(zuoraCacheEnabled));
}
if (zuoraEntityIds != null) {
localVarHeaderParams.put("zuora-entity-ids", localVarApiClient.parameterToString(zuoraEntityIds));
}
if (idempotencyKey != null) {
localVarHeaderParams.put("idempotency-key", localVarApiClient.parameterToString(idempotencyKey));
}
if (acceptEncoding != null) {
localVarHeaderParams.put("accept-encoding", localVarApiClient.parameterToString(acceptEncoding));
}
if (contentEncoding != null) {
localVarHeaderParams.put("content-encoding", localVarApiClient.parameterToString(contentEncoding));
}
if (zuoraOrgIds != null) {
localVarHeaderParams.put("zuora-org-ids", localVarApiClient.parameterToString(zuoraOrgIds));
}
final String[] localVarAccepts = {
"application/json"
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
localVarHeaderParams.put("Accept", localVarAccept);
}
final String[] localVarContentTypes = {
"application/json"
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarContentType != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
String[] localVarAuthNames = new String[] { "bearerAuth" };
return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call createAccountValidateBeforeCall(AccountCreateRequest accountCreateRequest, List fields, List accountFields, List subscriptionsFields, List subscriptionPlansFields, List subscriptionItemsFields, List invoiceOwnerAccountFields, List planFields, List paymentMethodsFields, List paymentsFields, List billingDocumentsFields, List billingDocumentItemsFields, List billToFields, List soldToFields, List defaultPaymentMethodFields, List usageRecordsFields, List invoicesFields, List creditMemosFields, List debitMemosFields, List prepaidBalanceFields, List transactionsFields, List expand, List filter, Integer pageSize, String zuoraTrackId, Boolean async, Boolean zuoraCacheEnabled, String zuoraEntityIds, String idempotencyKey, String acceptEncoding, String contentEncoding, String zuoraOrgIds, final ApiCallback _callback) throws ApiException {
// verify the required parameter 'accountCreateRequest' is set
if (accountCreateRequest == null) {
throw new ApiException("Missing the required parameter 'accountCreateRequest' when calling createAccount(Async)");
}
return createAccountCall(accountCreateRequest, fields, accountFields, subscriptionsFields, subscriptionPlansFields, subscriptionItemsFields, invoiceOwnerAccountFields, planFields, paymentMethodsFields, paymentsFields, billingDocumentsFields, billingDocumentItemsFields, billToFields, soldToFields, defaultPaymentMethodFields, usageRecordsFields, invoicesFields, creditMemosFields, debitMemosFields, prepaidBalanceFields, transactionsFields, expand, filter, pageSize, zuoraTrackId, async, zuoraCacheEnabled, zuoraEntityIds, idempotencyKey, acceptEncoding, contentEncoding, zuoraOrgIds, _callback);
}
private ApiResponse createAccountWithHttpInfo(AccountCreateRequest accountCreateRequest, List fields, List accountFields, List subscriptionsFields, List subscriptionPlansFields, List subscriptionItemsFields, List invoiceOwnerAccountFields, List planFields, List paymentMethodsFields, List paymentsFields, List billingDocumentsFields, List billingDocumentItemsFields, List billToFields, List soldToFields, List defaultPaymentMethodFields, List usageRecordsFields, List invoicesFields, List creditMemosFields, List debitMemosFields, List prepaidBalanceFields, List transactionsFields, List expand, List filter, Integer pageSize, String zuoraTrackId, Boolean async, Boolean zuoraCacheEnabled, String zuoraEntityIds, String idempotencyKey, String acceptEncoding, String contentEncoding, String zuoraOrgIds) throws ApiException {
okhttp3.Call localVarCall = createAccountValidateBeforeCall(accountCreateRequest, fields, accountFields, subscriptionsFields, subscriptionPlansFields, subscriptionItemsFields, invoiceOwnerAccountFields, planFields, paymentMethodsFields, paymentsFields, billingDocumentsFields, billingDocumentItemsFields, billToFields, soldToFields, defaultPaymentMethodFields, usageRecordsFields, invoicesFields, creditMemosFields, debitMemosFields, prepaidBalanceFields, transactionsFields, expand, filter, pageSize, zuoraTrackId, async, zuoraCacheEnabled, zuoraEntityIds, idempotencyKey, acceptEncoding, contentEncoding, zuoraOrgIds, null);
try {
Type localVarReturnType = new TypeToken(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
} catch (ApiException e) {
e.setErrorObject(localVarApiClient.getJSON().getGson().fromJson(e.getResponseBody(), new TypeToken(){}.getType()));
throw e;
}
}
private okhttp3.Call createAccountAsync(AccountCreateRequest accountCreateRequest, List fields, List accountFields, List subscriptionsFields, List subscriptionPlansFields, List subscriptionItemsFields, List invoiceOwnerAccountFields, List planFields, List paymentMethodsFields, List paymentsFields, List billingDocumentsFields, List billingDocumentItemsFields, List billToFields, List soldToFields, List defaultPaymentMethodFields, List usageRecordsFields, List invoicesFields, List creditMemosFields, List debitMemosFields, List prepaidBalanceFields, List transactionsFields, List expand, List filter, Integer pageSize, String zuoraTrackId, Boolean async, Boolean zuoraCacheEnabled, String zuoraEntityIds, String idempotencyKey, String acceptEncoding, String contentEncoding, String zuoraOrgIds, final ApiCallback _callback) throws ApiException {
okhttp3.Call localVarCall = createAccountValidateBeforeCall(accountCreateRequest, fields, accountFields, subscriptionsFields, subscriptionPlansFields, subscriptionItemsFields, invoiceOwnerAccountFields, planFields, paymentMethodsFields, paymentsFields, billingDocumentsFields, billingDocumentItemsFields, billToFields, soldToFields, defaultPaymentMethodFields, usageRecordsFields, invoicesFields, creditMemosFields, debitMemosFields, prepaidBalanceFields, transactionsFields, expand, filter, pageSize, zuoraTrackId, async, zuoraCacheEnabled, zuoraEntityIds, idempotencyKey, acceptEncoding, contentEncoding, zuoraOrgIds, _callback);
Type localVarReturnType = new TypeToken(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
public static class CreateAccountParams {
private final AccountCreateRequest accountCreateRequest;
private Headers headers;
/*
* Check for list params
*/
private GetByIdQueryParams getByIdQueryParams;
private List fields;
private List accountFields;
private List subscriptionsFields;
private List subscriptionPlansFields;
private List subscriptionItemsFields;
private List invoiceOwnerAccountFields;
private List planFields;
private List paymentMethodsFields;
private List paymentsFields;
private List billingDocumentsFields;
private List billingDocumentItemsFields;
private List billToFields;
private List soldToFields;
private List defaultPaymentMethodFields;
private List usageRecordsFields;
private List invoicesFields;
private List creditMemosFields;
private List debitMemosFields;
private List prepaidBalanceFields;
private List transactionsFields;
private List expand;
private List filter;
private Integer pageSize;
private String zuoraTrackId;
private Boolean async;
private Boolean zuoraCacheEnabled;
private String zuoraEntityIds;
private String idempotencyKey;
private String acceptEncoding;
private String contentEncoding;
private String zuoraOrgIds;
public CreateAccountParams(AccountCreateRequest accountCreateRequest) {
this.accountCreateRequest = accountCreateRequest;
}
/**
* Set getByIdQueryParams
* @param getByIdQueryParams GetByIdQueryParams
* @return CreateAccountParams
*/
public CreateAccountParams getByIdQueryParams(GetByIdQueryParams getByIdQueryParams) {
this.getByIdQueryParams = getByIdQueryParams;
if (expand != null) {
this.expand = getByIdQueryParams.getExpand();
}
if (filter != null) {
this.filter = getByIdQueryParams.getFilter();
}
if (pageSize != null) {
this.pageSize = getByIdQueryParams.getPageSize();
}
return this;
}
/**
* Set headers
* @param headers Headers
* @return CreateAccountParams
*/
public CreateAccountParams headers(Headers headers) {
this.headers = headers;
if (headers.getZuoraTrackId() != null) {
this.zuoraTrackId = headers.getZuoraTrackId();
}
if (headers.getAsync() != null) {
this.async = headers.getAsync();
}
if (headers.getZuoraCacheEnabled() != null) {
this.zuoraCacheEnabled = headers.getZuoraCacheEnabled();
}
if (headers.getZuoraEntityIds() != null) {
this.zuoraEntityIds = headers.getZuoraEntityIds();
}
if (headers.getIdempotencyKey() != null) {
this.idempotencyKey = headers.getIdempotencyKey();
}
if (headers.getAcceptEncoding() != null) {
this.acceptEncoding = headers.getAcceptEncoding();
}
if (headers.getContentEncoding() != null) {
this.contentEncoding = headers.getContentEncoding();
}
if (headers.getZuoraOrgIds() != null) {
this.zuoraOrgIds = headers.getZuoraOrgIds();
}
return this;
}
/**
* Set fields
* @param fields Allows you to specify which fields are returned in the response. <details> <summary> Accepted values </summary> `custom_fields`, `created_by_id`, `updated_by_id`, `created_time`, `id`, `updated_time`, `auto_pay`, `account_number`, `bill_to_id`, `sold_to_id`, `billing_document_settings`, `communication_profile_id`, `crm_id`, `sales_rep`, `parent_account_id`, `payment_gateway`, `payment_terms`, `remaining_credit_memo_balance`, `remaining_debit_memo_balance`, `remaining_invoice_balance`, `remaining_payment_balance`, `sequence_set_id`, `tax_certificate`, `batch`, `tax_identifier`, `bill_cycle_day`, `description`, `name`, `currency`, `default_payment_method_id`, `enabled`, `organization_id` </details> (optional)
* @return CreateAccountParams
*/
public CreateAccountParams fields(List fields) {
this.fields = fields;
return this;
}
/**
* Set accountFields
* @param accountFields Allows you to specify which fields are returned in the response. <details> <summary> Accepted values </summary> `custom_fields`, `created_by_id`, `updated_by_id`, `created_time`, `id`, `updated_time`, `auto_pay`, `account_number`, `bill_to_id`, `sold_to_id`, `billing_document_settings`, `communication_profile_id`, `crm_id`, `sales_rep`, `parent_account_id`, `payment_gateway`, `payment_terms`, `remaining_credit_memo_balance`, `remaining_debit_memo_balance`, `remaining_invoice_balance`, `remaining_payment_balance`, `sequence_set_id`, `tax_certificate`, `batch`, `tax_identifier`, `bill_cycle_day`, `description`, `name`, `currency`, `default_payment_method_id`, `enabled`, `organization_id` </details> (optional)
* @return CreateAccountParams
*/
public CreateAccountParams accountFields(List accountFields) {
this.accountFields = accountFields;
return this;
}
/**
* Set subscriptionsFields
* @param subscriptionsFields Allows you to specify which fields are returned in the response. <details> <summary> Accepted values </summary> `custom_fields`, `created_by_id`, `updated_by_id`, `created_time`, `id`, `updated_time`, `subscription_number`, `state`, `account_id`, `invoice_owner_account_id`, `auto_renew`, `version`, `initial_term`, `current_term`, `renewal_term`, `start_date`, `end_date`, `description`, `contract_effective`, `service_activation`, `customer_acceptance`, `invoice_separately`, `latest_version`, `payment_terms`, `billing_document_settings`, `bill_to_id`, `sold_to_id`, `contracted_mrr`, `currency`, `cancel_reason`, `last_booking_date`, `order_number` </details> (optional)
* @return CreateAccountParams
*/
public CreateAccountParams subscriptionsFields(List subscriptionsFields) {
this.subscriptionsFields = subscriptionsFields;
return this;
}
/**
* Set subscriptionPlansFields
* @param subscriptionPlansFields Allows you to specify which fields are returned in the response. <details> <summary> Accepted values </summary> `custom_fields`, `created_by_id`, `updated_by_id`, `created_time`, `id`, `updated_time`, `name`, `plan_id`, `subscription_id`, `product_id`, `subscription_plan_number` </details> (optional)
* @return CreateAccountParams
*/
public CreateAccountParams subscriptionPlansFields(List subscriptionPlansFields) {
this.subscriptionPlansFields = subscriptionPlansFields;
return this;
}
/**
* Set subscriptionItemsFields
* @param subscriptionItemsFields Allows you to specify which fields are returned in the response. <details> <summary> Accepted values </summary> `custom_fields`, `created_by_id`, `updated_by_id`, `created_time`, `id`, `updated_time`, `start_date`, `end_date`, `charge_model`, `charge_type`, `tiers`, `subscription_item_number`, `name`, `description`, `charged_through_date`, `recurring`, `price_id`, `start_event`, `tax_code`, `tax_inclusive`, `unit_of_measure`, `quantity`, `price_base_interval`, `overage`, `subscription_plan_id`, `tiers_mode`, `processed_through_date`, `active`, `state`, `unit_amount`, `amount`, `discount_amount`, `discount_percent`, `price_change_percentage`, `price_change_option` </details> (optional)
* @return CreateAccountParams
*/
public CreateAccountParams subscriptionItemsFields(List subscriptionItemsFields) {
this.subscriptionItemsFields = subscriptionItemsFields;
return this;
}
/**
* Set invoiceOwnerAccountFields
* @param invoiceOwnerAccountFields Allows you to specify which fields are returned in the response. <details> <summary> Accepted values </summary> `custom_fields`, `created_by_id`, `updated_by_id`, `created_time`, `id`, `updated_time`, `auto_pay`, `account_number`, `bill_to_id`, `sold_to_id`, `billing_document_settings`, `communication_profile_id`, `crm_id`, `sales_rep`, `parent_account_id`, `payment_gateway`, `payment_terms`, `remaining_credit_memo_balance`, `remaining_debit_memo_balance`, `remaining_invoice_balance`, `remaining_payment_balance`, `sequence_set_id`, `tax_certificate`, `batch`, `tax_identifier`, `bill_cycle_day`, `description`, `name`, `currency`, `default_payment_method_id`, `enabled`, `organization_id` </details> (optional)
* @return CreateAccountParams
*/
public CreateAccountParams invoiceOwnerAccountFields(List invoiceOwnerAccountFields) {
this.invoiceOwnerAccountFields = invoiceOwnerAccountFields;
return this;
}
/**
* Set planFields
* @param planFields Allows you to specify which fields are returned in the response. <details> <summary> Accepted values </summary> `custom_fields`, `created_by_id`, `updated_by_id`, `created_time`, `id`, `updated_time`, `start_date`, `end_date`, `name`, `active`, `description`, `plan_number`, `product_id`, `active_currencies` </details> (optional)
* @return CreateAccountParams
*/
public CreateAccountParams planFields(List planFields) {
this.planFields = planFields;
return this;
}
/**
* Set paymentMethodsFields
* @param paymentMethodsFields Allows you to specify which fields are returned in the response. <details> <summary> Accepted values </summary> `custom_fields`, `created_by_id`, `updated_by_id`, `created_time`, `id`, `updated_time`, `type`, `account_id`, `bank_identification_number`, `device_session_id`, `ip_address`, `maximum_payment_attempts`, `payment_retry_interval`, `state`, `use_default_retry_rule`, `existing_mandate`, `last_failed_sale_transaction_time`, `last_transaction_time`, `last_transaction_status`, `number_of_consecutive_failures`, `total_number_of_processed_payments`, `total_number_of_error_payments`, `billing_details`, `card`, `apple_pay`, `google_pay`, `ach_debit`, `cc_ref`, `paypal_adaptive`, `paypal_express_native`, `paypal_express`, `sepa_debit`, `betalings_debit`, `autogiro_debit`, `bacs_debit`, `au_becs_debit`, `nz_becs_debit`, `pad_debit` </details> (optional)
* @return CreateAccountParams
*/
public CreateAccountParams paymentMethodsFields(List paymentMethodsFields) {
this.paymentMethodsFields = paymentMethodsFields;
return this;
}
/**
* Set paymentsFields
* @param paymentsFields Allows you to specify which fields are returned in the response. <details> <summary> Accepted values </summary> `custom_fields`, `created_by_id`, `updated_by_id`, `created_time`, `id`, `updated_time`, `payment_number`, `payment_date`, `gateway_id`, `payment_method_id`, `payout_id`, `reference_id`, `second_reference_id`, `statement_descriptor_phone`, `state`, `statement_descriptor`, `account_id`, `amount`, `amount_applied`, `amount_refunded`, `remaining_balance`, `currency`, `description`, `authorization_id`, `external`, `gateway_order_id`, `gateway_reconciliation_status`, `gateway_reconciliation_reason`, `gateway_response`, `gateway_response_code`, `gateway_state`, `state_transitions`, `gateway_state_transitions` </details> (optional)
* @return CreateAccountParams
*/
public CreateAccountParams paymentsFields(List paymentsFields) {
this.paymentsFields = paymentsFields;
return this;
}
/**
* Set billingDocumentsFields
* @param billingDocumentsFields Allows you to specify which fields are returned in the response. <details> <summary> Accepted values </summary> `custom_fields`, `created_by_id`, `updated_by_id`, `created_time`, `id`, `updated_time`, `account_id`, `balance`, `description`, `state`, `tax` </details> (optional)
* @return CreateAccountParams
*/
public CreateAccountParams billingDocumentsFields(List billingDocumentsFields) {
this.billingDocumentsFields = billingDocumentsFields;
return this;
}
/**
* Set billingDocumentItemsFields
* @param billingDocumentItemsFields Allows you to specify which fields are returned in the response. <details> <summary> Accepted values </summary> `custom_fields`, `created_by_id`, `updated_by_id`, `created_time`, `id`, `updated_time`, `price_id`, `discount_item`, `deferred_revenue_account`, `description`, `name`, `quantity`, `recognized_revenue_account`, `service_end`, `service_start`, `accounts_receivable_account`, `subscription_id`, `subscription_item_id`, `tax`, `tax_inclusive`, `unit_amount` </details> (optional)
* @return CreateAccountParams
*/
public CreateAccountParams billingDocumentItemsFields(List billingDocumentItemsFields) {
this.billingDocumentItemsFields = billingDocumentItemsFields;
return this;
}
/**
* Set billToFields
* @param billToFields Allows you to specify which fields are returned in the response. <details> <summary> Accepted values </summary> `custom_fields`, `created_by_id`, `updated_by_id`, `created_time`, `id`, `updated_time`, `account_id`, `address`, `home_phone`, `first_name`, `last_name`, `email`, `work_email`, `nickname`, `other_phone`, `work_phone`, `mobile_phone`, `tax_region`, `other_phone_type`, `fax` </details> (optional)
* @return CreateAccountParams
*/
public CreateAccountParams billToFields(List billToFields) {
this.billToFields = billToFields;
return this;
}
/**
* Set soldToFields
* @param soldToFields Allows you to specify which fields are returned in the response. <details> <summary> Accepted values </summary> `custom_fields`, `created_by_id`, `updated_by_id`, `created_time`, `id`, `updated_time`, `account_id`, `address`, `home_phone`, `first_name`, `last_name`, `email`, `work_email`, `nickname`, `other_phone`, `work_phone`, `mobile_phone`, `tax_region`, `other_phone_type`, `fax` </details> (optional)
* @return CreateAccountParams
*/
public CreateAccountParams soldToFields(List soldToFields) {
this.soldToFields = soldToFields;
return this;
}
/**
* Set defaultPaymentMethodFields
* @param defaultPaymentMethodFields Allows you to specify which fields are returned in the response. <details> <summary> Accepted values </summary> `custom_fields`, `created_by_id`, `updated_by_id`, `created_time`, `id`, `updated_time`, `type`, `account_id`, `bank_identification_number`, `device_session_id`, `ip_address`, `maximum_payment_attempts`, `payment_retry_interval`, `state`, `use_default_retry_rule`, `existing_mandate`, `last_failed_sale_transaction_time`, `last_transaction_time`, `last_transaction_status`, `number_of_consecutive_failures`, `total_number_of_processed_payments`, `total_number_of_error_payments`, `billing_details`, `card`, `apple_pay`, `google_pay`, `ach_debit`, `cc_ref`, `paypal_adaptive`, `paypal_express_native`, `paypal_express`, `sepa_debit`, `betalings_debit`, `autogiro_debit`, `bacs_debit`, `au_becs_debit`, `nz_becs_debit`, `pad_debit` </details> (optional)
* @return CreateAccountParams
*/
public CreateAccountParams defaultPaymentMethodFields(List defaultPaymentMethodFields) {
this.defaultPaymentMethodFields = defaultPaymentMethodFields;
return this;
}
/**
* Set usageRecordsFields
* @param usageRecordsFields Allows you to specify which fields are returned in the response. <details> <summary> Accepted values </summary> `custom_fields`, `created_by_id`, `updated_by_id`, `created_time`, `id`, `updated_time`, `account_id`, `account_number`, `subscription_item_id`, `subscription_item_number`, `subscription_id`, `subscription_number`, `unit_of_measure`, `description`, `end_time`, `state`, `start_time`, `quantity` </details> (optional)
* @return CreateAccountParams
*/
public CreateAccountParams usageRecordsFields(List usageRecordsFields) {
this.usageRecordsFields = usageRecordsFields;
return this;
}
/**
* Set invoicesFields
* @param invoicesFields Allows you to specify which fields are returned in the response. <details> <summary> Accepted values </summary> `custom_fields`, `created_by_id`, `updated_by_id`, `created_time`, `id`, `updated_time`, `state`, `balance`, `due_date`, `invoice_number`, `posted_by_id`, `state_transitions`, `description`, `account_id`, `total`, `subtotal`, `tax`, `paid`, `past_due`, `document_date`, `amount_paid`, `amount_refunded`, `payment_terms`, `bill_to_id`, `sold_to_id`, `billing_document_settings`, `currency` </details> (optional)
* @return CreateAccountParams
*/
public CreateAccountParams invoicesFields(List invoicesFields) {
this.invoicesFields = invoicesFields;
return this;
}
/**
* Set creditMemosFields
* @param creditMemosFields Allows you to specify which fields are returned in the response. <details> <summary> Accepted values </summary> `custom_fields`, `created_by_id`, `updated_by_id`, `created_time`, `id`, `updated_time`, `credit_memo_number`, `state_transitions`, `description`, `account_id`, `total`, `subtotal`, `tax`, `document_date`, `exclude_from_auto_apply_rules`, `posted_by_id`, `state`, `balance`, `invoice_id`, `reason_code`, `amount_refunded`, `bill_to_id`, `billing_document_settings`, `currency` </details> (optional)
* @return CreateAccountParams
*/
public CreateAccountParams creditMemosFields(List creditMemosFields) {
this.creditMemosFields = creditMemosFields;
return this;
}
/**
* Set debitMemosFields
* @param debitMemosFields Allows you to specify which fields are returned in the response. <details> <summary> Accepted values </summary> `custom_fields`, `created_by_id`, `updated_by_id`, `created_time`, `id`, `updated_time`, `balance`, `due_date`, `debit_memo_number`, `state_transitions`, `description`, `account_id`, `total`, `subtotal`, `tax`, `document_date`, `posted_by_id`, `state`, `reason_code`, `paid`, `past_due`, `billing_document_settings`, `payment_terms`, `bill_to_id`, `invoice_id`, `currency` </details> (optional)
* @return CreateAccountParams
*/
public CreateAccountParams debitMemosFields(List debitMemosFields) {
this.debitMemosFields = debitMemosFields;
return this;
}
/**
* Set prepaidBalanceFields
* @param prepaidBalanceFields Allows you to specify which fields are returned in the response. <details> <summary> Accepted values </summary> `prepaid_UOM`, `start_date`, `end_date`, `total_balance`, `remaining_balance` </details> (optional)
* @return CreateAccountParams
*/
public CreateAccountParams prepaidBalanceFields(List prepaidBalanceFields) {
this.prepaidBalanceFields = prepaidBalanceFields;
return this;
}
/**
* Set transactionsFields
* @param transactionsFields Allows you to specify which fields are returned in the response. <details> <summary> Accepted values </summary> `transaction_date`, `type`, `quantity` </details> (optional)
* @return CreateAccountParams
*/
public CreateAccountParams transactionsFields(List transactionsFields) {
this.transactionsFields = transactionsFields;
return this;
}
/**
* Set expand
* @param expand Allows you to expand responses by including related object information in a single call. See the [Expand responses](https://developer.zuora.com/quickstart-api/tutorial/expand-responses/) section of the Quickstart API Tutorials for detailed instructions. (optional)
* @return CreateAccountParams
*/
public CreateAccountParams expand(List expand) {
this.expand = expand;
return this;
}
/**
* Set filter
* @param filter A case-sensitive filter on the list. See the [Filter lists](https://developer.zuora.com/quickstart-api/tutorial/filter-lists/) section of the Quickstart API Tutorial for detailed instructions. Note that the filters on this operation are only applicable to the related objects. For example, when you are calling the \"Retrieve a billing document\" operation, you can use the `filter[]` parameter on the related objects such as `filter[]=items[account_id].EQ:8ad09e208858b5cf0188595208151c63` (optional)
* @return CreateAccountParams
*/
public CreateAccountParams filter(List filter) {
this.filter = filter;
return this;
}
/**
* Set pageSize
* @param pageSize The maximum number of results to return in a single page. If the specified `page_size` is less than 1 or greater than 99, Zuora will return a 400 error. (optional)
* @return CreateAccountParams
*/
public CreateAccountParams pageSize(Integer pageSize) {
this.pageSize = pageSize;
return this;
}
}
/**
* Create an account
* Creates a new account object.
* @param accountCreateRequest (required)
* @return Account
* @http.response.details
Status Code
Description
Response Headers
201
Default Response
* ratelimit-limit - The request limit quota for the time window closest to exhaustion. See [rate limits](https://developer.zuora.com/rest-api/general-concepts/rate-concurrency-limits/#rate-limits) for more information. * ratelimit-remaining - The number of requests remaining in the time window closest to quota exhaustion. See [rate limits](https://developer.zuora.com/rest-api/general-concepts/rate-concurrency-limits/#rate-limits) for more information. * ratelimit-reset - The number of seconds until the quota resets for the time window closest to quota exhaustion. See [rate limits](https://developer.zuora.com/rest-api/general-concepts/rate-concurrency-limits/#rate-limits) for more information. * zuora-request-id - Zuora’s internal identifier for this request. * zuora-track-id - A user-supplied identifier for this request. If you supply a `zuora-track-id` as a request header, Zuora returns the `zuora-track-id` as a response header.
400
Bad Request
-
401
Unauthorized
-
404
Not Found
-
405
Method Not Allowed
-
429
Too Many Requests
-
500
Internal Server Error
-
502
Bad Gateway
-
503
Service Unavailable
-
504
Gateway Timeout
-
*/
public CreateAccountParams createAccountParams(AccountCreateRequest accountCreateRequest) {
return new CreateAccountParams(accountCreateRequest);
}
public Account createAccount(AccountCreateRequest accountCreateRequest) throws ApiException {
CreateAccountParams params = new CreateAccountParams(accountCreateRequest);
return executeCreateAccountAPICall(params).getData();
}
/**
* Expose HTTP info
public ApiResponse createAccountWithHttpInfo(AccountCreateRequest accountCreateRequest) throws ApiException {
CreateAccountParams params = new CreateAccountParams(accountCreateRequest);
return executeCreateAccountAPICall(params);
}
**/
/**
Legacy Query Params Requests
**/
public Account createAccount( AccountCreateRequest accountCreateRequest , List expand) throws ApiException {
CreateAccountParams params = new CreateAccountParams(accountCreateRequest);
params.expand(expand);
return executeCreateAccountAPICall(params).getData();
}
/*
* add header methods
*/
public Account createAccount(AccountCreateRequest accountCreateRequest ,List expand,Headers headers) throws ApiException {
CreateAccountParams params = new CreateAccountParams(accountCreateRequest)
.expand(expand)
.headers(headers);
return executeCreateAccountAPICall(params).getData();
}
/**
* Create an account
* Creates a new account object.
* @param params CreateAccountParams
* @return Account
* @http.response.details
Status Code
Description
Response Headers
201
Default Response
* ratelimit-limit - The request limit quota for the time window closest to exhaustion. See [rate limits](https://developer.zuora.com/rest-api/general-concepts/rate-concurrency-limits/#rate-limits) for more information. * ratelimit-remaining - The number of requests remaining in the time window closest to quota exhaustion. See [rate limits](https://developer.zuora.com/rest-api/general-concepts/rate-concurrency-limits/#rate-limits) for more information. * ratelimit-reset - The number of seconds until the quota resets for the time window closest to quota exhaustion. See [rate limits](https://developer.zuora.com/rest-api/general-concepts/rate-concurrency-limits/#rate-limits) for more information. * zuora-request-id - Zuora’s internal identifier for this request. * zuora-track-id - A user-supplied identifier for this request. If you supply a `zuora-track-id` as a request header, Zuora returns the `zuora-track-id` as a response header.
400
Bad Request
-
401
Unauthorized
-
404
Not Found
-
405
Method Not Allowed
-
429
Too Many Requests
-
500
Internal Server Error
-
502
Bad Gateway
-
503
Service Unavailable
-
504
Gateway Timeout
-
*/
public Account create(CreateAccountParams params) throws ApiException {
return executeCreateAccountAPICall(params).getData();
}
public ApiResponse createWithHttpInfo(CreateAccountParams params) throws ApiException {
return executeCreateAccountAPICall(params);
}
ApiResponse executeCreateAccountAPICall(CreateAccountParams params) throws ApiException {
return createAccountWithHttpInfo(params.accountCreateRequest, params.fields, params.accountFields, params.subscriptionsFields, params.subscriptionPlansFields, params.subscriptionItemsFields, params.invoiceOwnerAccountFields, params.planFields, params.paymentMethodsFields, params.paymentsFields, params.billingDocumentsFields, params.billingDocumentItemsFields, params.billToFields, params.soldToFields, params.defaultPaymentMethodFields, params.usageRecordsFields, params.invoicesFields, params.creditMemosFields, params.debitMemosFields, params.prepaidBalanceFields, params.transactionsFields, params.expand, params.filter, params.pageSize, params.zuoraTrackId, params.async, params.zuoraCacheEnabled, params.zuoraEntityIds, params.idempotencyKey, params.acceptEncoding, params.contentEncoding, params.zuoraOrgIds);
}
private okhttp3.Call deleteAccountCall(String accountId, String zuoraTrackId, Boolean async, Boolean zuoraCacheEnabled, String zuoraEntityIds, String idempotencyKey, String acceptEncoding, String contentEncoding, String zuoraOrgIds, final ApiCallback _callback) throws ApiException {
String basePath = null;
// Operation Servers
String[] localBasePaths = new String[] { };
// Determine Base Path to Use
if (localCustomBaseUrl != null){
basePath = localCustomBaseUrl;
} else if ( localBasePaths.length > 0 ) {
basePath = localBasePaths[localHostIndex];
} else {
basePath = null;
}
Object localVarPostBody = null;
// create path and map variables
String localVarPath = "/accounts/{account_id}"
.replace("{" + "account_id" + "}", localVarApiClient.escapeString(accountId.toString()));
List localVarQueryParams = new ArrayList();
List localVarCollectionQueryParams = new ArrayList();
Map localVarHeaderParams = new HashMap();
Map localVarCookieParams = new HashMap();
Map localVarFormParams = new HashMap();
if (zuoraTrackId != null) {
localVarHeaderParams.put("zuora-track-id", localVarApiClient.parameterToString(zuoraTrackId));
}
if (async != null) {
localVarHeaderParams.put("async", localVarApiClient.parameterToString(async));
}
if (zuoraCacheEnabled != null) {
localVarHeaderParams.put("zuora-cache-enabled", localVarApiClient.parameterToString(zuoraCacheEnabled));
}
if (zuoraEntityIds != null) {
localVarHeaderParams.put("zuora-entity-ids", localVarApiClient.parameterToString(zuoraEntityIds));
}
if (idempotencyKey != null) {
localVarHeaderParams.put("idempotency-key", localVarApiClient.parameterToString(idempotencyKey));
}
if (acceptEncoding != null) {
localVarHeaderParams.put("accept-encoding", localVarApiClient.parameterToString(acceptEncoding));
}
if (contentEncoding != null) {
localVarHeaderParams.put("content-encoding", localVarApiClient.parameterToString(contentEncoding));
}
if (zuoraOrgIds != null) {
localVarHeaderParams.put("zuora-org-ids", localVarApiClient.parameterToString(zuoraOrgIds));
}
final String[] localVarAccepts = {
"application/json"
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
localVarHeaderParams.put("Accept", localVarAccept);
}
final String[] localVarContentTypes = {
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarContentType != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
String[] localVarAuthNames = new String[] { "bearerAuth" };
return localVarApiClient.buildCall(basePath, localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call deleteAccountValidateBeforeCall(String accountId, String zuoraTrackId, Boolean async, Boolean zuoraCacheEnabled, String zuoraEntityIds, String idempotencyKey, String acceptEncoding, String contentEncoding, String zuoraOrgIds, final ApiCallback _callback) throws ApiException {
// verify the required parameter 'accountId' is set
if (accountId == null) {
throw new ApiException("Missing the required parameter 'accountId' when calling deleteAccount(Async)");
}
return deleteAccountCall(accountId, zuoraTrackId, async, zuoraCacheEnabled, zuoraEntityIds, idempotencyKey, acceptEncoding, contentEncoding, zuoraOrgIds, _callback);
}
private ApiResponse deleteAccountWithHttpInfo(String accountId, String zuoraTrackId, Boolean async, Boolean zuoraCacheEnabled, String zuoraEntityIds, String idempotencyKey, String acceptEncoding, String contentEncoding, String zuoraOrgIds) throws ApiException {
okhttp3.Call localVarCall = deleteAccountValidateBeforeCall(accountId, zuoraTrackId, async, zuoraCacheEnabled, zuoraEntityIds, idempotencyKey, acceptEncoding, contentEncoding, zuoraOrgIds, null);
return localVarApiClient.execute(localVarCall);
}
private okhttp3.Call deleteAccountAsync(String accountId, String zuoraTrackId, Boolean async, Boolean zuoraCacheEnabled, String zuoraEntityIds, String idempotencyKey, String acceptEncoding, String contentEncoding, String zuoraOrgIds, final ApiCallback _callback) throws ApiException {
okhttp3.Call localVarCall = deleteAccountValidateBeforeCall(accountId, zuoraTrackId, async, zuoraCacheEnabled, zuoraEntityIds, idempotencyKey, acceptEncoding, contentEncoding, zuoraOrgIds, _callback);
localVarApiClient.executeAsync(localVarCall, _callback);
return localVarCall;
}
public static class DeleteAccountParams {
private final String accountId;
private Headers headers;
/*
* Check for list params
*/
private GetByIdQueryParams getByIdQueryParams;
private String zuoraTrackId;
private Boolean async;
private Boolean zuoraCacheEnabled;
private String zuoraEntityIds;
private String idempotencyKey;
private String acceptEncoding;
private String contentEncoding;
private String zuoraOrgIds;
public DeleteAccountParams(String accountId) {
this.accountId = accountId;
}
/**
* Set headers
* @param headers Headers
* @return DeleteAccountParams
*/
public DeleteAccountParams headers(Headers headers) {
this.headers = headers;
if (headers.getZuoraTrackId() != null) {
this.zuoraTrackId = headers.getZuoraTrackId();
}
if (headers.getAsync() != null) {
this.async = headers.getAsync();
}
if (headers.getZuoraCacheEnabled() != null) {
this.zuoraCacheEnabled = headers.getZuoraCacheEnabled();
}
if (headers.getZuoraEntityIds() != null) {
this.zuoraEntityIds = headers.getZuoraEntityIds();
}
if (headers.getIdempotencyKey() != null) {
this.idempotencyKey = headers.getIdempotencyKey();
}
if (headers.getAcceptEncoding() != null) {
this.acceptEncoding = headers.getAcceptEncoding();
}
if (headers.getContentEncoding() != null) {
this.contentEncoding = headers.getContentEncoding();
}
if (headers.getZuoraOrgIds() != null) {
this.zuoraOrgIds = headers.getZuoraOrgIds();
}
return this;
}
}
/**
* Delete an account
* Permanently deletes an account. It cannot be undone.
* @param accountId Identifier for the account, either `account_number` or `account_id` (required)
* @return
* @http.response.details
Status Code
Description
Response Headers
204
Default Response
* ratelimit-limit - The request limit quota for the time window closest to exhaustion. See [rate limits](https://developer.zuora.com/rest-api/general-concepts/rate-concurrency-limits/#rate-limits) for more information. * ratelimit-remaining - The number of requests remaining in the time window closest to quota exhaustion. See [rate limits](https://developer.zuora.com/rest-api/general-concepts/rate-concurrency-limits/#rate-limits) for more information. * ratelimit-reset - The number of seconds until the quota resets for the time window closest to quota exhaustion. See [rate limits](https://developer.zuora.com/rest-api/general-concepts/rate-concurrency-limits/#rate-limits) for more information. * zuora-request-id - Zuora’s internal identifier for this request. * zuora-track-id - A user-supplied identifier for this request. If you supply a `zuora-track-id` as a request header, Zuora returns the `zuora-track-id` as a response header.
400
Bad Request
-
401
Unauthorized
-
404
Not Found
-
405
Method Not Allowed
-
429
Too Many Requests
-
500
Internal Server Error
-
502
Bad Gateway
-
503
Service Unavailable
-
504
Gateway Timeout
-
*/
public DeleteAccountParams deleteAccountParams(String accountId) {
return new DeleteAccountParams(accountId);
}
public void deleteAccount(String accountId) throws ApiException {
DeleteAccountParams params = new DeleteAccountParams(accountId);
executeDeleteAccountAPICall(params);
}
/**
* Expose HTTP info
public ApiResponse deleteAccountWithHttpInfo(String accountId) throws ApiException {
DeleteAccountParams params = new DeleteAccountParams(accountId);
return executeDeleteAccountAPICall(params);
}
**/
/**
Legacy Query Params Requests
**/
/*
* add header methods
*/
public void deleteAccount(String accountId ,Headers headers) throws ApiException {
DeleteAccountParams params = new DeleteAccountParams(accountId)
.headers(headers);
executeDeleteAccountAPICall(params);
}
/**
* Delete an account
* Permanently deletes an account. It cannot be undone.
* @param params DeleteAccountParams
* @return
* @http.response.details
Status Code
Description
Response Headers
204
Default Response
* ratelimit-limit - The request limit quota for the time window closest to exhaustion. See [rate limits](https://developer.zuora.com/rest-api/general-concepts/rate-concurrency-limits/#rate-limits) for more information. * ratelimit-remaining - The number of requests remaining in the time window closest to quota exhaustion. See [rate limits](https://developer.zuora.com/rest-api/general-concepts/rate-concurrency-limits/#rate-limits) for more information. * ratelimit-reset - The number of seconds until the quota resets for the time window closest to quota exhaustion. See [rate limits](https://developer.zuora.com/rest-api/general-concepts/rate-concurrency-limits/#rate-limits) for more information. * zuora-request-id - Zuora’s internal identifier for this request. * zuora-track-id - A user-supplied identifier for this request. If you supply a `zuora-track-id` as a request header, Zuora returns the `zuora-track-id` as a response header.
400
Bad Request
-
401
Unauthorized
-
404
Not Found
-
405
Method Not Allowed
-
429
Too Many Requests
-
500
Internal Server Error
-
502
Bad Gateway
-
503
Service Unavailable
-
504
Gateway Timeout
-
*/
public void delete(DeleteAccountParams params) throws ApiException {
executeDeleteAccountAPICall(params).getData();
}
public ApiResponse deleteWithHttpInfo(DeleteAccountParams params) throws ApiException {
return executeDeleteAccountAPICall(params);
}
ApiResponse executeDeleteAccountAPICall(DeleteAccountParams params) throws ApiException {
return deleteAccountWithHttpInfo(params.accountId, params.zuoraTrackId, params.async, params.zuoraCacheEnabled, params.zuoraEntityIds, params.idempotencyKey, params.acceptEncoding, params.contentEncoding, params.zuoraOrgIds);
}
private okhttp3.Call generateBillingDocumentsCall(String accountId, GenerateBillingDocumentsAccountRequest generateBillingDocumentsAccountRequest, String zuoraTrackId, Boolean async, Boolean zuoraCacheEnabled, String zuoraEntityIds, String idempotencyKey, String acceptEncoding, String contentEncoding, String zuoraOrgIds, final ApiCallback _callback) throws ApiException {
String basePath = null;
// Operation Servers
String[] localBasePaths = new String[] { };
// Determine Base Path to Use
if (localCustomBaseUrl != null){
basePath = localCustomBaseUrl;
} else if ( localBasePaths.length > 0 ) {
basePath = localBasePaths[localHostIndex];
} else {
basePath = null;
}
Object localVarPostBody = generateBillingDocumentsAccountRequest;
// create path and map variables
String localVarPath = "/accounts/{account_id}/bill"
.replace("{" + "account_id" + "}", localVarApiClient.escapeString(accountId.toString()));
List localVarQueryParams = new ArrayList();
List localVarCollectionQueryParams = new ArrayList();
Map localVarHeaderParams = new HashMap();
Map localVarCookieParams = new HashMap();
Map localVarFormParams = new HashMap();
if (zuoraTrackId != null) {
localVarHeaderParams.put("zuora-track-id", localVarApiClient.parameterToString(zuoraTrackId));
}
if (async != null) {
localVarHeaderParams.put("async", localVarApiClient.parameterToString(async));
}
if (zuoraCacheEnabled != null) {
localVarHeaderParams.put("zuora-cache-enabled", localVarApiClient.parameterToString(zuoraCacheEnabled));
}
if (zuoraEntityIds != null) {
localVarHeaderParams.put("zuora-entity-ids", localVarApiClient.parameterToString(zuoraEntityIds));
}
if (idempotencyKey != null) {
localVarHeaderParams.put("idempotency-key", localVarApiClient.parameterToString(idempotencyKey));
}
if (acceptEncoding != null) {
localVarHeaderParams.put("accept-encoding", localVarApiClient.parameterToString(acceptEncoding));
}
if (contentEncoding != null) {
localVarHeaderParams.put("content-encoding", localVarApiClient.parameterToString(contentEncoding));
}
if (zuoraOrgIds != null) {
localVarHeaderParams.put("zuora-org-ids", localVarApiClient.parameterToString(zuoraOrgIds));
}
final String[] localVarAccepts = {
"application/json"
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
localVarHeaderParams.put("Accept", localVarAccept);
}
final String[] localVarContentTypes = {
"application/json"
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarContentType != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
String[] localVarAuthNames = new String[] { "bearerAuth" };
return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call generateBillingDocumentsValidateBeforeCall(String accountId, GenerateBillingDocumentsAccountRequest generateBillingDocumentsAccountRequest, String zuoraTrackId, Boolean async, Boolean zuoraCacheEnabled, String zuoraEntityIds, String idempotencyKey, String acceptEncoding, String contentEncoding, String zuoraOrgIds, final ApiCallback _callback) throws ApiException {
// verify the required parameter 'accountId' is set
if (accountId == null) {
throw new ApiException("Missing the required parameter 'accountId' when calling generateBillingDocuments(Async)");
}
// verify the required parameter 'generateBillingDocumentsAccountRequest' is set
if (generateBillingDocumentsAccountRequest == null) {
throw new ApiException("Missing the required parameter 'generateBillingDocumentsAccountRequest' when calling generateBillingDocuments(Async)");
}
return generateBillingDocumentsCall(accountId, generateBillingDocumentsAccountRequest, zuoraTrackId, async, zuoraCacheEnabled, zuoraEntityIds, idempotencyKey, acceptEncoding, contentEncoding, zuoraOrgIds, _callback);
}
private ApiResponse generateBillingDocumentsWithHttpInfo(String accountId, GenerateBillingDocumentsAccountRequest generateBillingDocumentsAccountRequest, String zuoraTrackId, Boolean async, Boolean zuoraCacheEnabled, String zuoraEntityIds, String idempotencyKey, String acceptEncoding, String contentEncoding, String zuoraOrgIds) throws ApiException {
okhttp3.Call localVarCall = generateBillingDocumentsValidateBeforeCall(accountId, generateBillingDocumentsAccountRequest, zuoraTrackId, async, zuoraCacheEnabled, zuoraEntityIds, idempotencyKey, acceptEncoding, contentEncoding, zuoraOrgIds, null);
try {
Type localVarReturnType = new TypeToken(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
} catch (ApiException e) {
e.setErrorObject(localVarApiClient.getJSON().getGson().fromJson(e.getResponseBody(), new TypeToken(){}.getType()));
throw e;
}
}
private okhttp3.Call generateBillingDocumentsAsync(String accountId, GenerateBillingDocumentsAccountRequest generateBillingDocumentsAccountRequest, String zuoraTrackId, Boolean async, Boolean zuoraCacheEnabled, String zuoraEntityIds, String idempotencyKey, String acceptEncoding, String contentEncoding, String zuoraOrgIds, final ApiCallback _callback) throws ApiException {
okhttp3.Call localVarCall = generateBillingDocumentsValidateBeforeCall(accountId, generateBillingDocumentsAccountRequest, zuoraTrackId, async, zuoraCacheEnabled, zuoraEntityIds, idempotencyKey, acceptEncoding, contentEncoding, zuoraOrgIds, _callback);
Type localVarReturnType = new TypeToken(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
public static class GenerateBillingDocumentsParams {
private final String accountId;
private final GenerateBillingDocumentsAccountRequest generateBillingDocumentsAccountRequest;
private Headers headers;
/*
* Check for list params
*/
private GetByIdQueryParams getByIdQueryParams;
private String zuoraTrackId;
private Boolean async;
private Boolean zuoraCacheEnabled;
private String zuoraEntityIds;
private String idempotencyKey;
private String acceptEncoding;
private String contentEncoding;
private String zuoraOrgIds;
public GenerateBillingDocumentsParams(String accountId, GenerateBillingDocumentsAccountRequest generateBillingDocumentsAccountRequest) {
this.accountId = accountId;
this.generateBillingDocumentsAccountRequest = generateBillingDocumentsAccountRequest;
}
/**
* Set headers
* @param headers Headers
* @return GenerateBillingDocumentsParams
*/
public GenerateBillingDocumentsParams headers(Headers headers) {
this.headers = headers;
if (headers.getZuoraTrackId() != null) {
this.zuoraTrackId = headers.getZuoraTrackId();
}
if (headers.getAsync() != null) {
this.async = headers.getAsync();
}
if (headers.getZuoraCacheEnabled() != null) {
this.zuoraCacheEnabled = headers.getZuoraCacheEnabled();
}
if (headers.getZuoraEntityIds() != null) {
this.zuoraEntityIds = headers.getZuoraEntityIds();
}
if (headers.getIdempotencyKey() != null) {
this.idempotencyKey = headers.getIdempotencyKey();
}
if (headers.getAcceptEncoding() != null) {
this.acceptEncoding = headers.getAcceptEncoding();
}
if (headers.getContentEncoding() != null) {
this.contentEncoding = headers.getContentEncoding();
}
if (headers.getZuoraOrgIds() != null) {
this.zuoraOrgIds = headers.getZuoraOrgIds();
}
return this;
}
}
/**
* Generate billing documents for an account
* Creates billing documents for an account.
* @param accountId Identifier for the account, either `account_number` or `account_id` (required)
* @param generateBillingDocumentsAccountRequest (required)
* @return GenerateBillingDocumentsAccountResponse
* @http.response.details
Status Code
Description
Response Headers
200
Default Response
* ratelimit-limit - The request limit quota for the time window closest to exhaustion. See [rate limits](https://developer.zuora.com/rest-api/general-concepts/rate-concurrency-limits/#rate-limits) for more information. * ratelimit-remaining - The number of requests remaining in the time window closest to quota exhaustion. See [rate limits](https://developer.zuora.com/rest-api/general-concepts/rate-concurrency-limits/#rate-limits) for more information. * ratelimit-reset - The number of seconds until the quota resets for the time window closest to quota exhaustion. See [rate limits](https://developer.zuora.com/rest-api/general-concepts/rate-concurrency-limits/#rate-limits) for more information. * zuora-request-id - Zuora’s internal identifier for this request. * zuora-track-id - A user-supplied identifier for this request. If you supply a `zuora-track-id` as a request header, Zuora returns the `zuora-track-id` as a response header.
400
Bad Request
-
401
Unauthorized
-
404
Not Found
-
405
Method Not Allowed
-
429
Too Many Requests
-
500
Internal Server Error
-
502
Bad Gateway
-
503
Service Unavailable
-
504
Gateway Timeout
-
*/
public GenerateBillingDocumentsParams generateBillingDocumentsParams(String accountId, GenerateBillingDocumentsAccountRequest generateBillingDocumentsAccountRequest) {
return new GenerateBillingDocumentsParams(accountId, generateBillingDocumentsAccountRequest);
}
public GenerateBillingDocumentsAccountResponse generateBillingDocuments(String accountId, GenerateBillingDocumentsAccountRequest generateBillingDocumentsAccountRequest) throws ApiException {
GenerateBillingDocumentsParams params = new GenerateBillingDocumentsParams(accountId, generateBillingDocumentsAccountRequest);
return executeGenerateBillingDocumentsAPICall(params).getData();
}
/**
* Expose HTTP info
public ApiResponse generateBillingDocumentsWithHttpInfo(String accountId, GenerateBillingDocumentsAccountRequest generateBillingDocumentsAccountRequest) throws ApiException {
GenerateBillingDocumentsParams params = new GenerateBillingDocumentsParams(accountId, generateBillingDocumentsAccountRequest);
return executeGenerateBillingDocumentsAPICall(params);
}
**/
/**
Legacy Query Params Requests
**/
/*
* add header methods
*/
public GenerateBillingDocumentsAccountResponse generateBillingDocuments(String accountId , GenerateBillingDocumentsAccountRequest generateBillingDocumentsAccountRequest ,Headers headers) throws ApiException {
GenerateBillingDocumentsParams params = new GenerateBillingDocumentsParams(accountId, generateBillingDocumentsAccountRequest)
.headers(headers);
return executeGenerateBillingDocumentsAPICall(params).getData();
}
/**
* Generate billing documents for an account
* Creates billing documents for an account.
* @param params GenerateBillingDocumentsParams
* @return GenerateBillingDocumentsAccountResponse
* @http.response.details
Status Code
Description
Response Headers
200
Default Response
* ratelimit-limit - The request limit quota for the time window closest to exhaustion. See [rate limits](https://developer.zuora.com/rest-api/general-concepts/rate-concurrency-limits/#rate-limits) for more information. * ratelimit-remaining - The number of requests remaining in the time window closest to quota exhaustion. See [rate limits](https://developer.zuora.com/rest-api/general-concepts/rate-concurrency-limits/#rate-limits) for more information. * ratelimit-reset - The number of seconds until the quota resets for the time window closest to quota exhaustion. See [rate limits](https://developer.zuora.com/rest-api/general-concepts/rate-concurrency-limits/#rate-limits) for more information. * zuora-request-id - Zuora’s internal identifier for this request. * zuora-track-id - A user-supplied identifier for this request. If you supply a `zuora-track-id` as a request header, Zuora returns the `zuora-track-id` as a response header.
400
Bad Request
-
401
Unauthorized
-
404
Not Found
-
405
Method Not Allowed
-
429
Too Many Requests
-
500
Internal Server Error
-
502
Bad Gateway
-
503
Service Unavailable
-
504
Gateway Timeout
-
*/
public GenerateBillingDocumentsAccountResponse generateBillingDocuments(GenerateBillingDocumentsParams params) throws ApiException {
return executeGenerateBillingDocumentsAPICall(params).getData();
}
public ApiResponse generateBillingDocumentsWithHttpInfo(GenerateBillingDocumentsParams params) throws ApiException {
return executeGenerateBillingDocumentsAPICall(params);
}
ApiResponse executeGenerateBillingDocumentsAPICall(GenerateBillingDocumentsParams params) throws ApiException {
return generateBillingDocumentsWithHttpInfo(params.accountId, params.generateBillingDocumentsAccountRequest, params.zuoraTrackId, params.async, params.zuoraCacheEnabled, params.zuoraEntityIds, params.idempotencyKey, params.acceptEncoding, params.contentEncoding, params.zuoraOrgIds);
}
private okhttp3.Call getAccountCall(String accountId, List fields, List accountFields, List subscriptionsFields, List subscriptionPlansFields, List subscriptionItemsFields, List invoiceOwnerAccountFields, List planFields, List paymentMethodsFields, List paymentsFields, List billingDocumentsFields, List billingDocumentItemsFields, List billToFields, List soldToFields, List defaultPaymentMethodFields, List usageRecordsFields, List invoicesFields, List creditMemosFields, List debitMemosFields, List prepaidBalanceFields, List transactionsFields, List expand, List filter, Integer pageSize, String zuoraTrackId, Boolean async, Boolean zuoraCacheEnabled, String zuoraEntityIds, String idempotencyKey, String acceptEncoding, String contentEncoding, String zuoraOrgIds, final ApiCallback _callback) throws ApiException {
String basePath = null;
// Operation Servers
String[] localBasePaths = new String[] { };
// Determine Base Path to Use
if (localCustomBaseUrl != null){
basePath = localCustomBaseUrl;
} else if ( localBasePaths.length > 0 ) {
basePath = localBasePaths[localHostIndex];
} else {
basePath = null;
}
Object localVarPostBody = null;
// create path and map variables
String localVarPath = "/accounts/{account_id}"
.replace("{" + "account_id" + "}", localVarApiClient.escapeString(accountId.toString()));
List localVarQueryParams = new ArrayList();
List localVarCollectionQueryParams = new ArrayList();
Map localVarHeaderParams = new HashMap();
Map localVarCookieParams = new HashMap();
Map localVarFormParams = new HashMap();
if (fields != null) {
localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "fields[]", fields));
}
if (accountFields != null) {
localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "account.fields[]", accountFields));
}
if (subscriptionsFields != null) {
localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "subscriptions.fields[]", subscriptionsFields));
}
if (subscriptionPlansFields != null) {
localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "subscription_plans.fields[]", subscriptionPlansFields));
}
if (subscriptionItemsFields != null) {
localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "subscription_items.fields[]", subscriptionItemsFields));
}
if (invoiceOwnerAccountFields != null) {
localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "invoice_owner_account.fields[]", invoiceOwnerAccountFields));
}
if (planFields != null) {
localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "plan.fields[]", planFields));
}
if (paymentMethodsFields != null) {
localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "payment_methods.fields[]", paymentMethodsFields));
}
if (paymentsFields != null) {
localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "payments.fields[]", paymentsFields));
}
if (billingDocumentsFields != null) {
localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "billing_documents.fields[]", billingDocumentsFields));
}
if (billingDocumentItemsFields != null) {
localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "billing_document_items.fields[]", billingDocumentItemsFields));
}
if (billToFields != null) {
localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "bill_to.fields[]", billToFields));
}
if (soldToFields != null) {
localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "sold_to.fields[]", soldToFields));
}
if (defaultPaymentMethodFields != null) {
localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "default_payment_method.fields[]", defaultPaymentMethodFields));
}
if (usageRecordsFields != null) {
localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "usage_records.fields[]", usageRecordsFields));
}
if (invoicesFields != null) {
localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "invoices.fields[]", invoicesFields));
}
if (creditMemosFields != null) {
localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "credit_memos.fields[]", creditMemosFields));
}
if (debitMemosFields != null) {
localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "debit_memos.fields[]", debitMemosFields));
}
if (prepaidBalanceFields != null) {
localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "prepaid_balance.fields[]", prepaidBalanceFields));
}
if (transactionsFields != null) {
localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "transactions.fields[]", transactionsFields));
}
if (expand != null) {
localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "expand[]", expand));
}
if (filter != null) {
localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "filter[]", filter));
}
if (pageSize != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("page_size", pageSize));
}
if (zuoraTrackId != null) {
localVarHeaderParams.put("zuora-track-id", localVarApiClient.parameterToString(zuoraTrackId));
}
if (async != null) {
localVarHeaderParams.put("async", localVarApiClient.parameterToString(async));
}
if (zuoraCacheEnabled != null) {
localVarHeaderParams.put("zuora-cache-enabled", localVarApiClient.parameterToString(zuoraCacheEnabled));
}
if (zuoraEntityIds != null) {
localVarHeaderParams.put("zuora-entity-ids", localVarApiClient.parameterToString(zuoraEntityIds));
}
if (idempotencyKey != null) {
localVarHeaderParams.put("idempotency-key", localVarApiClient.parameterToString(idempotencyKey));
}
if (acceptEncoding != null) {
localVarHeaderParams.put("accept-encoding", localVarApiClient.parameterToString(acceptEncoding));
}
if (contentEncoding != null) {
localVarHeaderParams.put("content-encoding", localVarApiClient.parameterToString(contentEncoding));
}
if (zuoraOrgIds != null) {
localVarHeaderParams.put("zuora-org-ids", localVarApiClient.parameterToString(zuoraOrgIds));
}
final String[] localVarAccepts = {
"application/json"
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
localVarHeaderParams.put("Accept", localVarAccept);
}
final String[] localVarContentTypes = {
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarContentType != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
String[] localVarAuthNames = new String[] { "bearerAuth" };
return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call getAccountValidateBeforeCall(String accountId, List fields, List accountFields, List subscriptionsFields, List subscriptionPlansFields, List subscriptionItemsFields, List invoiceOwnerAccountFields, List planFields, List paymentMethodsFields, List paymentsFields, List billingDocumentsFields, List billingDocumentItemsFields, List billToFields, List soldToFields, List defaultPaymentMethodFields, List usageRecordsFields, List invoicesFields, List creditMemosFields, List debitMemosFields, List prepaidBalanceFields, List transactionsFields, List expand, List filter, Integer pageSize, String zuoraTrackId, Boolean async, Boolean zuoraCacheEnabled, String zuoraEntityIds, String idempotencyKey, String acceptEncoding, String contentEncoding, String zuoraOrgIds, final ApiCallback _callback) throws ApiException {
// verify the required parameter 'accountId' is set
if (accountId == null) {
throw new ApiException("Missing the required parameter 'accountId' when calling getAccount(Async)");
}
return getAccountCall(accountId, fields, accountFields, subscriptionsFields, subscriptionPlansFields, subscriptionItemsFields, invoiceOwnerAccountFields, planFields, paymentMethodsFields, paymentsFields, billingDocumentsFields, billingDocumentItemsFields, billToFields, soldToFields, defaultPaymentMethodFields, usageRecordsFields, invoicesFields, creditMemosFields, debitMemosFields, prepaidBalanceFields, transactionsFields, expand, filter, pageSize, zuoraTrackId, async, zuoraCacheEnabled, zuoraEntityIds, idempotencyKey, acceptEncoding, contentEncoding, zuoraOrgIds, _callback);
}
private ApiResponse getAccountWithHttpInfo(String accountId, List fields, List accountFields, List subscriptionsFields, List subscriptionPlansFields, List subscriptionItemsFields, List invoiceOwnerAccountFields, List planFields, List paymentMethodsFields, List paymentsFields, List billingDocumentsFields, List