org.openapitools.client.api.SubscriptionItemsApi 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.ErrorResponse;
import org.openapitools.client.model.SubscriptionItemListResponse;
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 SubscriptionItemsApi {
private ApiClient localVarApiClient;
private int localHostIndex;
private String localCustomBaseUrl;
public SubscriptionItemsApi() {
this(Configuration.getDefaultApiClient());
}
public SubscriptionItemsApi(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 getSubscriptionItemsCall(String cursor, List expand, List filter, List sort, Integer pageSize, List fields, List subscriptionItemFields, List priceFields, List subscriptionPlanFields, List planFields, List productFields, List subscriptionFields, 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 = "/subscription_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 (subscriptionItemFields != null) {
localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "subscription_item.fields[]", subscriptionItemFields));
}
if (priceFields != null) {
localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "price.fields[]", priceFields));
}
if (subscriptionPlanFields != null) {
localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "subscription_plan.fields[]", subscriptionPlanFields));
}
if (planFields != null) {
localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "plan.fields[]", planFields));
}
if (productFields != null) {
localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "product.fields[]", productFields));
}
if (subscriptionFields != null) {
localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "subscription.fields[]", subscriptionFields));
}
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 getSubscriptionItemsValidateBeforeCall(String cursor, List expand, List filter, List sort, Integer pageSize, List fields, List subscriptionItemFields, List priceFields, List subscriptionPlanFields, List planFields, List productFields, List subscriptionFields, String zuoraTrackId, Boolean async, Boolean zuoraCacheEnabled, String zuoraEntityIds, String idempotencyKey, String acceptEncoding, String contentEncoding, String zuoraOrgIds, final ApiCallback _callback) throws ApiException {
return getSubscriptionItemsCall(cursor, expand, filter, sort, pageSize, fields, subscriptionItemFields, priceFields, subscriptionPlanFields, planFields, productFields, subscriptionFields, zuoraTrackId, async, zuoraCacheEnabled, zuoraEntityIds, idempotencyKey, acceptEncoding, contentEncoding, zuoraOrgIds, _callback);
}
private ApiResponse getSubscriptionItemsWithHttpInfo(String cursor, List expand, List filter, List sort, Integer pageSize, List fields, List subscriptionItemFields, List priceFields, List subscriptionPlanFields, List planFields, List productFields, List subscriptionFields, String zuoraTrackId, Boolean async, Boolean zuoraCacheEnabled, String zuoraEntityIds, String idempotencyKey, String acceptEncoding, String contentEncoding, String zuoraOrgIds) throws ApiException {
okhttp3.Call localVarCall = getSubscriptionItemsValidateBeforeCall(cursor, expand, filter, sort, pageSize, fields, subscriptionItemFields, priceFields, subscriptionPlanFields, planFields, productFields, subscriptionFields, 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 getSubscriptionItemsAsync(String cursor, List expand, List filter, List sort, Integer pageSize, List fields, List subscriptionItemFields, List priceFields, List subscriptionPlanFields, List planFields, List productFields, List subscriptionFields, String zuoraTrackId, Boolean async, Boolean zuoraCacheEnabled, String zuoraEntityIds, String idempotencyKey, String acceptEncoding, String contentEncoding, String zuoraOrgIds, final ApiCallback _callback) throws ApiException {
okhttp3.Call localVarCall = getSubscriptionItemsValidateBeforeCall(cursor, expand, filter, sort, pageSize, fields, subscriptionItemFields, priceFields, subscriptionPlanFields, planFields, productFields, subscriptionFields, zuoraTrackId, async, zuoraCacheEnabled, zuoraEntityIds, idempotencyKey, acceptEncoding, contentEncoding, zuoraOrgIds, _callback);
Type localVarReturnType = new TypeToken(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
public static class GetSubscriptionItemsParams {
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 subscriptionItemFields;
private List priceFields;
private List subscriptionPlanFields;
private List planFields;
private List productFields;
private List subscriptionFields;
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 GetSubscriptionItemsParams() {
}
/**
* Set listQueryParams
* @param listQueryParams ListQueryParams
* @return GetSubscriptionItemsParams
*/
public GetSubscriptionItemsParams 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 GetSubscriptionItemsParams
*/
public GetSubscriptionItemsParams 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 GetSubscriptionItemsParams
*/
public GetSubscriptionItemsParams 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 GetSubscriptionItemsParams
*/
public GetSubscriptionItemsParams 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 GetSubscriptionItemsParams
*/
public GetSubscriptionItemsParams 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 GetSubscriptionItemsParams
*/
public GetSubscriptionItemsParams 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 GetSubscriptionItemsParams
*/
public GetSubscriptionItemsParams 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`, `start_date`, `end_date`, `charge_model`, `charge_type`, `tiers`, `subscription_item_number`, `name`, `description`, `charged_through_date`, `recurring`, `price_id`, `start_event`, `tax_code`, `tax_inclusive`, `unit_of_measure`, `quantity`, `price_base_interval`, `overage`, `subscription_plan_id`, `tiers_mode`, `processed_through_date`, `active`, `state`, `unit_amount`, `amount`, `discount_amount`, `discount_percent`, `price_change_percentage`, `price_change_option` </details> (optional)
* @return GetSubscriptionItemsParams
*/
public GetSubscriptionItemsParams fields(List fields) {
this.fields = fields;
return this;
}
/**
* Set subscriptionItemFields
* @param subscriptionItemFields Allows you to specify which fields are returned in the response. <details> <summary> Accepted values </summary> `custom_fields`, `created_by_id`, `updated_by_id`, `created_time`, `id`, `updated_time`, `start_date`, `end_date`, `charge_model`, `charge_type`, `tiers`, `subscription_item_number`, `name`, `description`, `charged_through_date`, `recurring`, `price_id`, `start_event`, `tax_code`, `tax_inclusive`, `unit_of_measure`, `quantity`, `price_base_interval`, `overage`, `subscription_plan_id`, `tiers_mode`, `processed_through_date`, `active`, `state`, `unit_amount`, `amount`, `discount_amount`, `discount_percent`, `price_change_percentage`, `price_change_option` </details> (optional)
* @return GetSubscriptionItemsParams
*/
public GetSubscriptionItemsParams subscriptionItemFields(List subscriptionItemFields) {
this.subscriptionItemFields = subscriptionItemFields;
return this;
}
/**
* Set priceFields
* @param priceFields 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`, `tiers`, `charge_model`, `charge_type`, `name`, `description`, `revenue_recognition_rule`, `stacked_discount`, `recognized_revenue_accounting_code`, `deferred_revenue_accounting_code`, `accounting_code`, `recurring`, `start_event`, `tax_code`, `tax_inclusive`, `taxable`, `unit_of_measure`, `quantity`, `min_quantity`, `max_quantity`, `price_base_interval`, `discount_level`, `overage`, `plan_id`, `tiers_mode`, `apply_discount_to`, `prepayment`, `drawdown`, `discount_amounts`, `unit_amounts`, `discount_percent`, `amounts`, `price_change_percentage`, `price_change_option`, `price_increase_option` </details> (optional)
* @return GetSubscriptionItemsParams
*/
public GetSubscriptionItemsParams priceFields(List priceFields) {
this.priceFields = priceFields;
return this;
}
/**
* Set subscriptionPlanFields
* @param subscriptionPlanFields Allows you to specify which fields are returned in the response. <details> <summary> Accepted values </summary> `custom_fields`, `created_by_id`, `updated_by_id`, `created_time`, `id`, `updated_time`, `name`, `plan_id`, `subscription_id`, `product_id`, `subscription_plan_number` </details> (optional)
* @return GetSubscriptionItemsParams
*/
public GetSubscriptionItemsParams subscriptionPlanFields(List subscriptionPlanFields) {
this.subscriptionPlanFields = subscriptionPlanFields;
return this;
}
/**
* Set planFields
* @param planFields Allows you to specify which fields are returned in the response. <details> <summary> Accepted values </summary> `custom_fields`, `created_by_id`, `updated_by_id`, `created_time`, `id`, `updated_time`, `start_date`, `end_date`, `name`, `active`, `description`, `plan_number`, `product_id`, `active_currencies` </details> (optional)
* @return GetSubscriptionItemsParams
*/
public GetSubscriptionItemsParams planFields(List planFields) {
this.planFields = planFields;
return this;
}
/**
* Set productFields
* @param productFields Allows you to specify which fields are returned in the response. <details> <summary> Accepted values </summary> `custom_fields`, `created_by_id`, `updated_by_id`, `created_time`, `id`, `updated_time`, `start_date`, `end_date`, `active`, `name`, `type`, `sku`, `description` </details> (optional)
* @return GetSubscriptionItemsParams
*/
public GetSubscriptionItemsParams productFields(List productFields) {
this.productFields = productFields;
return this;
}
/**
* Set subscriptionFields
* @param subscriptionFields Allows you to specify which fields are returned in the response. <details> <summary> Accepted values </summary> `custom_fields`, `created_by_id`, `updated_by_id`, `created_time`, `id`, `updated_time`, `subscription_number`, `state`, `account_id`, `invoice_owner_account_id`, `auto_renew`, `version`, `initial_term`, `current_term`, `renewal_term`, `start_date`, `end_date`, `description`, `contract_effective`, `service_activation`, `customer_acceptance`, `invoice_separately`, `latest_version`, `payment_terms`, `billing_document_settings`, `bill_to_id`, `sold_to_id`, `contracted_mrr`, `currency`, `cancel_reason`, `last_booking_date`, `order_number` </details> (optional)
* @return GetSubscriptionItemsParams
*/
public GetSubscriptionItemsParams subscriptionFields(List subscriptionFields) {
this.subscriptionFields = subscriptionFields;
return this;
}
}
/**
* List subscription items
* List items contained in subscriptions.
* @return SubscriptionItemListResponse
* @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 GetSubscriptionItemsParams getSubscriptionItemsParams() {
return new GetSubscriptionItemsParams();
}
public SubscriptionItemListResponse getSubscriptionItems() throws ApiException {
GetSubscriptionItemsParams params = new GetSubscriptionItemsParams();
return executeGetSubscriptionItemsAPICall(params).getData();
}
/**
* Expose HTTP info
public ApiResponse getSubscriptionItemsWithHttpInfo() throws ApiException {
GetSubscriptionItemsParams params = new GetSubscriptionItemsParams();
return executeGetSubscriptionItemsAPICall(params);
}
**/
/**
Legacy Query Params Requests
**/
public SubscriptionItemListResponse getSubscriptionItems(String cursor, List expand, List filter) throws ApiException {
GetSubscriptionItemsParams params = new GetSubscriptionItemsParams();
params.cursor(cursor);
params.expand(expand);
params.filter(filter);
return executeGetSubscriptionItemsAPICall(params).getData();
}
/*
* add header methods
*/
public SubscriptionItemListResponse getSubscriptionItems(String cursor,List expand,List filter,Headers headers) throws ApiException {
GetSubscriptionItemsParams params = new GetSubscriptionItemsParams()
.cursor(cursor)
.expand(expand)
.filter(filter)
.headers(headers);
return executeGetSubscriptionItemsAPICall(params).getData();
}
/**
* List subscription items
* List items contained in subscriptions.
* @param params GetSubscriptionItemsParams
* @return SubscriptionItemListResponse
* @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 SubscriptionItemListResponse list(GetSubscriptionItemsParams params) throws ApiException {
return executeGetSubscriptionItemsAPICall(params).getData();
}
public ApiResponse listWithHttpInfo(GetSubscriptionItemsParams params) throws ApiException {
return executeGetSubscriptionItemsAPICall(params);
}
ApiResponse executeGetSubscriptionItemsAPICall(GetSubscriptionItemsParams params) throws ApiException {
return getSubscriptionItemsWithHttpInfo(params.cursor, params.expand, params.filter, params.sort, params.pageSize, params.fields, params.subscriptionItemFields, params.priceFields, params.subscriptionPlanFields, params.planFields, params.productFields, params.subscriptionFields, params.zuoraTrackId, params.async, params.zuoraCacheEnabled, params.zuoraEntityIds, params.idempotencyKey, params.acceptEncoding, params.contentEncoding, params.zuoraOrgIds);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy