org.openapitools.client.api.BillingDocumentItemsApi Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of zuora-sdk-java Show documentation
Show all versions of zuora-sdk-java Show documentation
The SDK of JAVA language for Zuora pricing system
/*
* Quickstart API Reference
* Zuora Quickstart API is the API that helps you achieve fundamental use cases.
* It provides a much simplified object model and improved performance, enabling developers to easily learn and use.
*/
package org.openapitools.client.api;
import org.openapitools.client.ApiCallback;
import org.openapitools.client.ApiClient;
import org.openapitools.client.ApiException;
import org.openapitools.client.model.Headers;
import org.openapitools.client.model.ListQueryParams;
import org.openapitools.client.model.GetByIdQueryParams;
import org.openapitools.client.ApiResponse;
import org.openapitools.client.Configuration;
import org.openapitools.client.Pair;
import org.openapitools.client.ProgressRequestBody;
import org.openapitools.client.ProgressResponseBody;
import com.google.gson.reflect.TypeToken;
import java.io.IOException;
import java.math.BigDecimal;
import org.openapitools.client.model.BillingDocumentItemListResponse;
import org.openapitools.client.model.ErrorResponse;
import org.openapitools.client.model.ErrorResponse;
import java.lang.reflect.Type;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
public class BillingDocumentItemsApi {
private ApiClient localVarApiClient;
private int localHostIndex;
private String localCustomBaseUrl;
public BillingDocumentItemsApi() {
this(Configuration.getDefaultApiClient());
}
public BillingDocumentItemsApi(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 getBillingDocumentItemsCall(String cursor, List expand, List filter, List sort, Integer pageSize, List fields, List billingDocumentItemFields, List taxationItemsFields, String zuoraTrackId, Boolean async, Boolean zuoraCacheEnabled, String zuoraEntityIds, String idempotencyKey, String acceptEncoding, String contentEncoding, String zuoraOrgIds, final ApiCallback _callback) throws ApiException {
String basePath = null;
// Operation Servers
String[] localBasePaths = new String[] { };
// Determine Base Path to Use
if (localCustomBaseUrl != null){
basePath = localCustomBaseUrl;
} else if ( localBasePaths.length > 0 ) {
basePath = localBasePaths[localHostIndex];
} else {
basePath = null;
}
Object localVarPostBody = null;
// create path and map variables
String localVarPath = "/billing_document_items";
List localVarQueryParams = new ArrayList();
List localVarCollectionQueryParams = new ArrayList();
Map localVarHeaderParams = new HashMap();
Map localVarCookieParams = new HashMap();
Map localVarFormParams = new HashMap();
if (cursor != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("cursor", cursor));
}
if (expand != null) {
localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "expand[]", expand));
}
if (filter != null) {
localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "filter[]", filter));
}
if (sort != null) {
localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "sort[]", sort));
}
if (pageSize != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("page_size", pageSize));
}
if (fields != null) {
localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "fields[]", fields));
}
if (billingDocumentItemFields != null) {
localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "billing_document_item.fields[]", billingDocumentItemFields));
}
if (taxationItemsFields != null) {
localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "taxation_items.fields[]", taxationItemsFields));
}
if (zuoraTrackId != null) {
localVarHeaderParams.put("zuora-track-id", localVarApiClient.parameterToString(zuoraTrackId));
}
if (async != null) {
localVarHeaderParams.put("async", localVarApiClient.parameterToString(async));
}
if (zuoraCacheEnabled != null) {
localVarHeaderParams.put("zuora-cache-enabled", localVarApiClient.parameterToString(zuoraCacheEnabled));
}
if (zuoraEntityIds != null) {
localVarHeaderParams.put("zuora-entity-ids", localVarApiClient.parameterToString(zuoraEntityIds));
}
if (idempotencyKey != null) {
localVarHeaderParams.put("idempotency-key", localVarApiClient.parameterToString(idempotencyKey));
}
if (acceptEncoding != null) {
localVarHeaderParams.put("accept-encoding", localVarApiClient.parameterToString(acceptEncoding));
}
if (contentEncoding != null) {
localVarHeaderParams.put("content-encoding", localVarApiClient.parameterToString(contentEncoding));
}
if (zuoraOrgIds != null) {
localVarHeaderParams.put("zuora-org-ids", localVarApiClient.parameterToString(zuoraOrgIds));
}
final String[] localVarAccepts = {
"application/json"
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
localVarHeaderParams.put("Accept", localVarAccept);
}
final String[] localVarContentTypes = {
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarContentType != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
String[] localVarAuthNames = new String[] { "bearerAuth" };
return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call getBillingDocumentItemsValidateBeforeCall(String cursor, List expand, List filter, List sort, Integer pageSize, List fields, List billingDocumentItemFields, List taxationItemsFields, String zuoraTrackId, Boolean async, Boolean zuoraCacheEnabled, String zuoraEntityIds, String idempotencyKey, String acceptEncoding, String contentEncoding, String zuoraOrgIds, final ApiCallback _callback) throws ApiException {
return getBillingDocumentItemsCall(cursor, expand, filter, sort, pageSize, fields, billingDocumentItemFields, taxationItemsFields, zuoraTrackId, async, zuoraCacheEnabled, zuoraEntityIds, idempotencyKey, acceptEncoding, contentEncoding, zuoraOrgIds, _callback);
}
private ApiResponse getBillingDocumentItemsWithHttpInfo(String cursor, List expand, List filter, List sort, Integer pageSize, List fields, List billingDocumentItemFields, List taxationItemsFields, String zuoraTrackId, Boolean async, Boolean zuoraCacheEnabled, String zuoraEntityIds, String idempotencyKey, String acceptEncoding, String contentEncoding, String zuoraOrgIds) throws ApiException {
okhttp3.Call localVarCall = getBillingDocumentItemsValidateBeforeCall(cursor, expand, filter, sort, pageSize, fields, billingDocumentItemFields, taxationItemsFields, zuoraTrackId, async, zuoraCacheEnabled, zuoraEntityIds, idempotencyKey, acceptEncoding, contentEncoding, zuoraOrgIds, null);
try {
Type localVarReturnType = new TypeToken(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
} catch (ApiException e) {
e.setErrorObject(localVarApiClient.getJSON().getGson().fromJson(e.getResponseBody(), new TypeToken(){}.getType()));
throw e;
}
}
private okhttp3.Call getBillingDocumentItemsAsync(String cursor, List expand, List filter, List sort, Integer pageSize, List fields, List billingDocumentItemFields, List taxationItemsFields, String zuoraTrackId, Boolean async, Boolean zuoraCacheEnabled, String zuoraEntityIds, String idempotencyKey, String acceptEncoding, String contentEncoding, String zuoraOrgIds, final ApiCallback _callback) throws ApiException {
okhttp3.Call localVarCall = getBillingDocumentItemsValidateBeforeCall(cursor, expand, filter, sort, pageSize, fields, billingDocumentItemFields, taxationItemsFields, zuoraTrackId, async, zuoraCacheEnabled, zuoraEntityIds, idempotencyKey, acceptEncoding, contentEncoding, zuoraOrgIds, _callback);
Type localVarReturnType = new TypeToken(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
public static class GetBillingDocumentItemsParams {
private Headers headers;
/*
* Check for list params
*/
private ListQueryParams listQueryParams;
private String cursor;
private List expand;
private List filter;
private List sort;
private Integer pageSize;
private List fields;
private List billingDocumentItemFields;
private List taxationItemsFields;
private String zuoraTrackId;
private Boolean async;
private Boolean zuoraCacheEnabled;
private String zuoraEntityIds;
private String idempotencyKey;
private String acceptEncoding;
private String contentEncoding;
private String zuoraOrgIds;
public GetBillingDocumentItemsParams() {
}
/**
* Set listQueryParams
* @param listQueryParams ListQueryParams
* @return GetBillingDocumentItemsParams
*/
public GetBillingDocumentItemsParams listQueryParams(ListQueryParams listQueryParams) {
this.listQueryParams = listQueryParams;
if (cursor != null) {
this.cursor = listQueryParams.getCursor();
}
if (expand != null) {
this.expand = listQueryParams.getExpand();
}
if (filter != null) {
this.filter = listQueryParams.getFilter();
}
if (sort != null) {
this.sort = listQueryParams.getSort();
}
if (pageSize != null) {
this.pageSize = listQueryParams.getPageSize();
}
return this;
}
/**
* Set headers
* @param headers Headers
* @return GetBillingDocumentItemsParams
*/
public GetBillingDocumentItemsParams headers(Headers headers) {
this.headers = headers;
if (headers.getZuoraTrackId() != null) {
this.zuoraTrackId = headers.getZuoraTrackId();
}
if (headers.getAsync() != null) {
this.async = headers.getAsync();
}
if (headers.getZuoraCacheEnabled() != null) {
this.zuoraCacheEnabled = headers.getZuoraCacheEnabled();
}
if (headers.getZuoraEntityIds() != null) {
this.zuoraEntityIds = headers.getZuoraEntityIds();
}
if (headers.getIdempotencyKey() != null) {
this.idempotencyKey = headers.getIdempotencyKey();
}
if (headers.getAcceptEncoding() != null) {
this.acceptEncoding = headers.getAcceptEncoding();
}
if (headers.getContentEncoding() != null) {
this.contentEncoding = headers.getContentEncoding();
}
if (headers.getZuoraOrgIds() != null) {
this.zuoraOrgIds = headers.getZuoraOrgIds();
}
return this;
}
/**
* Set 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 GetBillingDocumentItemsParams
*/
public GetBillingDocumentItemsParams cursor(String cursor) {
this.cursor = cursor;
return this;
}
/**
* Set expand
* @param expand Allows you to expand responses by including related object information in a single call. See the [Expand responses](https://developer.zuora.com/quickstart-api/tutorial/expand-responses/) section of the Quickstart API Tutorials for detailed instructions. (optional)
* @return GetBillingDocumentItemsParams
*/
public GetBillingDocumentItemsParams expand(List expand) {
this.expand = expand;
return this;
}
/**
* Set filter
* @param filter A case-sensitive filter on the list. See the [Filter lists](https://developer.zuora.com/quickstart-api/tutorial/filter-lists/) section of the Quickstart API Tutorials for detailed instructions. (optional)
* @return GetBillingDocumentItemsParams
*/
public GetBillingDocumentItemsParams filter(List filter) {
this.filter = filter;
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. `account_number.asc`) or descending (e.g. `account_number.desc`). You cannot sort on properties that are arrays. If the array-type properties are specified for the `sort[]` parameter, they are ignored. (optional)
* @return GetBillingDocumentItemsParams
*/
public GetBillingDocumentItemsParams sort(List sort) {
this.sort = sort;
return this;
}
/**
* Set pageSize
* @param pageSize The maximum number of results to return in a single page. If the specified `page_size` is less than 1 or greater than 99, Zuora will return a 400 error. (optional)
* @return GetBillingDocumentItemsParams
*/
public GetBillingDocumentItemsParams pageSize(Integer pageSize) {
this.pageSize = pageSize;
return this;
}
/**
* Set fields
* @param fields Allows you to specify which fields are returned in the response. <details> <summary> Accepted values </summary> `custom_fields`, `created_by_id`, `updated_by_id`, `created_time`, `id`, `updated_time`, `price_id`, `discount_item`, `deferred_revenue_account`, `description`, `name`, `quantity`, `recognized_revenue_account`, `service_end`, `service_start`, `accounts_receivable_account`, `subscription_id`, `subscription_item_id`, `tax`, `tax_inclusive`, `unit_amount` </details> (optional)
* @return GetBillingDocumentItemsParams
*/
public GetBillingDocumentItemsParams fields(List fields) {
this.fields = fields;
return this;
}
/**
* Set billingDocumentItemFields
* @param billingDocumentItemFields Allows you to specify which fields are returned in the response. <details> <summary> Accepted values </summary> `custom_fields`, `created_by_id`, `updated_by_id`, `created_time`, `id`, `updated_time`, `price_id`, `discount_item`, `deferred_revenue_account`, `description`, `name`, `quantity`, `recognized_revenue_account`, `service_end`, `service_start`, `accounts_receivable_account`, `subscription_id`, `subscription_item_id`, `tax`, `tax_inclusive`, `unit_amount` </details> (optional)
* @return GetBillingDocumentItemsParams
*/
public GetBillingDocumentItemsParams billingDocumentItemFields(List billingDocumentItemFields) {
this.billingDocumentItemFields = billingDocumentItemFields;
return this;
}
/**
* Set taxationItemsFields
* @param taxationItemsFields Allows you to specify which fields are returned in the response. <details> <summary> Accepted values </summary> `custom_fields`, `created_by_id`, `updated_by_id`, `created_time`, `id`, `updated_time`, `amount`, `amount_exempt`, `tax_date`, `jurisdiction`, `location_code`, `name`, `sales_tax_payable_account`, `tax_code`, `tax_code_name`, `tax_rate`, `tax_rate_name`, `tax_inclusive`, `tax_rate_type` </details> (optional)
* @return GetBillingDocumentItemsParams
*/
public GetBillingDocumentItemsParams taxationItemsFields(List taxationItemsFields) {
this.taxationItemsFields = taxationItemsFields;
return this;
}
}
/**
* List billing document items
* List billing document items
* @return BillingDocumentItemListResponse
* @http.response.details
Status Code Description Response Headers
200 Default Response * ratelimit-limit - The request limit quota for the time window closest to exhaustion. See [rate limits](https://developer.zuora.com/rest-api/general-concepts/rate-concurrency-limits/#rate-limits) for more information.
* ratelimit-remaining - The number of requests remaining in the time window closest to quota exhaustion. See [rate limits](https://developer.zuora.com/rest-api/general-concepts/rate-concurrency-limits/#rate-limits) for more information.
* ratelimit-reset - The number of seconds until the quota resets for the time window closest to quota exhaustion. See [rate limits](https://developer.zuora.com/rest-api/general-concepts/rate-concurrency-limits/#rate-limits) for more information.
* zuora-request-id - Zuora’s internal identifier for this request.
* zuora-track-id - A user-supplied identifier for this request. If you supply a `zuora-track-id` as a request header, Zuora returns the `zuora-track-id` as a response header.
400 Bad Request -
401 Unauthorized -
404 Not Found -
405 Method Not Allowed -
429 Too Many Requests -
500 Internal Server Error -
502 Bad Gateway -
503 Service Unavailable -
504 Gateway Timeout -
*/
public GetBillingDocumentItemsParams getBillingDocumentItemsParams() {
return new GetBillingDocumentItemsParams();
}
public BillingDocumentItemListResponse getBillingDocumentItems() throws ApiException {
GetBillingDocumentItemsParams params = new GetBillingDocumentItemsParams();
return executeGetBillingDocumentItemsAPICall(params).getData();
}
/**
* Expose HTTP info
public ApiResponse getBillingDocumentItemsWithHttpInfo() throws ApiException {
GetBillingDocumentItemsParams params = new GetBillingDocumentItemsParams();
return executeGetBillingDocumentItemsAPICall(params);
}
**/
/**
Legacy Query Params Requests
**/
public BillingDocumentItemListResponse getBillingDocumentItems(String cursor, List expand, List filter) throws ApiException {
GetBillingDocumentItemsParams params = new GetBillingDocumentItemsParams();
params.cursor(cursor);
params.expand(expand);
params.filter(filter);
return executeGetBillingDocumentItemsAPICall(params).getData();
}
/*
* add header methods
*/
public BillingDocumentItemListResponse getBillingDocumentItems(String cursor,List expand,List filter,Headers headers) throws ApiException {
GetBillingDocumentItemsParams params = new GetBillingDocumentItemsParams()
.cursor(cursor)
.expand(expand)
.filter(filter)
.headers(headers);
return executeGetBillingDocumentItemsAPICall(params).getData();
}
/**
* List billing document items
* List billing document items
* @param params GetBillingDocumentItemsParams
* @return BillingDocumentItemListResponse
* @http.response.details
Status Code Description Response Headers
200 Default Response * ratelimit-limit - The request limit quota for the time window closest to exhaustion. See [rate limits](https://developer.zuora.com/rest-api/general-concepts/rate-concurrency-limits/#rate-limits) for more information.
* ratelimit-remaining - The number of requests remaining in the time window closest to quota exhaustion. See [rate limits](https://developer.zuora.com/rest-api/general-concepts/rate-concurrency-limits/#rate-limits) for more information.
* ratelimit-reset - The number of seconds until the quota resets for the time window closest to quota exhaustion. See [rate limits](https://developer.zuora.com/rest-api/general-concepts/rate-concurrency-limits/#rate-limits) for more information.
* zuora-request-id - Zuora’s internal identifier for this request.
* zuora-track-id - A user-supplied identifier for this request. If you supply a `zuora-track-id` as a request header, Zuora returns the `zuora-track-id` as a response header.
400 Bad Request -
401 Unauthorized -
404 Not Found -
405 Method Not Allowed -
429 Too Many Requests -
500 Internal Server Error -
502 Bad Gateway -
503 Service Unavailable -
504 Gateway Timeout -
*/
public BillingDocumentItemListResponse list(GetBillingDocumentItemsParams params) throws ApiException {
return executeGetBillingDocumentItemsAPICall(params).getData();
}
public ApiResponse listWithHttpInfo(GetBillingDocumentItemsParams params) throws ApiException {
return executeGetBillingDocumentItemsAPICall(params);
}
ApiResponse executeGetBillingDocumentItemsAPICall(GetBillingDocumentItemsParams params) throws ApiException {
return getBillingDocumentItemsWithHttpInfo(params.cursor, params.expand, params.filter, params.sort, params.pageSize, params.fields, params.billingDocumentItemFields, params.taxationItemsFields, params.zuoraTrackId, params.async, params.zuoraCacheEnabled, params.zuoraEntityIds, params.idempotencyKey, params.acceptEncoding, params.contentEncoding, params.zuoraOrgIds);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy