All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.openapitools.client.api.PlansApi Maven / Gradle / Ivy

There is a newer version: 3.2.1
Show newest version
/*
* 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.Plan;
import org.openapitools.client.model.PlanCreateRequest;
import org.openapitools.client.model.PlanListResponse;
import org.openapitools.client.model.PlanPatchRequest;

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 PlansApi {
    private ApiClient localVarApiClient;
    private int localHostIndex;
    private String localCustomBaseUrl;
    public PlansApi() {
    this(Configuration.getDefaultApiClient());
    }

    public PlansApi(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 createPlanCall(PlanCreateRequest planCreateRequest, List fields, List planFields, List pricesFields, List productFields, List expand, List filter, Integer pageSize, String zuoraTrackId, Boolean async, Boolean zuoraCacheEnabled, String zuoraEntityIds, String idempotencyKey, String acceptEncoding, String contentEncoding, String zuoraOrgIds, final ApiCallback _callback) throws ApiException {
        String basePath = null;
        // Operation Servers
        String[] localBasePaths = new String[] {  };

        // Determine Base Path to Use
        if (localCustomBaseUrl != null){
        basePath = localCustomBaseUrl;
        } else if ( localBasePaths.length > 0 ) {
        basePath = localBasePaths[localHostIndex];
        } else {
        basePath = null;
        }

        Object localVarPostBody = planCreateRequest;

        // create path and map variables
            String localVarPath = "/plans";


        List localVarQueryParams = new ArrayList();
        List localVarCollectionQueryParams = new ArrayList();
        Map localVarHeaderParams = new HashMap();
        Map localVarCookieParams = new HashMap();
        Map localVarFormParams = new HashMap();

                    if (fields != null) {
                localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "fields[]", fields));
                    }

                    if (planFields != null) {
                localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "plan.fields[]", planFields));
                    }

                    if (pricesFields != null) {
                localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "prices.fields[]", pricesFields));
                    }

                    if (productFields != null) {
                localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "product.fields[]", productFields));
                    }

                    if (expand != null) {
                localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "expand[]", expand));
                    }

                    if (filter != null) {
                localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "filter[]", filter));
                    }

                    if (pageSize != null) {
                localVarQueryParams.addAll(localVarApiClient.parameterToPair("page_size", pageSize));
                    }

                    if (zuoraTrackId != null) {
                    localVarHeaderParams.put("zuora-track-id", localVarApiClient.parameterToString(zuoraTrackId));
                    }

                    if (async != null) {
                    localVarHeaderParams.put("async", localVarApiClient.parameterToString(async));
                    }

                    if (zuoraCacheEnabled != null) {
                    localVarHeaderParams.put("zuora-cache-enabled", localVarApiClient.parameterToString(zuoraCacheEnabled));
                    }

                    if (zuoraEntityIds != null) {
                    localVarHeaderParams.put("zuora-entity-ids", localVarApiClient.parameterToString(zuoraEntityIds));
                    }

                    if (idempotencyKey != null) {
                    localVarHeaderParams.put("idempotency-key", localVarApiClient.parameterToString(idempotencyKey));
                    }

                    if (acceptEncoding != null) {
                    localVarHeaderParams.put("accept-encoding", localVarApiClient.parameterToString(acceptEncoding));
                    }

                    if (contentEncoding != null) {
                    localVarHeaderParams.put("content-encoding", localVarApiClient.parameterToString(contentEncoding));
                    }

                    if (zuoraOrgIds != null) {
                    localVarHeaderParams.put("zuora-org-ids", localVarApiClient.parameterToString(zuoraOrgIds));
                    }

            final String[] localVarAccepts = {
                "application/json"
            };
            final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
            if (localVarAccept != null) {
            localVarHeaderParams.put("Accept", localVarAccept);
            }

            final String[] localVarContentTypes = {
                "application/json"
            };
            final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
            if (localVarContentType != null) {
            localVarHeaderParams.put("Content-Type", localVarContentType);
            }

            String[] localVarAuthNames = new String[] { "bearerAuth" };
            return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
            }

            @SuppressWarnings("rawtypes")
            private okhttp3.Call createPlanValidateBeforeCall(PlanCreateRequest planCreateRequest, List fields, List planFields, List pricesFields, List productFields, List expand, List filter, Integer pageSize, String zuoraTrackId, Boolean async, Boolean zuoraCacheEnabled, String zuoraEntityIds, String idempotencyKey, String acceptEncoding, String contentEncoding, String zuoraOrgIds, final ApiCallback _callback) throws ApiException {
                        // verify the required parameter 'planCreateRequest' is set
                        if (planCreateRequest == null) {
                        throw new ApiException("Missing the required parameter 'planCreateRequest' when calling createPlan(Async)");
                        }

                return createPlanCall(planCreateRequest, fields, planFields, pricesFields, productFields, expand, filter, pageSize, zuoraTrackId, async, zuoraCacheEnabled, zuoraEntityIds, idempotencyKey, acceptEncoding, contentEncoding, zuoraOrgIds, _callback);
            }

        private ApiResponse createPlanWithHttpInfo(PlanCreateRequest planCreateRequest, List fields, List planFields, List pricesFields, List productFields, List expand, List filter, Integer pageSize, String zuoraTrackId, Boolean async, Boolean zuoraCacheEnabled, String zuoraEntityIds, String idempotencyKey, String acceptEncoding, String contentEncoding, String zuoraOrgIds) throws ApiException {
            okhttp3.Call localVarCall = createPlanValidateBeforeCall(planCreateRequest, fields, planFields, pricesFields, productFields, expand, filter, pageSize, zuoraTrackId, async, zuoraCacheEnabled, zuoraEntityIds, idempotencyKey, acceptEncoding, contentEncoding, zuoraOrgIds, null);
                    try {
                    Type localVarReturnType = new TypeToken(){}.getType();
                    return localVarApiClient.execute(localVarCall, localVarReturnType);
                    } catch (ApiException e) {
                    e.setErrorObject(localVarApiClient.getJSON().getGson().fromJson(e.getResponseBody(), new TypeToken(){}.getType()));
                    throw e;
                    }
            }

        private okhttp3.Call createPlanAsync(PlanCreateRequest planCreateRequest, List fields, List planFields, List pricesFields, List productFields, List expand, List filter, Integer pageSize, String zuoraTrackId, Boolean async, Boolean zuoraCacheEnabled, String zuoraEntityIds, String idempotencyKey, String acceptEncoding, String contentEncoding, String zuoraOrgIds, final ApiCallback _callback) throws ApiException {
            okhttp3.Call localVarCall = createPlanValidateBeforeCall(planCreateRequest, fields, planFields, pricesFields, productFields, expand, filter, pageSize, zuoraTrackId, async, zuoraCacheEnabled, zuoraEntityIds, idempotencyKey, acceptEncoding, contentEncoding, zuoraOrgIds, _callback);
        Type localVarReturnType = new TypeToken(){}.getType();
            localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
            return localVarCall;
            }

        public static class CreatePlanParams {
                    private final PlanCreateRequest planCreateRequest;
            private Headers headers;
            /*
        * Check for list params
            */
                private GetByIdQueryParams getByIdQueryParams;
                    private List fields;
                    private List planFields;
                    private List pricesFields;
                    private List productFields;
                    private List expand;
                    private List filter;
                    private Integer pageSize;
                    private String zuoraTrackId;
                    private Boolean async;
                    private Boolean zuoraCacheEnabled;
                    private String zuoraEntityIds;
                    private String idempotencyKey;
                    private String acceptEncoding;
                    private String contentEncoding;
                    private String zuoraOrgIds;
                public CreatePlanParams(PlanCreateRequest planCreateRequest) {
                    this.planCreateRequest = planCreateRequest;
                }
                    /**
                    * Set getByIdQueryParams
                    * @param getByIdQueryParams GetByIdQueryParams
                    * @return CreatePlanParams
                    */
                    public CreatePlanParams getByIdQueryParams(GetByIdQueryParams getByIdQueryParams) {
                    this.getByIdQueryParams = getByIdQueryParams;
                        if (expand != null) {
                        this.expand = getByIdQueryParams.getExpand();
                        }
                        if (filter != null) {
                        this.filter = getByIdQueryParams.getFilter();
                        }
                        if (pageSize != null) {
                        this.pageSize = getByIdQueryParams.getPageSize();
                        }
                    return this;
                    }
            /**
            * Set headers
            * @param headers Headers
            * @return CreatePlanParams
            */
            public CreatePlanParams headers(Headers headers) {
            this.headers = headers;
                if (headers.getZuoraTrackId() != null) {
                this.zuoraTrackId = headers.getZuoraTrackId();
                }
                if (headers.getAsync() != null) {
                this.async = headers.getAsync();
                }
                if (headers.getZuoraCacheEnabled() != null) {
                this.zuoraCacheEnabled = headers.getZuoraCacheEnabled();
                }
                if (headers.getZuoraEntityIds() != null) {
                this.zuoraEntityIds = headers.getZuoraEntityIds();
                }
                if (headers.getIdempotencyKey() != null) {
                this.idempotencyKey = headers.getIdempotencyKey();
                }
                if (headers.getAcceptEncoding() != null) {
                this.acceptEncoding = headers.getAcceptEncoding();
                }
                if (headers.getContentEncoding() != null) {
                this.contentEncoding = headers.getContentEncoding();
                }
                if (headers.getZuoraOrgIds() != null) {
                this.zuoraOrgIds = headers.getZuoraOrgIds();
                }
            return this;
            }
                    /**
                    * Set fields
                    * @param fields Allows you to specify which fields are returned in the response.          <details>            <summary> Accepted values </summary>              `custom_fields`, `created_by_id`, `updated_by_id`, `created_time`, `id`, `updated_time`, `start_date`, `end_date`, `name`, `active`, `description`, `plan_number`, `product_id`, `active_currencies`          </details> (optional)
                    * @return CreatePlanParams
                    */
                    public CreatePlanParams fields(List fields) {
                    this.fields = fields;
                    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 CreatePlanParams
                    */
                    public CreatePlanParams planFields(List planFields) {
                    this.planFields = planFields;
                    return this;
                    }
                    /**
                    * Set pricesFields
                    * @param pricesFields 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 CreatePlanParams
                    */
                    public CreatePlanParams pricesFields(List pricesFields) {
                    this.pricesFields = pricesFields;
                    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 CreatePlanParams
                    */
                    public CreatePlanParams productFields(List productFields) {
                    this.productFields = productFields;
                    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 CreatePlanParams
                    */
                    public CreatePlanParams expand(List expand) {
                    this.expand = expand;
                    return this;
                    }
                    /**
                    * Set filter
                    * @param filter A case-sensitive filter on the list. See the [Filter lists](https://developer.zuora.com/quickstart-api/tutorial/filter-lists/) section of the Quickstart API Tutorial for detailed instructions.                         Note that the filters on this operation are only applicable to the related objects. For example, when you are calling the \"Retrieve a billing document\" operation, you can use the `filter[]` parameter on the related objects such as `filter[]=items[account_id].EQ:8ad09e208858b5cf0188595208151c63` (optional)
                    * @return CreatePlanParams
                    */
                    public CreatePlanParams filter(List filter) {
                    this.filter = filter;
                    return this;
                    }
                    /**
                    * Set pageSize
                    * @param pageSize The maximum number of results to return in a single page. If the specified `page_size` is less than 1 or greater than 99, Zuora will return a 400 error. (optional)
                    * @return CreatePlanParams
                    */
                    public CreatePlanParams pageSize(Integer pageSize) {
                    this.pageSize = pageSize;
                    return this;
                    }
                }

            /**
            * Create a plan
            * Creates a new plan for an existing product.
                * @param planCreateRequest  (required)
            * @return Plan
                * @http.response.details
                
Status Code Description Response Headers
201 Default Response * ratelimit-limit - The request limit quota for the time window closest to exhaustion. See [rate limits](https://developer.zuora.com/rest-api/general-concepts/rate-concurrency-limits/#rate-limits) for more information.
* ratelimit-remaining - The number of requests remaining in the time window closest to quota exhaustion. See [rate limits](https://developer.zuora.com/rest-api/general-concepts/rate-concurrency-limits/#rate-limits) for more information.
* ratelimit-reset - The number of seconds until the quota resets for the time window closest to quota exhaustion. See [rate limits](https://developer.zuora.com/rest-api/general-concepts/rate-concurrency-limits/#rate-limits) for more information.
* zuora-request-id - Zuora’s internal identifier for this request.
* zuora-track-id - A user-supplied identifier for this request. If you supply a `zuora-track-id` as a request header, Zuora returns the `zuora-track-id` as a response header.
400 Bad Request -
401 Unauthorized -
404 Not Found -
405 Method Not Allowed -
429 Too Many Requests -
500 Internal Server Error -
502 Bad Gateway -
503 Service Unavailable -
504 Gateway Timeout -
*/ public CreatePlanParams createPlanParams(PlanCreateRequest planCreateRequest) { return new CreatePlanParams(planCreateRequest); } public Plan createPlan(PlanCreateRequest planCreateRequest) throws ApiException { CreatePlanParams params = new CreatePlanParams(planCreateRequest); return executeCreatePlanAPICall(params).getData(); } /** * Expose HTTP info public ApiResponse createPlanWithHttpInfo(PlanCreateRequest planCreateRequest) throws ApiException { CreatePlanParams params = new CreatePlanParams(planCreateRequest); return executeCreatePlanAPICall(params); } **/ /** Legacy Query Params Requests **/ public Plan createPlan( PlanCreateRequest planCreateRequest , List expand) throws ApiException { CreatePlanParams params = new CreatePlanParams(planCreateRequest); params.expand(expand); return executeCreatePlanAPICall(params).getData(); } /* * add header methods */ public Plan createPlan(PlanCreateRequest planCreateRequest ,List expand,Headers headers) throws ApiException { CreatePlanParams params = new CreatePlanParams(planCreateRequest) .expand(expand) .headers(headers); return executeCreatePlanAPICall(params).getData(); } /** * Create a plan * Creates a new plan for an existing product. * @param params CreatePlanParams * @return Plan * @http.response.details
Status Code Description Response Headers
201 Default Response * ratelimit-limit - The request limit quota for the time window closest to exhaustion. See [rate limits](https://developer.zuora.com/rest-api/general-concepts/rate-concurrency-limits/#rate-limits) for more information.
* ratelimit-remaining - The number of requests remaining in the time window closest to quota exhaustion. See [rate limits](https://developer.zuora.com/rest-api/general-concepts/rate-concurrency-limits/#rate-limits) for more information.
* ratelimit-reset - The number of seconds until the quota resets for the time window closest to quota exhaustion. See [rate limits](https://developer.zuora.com/rest-api/general-concepts/rate-concurrency-limits/#rate-limits) for more information.
* zuora-request-id - Zuora’s internal identifier for this request.
* zuora-track-id - A user-supplied identifier for this request. If you supply a `zuora-track-id` as a request header, Zuora returns the `zuora-track-id` as a response header.
400 Bad Request -
401 Unauthorized -
404 Not Found -
405 Method Not Allowed -
429 Too Many Requests -
500 Internal Server Error -
502 Bad Gateway -
503 Service Unavailable -
504 Gateway Timeout -
*/ public Plan create(CreatePlanParams params) throws ApiException { return executeCreatePlanAPICall(params).getData(); } public ApiResponse createWithHttpInfo(CreatePlanParams params) throws ApiException { return executeCreatePlanAPICall(params); } ApiResponse executeCreatePlanAPICall(CreatePlanParams params) throws ApiException { return createPlanWithHttpInfo(params.planCreateRequest, params.fields, params.planFields, params.pricesFields, params.productFields, params.expand, params.filter, params.pageSize, params.zuoraTrackId, params.async, params.zuoraCacheEnabled, params.zuoraEntityIds, params.idempotencyKey, params.acceptEncoding, params.contentEncoding, params.zuoraOrgIds); } private okhttp3.Call deletePlanCall(String planId, 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 = "/plans/{plan_id}" .replace("{" + "plan_id" + "}", localVarApiClient.escapeString(planId.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); Map localVarHeaderParams = new HashMap(); Map localVarCookieParams = new HashMap(); Map localVarFormParams = new HashMap(); if (zuoraTrackId != null) { localVarHeaderParams.put("zuora-track-id", localVarApiClient.parameterToString(zuoraTrackId)); } if (async != null) { localVarHeaderParams.put("async", localVarApiClient.parameterToString(async)); } if (zuoraCacheEnabled != null) { localVarHeaderParams.put("zuora-cache-enabled", localVarApiClient.parameterToString(zuoraCacheEnabled)); } if (zuoraEntityIds != null) { localVarHeaderParams.put("zuora-entity-ids", localVarApiClient.parameterToString(zuoraEntityIds)); } if (idempotencyKey != null) { localVarHeaderParams.put("idempotency-key", localVarApiClient.parameterToString(idempotencyKey)); } if (acceptEncoding != null) { localVarHeaderParams.put("accept-encoding", localVarApiClient.parameterToString(acceptEncoding)); } if (contentEncoding != null) { localVarHeaderParams.put("content-encoding", localVarApiClient.parameterToString(contentEncoding)); } if (zuoraOrgIds != null) { localVarHeaderParams.put("zuora-org-ids", localVarApiClient.parameterToString(zuoraOrgIds)); } final String[] localVarAccepts = { "application/json" }; final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) { localVarHeaderParams.put("Accept", localVarAccept); } final String[] localVarContentTypes = { }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } String[] localVarAuthNames = new String[] { "bearerAuth" }; return localVarApiClient.buildCall(basePath, localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") private okhttp3.Call deletePlanValidateBeforeCall(String planId, String zuoraTrackId, Boolean async, Boolean zuoraCacheEnabled, String zuoraEntityIds, String idempotencyKey, String acceptEncoding, String contentEncoding, String zuoraOrgIds, final ApiCallback _callback) throws ApiException { // verify the required parameter 'planId' is set if (planId == null) { throw new ApiException("Missing the required parameter 'planId' when calling deletePlan(Async)"); } return deletePlanCall(planId, zuoraTrackId, async, zuoraCacheEnabled, zuoraEntityIds, idempotencyKey, acceptEncoding, contentEncoding, zuoraOrgIds, _callback); } private ApiResponse deletePlanWithHttpInfo(String planId, String zuoraTrackId, Boolean async, Boolean zuoraCacheEnabled, String zuoraEntityIds, String idempotencyKey, String acceptEncoding, String contentEncoding, String zuoraOrgIds) throws ApiException { okhttp3.Call localVarCall = deletePlanValidateBeforeCall(planId, zuoraTrackId, async, zuoraCacheEnabled, zuoraEntityIds, idempotencyKey, acceptEncoding, contentEncoding, zuoraOrgIds, null); return localVarApiClient.execute(localVarCall); } private okhttp3.Call deletePlanAsync(String planId, String zuoraTrackId, Boolean async, Boolean zuoraCacheEnabled, String zuoraEntityIds, String idempotencyKey, String acceptEncoding, String contentEncoding, String zuoraOrgIds, final ApiCallback _callback) throws ApiException { okhttp3.Call localVarCall = deletePlanValidateBeforeCall(planId, zuoraTrackId, async, zuoraCacheEnabled, zuoraEntityIds, idempotencyKey, acceptEncoding, contentEncoding, zuoraOrgIds, _callback); localVarApiClient.executeAsync(localVarCall, _callback); return localVarCall; } public static class DeletePlanParams { private final String planId; private Headers headers; /* * Check for list params */ private GetByIdQueryParams getByIdQueryParams; private String zuoraTrackId; private Boolean async; private Boolean zuoraCacheEnabled; private String zuoraEntityIds; private String idempotencyKey; private String acceptEncoding; private String contentEncoding; private String zuoraOrgIds; public DeletePlanParams(String planId) { this.planId = planId; } /** * Set headers * @param headers Headers * @return DeletePlanParams */ public DeletePlanParams headers(Headers headers) { this.headers = headers; if (headers.getZuoraTrackId() != null) { this.zuoraTrackId = headers.getZuoraTrackId(); } if (headers.getAsync() != null) { this.async = headers.getAsync(); } if (headers.getZuoraCacheEnabled() != null) { this.zuoraCacheEnabled = headers.getZuoraCacheEnabled(); } if (headers.getZuoraEntityIds() != null) { this.zuoraEntityIds = headers.getZuoraEntityIds(); } if (headers.getIdempotencyKey() != null) { this.idempotencyKey = headers.getIdempotencyKey(); } if (headers.getAcceptEncoding() != null) { this.acceptEncoding = headers.getAcceptEncoding(); } if (headers.getContentEncoding() != null) { this.contentEncoding = headers.getContentEncoding(); } if (headers.getZuoraOrgIds() != null) { this.zuoraOrgIds = headers.getZuoraOrgIds(); } return this; } } /** * Delete a plan * Permanently deletes a plan. It cannot be undone. * @param planId The plan number or plan Id. (required) * @return * @http.response.details
Status Code Description Response Headers
204 Default Response * ratelimit-limit - The request limit quota for the time window closest to exhaustion. See [rate limits](https://developer.zuora.com/rest-api/general-concepts/rate-concurrency-limits/#rate-limits) for more information.
* ratelimit-remaining - The number of requests remaining in the time window closest to quota exhaustion. See [rate limits](https://developer.zuora.com/rest-api/general-concepts/rate-concurrency-limits/#rate-limits) for more information.
* ratelimit-reset - The number of seconds until the quota resets for the time window closest to quota exhaustion. See [rate limits](https://developer.zuora.com/rest-api/general-concepts/rate-concurrency-limits/#rate-limits) for more information.
* zuora-request-id - Zuora’s internal identifier for this request.
* zuora-track-id - A user-supplied identifier for this request. If you supply a `zuora-track-id` as a request header, Zuora returns the `zuora-track-id` as a response header.
400 Bad Request -
401 Unauthorized -
404 Not Found -
405 Method Not Allowed -
429 Too Many Requests -
500 Internal Server Error -
502 Bad Gateway -
503 Service Unavailable -
504 Gateway Timeout -
*/ public DeletePlanParams deletePlanParams(String planId) { return new DeletePlanParams(planId); } public void deletePlan(String planId) throws ApiException { DeletePlanParams params = new DeletePlanParams(planId); executeDeletePlanAPICall(params); } /** * Expose HTTP info public ApiResponse deletePlanWithHttpInfo(String planId) throws ApiException { DeletePlanParams params = new DeletePlanParams(planId); return executeDeletePlanAPICall(params); } **/ /** Legacy Query Params Requests **/ /* * add header methods */ public void deletePlan(String planId ,Headers headers) throws ApiException { DeletePlanParams params = new DeletePlanParams(planId) .headers(headers); executeDeletePlanAPICall(params); } /** * Delete a plan * Permanently deletes a plan. It cannot be undone. * @param params DeletePlanParams * @return * @http.response.details
Status Code Description Response Headers
204 Default Response * ratelimit-limit - The request limit quota for the time window closest to exhaustion. See [rate limits](https://developer.zuora.com/rest-api/general-concepts/rate-concurrency-limits/#rate-limits) for more information.
* ratelimit-remaining - The number of requests remaining in the time window closest to quota exhaustion. See [rate limits](https://developer.zuora.com/rest-api/general-concepts/rate-concurrency-limits/#rate-limits) for more information.
* ratelimit-reset - The number of seconds until the quota resets for the time window closest to quota exhaustion. See [rate limits](https://developer.zuora.com/rest-api/general-concepts/rate-concurrency-limits/#rate-limits) for more information.
* zuora-request-id - Zuora’s internal identifier for this request.
* zuora-track-id - A user-supplied identifier for this request. If you supply a `zuora-track-id` as a request header, Zuora returns the `zuora-track-id` as a response header.
400 Bad Request -
401 Unauthorized -
404 Not Found -
405 Method Not Allowed -
429 Too Many Requests -
500 Internal Server Error -
502 Bad Gateway -
503 Service Unavailable -
504 Gateway Timeout -
*/ public void delete(DeletePlanParams params) throws ApiException { executeDeletePlanAPICall(params).getData(); } public ApiResponse deleteWithHttpInfo(DeletePlanParams params) throws ApiException { return executeDeletePlanAPICall(params); } ApiResponse executeDeletePlanAPICall(DeletePlanParams params) throws ApiException { return deletePlanWithHttpInfo(params.planId, params.zuoraTrackId, params.async, params.zuoraCacheEnabled, params.zuoraEntityIds, params.idempotencyKey, params.acceptEncoding, params.contentEncoding, params.zuoraOrgIds); } private okhttp3.Call getPlanCall(String planId, List fields, List planFields, List pricesFields, List productFields, List expand, List filter, Integer pageSize, String zuoraTrackId, Boolean async, Boolean zuoraCacheEnabled, String zuoraEntityIds, String idempotencyKey, String acceptEncoding, String contentEncoding, String zuoraOrgIds, final ApiCallback _callback) throws ApiException { String basePath = null; // Operation Servers String[] localBasePaths = new String[] { }; // Determine Base Path to Use if (localCustomBaseUrl != null){ basePath = localCustomBaseUrl; } else if ( localBasePaths.length > 0 ) { basePath = localBasePaths[localHostIndex]; } else { basePath = null; } Object localVarPostBody = null; // create path and map variables String localVarPath = "/plans/{plan_id}" .replace("{" + "plan_id" + "}", localVarApiClient.escapeString(planId.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); Map localVarHeaderParams = new HashMap(); Map localVarCookieParams = new HashMap(); Map localVarFormParams = new HashMap(); if (fields != null) { localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "fields[]", fields)); } if (planFields != null) { localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "plan.fields[]", planFields)); } if (pricesFields != null) { localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "prices.fields[]", pricesFields)); } if (productFields != null) { localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "product.fields[]", productFields)); } if (expand != null) { localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "expand[]", expand)); } if (filter != null) { localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "filter[]", filter)); } if (pageSize != null) { localVarQueryParams.addAll(localVarApiClient.parameterToPair("page_size", pageSize)); } if (zuoraTrackId != null) { localVarHeaderParams.put("zuora-track-id", localVarApiClient.parameterToString(zuoraTrackId)); } if (async != null) { localVarHeaderParams.put("async", localVarApiClient.parameterToString(async)); } if (zuoraCacheEnabled != null) { localVarHeaderParams.put("zuora-cache-enabled", localVarApiClient.parameterToString(zuoraCacheEnabled)); } if (zuoraEntityIds != null) { localVarHeaderParams.put("zuora-entity-ids", localVarApiClient.parameterToString(zuoraEntityIds)); } if (idempotencyKey != null) { localVarHeaderParams.put("idempotency-key", localVarApiClient.parameterToString(idempotencyKey)); } if (acceptEncoding != null) { localVarHeaderParams.put("accept-encoding", localVarApiClient.parameterToString(acceptEncoding)); } if (contentEncoding != null) { localVarHeaderParams.put("content-encoding", localVarApiClient.parameterToString(contentEncoding)); } if (zuoraOrgIds != null) { localVarHeaderParams.put("zuora-org-ids", localVarApiClient.parameterToString(zuoraOrgIds)); } final String[] localVarAccepts = { "application/json" }; final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) { localVarHeaderParams.put("Accept", localVarAccept); } final String[] localVarContentTypes = { }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } String[] localVarAuthNames = new String[] { "bearerAuth" }; return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") private okhttp3.Call getPlanValidateBeforeCall(String planId, List fields, List planFields, List pricesFields, List productFields, List expand, List filter, Integer pageSize, String zuoraTrackId, Boolean async, Boolean zuoraCacheEnabled, String zuoraEntityIds, String idempotencyKey, String acceptEncoding, String contentEncoding, String zuoraOrgIds, final ApiCallback _callback) throws ApiException { // verify the required parameter 'planId' is set if (planId == null) { throw new ApiException("Missing the required parameter 'planId' when calling getPlan(Async)"); } return getPlanCall(planId, fields, planFields, pricesFields, productFields, expand, filter, pageSize, zuoraTrackId, async, zuoraCacheEnabled, zuoraEntityIds, idempotencyKey, acceptEncoding, contentEncoding, zuoraOrgIds, _callback); } private ApiResponse getPlanWithHttpInfo(String planId, List fields, List planFields, List pricesFields, List productFields, List expand, List filter, Integer pageSize, String zuoraTrackId, Boolean async, Boolean zuoraCacheEnabled, String zuoraEntityIds, String idempotencyKey, String acceptEncoding, String contentEncoding, String zuoraOrgIds) throws ApiException { okhttp3.Call localVarCall = getPlanValidateBeforeCall(planId, fields, planFields, pricesFields, productFields, expand, filter, pageSize, zuoraTrackId, async, zuoraCacheEnabled, zuoraEntityIds, idempotencyKey, acceptEncoding, contentEncoding, zuoraOrgIds, null); try { Type localVarReturnType = new TypeToken(){}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } catch (ApiException e) { e.setErrorObject(localVarApiClient.getJSON().getGson().fromJson(e.getResponseBody(), new TypeToken(){}.getType())); throw e; } } private okhttp3.Call getPlanAsync(String planId, List fields, List planFields, List pricesFields, List productFields, List expand, List filter, Integer pageSize, String zuoraTrackId, Boolean async, Boolean zuoraCacheEnabled, String zuoraEntityIds, String idempotencyKey, String acceptEncoding, String contentEncoding, String zuoraOrgIds, final ApiCallback _callback) throws ApiException { okhttp3.Call localVarCall = getPlanValidateBeforeCall(planId, fields, planFields, pricesFields, productFields, expand, filter, pageSize, zuoraTrackId, async, zuoraCacheEnabled, zuoraEntityIds, idempotencyKey, acceptEncoding, contentEncoding, zuoraOrgIds, _callback); Type localVarReturnType = new TypeToken(){}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } public static class GetPlanParams { private final String planId; private Headers headers; /* * Check for list params */ private GetByIdQueryParams getByIdQueryParams; private List fields; private List planFields; private List pricesFields; private List productFields; private List expand; private List filter; private Integer pageSize; private String zuoraTrackId; private Boolean async; private Boolean zuoraCacheEnabled; private String zuoraEntityIds; private String idempotencyKey; private String acceptEncoding; private String contentEncoding; private String zuoraOrgIds; public GetPlanParams(String planId) { this.planId = planId; } /** * Set getByIdQueryParams * @param getByIdQueryParams GetByIdQueryParams * @return GetPlanParams */ public GetPlanParams getByIdQueryParams(GetByIdQueryParams getByIdQueryParams) { this.getByIdQueryParams = getByIdQueryParams; if (expand != null) { this.expand = getByIdQueryParams.getExpand(); } if (filter != null) { this.filter = getByIdQueryParams.getFilter(); } if (pageSize != null) { this.pageSize = getByIdQueryParams.getPageSize(); } return this; } /** * Set headers * @param headers Headers * @return GetPlanParams */ public GetPlanParams headers(Headers headers) { this.headers = headers; if (headers.getZuoraTrackId() != null) { this.zuoraTrackId = headers.getZuoraTrackId(); } if (headers.getAsync() != null) { this.async = headers.getAsync(); } if (headers.getZuoraCacheEnabled() != null) { this.zuoraCacheEnabled = headers.getZuoraCacheEnabled(); } if (headers.getZuoraEntityIds() != null) { this.zuoraEntityIds = headers.getZuoraEntityIds(); } if (headers.getIdempotencyKey() != null) { this.idempotencyKey = headers.getIdempotencyKey(); } if (headers.getAcceptEncoding() != null) { this.acceptEncoding = headers.getAcceptEncoding(); } if (headers.getContentEncoding() != null) { this.contentEncoding = headers.getContentEncoding(); } if (headers.getZuoraOrgIds() != null) { this.zuoraOrgIds = headers.getZuoraOrgIds(); } return this; } /** * Set fields * @param fields Allows you to specify which fields are returned in the response. <details> <summary> Accepted values </summary> `custom_fields`, `created_by_id`, `updated_by_id`, `created_time`, `id`, `updated_time`, `start_date`, `end_date`, `name`, `active`, `description`, `plan_number`, `product_id`, `active_currencies` </details> (optional) * @return GetPlanParams */ public GetPlanParams fields(List fields) { this.fields = fields; 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 GetPlanParams */ public GetPlanParams planFields(List planFields) { this.planFields = planFields; return this; } /** * Set pricesFields * @param pricesFields 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 GetPlanParams */ public GetPlanParams pricesFields(List pricesFields) { this.pricesFields = pricesFields; 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 GetPlanParams */ public GetPlanParams productFields(List productFields) { this.productFields = productFields; 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 GetPlanParams */ public GetPlanParams expand(List expand) { this.expand = expand; return this; } /** * Set filter * @param filter A case-sensitive filter on the list. See the [Filter lists](https://developer.zuora.com/quickstart-api/tutorial/filter-lists/) section of the Quickstart API Tutorial for detailed instructions. Note that the filters on this operation are only applicable to the related objects. For example, when you are calling the \"Retrieve a billing document\" operation, you can use the `filter[]` parameter on the related objects such as `filter[]=items[account_id].EQ:8ad09e208858b5cf0188595208151c63` (optional) * @return GetPlanParams */ public GetPlanParams filter(List filter) { this.filter = filter; return this; } /** * Set pageSize * @param pageSize The maximum number of results to return in a single page. If the specified `page_size` is less than 1 or greater than 99, Zuora will return a 400 error. (optional) * @return GetPlanParams */ public GetPlanParams pageSize(Integer pageSize) { this.pageSize = pageSize; return this; } } /** * Retrieve a plan * Retrieves the plan with the given ID. * @param planId The plan number or plan Id. (required) * @return Plan * @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 GetPlanParams getPlanParams(String planId) { return new GetPlanParams(planId); } public Plan getPlan(String planId) throws ApiException { GetPlanParams params = new GetPlanParams(planId); return executeGetPlanAPICall(params).getData(); } /** * Expose HTTP info public ApiResponse getPlanWithHttpInfo(String planId) throws ApiException { GetPlanParams params = new GetPlanParams(planId); return executeGetPlanAPICall(params); } **/ /** Legacy Query Params Requests **/ public Plan getPlan( String planId , List expand) throws ApiException { GetPlanParams params = new GetPlanParams(planId); params.expand(expand); return executeGetPlanAPICall(params).getData(); } /* * add header methods */ public Plan getPlan(String planId ,List expand,Headers headers) throws ApiException { GetPlanParams params = new GetPlanParams(planId) .expand(expand) .headers(headers); return executeGetPlanAPICall(params).getData(); } /** * Retrieve a plan * Retrieves the plan with the given ID. * @param params GetPlanParams * @return Plan * @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 Plan get(GetPlanParams params) throws ApiException { return executeGetPlanAPICall(params).getData(); } public ApiResponse getWithHttpInfo(GetPlanParams params) throws ApiException { return executeGetPlanAPICall(params); } ApiResponse executeGetPlanAPICall(GetPlanParams params) throws ApiException { return getPlanWithHttpInfo(params.planId, params.fields, params.planFields, params.pricesFields, params.productFields, params.expand, params.filter, params.pageSize, params.zuoraTrackId, params.async, params.zuoraCacheEnabled, params.zuoraEntityIds, params.idempotencyKey, params.acceptEncoding, params.contentEncoding, params.zuoraOrgIds); } private okhttp3.Call getPlansCall(String cursor, List expand, List filter, List sort, Integer pageSize, List fields, List planFields, List pricesFields, List productFields, 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 = "/plans"; 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 (planFields != null) { localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "plan.fields[]", planFields)); } if (pricesFields != null) { localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "prices.fields[]", pricesFields)); } if (productFields != null) { localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "product.fields[]", productFields)); } 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 getPlansValidateBeforeCall(String cursor, List expand, List filter, List sort, Integer pageSize, List fields, List planFields, List pricesFields, List productFields, String zuoraTrackId, Boolean async, Boolean zuoraCacheEnabled, String zuoraEntityIds, String idempotencyKey, String acceptEncoding, String contentEncoding, String zuoraOrgIds, final ApiCallback _callback) throws ApiException { return getPlansCall(cursor, expand, filter, sort, pageSize, fields, planFields, pricesFields, productFields, zuoraTrackId, async, zuoraCacheEnabled, zuoraEntityIds, idempotencyKey, acceptEncoding, contentEncoding, zuoraOrgIds, _callback); } private ApiResponse getPlansWithHttpInfo(String cursor, List expand, List filter, List sort, Integer pageSize, List fields, List planFields, List pricesFields, List productFields, String zuoraTrackId, Boolean async, Boolean zuoraCacheEnabled, String zuoraEntityIds, String idempotencyKey, String acceptEncoding, String contentEncoding, String zuoraOrgIds) throws ApiException { okhttp3.Call localVarCall = getPlansValidateBeforeCall(cursor, expand, filter, sort, pageSize, fields, planFields, pricesFields, productFields, 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 getPlansAsync(String cursor, List expand, List filter, List sort, Integer pageSize, List fields, List planFields, List pricesFields, List productFields, String zuoraTrackId, Boolean async, Boolean zuoraCacheEnabled, String zuoraEntityIds, String idempotencyKey, String acceptEncoding, String contentEncoding, String zuoraOrgIds, final ApiCallback _callback) throws ApiException { okhttp3.Call localVarCall = getPlansValidateBeforeCall(cursor, expand, filter, sort, pageSize, fields, planFields, pricesFields, productFields, zuoraTrackId, async, zuoraCacheEnabled, zuoraEntityIds, idempotencyKey, acceptEncoding, contentEncoding, zuoraOrgIds, _callback); Type localVarReturnType = new TypeToken(){}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } public static class GetPlansParams { 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 planFields; private List pricesFields; private List productFields; 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 GetPlansParams() { } /** * Set listQueryParams * @param listQueryParams ListQueryParams * @return GetPlansParams */ public GetPlansParams 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 GetPlansParams */ public GetPlansParams 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 GetPlansParams */ public GetPlansParams 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 GetPlansParams */ public GetPlansParams 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 GetPlansParams */ public GetPlansParams 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 GetPlansParams */ public GetPlansParams 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 GetPlansParams */ public GetPlansParams 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`, `name`, `active`, `description`, `plan_number`, `product_id`, `active_currencies` </details> (optional) * @return GetPlansParams */ public GetPlansParams fields(List fields) { this.fields = fields; 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 GetPlansParams */ public GetPlansParams planFields(List planFields) { this.planFields = planFields; return this; } /** * Set pricesFields * @param pricesFields 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 GetPlansParams */ public GetPlansParams pricesFields(List pricesFields) { this.pricesFields = pricesFields; 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 GetPlansParams */ public GetPlansParams productFields(List productFields) { this.productFields = productFields; return this; } } /** * List plans * Returns a dictionary with a data property that contains an array of plans, starting after the cursor, if used. Each entry in the array is a separate plan object. If no more plans are available, the resulting array will be empty. This request should never return an error. * @return PlanListResponse * @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 GetPlansParams getPlansParams() { return new GetPlansParams(); } public PlanListResponse getPlans() throws ApiException { GetPlansParams params = new GetPlansParams(); return executeGetPlansAPICall(params).getData(); } /** * Expose HTTP info public ApiResponse getPlansWithHttpInfo() throws ApiException { GetPlansParams params = new GetPlansParams(); return executeGetPlansAPICall(params); } **/ /** Legacy Query Params Requests **/ public PlanListResponse getPlans(String cursor, List expand, List filter) throws ApiException { GetPlansParams params = new GetPlansParams(); params.cursor(cursor); params.expand(expand); params.filter(filter); return executeGetPlansAPICall(params).getData(); } /* * add header methods */ public PlanListResponse getPlans(String cursor,List expand,List filter,Headers headers) throws ApiException { GetPlansParams params = new GetPlansParams() .cursor(cursor) .expand(expand) .filter(filter) .headers(headers); return executeGetPlansAPICall(params).getData(); } /** * List plans * Returns a dictionary with a data property that contains an array of plans, starting after the cursor, if used. Each entry in the array is a separate plan object. If no more plans are available, the resulting array will be empty. This request should never return an error. * @param params GetPlansParams * @return PlanListResponse * @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 PlanListResponse list(GetPlansParams params) throws ApiException { return executeGetPlansAPICall(params).getData(); } public ApiResponse listWithHttpInfo(GetPlansParams params) throws ApiException { return executeGetPlansAPICall(params); } ApiResponse executeGetPlansAPICall(GetPlansParams params) throws ApiException { return getPlansWithHttpInfo(params.cursor, params.expand, params.filter, params.sort, params.pageSize, params.fields, params.planFields, params.pricesFields, params.productFields, params.zuoraTrackId, params.async, params.zuoraCacheEnabled, params.zuoraEntityIds, params.idempotencyKey, params.acceptEncoding, params.contentEncoding, params.zuoraOrgIds); } private okhttp3.Call updatePlanCall(String planId, PlanPatchRequest planPatchRequest, List fields, List planFields, List pricesFields, List productFields, List expand, List filter, Integer pageSize, String zuoraTrackId, Boolean async, Boolean zuoraCacheEnabled, String zuoraEntityIds, String idempotencyKey, String acceptEncoding, String contentEncoding, String zuoraOrgIds, final ApiCallback _callback) throws ApiException { String basePath = null; // Operation Servers String[] localBasePaths = new String[] { }; // Determine Base Path to Use if (localCustomBaseUrl != null){ basePath = localCustomBaseUrl; } else if ( localBasePaths.length > 0 ) { basePath = localBasePaths[localHostIndex]; } else { basePath = null; } Object localVarPostBody = planPatchRequest; // create path and map variables String localVarPath = "/plans/{plan_id}" .replace("{" + "plan_id" + "}", localVarApiClient.escapeString(planId.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); Map localVarHeaderParams = new HashMap(); Map localVarCookieParams = new HashMap(); Map localVarFormParams = new HashMap(); if (fields != null) { localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "fields[]", fields)); } if (planFields != null) { localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "plan.fields[]", planFields)); } if (pricesFields != null) { localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "prices.fields[]", pricesFields)); } if (productFields != null) { localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "product.fields[]", productFields)); } if (expand != null) { localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "expand[]", expand)); } if (filter != null) { localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "filter[]", filter)); } if (pageSize != null) { localVarQueryParams.addAll(localVarApiClient.parameterToPair("page_size", pageSize)); } if (zuoraTrackId != null) { localVarHeaderParams.put("zuora-track-id", localVarApiClient.parameterToString(zuoraTrackId)); } if (async != null) { localVarHeaderParams.put("async", localVarApiClient.parameterToString(async)); } if (zuoraCacheEnabled != null) { localVarHeaderParams.put("zuora-cache-enabled", localVarApiClient.parameterToString(zuoraCacheEnabled)); } if (zuoraEntityIds != null) { localVarHeaderParams.put("zuora-entity-ids", localVarApiClient.parameterToString(zuoraEntityIds)); } if (idempotencyKey != null) { localVarHeaderParams.put("idempotency-key", localVarApiClient.parameterToString(idempotencyKey)); } if (acceptEncoding != null) { localVarHeaderParams.put("accept-encoding", localVarApiClient.parameterToString(acceptEncoding)); } if (contentEncoding != null) { localVarHeaderParams.put("content-encoding", localVarApiClient.parameterToString(contentEncoding)); } if (zuoraOrgIds != null) { localVarHeaderParams.put("zuora-org-ids", localVarApiClient.parameterToString(zuoraOrgIds)); } final String[] localVarAccepts = { "application/json" }; final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) { localVarHeaderParams.put("Accept", localVarAccept); } final String[] localVarContentTypes = { "application/json" }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } String[] localVarAuthNames = new String[] { "bearerAuth" }; return localVarApiClient.buildCall(basePath, localVarPath, "PATCH", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") private okhttp3.Call updatePlanValidateBeforeCall(String planId, PlanPatchRequest planPatchRequest, List fields, List planFields, List pricesFields, List productFields, List expand, List filter, Integer pageSize, String zuoraTrackId, Boolean async, Boolean zuoraCacheEnabled, String zuoraEntityIds, String idempotencyKey, String acceptEncoding, String contentEncoding, String zuoraOrgIds, final ApiCallback _callback) throws ApiException { // verify the required parameter 'planId' is set if (planId == null) { throw new ApiException("Missing the required parameter 'planId' when calling updatePlan(Async)"); } // verify the required parameter 'planPatchRequest' is set if (planPatchRequest == null) { throw new ApiException("Missing the required parameter 'planPatchRequest' when calling updatePlan(Async)"); } return updatePlanCall(planId, planPatchRequest, fields, planFields, pricesFields, productFields, expand, filter, pageSize, zuoraTrackId, async, zuoraCacheEnabled, zuoraEntityIds, idempotencyKey, acceptEncoding, contentEncoding, zuoraOrgIds, _callback); } private ApiResponse updatePlanWithHttpInfo(String planId, PlanPatchRequest planPatchRequest, List fields, List planFields, List pricesFields, List productFields, List expand, List filter, Integer pageSize, String zuoraTrackId, Boolean async, Boolean zuoraCacheEnabled, String zuoraEntityIds, String idempotencyKey, String acceptEncoding, String contentEncoding, String zuoraOrgIds) throws ApiException { okhttp3.Call localVarCall = updatePlanValidateBeforeCall(planId, planPatchRequest, fields, planFields, pricesFields, productFields, expand, filter, pageSize, zuoraTrackId, async, zuoraCacheEnabled, zuoraEntityIds, idempotencyKey, acceptEncoding, contentEncoding, zuoraOrgIds, null); try { Type localVarReturnType = new TypeToken(){}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } catch (ApiException e) { e.setErrorObject(localVarApiClient.getJSON().getGson().fromJson(e.getResponseBody(), new TypeToken(){}.getType())); throw e; } } private okhttp3.Call updatePlanAsync(String planId, PlanPatchRequest planPatchRequest, List fields, List planFields, List pricesFields, List productFields, List expand, List filter, Integer pageSize, String zuoraTrackId, Boolean async, Boolean zuoraCacheEnabled, String zuoraEntityIds, String idempotencyKey, String acceptEncoding, String contentEncoding, String zuoraOrgIds, final ApiCallback _callback) throws ApiException { okhttp3.Call localVarCall = updatePlanValidateBeforeCall(planId, planPatchRequest, fields, planFields, pricesFields, productFields, expand, filter, pageSize, zuoraTrackId, async, zuoraCacheEnabled, zuoraEntityIds, idempotencyKey, acceptEncoding, contentEncoding, zuoraOrgIds, _callback); Type localVarReturnType = new TypeToken(){}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } public static class UpdatePlanParams { private final String planId; private final PlanPatchRequest planPatchRequest; private Headers headers; /* * Check for list params */ private GetByIdQueryParams getByIdQueryParams; private List fields; private List planFields; private List pricesFields; private List productFields; private List expand; private List filter; private Integer pageSize; private String zuoraTrackId; private Boolean async; private Boolean zuoraCacheEnabled; private String zuoraEntityIds; private String idempotencyKey; private String acceptEncoding; private String contentEncoding; private String zuoraOrgIds; public UpdatePlanParams(String planId, PlanPatchRequest planPatchRequest) { this.planId = planId; this.planPatchRequest = planPatchRequest; } /** * Set getByIdQueryParams * @param getByIdQueryParams GetByIdQueryParams * @return UpdatePlanParams */ public UpdatePlanParams getByIdQueryParams(GetByIdQueryParams getByIdQueryParams) { this.getByIdQueryParams = getByIdQueryParams; if (expand != null) { this.expand = getByIdQueryParams.getExpand(); } if (filter != null) { this.filter = getByIdQueryParams.getFilter(); } if (pageSize != null) { this.pageSize = getByIdQueryParams.getPageSize(); } return this; } /** * Set headers * @param headers Headers * @return UpdatePlanParams */ public UpdatePlanParams headers(Headers headers) { this.headers = headers; if (headers.getZuoraTrackId() != null) { this.zuoraTrackId = headers.getZuoraTrackId(); } if (headers.getAsync() != null) { this.async = headers.getAsync(); } if (headers.getZuoraCacheEnabled() != null) { this.zuoraCacheEnabled = headers.getZuoraCacheEnabled(); } if (headers.getZuoraEntityIds() != null) { this.zuoraEntityIds = headers.getZuoraEntityIds(); } if (headers.getIdempotencyKey() != null) { this.idempotencyKey = headers.getIdempotencyKey(); } if (headers.getAcceptEncoding() != null) { this.acceptEncoding = headers.getAcceptEncoding(); } if (headers.getContentEncoding() != null) { this.contentEncoding = headers.getContentEncoding(); } if (headers.getZuoraOrgIds() != null) { this.zuoraOrgIds = headers.getZuoraOrgIds(); } return this; } /** * Set fields * @param fields Allows you to specify which fields are returned in the response. <details> <summary> Accepted values </summary> `custom_fields`, `created_by_id`, `updated_by_id`, `created_time`, `id`, `updated_time`, `start_date`, `end_date`, `name`, `active`, `description`, `plan_number`, `product_id`, `active_currencies` </details> (optional) * @return UpdatePlanParams */ public UpdatePlanParams fields(List fields) { this.fields = fields; 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 UpdatePlanParams */ public UpdatePlanParams planFields(List planFields) { this.planFields = planFields; return this; } /** * Set pricesFields * @param pricesFields 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 UpdatePlanParams */ public UpdatePlanParams pricesFields(List pricesFields) { this.pricesFields = pricesFields; 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 UpdatePlanParams */ public UpdatePlanParams productFields(List productFields) { this.productFields = productFields; 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 UpdatePlanParams */ public UpdatePlanParams expand(List expand) { this.expand = expand; return this; } /** * Set filter * @param filter A case-sensitive filter on the list. See the [Filter lists](https://developer.zuora.com/quickstart-api/tutorial/filter-lists/) section of the Quickstart API Tutorial for detailed instructions. Note that the filters on this operation are only applicable to the related objects. For example, when you are calling the \"Retrieve a billing document\" operation, you can use the `filter[]` parameter on the related objects such as `filter[]=items[account_id].EQ:8ad09e208858b5cf0188595208151c63` (optional) * @return UpdatePlanParams */ public UpdatePlanParams filter(List filter) { this.filter = filter; return this; } /** * Set pageSize * @param pageSize The maximum number of results to return in a single page. If the specified `page_size` is less than 1 or greater than 99, Zuora will return a 400 error. (optional) * @return UpdatePlanParams */ public UpdatePlanParams pageSize(Integer pageSize) { this.pageSize = pageSize; return this; } } /** * Update a plan * Updates the specified plan by setting the values of the parameters passed. Any parameters not provided will be left unchanged. * @param planId The plan number or plan Id. (required) * @param planPatchRequest (required) * @return Plan * @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 UpdatePlanParams updatePlanParams(String planId, PlanPatchRequest planPatchRequest) { return new UpdatePlanParams(planId, planPatchRequest); } public Plan updatePlan(String planId, PlanPatchRequest planPatchRequest) throws ApiException { UpdatePlanParams params = new UpdatePlanParams(planId, planPatchRequest); return executeUpdatePlanAPICall(params).getData(); } /** * Expose HTTP info public ApiResponse updatePlanWithHttpInfo(String planId, PlanPatchRequest planPatchRequest) throws ApiException { UpdatePlanParams params = new UpdatePlanParams(planId, planPatchRequest); return executeUpdatePlanAPICall(params); } **/ /** Legacy Query Params Requests **/ public Plan updatePlan( String planId , PlanPatchRequest planPatchRequest , List expand) throws ApiException { UpdatePlanParams params = new UpdatePlanParams(planId, planPatchRequest); params.expand(expand); return executeUpdatePlanAPICall(params).getData(); } /* * add header methods */ public Plan updatePlan(String planId , PlanPatchRequest planPatchRequest ,List expand,Headers headers) throws ApiException { UpdatePlanParams params = new UpdatePlanParams(planId, planPatchRequest) .expand(expand) .headers(headers); return executeUpdatePlanAPICall(params).getData(); } /** * Update a plan * Updates the specified plan by setting the values of the parameters passed. Any parameters not provided will be left unchanged. * @param params UpdatePlanParams * @return Plan * @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 Plan update(UpdatePlanParams params) throws ApiException { return executeUpdatePlanAPICall(params).getData(); } public ApiResponse updateWithHttpInfo(UpdatePlanParams params) throws ApiException { return executeUpdatePlanAPICall(params); } ApiResponse executeUpdatePlanAPICall(UpdatePlanParams params) throws ApiException { return updatePlanWithHttpInfo(params.planId, params.planPatchRequest, params.fields, params.planFields, params.pricesFields, params.productFields, params.expand, params.filter, params.pageSize, params.zuoraTrackId, params.async, params.zuoraCacheEnabled, params.zuoraEntityIds, params.idempotencyKey, params.acceptEncoding, params.contentEncoding, params.zuoraOrgIds); } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy