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.
/*
* Zuora API Reference
* REST API reference for the Zuora Billing, Payments, and Central Platform! Check out the [REST API Overview](https://www.zuora.com/developer/api-references/api/overview/).
*
* The version of the OpenAPI document: 2024-05-20
* Contact: [email protected]
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
package com.zuora.api;
import com.zuora.ApiCallback;
import com.zuora.ApiClient;
import com.zuora.ApiException;
import com.zuora.ApiResponse;
import com.zuora.Configuration;
import com.zuora.Pair;
import com.zuora.ProgressRequestBody;
import com.zuora.ProgressResponseBody;
import com.google.gson.reflect.TypeToken;
import java.io.IOException;
import java.math.BigDecimal;
import com.zuora.model.CommonErrorResponse;
import com.zuora.model.ExpandedAccount;
import com.zuora.model.ExpandedAmendment;
import com.zuora.model.ExpandedBillingRun;
import com.zuora.model.ExpandedContact;
import com.zuora.model.ExpandedCreditMemo;
import com.zuora.model.ExpandedCreditMemoApplication;
import com.zuora.model.ExpandedCreditMemoItem;
import com.zuora.model.ExpandedDailyConsumptionSummary;
import com.zuora.model.ExpandedDebitMemo;
import com.zuora.model.ExpandedDebitMemoItem;
import com.zuora.model.ExpandedInvoice;
import com.zuora.model.ExpandedInvoiceItem;
import com.zuora.model.ExpandedOrderAction;
import com.zuora.model.ExpandedOrderLineItem;
import com.zuora.model.ExpandedOrders;
import com.zuora.model.ExpandedPayment;
import com.zuora.model.ExpandedPaymentApplication;
import com.zuora.model.ExpandedPaymentMethod;
import com.zuora.model.ExpandedPaymentMethodSnapshot;
import com.zuora.model.ExpandedPaymentRun;
import com.zuora.model.ExpandedPaymentSchedule;
import com.zuora.model.ExpandedPaymentScheduleItem;
import com.zuora.model.ExpandedPrepaidBalance;
import com.zuora.model.ExpandedPrepaidBalanceFund;
import com.zuora.model.ExpandedPrepaidBalanceTransaction;
import com.zuora.model.ExpandedProcessedUsage;
import com.zuora.model.ExpandedProduct;
import com.zuora.model.ExpandedProductRatePlan;
import com.zuora.model.ExpandedProductRatePlanCharge;
import com.zuora.model.ExpandedProductRatePlanChargeTier;
import com.zuora.model.ExpandedRatePlan;
import com.zuora.model.ExpandedRatePlanCharge;
import com.zuora.model.ExpandedRatePlanChargeTier;
import com.zuora.model.ExpandedRatingResult;
import com.zuora.model.ExpandedRefund;
import com.zuora.model.ExpandedRefundApplication;
import com.zuora.model.ExpandedRefundApplicationItem;
import com.zuora.model.ExpandedSubscription;
import com.zuora.model.ExpandedTaxationItem;
import com.zuora.model.ExpandedUsage;
import com.zuora.model.ExpandedValidityPeriodSummary;
import com.zuora.model.ProxyUnauthorizedResponse;
import com.zuora.model.QueryAccountsResponse;
import com.zuora.model.QueryAmendmentsResponse;
import com.zuora.model.QueryBillingRunsResponse;
import com.zuora.model.QueryContactsResponse;
import com.zuora.model.QueryCreditMemoApplicationsResponse;
import com.zuora.model.QueryCreditMemoItemsResponse;
import com.zuora.model.QueryCreditMemosResponse;
import com.zuora.model.QueryCustomObjectsResponse;
import com.zuora.model.QueryDailyConsumptionSummarysResponse;
import com.zuora.model.QueryDebitMemoItemsResponse;
import com.zuora.model.QueryDebitMemosResponse;
import com.zuora.model.QueryInvoiceItemsResponse;
import com.zuora.model.QueryInvoicesResponse;
import com.zuora.model.QueryOrderActionsResponse;
import com.zuora.model.QueryOrderLineItemsResponse;
import com.zuora.model.QueryOrderssResponse;
import com.zuora.model.QueryPaymentApplicationsResponse;
import com.zuora.model.QueryPaymentMethodSnapshotsResponse;
import com.zuora.model.QueryPaymentMethodsResponse;
import com.zuora.model.QueryPaymentRunsResponse;
import com.zuora.model.QueryPaymentScheduleItemsResponse;
import com.zuora.model.QueryPaymentSchedulesResponse;
import com.zuora.model.QueryPaymentsResponse;
import com.zuora.model.QueryPrepaidBalanceFundsResponse;
import com.zuora.model.QueryPrepaidBalanceTransactionsResponse;
import com.zuora.model.QueryPrepaidBalancesResponse;
import com.zuora.model.QueryProcessedUsagesResponse;
import com.zuora.model.QueryProductRatePlanChargeTiersResponse;
import com.zuora.model.QueryProductRatePlanChargesResponse;
import com.zuora.model.QueryProductRatePlansResponse;
import com.zuora.model.QueryProductsResponse;
import com.zuora.model.QueryRatePlanChargeTiersResponse;
import com.zuora.model.QueryRatePlanChargesResponse;
import com.zuora.model.QueryRatePlansResponse;
import com.zuora.model.QueryRatingResultsResponse;
import com.zuora.model.QueryRefundApplicationItemsResponse;
import com.zuora.model.QueryRefundApplicationsResponse;
import com.zuora.model.QueryRefundsResponse;
import com.zuora.model.QuerySubscriptionsResponse;
import com.zuora.model.QueryTaxationItemsResponse;
import com.zuora.model.QueryUsagesResponse;
import com.zuora.model.QueryValidityPeriodSummarysResponse;
import java.lang.reflect.Type;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
public class ObjectQueriesApi {
private ApiClient localVarApiClient;
private int localHostIndex;
private String localCustomBaseUrl;
public ObjectQueriesApi() {
this(Configuration.getDefaultApiClient());
}
public ObjectQueriesApi(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 queryAccountByKeyCall(String key, String idempotencyKey, String acceptEncoding, String contentEncoding, String zuoraTrackId, String zuoraEntityIds, String authorization, String zuoraVersion, Integer pageSize, String cursor, List sort, List expand, List filter, 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 = "/object-query/accounts/{key}"
.replace("{" + "key" + "}", localVarApiClient.escapeString(key.toString()));
List localVarQueryParams = new ArrayList();
List localVarCollectionQueryParams = new ArrayList();
Map localVarHeaderParams = new HashMap();
Map localVarCookieParams = new HashMap();
Map localVarFormParams = new HashMap();
if (pageSize != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("pageSize", pageSize));
}
if (cursor != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("cursor", cursor));
}
if (sort != null) {
localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "sort[]", sort));
}
if (expand != null) {
localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "expand[]", expand));
}
if (filter != null) {
localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "filter[]", filter));
}
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 (zuoraTrackId != null) {
localVarHeaderParams.put("Zuora-Track-Id", localVarApiClient.parameterToString(zuoraTrackId));
}
if (zuoraEntityIds != null) {
localVarHeaderParams.put("Zuora-Entity-Ids", localVarApiClient.parameterToString(zuoraEntityIds));
}
if (authorization != null) {
localVarHeaderParams.put("Authorization", localVarApiClient.parameterToString(authorization));
}
if (zuoraVersion != null) {
localVarHeaderParams.put("Zuora-Version", localVarApiClient.parameterToString(zuoraVersion));
}
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 queryAccountByKeyValidateBeforeCall(String key, String idempotencyKey, String acceptEncoding, String contentEncoding, String zuoraTrackId, String zuoraEntityIds, String authorization, String zuoraVersion, Integer pageSize, String cursor, List sort, List expand, List filter, final ApiCallback _callback) throws ApiException {
// verify the required parameter 'key' is set
if (key == null) {
throw new ApiException("Missing the required parameter 'key' when calling queryAccountByKey(Async)");
}
return queryAccountByKeyCall(key, idempotencyKey, acceptEncoding, contentEncoding, zuoraTrackId, zuoraEntityIds, authorization, zuoraVersion, pageSize, cursor, sort, expand, filter, _callback);
}
/**
*
* Query Account by key with filters, expands, sort capabilities. Supported expands: billto,soldto,defaultpaymentmethod,subscriptions,payments,refunds,creditmemos,debitmemos,invoices,usages,paymentmethods,subscriptions.rateplans,subscriptions.rateplans.rateplancharges.
* @param key Object ID or Number. (required)
* @param idempotencyKey Specify a unique idempotency key if you want to perform an idempotent POST or PATCH request. Do not use this header in other request types. With this header specified, the Zuora server can identify subsequent retries of the same request using this value, which prevents the same operation from being performed multiple times by accident. (optional)
* @param acceptEncoding Include the `Accept-Encoding: gzip` header to compress responses as a gzipped file. It can significantly reduce the bandwidth required for a response. If specified, Zuora automatically compresses responses that contain over 1000 bytes of data, and the response contains a `Content-Encoding` header with the compression algorithm so that your client can decompress it. (optional)
* @param contentEncoding Include the `Content-Encoding: gzip` header to compress a request. With this header specified, you should upload a gzipped file for the request payload instead of sending the JSON payload. (optional)
* @param zuoraTrackId A custom identifier for tracing the API call. If you set a value for this header, Zuora returns the same value in the response headers. This header enables you to associate your system process identifiers with Zuora API calls, to assist with troubleshooting in the event of an issue. The value of this field must use the US-ASCII character set and must not include any of the following characters: colon (`:`), semicolon (`;`), double quote (`\"`), and quote (`'`). (optional)
* @param zuoraEntityIds An entity ID. If you have [Zuora Multi-entity](https://knowledgecenter.zuora.com/BB_Introducing_Z_Business/Multi-entity) enabled and the OAuth token is valid for more than one entity, you must use this header to specify which entity to perform the operation in. If the OAuth token is only valid for a single entity, or you do not have Zuora Multi-entity enabled, you do not need to set this header. (optional)
* @param authorization The value is in the `Bearer {token}` format where {token} is a valid OAuth token generated by calling [Create an OAuth token](https://www.zuora.com/developer/api-references/api/operation/createToken). (optional)
* @param zuoraVersion The minor version of the Zuora REST API. (optional, default to 2024-05-20)
* @param pageSize The maximum number of results to return in a single page. If the specified `pageSize` is less than 1 or greater than 50, Zuora will return a 400 error. (optional)
* @param cursor A cursor for use in pagination. A cursor defines the starting place in a list. For instance, if you make a list request and receive 100 objects, ending with `next_page=W3sib3JkZXJ=`, your subsequent call can include `cursor=W3sib3JkZXJ=` in order to fetch the next page of the list. (optional)
* @param sort A case-sensitive query parameter that specifies the sort order of the list, which can be either ascending (e.g. `accountnumber.ASC`) or descending (e.g. `accountnumber.DESC`). You cannot sort on properties in arrays. If the array-type properties are specified for the `sort[]` parameter, they are ignored. (optional)
* @param expand Allows you to expand responses by including related object information in a single call. (optional)
* @param filter A case-sensitive filter on the list. (optional)
* @return ExpandedAccount
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
*/
protected ExpandedAccount queryAccountByKey(String key, String idempotencyKey, String acceptEncoding, String contentEncoding, String zuoraTrackId, String zuoraEntityIds, String authorization, String zuoraVersion, Integer pageSize, String cursor, List sort, List expand, List filter) throws ApiException {
ApiResponse localVarResp = queryAccountByKeyWithHttpInfo(key, idempotencyKey, acceptEncoding, contentEncoding, zuoraTrackId, zuoraEntityIds, authorization, zuoraVersion, pageSize, cursor, sort, expand, filter);
return localVarResp.getData();
}
private ApiResponse queryAccountByKeyWithHttpInfo(String key, String idempotencyKey, String acceptEncoding, String contentEncoding, String zuoraTrackId, String zuoraEntityIds, String authorization, String zuoraVersion, Integer pageSize, String cursor, List sort, List expand, List filter) throws ApiException {
okhttp3.Call localVarCall = queryAccountByKeyValidateBeforeCall(key, idempotencyKey, acceptEncoding, contentEncoding, zuoraTrackId, zuoraEntityIds, authorization, zuoraVersion, pageSize, cursor, sort, expand, filter, null);
Type localVarReturnType = new TypeToken(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
}
private okhttp3.Call queryAccountByKeyAsync(String key, String idempotencyKey, String acceptEncoding, String contentEncoding, String zuoraTrackId, String zuoraEntityIds, String authorization, String zuoraVersion, Integer pageSize, String cursor, List sort, List expand, List filter, final ApiCallback _callback) throws ApiException {
okhttp3.Call localVarCall = queryAccountByKeyValidateBeforeCall(key, idempotencyKey, acceptEncoding, contentEncoding, zuoraTrackId, zuoraEntityIds, authorization, zuoraVersion, pageSize, cursor, sort, expand, filter, _callback);
Type localVarReturnType = new TypeToken(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
public class QueryAccountByKeyApi {
private final String key;
private String idempotencyKey;
private String acceptEncoding;
private String contentEncoding;
private String zuoraTrackId;
private String zuoraEntityIds;
private String authorization;
private String zuoraVersion;
private Integer pageSize;
private String cursor;
private List sort;
private List expand;
private List filter;
private QueryAccountByKeyApi(String key) {
this.key = key;
}
/**
* Set idempotencyKey
* @param idempotencyKey Specify a unique idempotency key if you want to perform an idempotent POST or PATCH request. Do not use this header in other request types. With this header specified, the Zuora server can identify subsequent retries of the same request using this value, which prevents the same operation from being performed multiple times by accident. (optional)
* @return QueryAccountByKeyApi
*/
public QueryAccountByKeyApi idempotencyKey(String idempotencyKey) {
this.idempotencyKey = idempotencyKey;
return this;
}
/**
* Set acceptEncoding
* @param acceptEncoding Include the `Accept-Encoding: gzip` header to compress responses as a gzipped file. It can significantly reduce the bandwidth required for a response. If specified, Zuora automatically compresses responses that contain over 1000 bytes of data, and the response contains a `Content-Encoding` header with the compression algorithm so that your client can decompress it. (optional)
* @return QueryAccountByKeyApi
*/
public QueryAccountByKeyApi acceptEncoding(String acceptEncoding) {
this.acceptEncoding = acceptEncoding;
return this;
}
/**
* Set contentEncoding
* @param contentEncoding Include the `Content-Encoding: gzip` header to compress a request. With this header specified, you should upload a gzipped file for the request payload instead of sending the JSON payload. (optional)
* @return QueryAccountByKeyApi
*/
public QueryAccountByKeyApi contentEncoding(String contentEncoding) {
this.contentEncoding = contentEncoding;
return this;
}
/**
* Set zuoraTrackId
* @param zuoraTrackId A custom identifier for tracing the API call. If you set a value for this header, Zuora returns the same value in the response headers. This header enables you to associate your system process identifiers with Zuora API calls, to assist with troubleshooting in the event of an issue. The value of this field must use the US-ASCII character set and must not include any of the following characters: colon (`:`), semicolon (`;`), double quote (`\"`), and quote (`'`). (optional)
* @return QueryAccountByKeyApi
*/
public QueryAccountByKeyApi zuoraTrackId(String zuoraTrackId) {
this.zuoraTrackId = zuoraTrackId;
return this;
}
/**
* Set zuoraEntityIds
* @param zuoraEntityIds An entity ID. If you have [Zuora Multi-entity](https://knowledgecenter.zuora.com/BB_Introducing_Z_Business/Multi-entity) enabled and the OAuth token is valid for more than one entity, you must use this header to specify which entity to perform the operation in. If the OAuth token is only valid for a single entity, or you do not have Zuora Multi-entity enabled, you do not need to set this header. (optional)
* @return QueryAccountByKeyApi
*/
public QueryAccountByKeyApi zuoraEntityIds(String zuoraEntityIds) {
this.zuoraEntityIds = zuoraEntityIds;
return this;
}
/**
* Set authorization
* @param authorization The value is in the `Bearer {token}` format where {token} is a valid OAuth token generated by calling [Create an OAuth token](https://www.zuora.com/developer/api-references/api/operation/createToken). (optional)
* @return QueryAccountByKeyApi
*/
public QueryAccountByKeyApi authorization(String authorization) {
this.authorization = authorization;
return this;
}
/**
* Set zuoraVersion
* @param zuoraVersion The minor version of the Zuora REST API. (optional, default to 2024-05-20)
* @return QueryAccountByKeyApi
*/
public QueryAccountByKeyApi zuoraVersion(String zuoraVersion) {
this.zuoraVersion = zuoraVersion;
return this;
}
/**
* Set pageSize
* @param pageSize The maximum number of results to return in a single page. If the specified `pageSize` is less than 1 or greater than 50, Zuora will return a 400 error. (optional)
* @return QueryAccountByKeyApi
*/
public QueryAccountByKeyApi pageSize(Integer pageSize) {
this.pageSize = pageSize;
return this;
}
/**
* Set cursor
* @param cursor A cursor for use in pagination. A cursor defines the starting place in a list. For instance, if you make a list request and receive 100 objects, ending with `next_page=W3sib3JkZXJ=`, your subsequent call can include `cursor=W3sib3JkZXJ=` in order to fetch the next page of the list. (optional)
* @return QueryAccountByKeyApi
*/
public QueryAccountByKeyApi cursor(String cursor) {
this.cursor = cursor;
return this;
}
/**
* Set sort
* @param sort A case-sensitive query parameter that specifies the sort order of the list, which can be either ascending (e.g. `accountnumber.ASC`) or descending (e.g. `accountnumber.DESC`). You cannot sort on properties in arrays. If the array-type properties are specified for the `sort[]` parameter, they are ignored. (optional)
* @return QueryAccountByKeyApi
*/
public QueryAccountByKeyApi sort(List sort) {
this.sort = sort;
return this;
}
/**
* Set expand
* @param expand Allows you to expand responses by including related object information in a single call. (optional)
* @return QueryAccountByKeyApi
*/
public QueryAccountByKeyApi expand(List expand) {
this.expand = expand;
return this;
}
/**
* Set filter
* @param filter A case-sensitive filter on the list. (optional)
* @return QueryAccountByKeyApi
*/
public QueryAccountByKeyApi filter(List filter) {
this.filter = filter;
return this;
}
/**
* Build call for queryAccountByKey
* @param _callback ApiCallback API callback
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
* @http.response.details
*/
public ExpandedAccount execute() throws ApiException {
ApiResponse localVarResp = queryAccountByKeyWithHttpInfo(key, idempotencyKey, acceptEncoding, contentEncoding, zuoraTrackId, zuoraEntityIds, authorization, zuoraVersion, pageSize, cursor, sort, expand, filter);
return localVarResp.getData();
}
/**
* Execute queryAccountByKey request with HTTP info returned
* @return ApiResponse<ExpandedAccount>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
*/
private ApiResponse executeWithHttpInfo() throws ApiException {
return queryAccountByKeyWithHttpInfo(key, idempotencyKey, acceptEncoding, contentEncoding, zuoraTrackId, zuoraEntityIds, authorization, zuoraVersion, pageSize, cursor, sort, expand, filter);
}
/**
* Execute queryAccountByKey request (asynchronously)
* @param _callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
* @http.response.details
*/
public okhttp3.Call executeAsync(final ApiCallback _callback) throws ApiException {
return queryAccountByKeyAsync(key, idempotencyKey, acceptEncoding, contentEncoding, zuoraTrackId, zuoraEntityIds, authorization, zuoraVersion, pageSize, cursor, sort, expand, filter, _callback);
}
}
/**
*
* Query Account by key with filters, expands, sort capabilities. Supported expands: billto,soldto,defaultpaymentmethod,subscriptions,payments,refunds,creditmemos,debitmemos,invoices,usages,paymentmethods,subscriptions.rateplans,subscriptions.rateplans.rateplancharges.
* @param key Object ID or Number. (required)
* @return QueryAccountByKeyApi
*/
public QueryAccountByKeyApi queryAccountByKeyApi(String key) {
return new QueryAccountByKeyApi(key);
}
private okhttp3.Call queryAccountsCall(String idempotencyKey, String acceptEncoding, String contentEncoding, String zuoraTrackId, String zuoraEntityIds, String authorization, String zuoraVersion, Integer pageSize, String cursor, List sort, List expand, List filter, 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 = "/object-query/accounts";
List localVarQueryParams = new ArrayList();
List localVarCollectionQueryParams = new ArrayList();
Map localVarHeaderParams = new HashMap();
Map localVarCookieParams = new HashMap();
Map localVarFormParams = new HashMap();
if (pageSize != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("pageSize", pageSize));
}
if (cursor != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("cursor", cursor));
}
if (sort != null) {
localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "sort[]", sort));
}
if (expand != null) {
localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "expand[]", expand));
}
if (filter != null) {
localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "filter[]", filter));
}
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 (zuoraTrackId != null) {
localVarHeaderParams.put("Zuora-Track-Id", localVarApiClient.parameterToString(zuoraTrackId));
}
if (zuoraEntityIds != null) {
localVarHeaderParams.put("Zuora-Entity-Ids", localVarApiClient.parameterToString(zuoraEntityIds));
}
if (authorization != null) {
localVarHeaderParams.put("Authorization", localVarApiClient.parameterToString(authorization));
}
if (zuoraVersion != null) {
localVarHeaderParams.put("Zuora-Version", localVarApiClient.parameterToString(zuoraVersion));
}
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 queryAccountsValidateBeforeCall(String idempotencyKey, String acceptEncoding, String contentEncoding, String zuoraTrackId, String zuoraEntityIds, String authorization, String zuoraVersion, Integer pageSize, String cursor, List sort, List expand, List filter, final ApiCallback _callback) throws ApiException {
return queryAccountsCall(idempotencyKey, acceptEncoding, contentEncoding, zuoraTrackId, zuoraEntityIds, authorization, zuoraVersion, pageSize, cursor, sort, expand, filter, _callback);
}
/**
*
* Query Accounts with filters, expands, sort capabilities. Supported expands: billto,soldto,defaultpaymentmethod,subscriptions,payments,refunds,creditmemos,debitmemos,invoices,usages,paymentmethods,subscriptions.rateplans,subscriptions.rateplans.rateplancharges.
* @param idempotencyKey Specify a unique idempotency key if you want to perform an idempotent POST or PATCH request. Do not use this header in other request types. With this header specified, the Zuora server can identify subsequent retries of the same request using this value, which prevents the same operation from being performed multiple times by accident. (optional)
* @param acceptEncoding Include the `Accept-Encoding: gzip` header to compress responses as a gzipped file. It can significantly reduce the bandwidth required for a response. If specified, Zuora automatically compresses responses that contain over 1000 bytes of data, and the response contains a `Content-Encoding` header with the compression algorithm so that your client can decompress it. (optional)
* @param contentEncoding Include the `Content-Encoding: gzip` header to compress a request. With this header specified, you should upload a gzipped file for the request payload instead of sending the JSON payload. (optional)
* @param zuoraTrackId A custom identifier for tracing the API call. If you set a value for this header, Zuora returns the same value in the response headers. This header enables you to associate your system process identifiers with Zuora API calls, to assist with troubleshooting in the event of an issue. The value of this field must use the US-ASCII character set and must not include any of the following characters: colon (`:`), semicolon (`;`), double quote (`\"`), and quote (`'`). (optional)
* @param zuoraEntityIds An entity ID. If you have [Zuora Multi-entity](https://knowledgecenter.zuora.com/BB_Introducing_Z_Business/Multi-entity) enabled and the OAuth token is valid for more than one entity, you must use this header to specify which entity to perform the operation in. If the OAuth token is only valid for a single entity, or you do not have Zuora Multi-entity enabled, you do not need to set this header. (optional)
* @param authorization The value is in the `Bearer {token}` format where {token} is a valid OAuth token generated by calling [Create an OAuth token](https://www.zuora.com/developer/api-references/api/operation/createToken). (optional)
* @param zuoraVersion The minor version of the Zuora REST API. (optional, default to 2024-05-20)
* @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 50, Zuora will return a 400 error. (optional)
* @param cursor A cursor for use in pagination. A cursor defines the starting place in a list. For instance, if you make a list request and receive 100 objects, ending with `next_page=W3sib3JkZXJ=`, your subsequent call can include `cursor=W3sib3JkZXJ=` in order to fetch the next page of the list. (optional)
* @param sort A case-sensitive query parameter that specifies the sort order of the list, which can be either ascending (e.g. `accountnumber.ASC`) or descending (e.g. `accountnumber.DESC`). You cannot sort on properties in arrays. If the array-type properties are specified for the `sort[]` parameter, they are ignored. (optional)
* @param expand Allows you to expand responses by including related object information in a single call. (optional)
* @param filter A case-sensitive filter on the list. (optional)
* @return QueryAccountsResponse
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
*/
protected QueryAccountsResponse queryAccounts(String idempotencyKey, String acceptEncoding, String contentEncoding, String zuoraTrackId, String zuoraEntityIds, String authorization, String zuoraVersion, Integer pageSize, String cursor, List sort, List expand, List filter) throws ApiException {
ApiResponse localVarResp = queryAccountsWithHttpInfo(idempotencyKey, acceptEncoding, contentEncoding, zuoraTrackId, zuoraEntityIds, authorization, zuoraVersion, pageSize, cursor, sort, expand, filter);
return localVarResp.getData();
}
private ApiResponse queryAccountsWithHttpInfo(String idempotencyKey, String acceptEncoding, String contentEncoding, String zuoraTrackId, String zuoraEntityIds, String authorization, String zuoraVersion, Integer pageSize, String cursor, List sort, List expand, List filter) throws ApiException {
okhttp3.Call localVarCall = queryAccountsValidateBeforeCall(idempotencyKey, acceptEncoding, contentEncoding, zuoraTrackId, zuoraEntityIds, authorization, zuoraVersion, pageSize, cursor, sort, expand, filter, null);
Type localVarReturnType = new TypeToken(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
}
private okhttp3.Call queryAccountsAsync(String idempotencyKey, String acceptEncoding, String contentEncoding, String zuoraTrackId, String zuoraEntityIds, String authorization, String zuoraVersion, Integer pageSize, String cursor, List sort, List expand, List filter, final ApiCallback _callback) throws ApiException {
okhttp3.Call localVarCall = queryAccountsValidateBeforeCall(idempotencyKey, acceptEncoding, contentEncoding, zuoraTrackId, zuoraEntityIds, authorization, zuoraVersion, pageSize, cursor, sort, expand, filter, _callback);
Type localVarReturnType = new TypeToken(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
public class QueryAccountsApi {
private String idempotencyKey;
private String acceptEncoding;
private String contentEncoding;
private String zuoraTrackId;
private String zuoraEntityIds;
private String authorization;
private String zuoraVersion;
private Integer pageSize;
private String cursor;
private List sort;
private List expand;
private List filter;
private QueryAccountsApi() {
}
/**
* Set idempotencyKey
* @param idempotencyKey Specify a unique idempotency key if you want to perform an idempotent POST or PATCH request. Do not use this header in other request types. With this header specified, the Zuora server can identify subsequent retries of the same request using this value, which prevents the same operation from being performed multiple times by accident. (optional)
* @return QueryAccountsApi
*/
public QueryAccountsApi idempotencyKey(String idempotencyKey) {
this.idempotencyKey = idempotencyKey;
return this;
}
/**
* Set acceptEncoding
* @param acceptEncoding Include the `Accept-Encoding: gzip` header to compress responses as a gzipped file. It can significantly reduce the bandwidth required for a response. If specified, Zuora automatically compresses responses that contain over 1000 bytes of data, and the response contains a `Content-Encoding` header with the compression algorithm so that your client can decompress it. (optional)
* @return QueryAccountsApi
*/
public QueryAccountsApi acceptEncoding(String acceptEncoding) {
this.acceptEncoding = acceptEncoding;
return this;
}
/**
* Set contentEncoding
* @param contentEncoding Include the `Content-Encoding: gzip` header to compress a request. With this header specified, you should upload a gzipped file for the request payload instead of sending the JSON payload. (optional)
* @return QueryAccountsApi
*/
public QueryAccountsApi contentEncoding(String contentEncoding) {
this.contentEncoding = contentEncoding;
return this;
}
/**
* Set zuoraTrackId
* @param zuoraTrackId A custom identifier for tracing the API call. If you set a value for this header, Zuora returns the same value in the response headers. This header enables you to associate your system process identifiers with Zuora API calls, to assist with troubleshooting in the event of an issue. The value of this field must use the US-ASCII character set and must not include any of the following characters: colon (`:`), semicolon (`;`), double quote (`\"`), and quote (`'`). (optional)
* @return QueryAccountsApi
*/
public QueryAccountsApi zuoraTrackId(String zuoraTrackId) {
this.zuoraTrackId = zuoraTrackId;
return this;
}
/**
* Set zuoraEntityIds
* @param zuoraEntityIds An entity ID. If you have [Zuora Multi-entity](https://knowledgecenter.zuora.com/BB_Introducing_Z_Business/Multi-entity) enabled and the OAuth token is valid for more than one entity, you must use this header to specify which entity to perform the operation in. If the OAuth token is only valid for a single entity, or you do not have Zuora Multi-entity enabled, you do not need to set this header. (optional)
* @return QueryAccountsApi
*/
public QueryAccountsApi zuoraEntityIds(String zuoraEntityIds) {
this.zuoraEntityIds = zuoraEntityIds;
return this;
}
/**
* Set authorization
* @param authorization The value is in the `Bearer {token}` format where {token} is a valid OAuth token generated by calling [Create an OAuth token](https://www.zuora.com/developer/api-references/api/operation/createToken). (optional)
* @return QueryAccountsApi
*/
public QueryAccountsApi authorization(String authorization) {
this.authorization = authorization;
return this;
}
/**
* Set zuoraVersion
* @param zuoraVersion The minor version of the Zuora REST API. (optional, default to 2024-05-20)
* @return QueryAccountsApi
*/
public QueryAccountsApi zuoraVersion(String zuoraVersion) {
this.zuoraVersion = zuoraVersion;
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 50, Zuora will return a 400 error. (optional)
* @return QueryAccountsApi
*/
public QueryAccountsApi pageSize(Integer pageSize) {
this.pageSize = pageSize;
return this;
}
/**
* Set cursor
* @param cursor A cursor for use in pagination. A cursor defines the starting place in a list. For instance, if you make a list request and receive 100 objects, ending with `next_page=W3sib3JkZXJ=`, your subsequent call can include `cursor=W3sib3JkZXJ=` in order to fetch the next page of the list. (optional)
* @return QueryAccountsApi
*/
public QueryAccountsApi cursor(String cursor) {
this.cursor = cursor;
return this;
}
/**
* Set sort
* @param sort A case-sensitive query parameter that specifies the sort order of the list, which can be either ascending (e.g. `accountnumber.ASC`) or descending (e.g. `accountnumber.DESC`). You cannot sort on properties in arrays. If the array-type properties are specified for the `sort[]` parameter, they are ignored. (optional)
* @return QueryAccountsApi
*/
public QueryAccountsApi sort(List sort) {
this.sort = sort;
return this;
}
/**
* Set expand
* @param expand Allows you to expand responses by including related object information in a single call. (optional)
* @return QueryAccountsApi
*/
public QueryAccountsApi expand(List expand) {
this.expand = expand;
return this;
}
/**
* Set filter
* @param filter A case-sensitive filter on the list. (optional)
* @return QueryAccountsApi
*/
public QueryAccountsApi filter(List filter) {
this.filter = filter;
return this;
}
/**
* Build call for queryAccounts
* @param _callback ApiCallback API callback
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
* @http.response.details
*/
public QueryAccountsResponse execute() throws ApiException {
ApiResponse localVarResp = queryAccountsWithHttpInfo(idempotencyKey, acceptEncoding, contentEncoding, zuoraTrackId, zuoraEntityIds, authorization, zuoraVersion, pageSize, cursor, sort, expand, filter);
return localVarResp.getData();
}
/**
* Execute queryAccounts request with HTTP info returned
* @return ApiResponse<QueryAccountsResponse>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
*/
private ApiResponse executeWithHttpInfo() throws ApiException {
return queryAccountsWithHttpInfo(idempotencyKey, acceptEncoding, contentEncoding, zuoraTrackId, zuoraEntityIds, authorization, zuoraVersion, pageSize, cursor, sort, expand, filter);
}
/**
* Execute queryAccounts request (asynchronously)
* @param _callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
* @http.response.details
*/
public okhttp3.Call executeAsync(final ApiCallback _callback) throws ApiException {
return queryAccountsAsync(idempotencyKey, acceptEncoding, contentEncoding, zuoraTrackId, zuoraEntityIds, authorization, zuoraVersion, pageSize, cursor, sort, expand, filter, _callback);
}
}
/**
*
* Query Accounts with filters, expands, sort capabilities. Supported expands: billto,soldto,defaultpaymentmethod,subscriptions,payments,refunds,creditmemos,debitmemos,invoices,usages,paymentmethods,subscriptions.rateplans,subscriptions.rateplans.rateplancharges.
* @return QueryAccountsApi
*/
public QueryAccountsApi queryAccountsApi() {
return new QueryAccountsApi();
}
private okhttp3.Call queryAmendmentByKeyCall(String key, String idempotencyKey, String acceptEncoding, String contentEncoding, String zuoraTrackId, String zuoraEntityIds, String authorization, String zuoraVersion, Integer pageSize, String cursor, List sort, List expand, List filter, 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 = "/object-query/amendments/{key}"
.replace("{" + "key" + "}", localVarApiClient.escapeString(key.toString()));
List localVarQueryParams = new ArrayList();
List localVarCollectionQueryParams = new ArrayList();
Map localVarHeaderParams = new HashMap();
Map localVarCookieParams = new HashMap();
Map localVarFormParams = new HashMap();
if (pageSize != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("pageSize", pageSize));
}
if (cursor != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("cursor", cursor));
}
if (sort != null) {
localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "sort[]", sort));
}
if (expand != null) {
localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "expand[]", expand));
}
if (filter != null) {
localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "filter[]", filter));
}
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 (zuoraTrackId != null) {
localVarHeaderParams.put("Zuora-Track-Id", localVarApiClient.parameterToString(zuoraTrackId));
}
if (zuoraEntityIds != null) {
localVarHeaderParams.put("Zuora-Entity-Ids", localVarApiClient.parameterToString(zuoraEntityIds));
}
if (authorization != null) {
localVarHeaderParams.put("Authorization", localVarApiClient.parameterToString(authorization));
}
if (zuoraVersion != null) {
localVarHeaderParams.put("Zuora-Version", localVarApiClient.parameterToString(zuoraVersion));
}
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 queryAmendmentByKeyValidateBeforeCall(String key, String idempotencyKey, String acceptEncoding, String contentEncoding, String zuoraTrackId, String zuoraEntityIds, String authorization, String zuoraVersion, Integer pageSize, String cursor, List sort, List expand, List filter, final ApiCallback _callback) throws ApiException {
// verify the required parameter 'key' is set
if (key == null) {
throw new ApiException("Missing the required parameter 'key' when calling queryAmendmentByKey(Async)");
}
return queryAmendmentByKeyCall(key, idempotencyKey, acceptEncoding, contentEncoding, zuoraTrackId, zuoraEntityIds, authorization, zuoraVersion, pageSize, cursor, sort, expand, filter, _callback);
}
/**
*
* Query Amendment by key with filters, expands, sort capabilities. Supported expands: N/A.
* @param key Object ID or Number. (required)
* @param idempotencyKey Specify a unique idempotency key if you want to perform an idempotent POST or PATCH request. Do not use this header in other request types. With this header specified, the Zuora server can identify subsequent retries of the same request using this value, which prevents the same operation from being performed multiple times by accident. (optional)
* @param acceptEncoding Include the `Accept-Encoding: gzip` header to compress responses as a gzipped file. It can significantly reduce the bandwidth required for a response. If specified, Zuora automatically compresses responses that contain over 1000 bytes of data, and the response contains a `Content-Encoding` header with the compression algorithm so that your client can decompress it. (optional)
* @param contentEncoding Include the `Content-Encoding: gzip` header to compress a request. With this header specified, you should upload a gzipped file for the request payload instead of sending the JSON payload. (optional)
* @param zuoraTrackId A custom identifier for tracing the API call. If you set a value for this header, Zuora returns the same value in the response headers. This header enables you to associate your system process identifiers with Zuora API calls, to assist with troubleshooting in the event of an issue. The value of this field must use the US-ASCII character set and must not include any of the following characters: colon (`:`), semicolon (`;`), double quote (`\"`), and quote (`'`). (optional)
* @param zuoraEntityIds An entity ID. If you have [Zuora Multi-entity](https://knowledgecenter.zuora.com/BB_Introducing_Z_Business/Multi-entity) enabled and the OAuth token is valid for more than one entity, you must use this header to specify which entity to perform the operation in. If the OAuth token is only valid for a single entity, or you do not have Zuora Multi-entity enabled, you do not need to set this header. (optional)
* @param authorization The value is in the `Bearer {token}` format where {token} is a valid OAuth token generated by calling [Create an OAuth token](https://www.zuora.com/developer/api-references/api/operation/createToken). (optional)
* @param zuoraVersion The minor version of the Zuora REST API. (optional, default to 2024-05-20)
* @param pageSize The maximum number of results to return in a single page. If the specified `pageSize` is less than 1 or greater than 50, Zuora will return a 400 error. (optional)
* @param cursor A cursor for use in pagination. A cursor defines the starting place in a list. For instance, if you make a list request and receive 100 objects, ending with `next_page=W3sib3JkZXJ=`, your subsequent call can include `cursor=W3sib3JkZXJ=` in order to fetch the next page of the list. (optional)
* @param sort A case-sensitive query parameter that specifies the sort order of the list, which can be either ascending (e.g. `accountnumber.ASC`) or descending (e.g. `accountnumber.DESC`). You cannot sort on properties in arrays. If the array-type properties are specified for the `sort[]` parameter, they are ignored. (optional)
* @param expand Allows you to expand responses by including related object information in a single call. (optional)
* @param filter A case-sensitive filter on the list. (optional)
* @return ExpandedAmendment
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
*/
protected ExpandedAmendment queryAmendmentByKey(String key, String idempotencyKey, String acceptEncoding, String contentEncoding, String zuoraTrackId, String zuoraEntityIds, String authorization, String zuoraVersion, Integer pageSize, String cursor, List sort, List expand, List filter) throws ApiException {
ApiResponse localVarResp = queryAmendmentByKeyWithHttpInfo(key, idempotencyKey, acceptEncoding, contentEncoding, zuoraTrackId, zuoraEntityIds, authorization, zuoraVersion, pageSize, cursor, sort, expand, filter);
return localVarResp.getData();
}
private ApiResponse queryAmendmentByKeyWithHttpInfo(String key, String idempotencyKey, String acceptEncoding, String contentEncoding, String zuoraTrackId, String zuoraEntityIds, String authorization, String zuoraVersion, Integer pageSize, String cursor, List sort, List expand, List filter) throws ApiException {
okhttp3.Call localVarCall = queryAmendmentByKeyValidateBeforeCall(key, idempotencyKey, acceptEncoding, contentEncoding, zuoraTrackId, zuoraEntityIds, authorization, zuoraVersion, pageSize, cursor, sort, expand, filter, null);
Type localVarReturnType = new TypeToken(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
}
private okhttp3.Call queryAmendmentByKeyAsync(String key, String idempotencyKey, String acceptEncoding, String contentEncoding, String zuoraTrackId, String zuoraEntityIds, String authorization, String zuoraVersion, Integer pageSize, String cursor, List sort, List expand, List filter, final ApiCallback _callback) throws ApiException {
okhttp3.Call localVarCall = queryAmendmentByKeyValidateBeforeCall(key, idempotencyKey, acceptEncoding, contentEncoding, zuoraTrackId, zuoraEntityIds, authorization, zuoraVersion, pageSize, cursor, sort, expand, filter, _callback);
Type localVarReturnType = new TypeToken(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
public class QueryAmendmentByKeyApi {
private final String key;
private String idempotencyKey;
private String acceptEncoding;
private String contentEncoding;
private String zuoraTrackId;
private String zuoraEntityIds;
private String authorization;
private String zuoraVersion;
private Integer pageSize;
private String cursor;
private List sort;
private List expand;
private List filter;
private QueryAmendmentByKeyApi(String key) {
this.key = key;
}
/**
* Set idempotencyKey
* @param idempotencyKey Specify a unique idempotency key if you want to perform an idempotent POST or PATCH request. Do not use this header in other request types. With this header specified, the Zuora server can identify subsequent retries of the same request using this value, which prevents the same operation from being performed multiple times by accident. (optional)
* @return QueryAmendmentByKeyApi
*/
public QueryAmendmentByKeyApi idempotencyKey(String idempotencyKey) {
this.idempotencyKey = idempotencyKey;
return this;
}
/**
* Set acceptEncoding
* @param acceptEncoding Include the `Accept-Encoding: gzip` header to compress responses as a gzipped file. It can significantly reduce the bandwidth required for a response. If specified, Zuora automatically compresses responses that contain over 1000 bytes of data, and the response contains a `Content-Encoding` header with the compression algorithm so that your client can decompress it. (optional)
* @return QueryAmendmentByKeyApi
*/
public QueryAmendmentByKeyApi acceptEncoding(String acceptEncoding) {
this.acceptEncoding = acceptEncoding;
return this;
}
/**
* Set contentEncoding
* @param contentEncoding Include the `Content-Encoding: gzip` header to compress a request. With this header specified, you should upload a gzipped file for the request payload instead of sending the JSON payload. (optional)
* @return QueryAmendmentByKeyApi
*/
public QueryAmendmentByKeyApi contentEncoding(String contentEncoding) {
this.contentEncoding = contentEncoding;
return this;
}
/**
* Set zuoraTrackId
* @param zuoraTrackId A custom identifier for tracing the API call. If you set a value for this header, Zuora returns the same value in the response headers. This header enables you to associate your system process identifiers with Zuora API calls, to assist with troubleshooting in the event of an issue. The value of this field must use the US-ASCII character set and must not include any of the following characters: colon (`:`), semicolon (`;`), double quote (`\"`), and quote (`'`). (optional)
* @return QueryAmendmentByKeyApi
*/
public QueryAmendmentByKeyApi zuoraTrackId(String zuoraTrackId) {
this.zuoraTrackId = zuoraTrackId;
return this;
}
/**
* Set zuoraEntityIds
* @param zuoraEntityIds An entity ID. If you have [Zuora Multi-entity](https://knowledgecenter.zuora.com/BB_Introducing_Z_Business/Multi-entity) enabled and the OAuth token is valid for more than one entity, you must use this header to specify which entity to perform the operation in. If the OAuth token is only valid for a single entity, or you do not have Zuora Multi-entity enabled, you do not need to set this header. (optional)
* @return QueryAmendmentByKeyApi
*/
public QueryAmendmentByKeyApi zuoraEntityIds(String zuoraEntityIds) {
this.zuoraEntityIds = zuoraEntityIds;
return this;
}
/**
* Set authorization
* @param authorization The value is in the `Bearer {token}` format where {token} is a valid OAuth token generated by calling [Create an OAuth token](https://www.zuora.com/developer/api-references/api/operation/createToken). (optional)
* @return QueryAmendmentByKeyApi
*/
public QueryAmendmentByKeyApi authorization(String authorization) {
this.authorization = authorization;
return this;
}
/**
* Set zuoraVersion
* @param zuoraVersion The minor version of the Zuora REST API. (optional, default to 2024-05-20)
* @return QueryAmendmentByKeyApi
*/
public QueryAmendmentByKeyApi zuoraVersion(String zuoraVersion) {
this.zuoraVersion = zuoraVersion;
return this;
}
/**
* Set pageSize
* @param pageSize The maximum number of results to return in a single page. If the specified `pageSize` is less than 1 or greater than 50, Zuora will return a 400 error. (optional)
* @return QueryAmendmentByKeyApi
*/
public QueryAmendmentByKeyApi pageSize(Integer pageSize) {
this.pageSize = pageSize;
return this;
}
/**
* Set cursor
* @param cursor A cursor for use in pagination. A cursor defines the starting place in a list. For instance, if you make a list request and receive 100 objects, ending with `next_page=W3sib3JkZXJ=`, your subsequent call can include `cursor=W3sib3JkZXJ=` in order to fetch the next page of the list. (optional)
* @return QueryAmendmentByKeyApi
*/
public QueryAmendmentByKeyApi cursor(String cursor) {
this.cursor = cursor;
return this;
}
/**
* Set sort
* @param sort A case-sensitive query parameter that specifies the sort order of the list, which can be either ascending (e.g. `accountnumber.ASC`) or descending (e.g. `accountnumber.DESC`). You cannot sort on properties in arrays. If the array-type properties are specified for the `sort[]` parameter, they are ignored. (optional)
* @return QueryAmendmentByKeyApi
*/
public QueryAmendmentByKeyApi sort(List sort) {
this.sort = sort;
return this;
}
/**
* Set expand
* @param expand Allows you to expand responses by including related object information in a single call. (optional)
* @return QueryAmendmentByKeyApi
*/
public QueryAmendmentByKeyApi expand(List expand) {
this.expand = expand;
return this;
}
/**
* Set filter
* @param filter A case-sensitive filter on the list. (optional)
* @return QueryAmendmentByKeyApi
*/
public QueryAmendmentByKeyApi filter(List filter) {
this.filter = filter;
return this;
}
/**
* Build call for queryAmendmentByKey
* @param _callback ApiCallback API callback
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
* @http.response.details
*/
public ExpandedAmendment execute() throws ApiException {
ApiResponse localVarResp = queryAmendmentByKeyWithHttpInfo(key, idempotencyKey, acceptEncoding, contentEncoding, zuoraTrackId, zuoraEntityIds, authorization, zuoraVersion, pageSize, cursor, sort, expand, filter);
return localVarResp.getData();
}
/**
* Execute queryAmendmentByKey request with HTTP info returned
* @return ApiResponse<ExpandedAmendment>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
*/
private ApiResponse executeWithHttpInfo() throws ApiException {
return queryAmendmentByKeyWithHttpInfo(key, idempotencyKey, acceptEncoding, contentEncoding, zuoraTrackId, zuoraEntityIds, authorization, zuoraVersion, pageSize, cursor, sort, expand, filter);
}
/**
* Execute queryAmendmentByKey request (asynchronously)
* @param _callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
* @http.response.details
*/
public okhttp3.Call executeAsync(final ApiCallback _callback) throws ApiException {
return queryAmendmentByKeyAsync(key, idempotencyKey, acceptEncoding, contentEncoding, zuoraTrackId, zuoraEntityIds, authorization, zuoraVersion, pageSize, cursor, sort, expand, filter, _callback);
}
}
/**
*
* Query Amendment by key with filters, expands, sort capabilities. Supported expands: N/A.
* @param key Object ID or Number. (required)
* @return QueryAmendmentByKeyApi
*/
public QueryAmendmentByKeyApi queryAmendmentByKeyApi(String key) {
return new QueryAmendmentByKeyApi(key);
}
private okhttp3.Call queryAmendmentsCall(String idempotencyKey, String acceptEncoding, String contentEncoding, String zuoraTrackId, String zuoraEntityIds, String authorization, String zuoraVersion, Integer pageSize, String cursor, List sort, List expand, List filter, 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 = "/object-query/amendments";
List localVarQueryParams = new ArrayList();
List localVarCollectionQueryParams = new ArrayList();
Map localVarHeaderParams = new HashMap();
Map localVarCookieParams = new HashMap();
Map localVarFormParams = new HashMap();
if (pageSize != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("pageSize", pageSize));
}
if (cursor != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("cursor", cursor));
}
if (sort != null) {
localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "sort[]", sort));
}
if (expand != null) {
localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "expand[]", expand));
}
if (filter != null) {
localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "filter[]", filter));
}
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 (zuoraTrackId != null) {
localVarHeaderParams.put("Zuora-Track-Id", localVarApiClient.parameterToString(zuoraTrackId));
}
if (zuoraEntityIds != null) {
localVarHeaderParams.put("Zuora-Entity-Ids", localVarApiClient.parameterToString(zuoraEntityIds));
}
if (authorization != null) {
localVarHeaderParams.put("Authorization", localVarApiClient.parameterToString(authorization));
}
if (zuoraVersion != null) {
localVarHeaderParams.put("Zuora-Version", localVarApiClient.parameterToString(zuoraVersion));
}
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 queryAmendmentsValidateBeforeCall(String idempotencyKey, String acceptEncoding, String contentEncoding, String zuoraTrackId, String zuoraEntityIds, String authorization, String zuoraVersion, Integer pageSize, String cursor, List sort, List expand, List filter, final ApiCallback _callback) throws ApiException {
return queryAmendmentsCall(idempotencyKey, acceptEncoding, contentEncoding, zuoraTrackId, zuoraEntityIds, authorization, zuoraVersion, pageSize, cursor, sort, expand, filter, _callback);
}
/**
*
* Query Amendments with filters, expands, sort capabilities. Supported expands: N/A.
* @param idempotencyKey Specify a unique idempotency key if you want to perform an idempotent POST or PATCH request. Do not use this header in other request types. With this header specified, the Zuora server can identify subsequent retries of the same request using this value, which prevents the same operation from being performed multiple times by accident. (optional)
* @param acceptEncoding Include the `Accept-Encoding: gzip` header to compress responses as a gzipped file. It can significantly reduce the bandwidth required for a response. If specified, Zuora automatically compresses responses that contain over 1000 bytes of data, and the response contains a `Content-Encoding` header with the compression algorithm so that your client can decompress it. (optional)
* @param contentEncoding Include the `Content-Encoding: gzip` header to compress a request. With this header specified, you should upload a gzipped file for the request payload instead of sending the JSON payload. (optional)
* @param zuoraTrackId A custom identifier for tracing the API call. If you set a value for this header, Zuora returns the same value in the response headers. This header enables you to associate your system process identifiers with Zuora API calls, to assist with troubleshooting in the event of an issue. The value of this field must use the US-ASCII character set and must not include any of the following characters: colon (`:`), semicolon (`;`), double quote (`\"`), and quote (`'`). (optional)
* @param zuoraEntityIds An entity ID. If you have [Zuora Multi-entity](https://knowledgecenter.zuora.com/BB_Introducing_Z_Business/Multi-entity) enabled and the OAuth token is valid for more than one entity, you must use this header to specify which entity to perform the operation in. If the OAuth token is only valid for a single entity, or you do not have Zuora Multi-entity enabled, you do not need to set this header. (optional)
* @param authorization The value is in the `Bearer {token}` format where {token} is a valid OAuth token generated by calling [Create an OAuth token](https://www.zuora.com/developer/api-references/api/operation/createToken). (optional)
* @param zuoraVersion The minor version of the Zuora REST API. (optional, default to 2024-05-20)
* @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 50, Zuora will return a 400 error. (optional)
* @param cursor A cursor for use in pagination. A cursor defines the starting place in a list. For instance, if you make a list request and receive 100 objects, ending with `next_page=W3sib3JkZXJ=`, your subsequent call can include `cursor=W3sib3JkZXJ=` in order to fetch the next page of the list. (optional)
* @param sort A case-sensitive query parameter that specifies the sort order of the list, which can be either ascending (e.g. `accountnumber.ASC`) or descending (e.g. `accountnumber.DESC`). You cannot sort on properties in arrays. If the array-type properties are specified for the `sort[]` parameter, they are ignored. (optional)
* @param expand Allows you to expand responses by including related object information in a single call. (optional)
* @param filter A case-sensitive filter on the list. (optional)
* @return QueryAmendmentsResponse
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
*/
protected QueryAmendmentsResponse queryAmendments(String idempotencyKey, String acceptEncoding, String contentEncoding, String zuoraTrackId, String zuoraEntityIds, String authorization, String zuoraVersion, Integer pageSize, String cursor, List sort, List expand, List filter) throws ApiException {
ApiResponse localVarResp = queryAmendmentsWithHttpInfo(idempotencyKey, acceptEncoding, contentEncoding, zuoraTrackId, zuoraEntityIds, authorization, zuoraVersion, pageSize, cursor, sort, expand, filter);
return localVarResp.getData();
}
private ApiResponse queryAmendmentsWithHttpInfo(String idempotencyKey, String acceptEncoding, String contentEncoding, String zuoraTrackId, String zuoraEntityIds, String authorization, String zuoraVersion, Integer pageSize, String cursor, List sort, List expand, List filter) throws ApiException {
okhttp3.Call localVarCall = queryAmendmentsValidateBeforeCall(idempotencyKey, acceptEncoding, contentEncoding, zuoraTrackId, zuoraEntityIds, authorization, zuoraVersion, pageSize, cursor, sort, expand, filter, null);
Type localVarReturnType = new TypeToken(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
}
private okhttp3.Call queryAmendmentsAsync(String idempotencyKey, String acceptEncoding, String contentEncoding, String zuoraTrackId, String zuoraEntityIds, String authorization, String zuoraVersion, Integer pageSize, String cursor, List sort, List expand, List filter, final ApiCallback _callback) throws ApiException {
okhttp3.Call localVarCall = queryAmendmentsValidateBeforeCall(idempotencyKey, acceptEncoding, contentEncoding, zuoraTrackId, zuoraEntityIds, authorization, zuoraVersion, pageSize, cursor, sort, expand, filter, _callback);
Type localVarReturnType = new TypeToken(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
public class QueryAmendmentsApi {
private String idempotencyKey;
private String acceptEncoding;
private String contentEncoding;
private String zuoraTrackId;
private String zuoraEntityIds;
private String authorization;
private String zuoraVersion;
private Integer pageSize;
private String cursor;
private List sort;
private List expand;
private List filter;
private QueryAmendmentsApi() {
}
/**
* Set idempotencyKey
* @param idempotencyKey Specify a unique idempotency key if you want to perform an idempotent POST or PATCH request. Do not use this header in other request types. With this header specified, the Zuora server can identify subsequent retries of the same request using this value, which prevents the same operation from being performed multiple times by accident. (optional)
* @return QueryAmendmentsApi
*/
public QueryAmendmentsApi idempotencyKey(String idempotencyKey) {
this.idempotencyKey = idempotencyKey;
return this;
}
/**
* Set acceptEncoding
* @param acceptEncoding Include the `Accept-Encoding: gzip` header to compress responses as a gzipped file. It can significantly reduce the bandwidth required for a response. If specified, Zuora automatically compresses responses that contain over 1000 bytes of data, and the response contains a `Content-Encoding` header with the compression algorithm so that your client can decompress it. (optional)
* @return QueryAmendmentsApi
*/
public QueryAmendmentsApi acceptEncoding(String acceptEncoding) {
this.acceptEncoding = acceptEncoding;
return this;
}
/**
* Set contentEncoding
* @param contentEncoding Include the `Content-Encoding: gzip` header to compress a request. With this header specified, you should upload a gzipped file for the request payload instead of sending the JSON payload. (optional)
* @return QueryAmendmentsApi
*/
public QueryAmendmentsApi contentEncoding(String contentEncoding) {
this.contentEncoding = contentEncoding;
return this;
}
/**
* Set zuoraTrackId
* @param zuoraTrackId A custom identifier for tracing the API call. If you set a value for this header, Zuora returns the same value in the response headers. This header enables you to associate your system process identifiers with Zuora API calls, to assist with troubleshooting in the event of an issue. The value of this field must use the US-ASCII character set and must not include any of the following characters: colon (`:`), semicolon (`;`), double quote (`\"`), and quote (`'`). (optional)
* @return QueryAmendmentsApi
*/
public QueryAmendmentsApi zuoraTrackId(String zuoraTrackId) {
this.zuoraTrackId = zuoraTrackId;
return this;
}
/**
* Set zuoraEntityIds
* @param zuoraEntityIds An entity ID. If you have [Zuora Multi-entity](https://knowledgecenter.zuora.com/BB_Introducing_Z_Business/Multi-entity) enabled and the OAuth token is valid for more than one entity, you must use this header to specify which entity to perform the operation in. If the OAuth token is only valid for a single entity, or you do not have Zuora Multi-entity enabled, you do not need to set this header. (optional)
* @return QueryAmendmentsApi
*/
public QueryAmendmentsApi zuoraEntityIds(String zuoraEntityIds) {
this.zuoraEntityIds = zuoraEntityIds;
return this;
}
/**
* Set authorization
* @param authorization The value is in the `Bearer {token}` format where {token} is a valid OAuth token generated by calling [Create an OAuth token](https://www.zuora.com/developer/api-references/api/operation/createToken). (optional)
* @return QueryAmendmentsApi
*/
public QueryAmendmentsApi authorization(String authorization) {
this.authorization = authorization;
return this;
}
/**
* Set zuoraVersion
* @param zuoraVersion The minor version of the Zuora REST API. (optional, default to 2024-05-20)
* @return QueryAmendmentsApi
*/
public QueryAmendmentsApi zuoraVersion(String zuoraVersion) {
this.zuoraVersion = zuoraVersion;
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 50, Zuora will return a 400 error. (optional)
* @return QueryAmendmentsApi
*/
public QueryAmendmentsApi pageSize(Integer pageSize) {
this.pageSize = pageSize;
return this;
}
/**
* Set cursor
* @param cursor A cursor for use in pagination. A cursor defines the starting place in a list. For instance, if you make a list request and receive 100 objects, ending with `next_page=W3sib3JkZXJ=`, your subsequent call can include `cursor=W3sib3JkZXJ=` in order to fetch the next page of the list. (optional)
* @return QueryAmendmentsApi
*/
public QueryAmendmentsApi cursor(String cursor) {
this.cursor = cursor;
return this;
}
/**
* Set sort
* @param sort A case-sensitive query parameter that specifies the sort order of the list, which can be either ascending (e.g. `accountnumber.ASC`) or descending (e.g. `accountnumber.DESC`). You cannot sort on properties in arrays. If the array-type properties are specified for the `sort[]` parameter, they are ignored. (optional)
* @return QueryAmendmentsApi
*/
public QueryAmendmentsApi sort(List sort) {
this.sort = sort;
return this;
}
/**
* Set expand
* @param expand Allows you to expand responses by including related object information in a single call. (optional)
* @return QueryAmendmentsApi
*/
public QueryAmendmentsApi expand(List expand) {
this.expand = expand;
return this;
}
/**
* Set filter
* @param filter A case-sensitive filter on the list. (optional)
* @return QueryAmendmentsApi
*/
public QueryAmendmentsApi filter(List filter) {
this.filter = filter;
return this;
}
/**
* Build call for queryAmendments
* @param _callback ApiCallback API callback
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
* @http.response.details
*/
public QueryAmendmentsResponse execute() throws ApiException {
ApiResponse localVarResp = queryAmendmentsWithHttpInfo(idempotencyKey, acceptEncoding, contentEncoding, zuoraTrackId, zuoraEntityIds, authorization, zuoraVersion, pageSize, cursor, sort, expand, filter);
return localVarResp.getData();
}
/**
* Execute queryAmendments request with HTTP info returned
* @return ApiResponse<QueryAmendmentsResponse>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
*/
private ApiResponse executeWithHttpInfo() throws ApiException {
return queryAmendmentsWithHttpInfo(idempotencyKey, acceptEncoding, contentEncoding, zuoraTrackId, zuoraEntityIds, authorization, zuoraVersion, pageSize, cursor, sort, expand, filter);
}
/**
* Execute queryAmendments request (asynchronously)
* @param _callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
* @http.response.details
*/
public okhttp3.Call executeAsync(final ApiCallback _callback) throws ApiException {
return queryAmendmentsAsync(idempotencyKey, acceptEncoding, contentEncoding, zuoraTrackId, zuoraEntityIds, authorization, zuoraVersion, pageSize, cursor, sort, expand, filter, _callback);
}
}
/**
*
* Query Amendments with filters, expands, sort capabilities. Supported expands: N/A.
* @return QueryAmendmentsApi
*/
public QueryAmendmentsApi queryAmendmentsApi() {
return new QueryAmendmentsApi();
}
private okhttp3.Call queryBillingRunByKeyCall(String key, String idempotencyKey, String acceptEncoding, String contentEncoding, String zuoraTrackId, String zuoraEntityIds, String authorization, String zuoraVersion, Integer pageSize, String cursor, List sort, List expand, List filter, 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 = "/object-query/billing-runs/{key}"
.replace("{" + "key" + "}", localVarApiClient.escapeString(key.toString()));
List localVarQueryParams = new ArrayList();
List localVarCollectionQueryParams = new ArrayList();
Map localVarHeaderParams = new HashMap();
Map localVarCookieParams = new HashMap();
Map localVarFormParams = new HashMap();
if (pageSize != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("pageSize", pageSize));
}
if (cursor != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("cursor", cursor));
}
if (sort != null) {
localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "sort[]", sort));
}
if (expand != null) {
localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "expand[]", expand));
}
if (filter != null) {
localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "filter[]", filter));
}
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 (zuoraTrackId != null) {
localVarHeaderParams.put("Zuora-Track-Id", localVarApiClient.parameterToString(zuoraTrackId));
}
if (zuoraEntityIds != null) {
localVarHeaderParams.put("Zuora-Entity-Ids", localVarApiClient.parameterToString(zuoraEntityIds));
}
if (authorization != null) {
localVarHeaderParams.put("Authorization", localVarApiClient.parameterToString(authorization));
}
if (zuoraVersion != null) {
localVarHeaderParams.put("Zuora-Version", localVarApiClient.parameterToString(zuoraVersion));
}
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 queryBillingRunByKeyValidateBeforeCall(String key, String idempotencyKey, String acceptEncoding, String contentEncoding, String zuoraTrackId, String zuoraEntityIds, String authorization, String zuoraVersion, Integer pageSize, String cursor, List sort, List expand, List filter, final ApiCallback _callback) throws ApiException {
// verify the required parameter 'key' is set
if (key == null) {
throw new ApiException("Missing the required parameter 'key' when calling queryBillingRunByKey(Async)");
}
return queryBillingRunByKeyCall(key, idempotencyKey, acceptEncoding, contentEncoding, zuoraTrackId, zuoraEntityIds, authorization, zuoraVersion, pageSize, cursor, sort, expand, filter, _callback);
}
/**
*
* Query BillingRun by key with filters, expands, sort capabilities. Supported expands: N/A.
* @param key Object ID or Number. (required)
* @param idempotencyKey Specify a unique idempotency key if you want to perform an idempotent POST or PATCH request. Do not use this header in other request types. With this header specified, the Zuora server can identify subsequent retries of the same request using this value, which prevents the same operation from being performed multiple times by accident. (optional)
* @param acceptEncoding Include the `Accept-Encoding: gzip` header to compress responses as a gzipped file. It can significantly reduce the bandwidth required for a response. If specified, Zuora automatically compresses responses that contain over 1000 bytes of data, and the response contains a `Content-Encoding` header with the compression algorithm so that your client can decompress it. (optional)
* @param contentEncoding Include the `Content-Encoding: gzip` header to compress a request. With this header specified, you should upload a gzipped file for the request payload instead of sending the JSON payload. (optional)
* @param zuoraTrackId A custom identifier for tracing the API call. If you set a value for this header, Zuora returns the same value in the response headers. This header enables you to associate your system process identifiers with Zuora API calls, to assist with troubleshooting in the event of an issue. The value of this field must use the US-ASCII character set and must not include any of the following characters: colon (`:`), semicolon (`;`), double quote (`\"`), and quote (`'`). (optional)
* @param zuoraEntityIds An entity ID. If you have [Zuora Multi-entity](https://knowledgecenter.zuora.com/BB_Introducing_Z_Business/Multi-entity) enabled and the OAuth token is valid for more than one entity, you must use this header to specify which entity to perform the operation in. If the OAuth token is only valid for a single entity, or you do not have Zuora Multi-entity enabled, you do not need to set this header. (optional)
* @param authorization The value is in the `Bearer {token}` format where {token} is a valid OAuth token generated by calling [Create an OAuth token](https://www.zuora.com/developer/api-references/api/operation/createToken). (optional)
* @param zuoraVersion The minor version of the Zuora REST API. (optional, default to 2024-05-20)
* @param pageSize The maximum number of results to return in a single page. If the specified `pageSize` is less than 1 or greater than 50, Zuora will return a 400 error. (optional)
* @param cursor A cursor for use in pagination. A cursor defines the starting place in a list. For instance, if you make a list request and receive 100 objects, ending with `next_page=W3sib3JkZXJ=`, your subsequent call can include `cursor=W3sib3JkZXJ=` in order to fetch the next page of the list. (optional)
* @param sort A case-sensitive query parameter that specifies the sort order of the list, which can be either ascending (e.g. `accountnumber.ASC`) or descending (e.g. `accountnumber.DESC`). You cannot sort on properties in arrays. If the array-type properties are specified for the `sort[]` parameter, they are ignored. (optional)
* @param expand Allows you to expand responses by including related object information in a single call. (optional)
* @param filter A case-sensitive filter on the list. (optional)
* @return ExpandedBillingRun
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
*/
protected ExpandedBillingRun queryBillingRunByKey(String key, String idempotencyKey, String acceptEncoding, String contentEncoding, String zuoraTrackId, String zuoraEntityIds, String authorization, String zuoraVersion, Integer pageSize, String cursor, List sort, List expand, List filter) throws ApiException {
ApiResponse localVarResp = queryBillingRunByKeyWithHttpInfo(key, idempotencyKey, acceptEncoding, contentEncoding, zuoraTrackId, zuoraEntityIds, authorization, zuoraVersion, pageSize, cursor, sort, expand, filter);
return localVarResp.getData();
}
private ApiResponse queryBillingRunByKeyWithHttpInfo(String key, String idempotencyKey, String acceptEncoding, String contentEncoding, String zuoraTrackId, String zuoraEntityIds, String authorization, String zuoraVersion, Integer pageSize, String cursor, List sort, List expand, List filter) throws ApiException {
okhttp3.Call localVarCall = queryBillingRunByKeyValidateBeforeCall(key, idempotencyKey, acceptEncoding, contentEncoding, zuoraTrackId, zuoraEntityIds, authorization, zuoraVersion, pageSize, cursor, sort, expand, filter, null);
Type localVarReturnType = new TypeToken(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
}
private okhttp3.Call queryBillingRunByKeyAsync(String key, String idempotencyKey, String acceptEncoding, String contentEncoding, String zuoraTrackId, String zuoraEntityIds, String authorization, String zuoraVersion, Integer pageSize, String cursor, List sort, List expand, List filter, final ApiCallback _callback) throws ApiException {
okhttp3.Call localVarCall = queryBillingRunByKeyValidateBeforeCall(key, idempotencyKey, acceptEncoding, contentEncoding, zuoraTrackId, zuoraEntityIds, authorization, zuoraVersion, pageSize, cursor, sort, expand, filter, _callback);
Type localVarReturnType = new TypeToken(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
public class QueryBillingRunByKeyApi {
private final String key;
private String idempotencyKey;
private String acceptEncoding;
private String contentEncoding;
private String zuoraTrackId;
private String zuoraEntityIds;
private String authorization;
private String zuoraVersion;
private Integer pageSize;
private String cursor;
private List sort;
private List expand;
private List filter;
private QueryBillingRunByKeyApi(String key) {
this.key = key;
}
/**
* Set idempotencyKey
* @param idempotencyKey Specify a unique idempotency key if you want to perform an idempotent POST or PATCH request. Do not use this header in other request types. With this header specified, the Zuora server can identify subsequent retries of the same request using this value, which prevents the same operation from being performed multiple times by accident. (optional)
* @return QueryBillingRunByKeyApi
*/
public QueryBillingRunByKeyApi idempotencyKey(String idempotencyKey) {
this.idempotencyKey = idempotencyKey;
return this;
}
/**
* Set acceptEncoding
* @param acceptEncoding Include the `Accept-Encoding: gzip` header to compress responses as a gzipped file. It can significantly reduce the bandwidth required for a response. If specified, Zuora automatically compresses responses that contain over 1000 bytes of data, and the response contains a `Content-Encoding` header with the compression algorithm so that your client can decompress it. (optional)
* @return QueryBillingRunByKeyApi
*/
public QueryBillingRunByKeyApi acceptEncoding(String acceptEncoding) {
this.acceptEncoding = acceptEncoding;
return this;
}
/**
* Set contentEncoding
* @param contentEncoding Include the `Content-Encoding: gzip` header to compress a request. With this header specified, you should upload a gzipped file for the request payload instead of sending the JSON payload. (optional)
* @return QueryBillingRunByKeyApi
*/
public QueryBillingRunByKeyApi contentEncoding(String contentEncoding) {
this.contentEncoding = contentEncoding;
return this;
}
/**
* Set zuoraTrackId
* @param zuoraTrackId A custom identifier for tracing the API call. If you set a value for this header, Zuora returns the same value in the response headers. This header enables you to associate your system process identifiers with Zuora API calls, to assist with troubleshooting in the event of an issue. The value of this field must use the US-ASCII character set and must not include any of the following characters: colon (`:`), semicolon (`;`), double quote (`\"`), and quote (`'`). (optional)
* @return QueryBillingRunByKeyApi
*/
public QueryBillingRunByKeyApi zuoraTrackId(String zuoraTrackId) {
this.zuoraTrackId = zuoraTrackId;
return this;
}
/**
* Set zuoraEntityIds
* @param zuoraEntityIds An entity ID. If you have [Zuora Multi-entity](https://knowledgecenter.zuora.com/BB_Introducing_Z_Business/Multi-entity) enabled and the OAuth token is valid for more than one entity, you must use this header to specify which entity to perform the operation in. If the OAuth token is only valid for a single entity, or you do not have Zuora Multi-entity enabled, you do not need to set this header. (optional)
* @return QueryBillingRunByKeyApi
*/
public QueryBillingRunByKeyApi zuoraEntityIds(String zuoraEntityIds) {
this.zuoraEntityIds = zuoraEntityIds;
return this;
}
/**
* Set authorization
* @param authorization The value is in the `Bearer {token}` format where {token} is a valid OAuth token generated by calling [Create an OAuth token](https://www.zuora.com/developer/api-references/api/operation/createToken). (optional)
* @return QueryBillingRunByKeyApi
*/
public QueryBillingRunByKeyApi authorization(String authorization) {
this.authorization = authorization;
return this;
}
/**
* Set zuoraVersion
* @param zuoraVersion The minor version of the Zuora REST API. (optional, default to 2024-05-20)
* @return QueryBillingRunByKeyApi
*/
public QueryBillingRunByKeyApi zuoraVersion(String zuoraVersion) {
this.zuoraVersion = zuoraVersion;
return this;
}
/**
* Set pageSize
* @param pageSize The maximum number of results to return in a single page. If the specified `pageSize` is less than 1 or greater than 50, Zuora will return a 400 error. (optional)
* @return QueryBillingRunByKeyApi
*/
public QueryBillingRunByKeyApi pageSize(Integer pageSize) {
this.pageSize = pageSize;
return this;
}
/**
* Set cursor
* @param cursor A cursor for use in pagination. A cursor defines the starting place in a list. For instance, if you make a list request and receive 100 objects, ending with `next_page=W3sib3JkZXJ=`, your subsequent call can include `cursor=W3sib3JkZXJ=` in order to fetch the next page of the list. (optional)
* @return QueryBillingRunByKeyApi
*/
public QueryBillingRunByKeyApi cursor(String cursor) {
this.cursor = cursor;
return this;
}
/**
* Set sort
* @param sort A case-sensitive query parameter that specifies the sort order of the list, which can be either ascending (e.g. `accountnumber.ASC`) or descending (e.g. `accountnumber.DESC`). You cannot sort on properties in arrays. If the array-type properties are specified for the `sort[]` parameter, they are ignored. (optional)
* @return QueryBillingRunByKeyApi
*/
public QueryBillingRunByKeyApi sort(List sort) {
this.sort = sort;
return this;
}
/**
* Set expand
* @param expand Allows you to expand responses by including related object information in a single call. (optional)
* @return QueryBillingRunByKeyApi
*/
public QueryBillingRunByKeyApi expand(List expand) {
this.expand = expand;
return this;
}
/**
* Set filter
* @param filter A case-sensitive filter on the list. (optional)
* @return QueryBillingRunByKeyApi
*/
public QueryBillingRunByKeyApi filter(List filter) {
this.filter = filter;
return this;
}
/**
* Build call for queryBillingRunByKey
* @param _callback ApiCallback API callback
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
* @http.response.details
*/
public ExpandedBillingRun execute() throws ApiException {
ApiResponse localVarResp = queryBillingRunByKeyWithHttpInfo(key, idempotencyKey, acceptEncoding, contentEncoding, zuoraTrackId, zuoraEntityIds, authorization, zuoraVersion, pageSize, cursor, sort, expand, filter);
return localVarResp.getData();
}
/**
* Execute queryBillingRunByKey request with HTTP info returned
* @return ApiResponse<ExpandedBillingRun>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
*/
private ApiResponse executeWithHttpInfo() throws ApiException {
return queryBillingRunByKeyWithHttpInfo(key, idempotencyKey, acceptEncoding, contentEncoding, zuoraTrackId, zuoraEntityIds, authorization, zuoraVersion, pageSize, cursor, sort, expand, filter);
}
/**
* Execute queryBillingRunByKey request (asynchronously)
* @param _callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
* @http.response.details
*/
public okhttp3.Call executeAsync(final ApiCallback _callback) throws ApiException {
return queryBillingRunByKeyAsync(key, idempotencyKey, acceptEncoding, contentEncoding, zuoraTrackId, zuoraEntityIds, authorization, zuoraVersion, pageSize, cursor, sort, expand, filter, _callback);
}
}
/**
*
* Query BillingRun by key with filters, expands, sort capabilities. Supported expands: N/A.
* @param key Object ID or Number. (required)
* @return QueryBillingRunByKeyApi
*/
public QueryBillingRunByKeyApi queryBillingRunByKeyApi(String key) {
return new QueryBillingRunByKeyApi(key);
}
private okhttp3.Call queryBillingRunsCall(String idempotencyKey, String acceptEncoding, String contentEncoding, String zuoraTrackId, String zuoraEntityIds, String authorization, String zuoraVersion, Integer pageSize, String cursor, List sort, List expand, List filter, 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 = "/object-query/billing-runs";
List localVarQueryParams = new ArrayList();
List localVarCollectionQueryParams = new ArrayList();
Map localVarHeaderParams = new HashMap();
Map localVarCookieParams = new HashMap();
Map localVarFormParams = new HashMap();
if (pageSize != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("pageSize", pageSize));
}
if (cursor != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("cursor", cursor));
}
if (sort != null) {
localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "sort[]", sort));
}
if (expand != null) {
localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "expand[]", expand));
}
if (filter != null) {
localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "filter[]", filter));
}
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 (zuoraTrackId != null) {
localVarHeaderParams.put("Zuora-Track-Id", localVarApiClient.parameterToString(zuoraTrackId));
}
if (zuoraEntityIds != null) {
localVarHeaderParams.put("Zuora-Entity-Ids", localVarApiClient.parameterToString(zuoraEntityIds));
}
if (authorization != null) {
localVarHeaderParams.put("Authorization", localVarApiClient.parameterToString(authorization));
}
if (zuoraVersion != null) {
localVarHeaderParams.put("Zuora-Version", localVarApiClient.parameterToString(zuoraVersion));
}
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 queryBillingRunsValidateBeforeCall(String idempotencyKey, String acceptEncoding, String contentEncoding, String zuoraTrackId, String zuoraEntityIds, String authorization, String zuoraVersion, Integer pageSize, String cursor, List sort, List expand, List filter, final ApiCallback _callback) throws ApiException {
return queryBillingRunsCall(idempotencyKey, acceptEncoding, contentEncoding, zuoraTrackId, zuoraEntityIds, authorization, zuoraVersion, pageSize, cursor, sort, expand, filter, _callback);
}
/**
*
* Query BillingRuns with filters, expands, sort capabilities. Supported expands: N/A.
* @param idempotencyKey Specify a unique idempotency key if you want to perform an idempotent POST or PATCH request. Do not use this header in other request types. With this header specified, the Zuora server can identify subsequent retries of the same request using this value, which prevents the same operation from being performed multiple times by accident. (optional)
* @param acceptEncoding Include the `Accept-Encoding: gzip` header to compress responses as a gzipped file. It can significantly reduce the bandwidth required for a response. If specified, Zuora automatically compresses responses that contain over 1000 bytes of data, and the response contains a `Content-Encoding` header with the compression algorithm so that your client can decompress it. (optional)
* @param contentEncoding Include the `Content-Encoding: gzip` header to compress a request. With this header specified, you should upload a gzipped file for the request payload instead of sending the JSON payload. (optional)
* @param zuoraTrackId A custom identifier for tracing the API call. If you set a value for this header, Zuora returns the same value in the response headers. This header enables you to associate your system process identifiers with Zuora API calls, to assist with troubleshooting in the event of an issue. The value of this field must use the US-ASCII character set and must not include any of the following characters: colon (`:`), semicolon (`;`), double quote (`\"`), and quote (`'`). (optional)
* @param zuoraEntityIds An entity ID. If you have [Zuora Multi-entity](https://knowledgecenter.zuora.com/BB_Introducing_Z_Business/Multi-entity) enabled and the OAuth token is valid for more than one entity, you must use this header to specify which entity to perform the operation in. If the OAuth token is only valid for a single entity, or you do not have Zuora Multi-entity enabled, you do not need to set this header. (optional)
* @param authorization The value is in the `Bearer {token}` format where {token} is a valid OAuth token generated by calling [Create an OAuth token](https://www.zuora.com/developer/api-references/api/operation/createToken). (optional)
* @param zuoraVersion The minor version of the Zuora REST API. (optional, default to 2024-05-20)
* @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 50, Zuora will return a 400 error. (optional)
* @param cursor A cursor for use in pagination. A cursor defines the starting place in a list. For instance, if you make a list request and receive 100 objects, ending with `next_page=W3sib3JkZXJ=`, your subsequent call can include `cursor=W3sib3JkZXJ=` in order to fetch the next page of the list. (optional)
* @param sort A case-sensitive query parameter that specifies the sort order of the list, which can be either ascending (e.g. `accountnumber.ASC`) or descending (e.g. `accountnumber.DESC`). You cannot sort on properties in arrays. If the array-type properties are specified for the `sort[]` parameter, they are ignored. (optional)
* @param expand Allows you to expand responses by including related object information in a single call. (optional)
* @param filter A case-sensitive filter on the list. (optional)
* @return QueryBillingRunsResponse
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
*/
protected QueryBillingRunsResponse queryBillingRuns(String idempotencyKey, String acceptEncoding, String contentEncoding, String zuoraTrackId, String zuoraEntityIds, String authorization, String zuoraVersion, Integer pageSize, String cursor, List sort, List expand, List filter) throws ApiException {
ApiResponse localVarResp = queryBillingRunsWithHttpInfo(idempotencyKey, acceptEncoding, contentEncoding, zuoraTrackId, zuoraEntityIds, authorization, zuoraVersion, pageSize, cursor, sort, expand, filter);
return localVarResp.getData();
}
private ApiResponse queryBillingRunsWithHttpInfo(String idempotencyKey, String acceptEncoding, String contentEncoding, String zuoraTrackId, String zuoraEntityIds, String authorization, String zuoraVersion, Integer pageSize, String cursor, List sort, List expand, List filter) throws ApiException {
okhttp3.Call localVarCall = queryBillingRunsValidateBeforeCall(idempotencyKey, acceptEncoding, contentEncoding, zuoraTrackId, zuoraEntityIds, authorization, zuoraVersion, pageSize, cursor, sort, expand, filter, null);
Type localVarReturnType = new TypeToken(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
}
private okhttp3.Call queryBillingRunsAsync(String idempotencyKey, String acceptEncoding, String contentEncoding, String zuoraTrackId, String zuoraEntityIds, String authorization, String zuoraVersion, Integer pageSize, String cursor, List sort, List expand, List filter, final ApiCallback _callback) throws ApiException {
okhttp3.Call localVarCall = queryBillingRunsValidateBeforeCall(idempotencyKey, acceptEncoding, contentEncoding, zuoraTrackId, zuoraEntityIds, authorization, zuoraVersion, pageSize, cursor, sort, expand, filter, _callback);
Type localVarReturnType = new TypeToken(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
public class QueryBillingRunsApi {
private String idempotencyKey;
private String acceptEncoding;
private String contentEncoding;
private String zuoraTrackId;
private String zuoraEntityIds;
private String authorization;
private String zuoraVersion;
private Integer pageSize;
private String cursor;
private List sort;
private List expand;
private List filter;
private QueryBillingRunsApi() {
}
/**
* Set idempotencyKey
* @param idempotencyKey Specify a unique idempotency key if you want to perform an idempotent POST or PATCH request. Do not use this header in other request types. With this header specified, the Zuora server can identify subsequent retries of the same request using this value, which prevents the same operation from being performed multiple times by accident. (optional)
* @return QueryBillingRunsApi
*/
public QueryBillingRunsApi idempotencyKey(String idempotencyKey) {
this.idempotencyKey = idempotencyKey;
return this;
}
/**
* Set acceptEncoding
* @param acceptEncoding Include the `Accept-Encoding: gzip` header to compress responses as a gzipped file. It can significantly reduce the bandwidth required for a response. If specified, Zuora automatically compresses responses that contain over 1000 bytes of data, and the response contains a `Content-Encoding` header with the compression algorithm so that your client can decompress it. (optional)
* @return QueryBillingRunsApi
*/
public QueryBillingRunsApi acceptEncoding(String acceptEncoding) {
this.acceptEncoding = acceptEncoding;
return this;
}
/**
* Set contentEncoding
* @param contentEncoding Include the `Content-Encoding: gzip` header to compress a request. With this header specified, you should upload a gzipped file for the request payload instead of sending the JSON payload. (optional)
* @return QueryBillingRunsApi
*/
public QueryBillingRunsApi contentEncoding(String contentEncoding) {
this.contentEncoding = contentEncoding;
return this;
}
/**
* Set zuoraTrackId
* @param zuoraTrackId A custom identifier for tracing the API call. If you set a value for this header, Zuora returns the same value in the response headers. This header enables you to associate your system process identifiers with Zuora API calls, to assist with troubleshooting in the event of an issue. The value of this field must use the US-ASCII character set and must not include any of the following characters: colon (`:`), semicolon (`;`), double quote (`\"`), and quote (`'`). (optional)
* @return QueryBillingRunsApi
*/
public QueryBillingRunsApi zuoraTrackId(String zuoraTrackId) {
this.zuoraTrackId = zuoraTrackId;
return this;
}
/**
* Set zuoraEntityIds
* @param zuoraEntityIds An entity ID. If you have [Zuora Multi-entity](https://knowledgecenter.zuora.com/BB_Introducing_Z_Business/Multi-entity) enabled and the OAuth token is valid for more than one entity, you must use this header to specify which entity to perform the operation in. If the OAuth token is only valid for a single entity, or you do not have Zuora Multi-entity enabled, you do not need to set this header. (optional)
* @return QueryBillingRunsApi
*/
public QueryBillingRunsApi zuoraEntityIds(String zuoraEntityIds) {
this.zuoraEntityIds = zuoraEntityIds;
return this;
}
/**
* Set authorization
* @param authorization The value is in the `Bearer {token}` format where {token} is a valid OAuth token generated by calling [Create an OAuth token](https://www.zuora.com/developer/api-references/api/operation/createToken). (optional)
* @return QueryBillingRunsApi
*/
public QueryBillingRunsApi authorization(String authorization) {
this.authorization = authorization;
return this;
}
/**
* Set zuoraVersion
* @param zuoraVersion The minor version of the Zuora REST API. (optional, default to 2024-05-20)
* @return QueryBillingRunsApi
*/
public QueryBillingRunsApi zuoraVersion(String zuoraVersion) {
this.zuoraVersion = zuoraVersion;
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 50, Zuora will return a 400 error. (optional)
* @return QueryBillingRunsApi
*/
public QueryBillingRunsApi pageSize(Integer pageSize) {
this.pageSize = pageSize;
return this;
}
/**
* Set cursor
* @param cursor A cursor for use in pagination. A cursor defines the starting place in a list. For instance, if you make a list request and receive 100 objects, ending with `next_page=W3sib3JkZXJ=`, your subsequent call can include `cursor=W3sib3JkZXJ=` in order to fetch the next page of the list. (optional)
* @return QueryBillingRunsApi
*/
public QueryBillingRunsApi cursor(String cursor) {
this.cursor = cursor;
return this;
}
/**
* Set sort
* @param sort A case-sensitive query parameter that specifies the sort order of the list, which can be either ascending (e.g. `accountnumber.ASC`) or descending (e.g. `accountnumber.DESC`). You cannot sort on properties in arrays. If the array-type properties are specified for the `sort[]` parameter, they are ignored. (optional)
* @return QueryBillingRunsApi
*/
public QueryBillingRunsApi sort(List sort) {
this.sort = sort;
return this;
}
/**
* Set expand
* @param expand Allows you to expand responses by including related object information in a single call. (optional)
* @return QueryBillingRunsApi
*/
public QueryBillingRunsApi expand(List expand) {
this.expand = expand;
return this;
}
/**
* Set filter
* @param filter A case-sensitive filter on the list. (optional)
* @return QueryBillingRunsApi
*/
public QueryBillingRunsApi filter(List filter) {
this.filter = filter;
return this;
}
/**
* Build call for queryBillingRuns
* @param _callback ApiCallback API callback
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
* @http.response.details
*/
public QueryBillingRunsResponse execute() throws ApiException {
ApiResponse localVarResp = queryBillingRunsWithHttpInfo(idempotencyKey, acceptEncoding, contentEncoding, zuoraTrackId, zuoraEntityIds, authorization, zuoraVersion, pageSize, cursor, sort, expand, filter);
return localVarResp.getData();
}
/**
* Execute queryBillingRuns request with HTTP info returned
* @return ApiResponse<QueryBillingRunsResponse>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
*/
private ApiResponse executeWithHttpInfo() throws ApiException {
return queryBillingRunsWithHttpInfo(idempotencyKey, acceptEncoding, contentEncoding, zuoraTrackId, zuoraEntityIds, authorization, zuoraVersion, pageSize, cursor, sort, expand, filter);
}
/**
* Execute queryBillingRuns request (asynchronously)
* @param _callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
* @http.response.details
*/
public okhttp3.Call executeAsync(final ApiCallback _callback) throws ApiException {
return queryBillingRunsAsync(idempotencyKey, acceptEncoding, contentEncoding, zuoraTrackId, zuoraEntityIds, authorization, zuoraVersion, pageSize, cursor, sort, expand, filter, _callback);
}
}
/**
*
* Query BillingRuns with filters, expands, sort capabilities. Supported expands: N/A.
* @return QueryBillingRunsApi
*/
public QueryBillingRunsApi queryBillingRunsApi() {
return new QueryBillingRunsApi();
}
private okhttp3.Call queryContactByKeyCall(String key, String idempotencyKey, String acceptEncoding, String contentEncoding, String zuoraTrackId, String zuoraEntityIds, String authorization, String zuoraVersion, Integer pageSize, String cursor, List sort, List expand, List filter, 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 = "/object-query/contacts/{key}"
.replace("{" + "key" + "}", localVarApiClient.escapeString(key.toString()));
List localVarQueryParams = new ArrayList();
List localVarCollectionQueryParams = new ArrayList();
Map localVarHeaderParams = new HashMap();
Map localVarCookieParams = new HashMap();
Map localVarFormParams = new HashMap();
if (pageSize != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("pageSize", pageSize));
}
if (cursor != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("cursor", cursor));
}
if (sort != null) {
localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "sort[]", sort));
}
if (expand != null) {
localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "expand[]", expand));
}
if (filter != null) {
localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "filter[]", filter));
}
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 (zuoraTrackId != null) {
localVarHeaderParams.put("Zuora-Track-Id", localVarApiClient.parameterToString(zuoraTrackId));
}
if (zuoraEntityIds != null) {
localVarHeaderParams.put("Zuora-Entity-Ids", localVarApiClient.parameterToString(zuoraEntityIds));
}
if (authorization != null) {
localVarHeaderParams.put("Authorization", localVarApiClient.parameterToString(authorization));
}
if (zuoraVersion != null) {
localVarHeaderParams.put("Zuora-Version", localVarApiClient.parameterToString(zuoraVersion));
}
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 queryContactByKeyValidateBeforeCall(String key, String idempotencyKey, String acceptEncoding, String contentEncoding, String zuoraTrackId, String zuoraEntityIds, String authorization, String zuoraVersion, Integer pageSize, String cursor, List sort, List expand, List filter, final ApiCallback _callback) throws ApiException {
// verify the required parameter 'key' is set
if (key == null) {
throw new ApiException("Missing the required parameter 'key' when calling queryContactByKey(Async)");
}
return queryContactByKeyCall(key, idempotencyKey, acceptEncoding, contentEncoding, zuoraTrackId, zuoraEntityIds, authorization, zuoraVersion, pageSize, cursor, sort, expand, filter, _callback);
}
/**
*
* Query Contact by key with filters, expands, sort capabilities. Supported expands: N/A.
* @param key Object ID or Number. (required)
* @param idempotencyKey Specify a unique idempotency key if you want to perform an idempotent POST or PATCH request. Do not use this header in other request types. With this header specified, the Zuora server can identify subsequent retries of the same request using this value, which prevents the same operation from being performed multiple times by accident. (optional)
* @param acceptEncoding Include the `Accept-Encoding: gzip` header to compress responses as a gzipped file. It can significantly reduce the bandwidth required for a response. If specified, Zuora automatically compresses responses that contain over 1000 bytes of data, and the response contains a `Content-Encoding` header with the compression algorithm so that your client can decompress it. (optional)
* @param contentEncoding Include the `Content-Encoding: gzip` header to compress a request. With this header specified, you should upload a gzipped file for the request payload instead of sending the JSON payload. (optional)
* @param zuoraTrackId A custom identifier for tracing the API call. If you set a value for this header, Zuora returns the same value in the response headers. This header enables you to associate your system process identifiers with Zuora API calls, to assist with troubleshooting in the event of an issue. The value of this field must use the US-ASCII character set and must not include any of the following characters: colon (`:`), semicolon (`;`), double quote (`\"`), and quote (`'`). (optional)
* @param zuoraEntityIds An entity ID. If you have [Zuora Multi-entity](https://knowledgecenter.zuora.com/BB_Introducing_Z_Business/Multi-entity) enabled and the OAuth token is valid for more than one entity, you must use this header to specify which entity to perform the operation in. If the OAuth token is only valid for a single entity, or you do not have Zuora Multi-entity enabled, you do not need to set this header. (optional)
* @param authorization The value is in the `Bearer {token}` format where {token} is a valid OAuth token generated by calling [Create an OAuth token](https://www.zuora.com/developer/api-references/api/operation/createToken). (optional)
* @param zuoraVersion The minor version of the Zuora REST API. (optional, default to 2024-05-20)
* @param pageSize The maximum number of results to return in a single page. If the specified `pageSize` is less than 1 or greater than 50, Zuora will return a 400 error. (optional)
* @param cursor A cursor for use in pagination. A cursor defines the starting place in a list. For instance, if you make a list request and receive 100 objects, ending with `next_page=W3sib3JkZXJ=`, your subsequent call can include `cursor=W3sib3JkZXJ=` in order to fetch the next page of the list. (optional)
* @param sort A case-sensitive query parameter that specifies the sort order of the list, which can be either ascending (e.g. `accountnumber.ASC`) or descending (e.g. `accountnumber.DESC`). You cannot sort on properties in arrays. If the array-type properties are specified for the `sort[]` parameter, they are ignored. (optional)
* @param expand Allows you to expand responses by including related object information in a single call. (optional)
* @param filter A case-sensitive filter on the list. (optional)
* @return ExpandedContact
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details