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

org.openapitools.client.api.SubscriptionsApi 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.CancelSubscriptionRequest;
import org.openapitools.client.model.ErrorResponse;
import org.openapitools.client.model.PauseSubscriptionRequest;
import org.openapitools.client.model.ResumeSubscriptionRequest;
import org.openapitools.client.model.Subscription;
import org.openapitools.client.model.SubscriptionActivateRequest;
import org.openapitools.client.model.SubscriptionCancelResponse;
import org.openapitools.client.model.SubscriptionCreateRequest;
import org.openapitools.client.model.SubscriptionListResponse;
import org.openapitools.client.model.SubscriptionPatchRequest;
import org.openapitools.client.model.SubscriptionPreviewExistingRequest;
import org.openapitools.client.model.SubscriptionPreviewRequest;
import org.openapitools.client.model.SubscriptionPreviewResponse;
import org.openapitools.client.model.SubscriptionVersionListResponse;

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

    public SubscriptionsApi(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 activateSubscriptionCall(String subscriptionId, SubscriptionActivateRequest subscriptionActivateRequest, List fields, List subscriptionFields, List subscriptionPlansFields, List subscriptionItemsFields, List accountFields, List invoiceOwnerAccountFields, List planFields, List productFields, List priceFields, List billToFields, List prepaidBalanceFields, List prepaidBalancesFields, List validityPeriodFields, List transactionsFields, List expand, List filter, Integer pageSize, String zuoraTrackId, Boolean async, Boolean zuoraCacheEnabled, String zuoraEntityIds, String idempotencyKey, String acceptEncoding, String contentEncoding, String zuoraOrgIds, final ApiCallback _callback) throws ApiException {
        String basePath = null;
        // Operation Servers
        String[] localBasePaths = new String[] {  };

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

        Object localVarPostBody = subscriptionActivateRequest;

        // create path and map variables
            String localVarPath = "/subscriptions/{subscription_id}/activate"
                .replace("{" + "subscription_id" + "}", localVarApiClient.escapeString(subscriptionId.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 (subscriptionFields != null) {
                localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "subscription.fields[]", subscriptionFields));
                    }

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

            @SuppressWarnings("rawtypes")
            private okhttp3.Call activateSubscriptionValidateBeforeCall(String subscriptionId, SubscriptionActivateRequest subscriptionActivateRequest, List fields, List subscriptionFields, List subscriptionPlansFields, List subscriptionItemsFields, List accountFields, List invoiceOwnerAccountFields, List planFields, List productFields, List priceFields, List billToFields, List prepaidBalanceFields, List prepaidBalancesFields, List validityPeriodFields, List transactionsFields, List expand, List filter, Integer pageSize, String zuoraTrackId, Boolean async, Boolean zuoraCacheEnabled, String zuoraEntityIds, String idempotencyKey, String acceptEncoding, String contentEncoding, String zuoraOrgIds, final ApiCallback _callback) throws ApiException {
                        // verify the required parameter 'subscriptionId' is set
                        if (subscriptionId == null) {
                        throw new ApiException("Missing the required parameter 'subscriptionId' when calling activateSubscription(Async)");
                        }

                        // verify the required parameter 'subscriptionActivateRequest' is set
                        if (subscriptionActivateRequest == null) {
                        throw new ApiException("Missing the required parameter 'subscriptionActivateRequest' when calling activateSubscription(Async)");
                        }

                return activateSubscriptionCall(subscriptionId, subscriptionActivateRequest, fields, subscriptionFields, subscriptionPlansFields, subscriptionItemsFields, accountFields, invoiceOwnerAccountFields, planFields, productFields, priceFields, billToFields, prepaidBalanceFields, prepaidBalancesFields, validityPeriodFields, transactionsFields, expand, filter, pageSize, zuoraTrackId, async, zuoraCacheEnabled, zuoraEntityIds, idempotencyKey, acceptEncoding, contentEncoding, zuoraOrgIds, _callback);
            }

        private ApiResponse activateSubscriptionWithHttpInfo(String subscriptionId, SubscriptionActivateRequest subscriptionActivateRequest, List fields, List subscriptionFields, List subscriptionPlansFields, List subscriptionItemsFields, List accountFields, List invoiceOwnerAccountFields, List planFields, List productFields, List priceFields, List billToFields, List prepaidBalanceFields, List prepaidBalancesFields, List validityPeriodFields, List transactionsFields, List expand, List filter, Integer pageSize, String zuoraTrackId, Boolean async, Boolean zuoraCacheEnabled, String zuoraEntityIds, String idempotencyKey, String acceptEncoding, String contentEncoding, String zuoraOrgIds) throws ApiException {
            okhttp3.Call localVarCall = activateSubscriptionValidateBeforeCall(subscriptionId, subscriptionActivateRequest, fields, subscriptionFields, subscriptionPlansFields, subscriptionItemsFields, accountFields, invoiceOwnerAccountFields, planFields, productFields, priceFields, billToFields, prepaidBalanceFields, prepaidBalancesFields, validityPeriodFields, transactionsFields, expand, filter, pageSize, zuoraTrackId, async, zuoraCacheEnabled, zuoraEntityIds, idempotencyKey, acceptEncoding, contentEncoding, zuoraOrgIds, null);
                    try {
                    Type localVarReturnType = new TypeToken(){}.getType();
                    return localVarApiClient.execute(localVarCall, localVarReturnType);
                    } catch (ApiException e) {
                    e.setErrorObject(localVarApiClient.getJSON().getGson().fromJson(e.getResponseBody(), new TypeToken(){}.getType()));
                    throw e;
                    }
            }

        private okhttp3.Call activateSubscriptionAsync(String subscriptionId, SubscriptionActivateRequest subscriptionActivateRequest, List fields, List subscriptionFields, List subscriptionPlansFields, List subscriptionItemsFields, List accountFields, List invoiceOwnerAccountFields, List planFields, List productFields, List priceFields, List billToFields, List prepaidBalanceFields, List prepaidBalancesFields, List validityPeriodFields, List transactionsFields, List expand, List filter, Integer pageSize, String zuoraTrackId, Boolean async, Boolean zuoraCacheEnabled, String zuoraEntityIds, String idempotencyKey, String acceptEncoding, String contentEncoding, String zuoraOrgIds, final ApiCallback _callback) throws ApiException {
            okhttp3.Call localVarCall = activateSubscriptionValidateBeforeCall(subscriptionId, subscriptionActivateRequest, fields, subscriptionFields, subscriptionPlansFields, subscriptionItemsFields, accountFields, invoiceOwnerAccountFields, planFields, productFields, priceFields, billToFields, prepaidBalanceFields, prepaidBalancesFields, validityPeriodFields, transactionsFields, expand, filter, pageSize, zuoraTrackId, async, zuoraCacheEnabled, zuoraEntityIds, idempotencyKey, acceptEncoding, contentEncoding, zuoraOrgIds, _callback);
        Type localVarReturnType = new TypeToken(){}.getType();
            localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
            return localVarCall;
            }

        public static class ActivateSubscriptionParams {
                    private final String subscriptionId;
                    private final SubscriptionActivateRequest subscriptionActivateRequest;
            private Headers headers;
            /*
        * Check for list params
            */
                private GetByIdQueryParams getByIdQueryParams;
                    private List fields;
                    private List subscriptionFields;
                    private List subscriptionPlansFields;
                    private List subscriptionItemsFields;
                    private List accountFields;
                    private List invoiceOwnerAccountFields;
                    private List planFields;
                    private List productFields;
                    private List priceFields;
                    private List billToFields;
                    private List prepaidBalanceFields;
                    private List prepaidBalancesFields;
                    private List validityPeriodFields;
                    private List transactionsFields;
                    private List expand;
                    private List filter;
                    private Integer pageSize;
                    private String zuoraTrackId;
                    private Boolean async;
                    private Boolean zuoraCacheEnabled;
                    private String zuoraEntityIds;
                    private String idempotencyKey;
                    private String acceptEncoding;
                    private String contentEncoding;
                    private String zuoraOrgIds;
                public ActivateSubscriptionParams(String subscriptionId, SubscriptionActivateRequest subscriptionActivateRequest) {
                    this.subscriptionId = subscriptionId;
                    this.subscriptionActivateRequest = subscriptionActivateRequest;
                }
                    /**
                    * Set getByIdQueryParams
                    * @param getByIdQueryParams GetByIdQueryParams
                    * @return ActivateSubscriptionParams
                    */
                    public ActivateSubscriptionParams 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 ActivateSubscriptionParams
            */
            public ActivateSubscriptionParams 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`, `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 ActivateSubscriptionParams
                    */
                    public ActivateSubscriptionParams fields(List fields) {
                    this.fields = fields;
                    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 ActivateSubscriptionParams
                    */
                    public ActivateSubscriptionParams subscriptionFields(List subscriptionFields) {
                    this.subscriptionFields = subscriptionFields;
                    return this;
                    }
                    /**
                    * Set subscriptionPlansFields
                    * @param subscriptionPlansFields Allows you to specify which fields are returned in the response.          <details>            <summary> Accepted values </summary>              `custom_fields`, `created_by_id`, `updated_by_id`, `created_time`, `id`, `updated_time`, `name`, `plan_id`, `subscription_id`, `product_id`, `subscription_plan_number`          </details> (optional)
                    * @return ActivateSubscriptionParams
                    */
                    public ActivateSubscriptionParams subscriptionPlansFields(List subscriptionPlansFields) {
                    this.subscriptionPlansFields = subscriptionPlansFields;
                    return this;
                    }
                    /**
                    * Set subscriptionItemsFields
                    * @param subscriptionItemsFields Allows you to specify which fields are returned in the response.          <details>            <summary> Accepted values </summary>              `custom_fields`, `created_by_id`, `updated_by_id`, `created_time`, `id`, `updated_time`, `start_date`, `end_date`, `charge_model`, `charge_type`, `tiers`, `subscription_item_number`, `name`, `description`, `charged_through_date`, `recurring`, `price_id`, `start_event`, `tax_code`, `tax_inclusive`, `unit_of_measure`, `quantity`, `price_base_interval`, `overage`, `subscription_plan_id`, `tiers_mode`, `processed_through_date`, `active`, `state`, `unit_amount`, `amount`, `discount_amount`, `discount_percent`, `price_change_percentage`, `price_change_option`          </details> (optional)
                    * @return ActivateSubscriptionParams
                    */
                    public ActivateSubscriptionParams subscriptionItemsFields(List subscriptionItemsFields) {
                    this.subscriptionItemsFields = subscriptionItemsFields;
                    return this;
                    }
                    /**
                    * Set accountFields
                    * @param accountFields Allows you to specify which fields are returned in the response.          <details>            <summary> Accepted values </summary>              `custom_fields`, `created_by_id`, `updated_by_id`, `created_time`, `id`, `updated_time`, `auto_pay`, `account_number`, `bill_to_id`, `sold_to_id`, `billing_document_settings`, `communication_profile_id`, `crm_id`, `sales_rep`, `parent_account_id`, `payment_gateway`, `payment_terms`, `remaining_credit_memo_balance`, `remaining_debit_memo_balance`, `remaining_invoice_balance`, `remaining_payment_balance`, `sequence_set_id`, `tax_certificate`, `batch`, `tax_identifier`, `bill_cycle_day`, `description`, `name`, `currency`, `default_payment_method_id`, `enabled`, `organization_id`          </details> (optional)
                    * @return ActivateSubscriptionParams
                    */
                    public ActivateSubscriptionParams accountFields(List accountFields) {
                    this.accountFields = accountFields;
                    return this;
                    }
                    /**
                    * Set invoiceOwnerAccountFields
                    * @param invoiceOwnerAccountFields Allows you to specify which fields are returned in the response.          <details>            <summary> Accepted values </summary>              `custom_fields`, `created_by_id`, `updated_by_id`, `created_time`, `id`, `updated_time`, `auto_pay`, `account_number`, `bill_to_id`, `sold_to_id`, `billing_document_settings`, `communication_profile_id`, `crm_id`, `sales_rep`, `parent_account_id`, `payment_gateway`, `payment_terms`, `remaining_credit_memo_balance`, `remaining_debit_memo_balance`, `remaining_invoice_balance`, `remaining_payment_balance`, `sequence_set_id`, `tax_certificate`, `batch`, `tax_identifier`, `bill_cycle_day`, `description`, `name`, `currency`, `default_payment_method_id`, `enabled`, `organization_id`          </details> (optional)
                    * @return ActivateSubscriptionParams
                    */
                    public ActivateSubscriptionParams invoiceOwnerAccountFields(List invoiceOwnerAccountFields) {
                    this.invoiceOwnerAccountFields = invoiceOwnerAccountFields;
                    return this;
                    }
                    /**
                    * Set planFields
                    * @param planFields Allows you to specify which fields are returned in the response.          <details>            <summary> Accepted values </summary>              `custom_fields`, `created_by_id`, `updated_by_id`, `created_time`, `id`, `updated_time`, `start_date`, `end_date`, `name`, `active`, `description`, `plan_number`, `product_id`, `active_currencies`          </details> (optional)
                    * @return ActivateSubscriptionParams
                    */
                    public ActivateSubscriptionParams 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 ActivateSubscriptionParams
                    */
                    public ActivateSubscriptionParams productFields(List productFields) {
                    this.productFields = productFields;
                    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 ActivateSubscriptionParams
                    */
                    public ActivateSubscriptionParams priceFields(List priceFields) {
                    this.priceFields = priceFields;
                    return this;
                    }
                    /**
                    * Set billToFields
                    * @param billToFields Allows you to specify which fields are returned in the response.          <details>            <summary> Accepted values </summary>              `custom_fields`, `created_by_id`, `updated_by_id`, `created_time`, `id`, `updated_time`, `account_id`, `address`, `home_phone`, `first_name`, `last_name`, `email`, `work_email`, `nickname`, `other_phone`, `work_phone`, `mobile_phone`, `tax_region`, `other_phone_type`, `fax`          </details> (optional)
                    * @return ActivateSubscriptionParams
                    */
                    public ActivateSubscriptionParams billToFields(List billToFields) {
                    this.billToFields = billToFields;
                    return this;
                    }
                    /**
                    * Set prepaidBalanceFields
                    * @param prepaidBalanceFields Allows you to specify which fields are returned in the response.          <details>            <summary> Accepted values </summary>              `prepaid_UOM`, `start_date`, `end_date`, `total_balance`, `remaining_balance`          </details> (optional)
                    * @return ActivateSubscriptionParams
                    */
                    public ActivateSubscriptionParams prepaidBalanceFields(List prepaidBalanceFields) {
                    this.prepaidBalanceFields = prepaidBalanceFields;
                    return this;
                    }
                    /**
                    * Set prepaidBalancesFields
                    * @param prepaidBalancesFields Allows you to specify which fields are returned in the response.          <details>            <summary> Accepted values </summary>              `validity_periods`          </details> (optional)
                    * @return ActivateSubscriptionParams
                    */
                    public ActivateSubscriptionParams prepaidBalancesFields(List prepaidBalancesFields) {
                    this.prepaidBalancesFields = prepaidBalancesFields;
                    return this;
                    }
                    /**
                    * Set validityPeriodFields
                    * @param validityPeriodFields Allows you to specify which fields are returned in the response.          <details>            <summary> Accepted values </summary>              `prepaid_UOM`, `start_date`, `end_date`, `total_balance`, `remaining_balance`, `overage_rated_amount`, `overage_rated_quantity`          </details> (optional)
                    * @return ActivateSubscriptionParams
                    */
                    public ActivateSubscriptionParams validityPeriodFields(List validityPeriodFields) {
                    this.validityPeriodFields = validityPeriodFields;
                    return this;
                    }
                    /**
                    * Set transactionsFields
                    * @param transactionsFields Allows you to specify which fields are returned in the response.          <details>            <summary> Accepted values </summary>              `transaction_date`, `type`, `quantity`          </details> (optional)
                    * @return ActivateSubscriptionParams
                    */
                    public ActivateSubscriptionParams transactionsFields(List transactionsFields) {
                    this.transactionsFields = transactionsFields;
                    return this;
                    }
                    /**
                    * Set expand
                    * @param expand Allows you to expand responses by including related object information in a single call. See the [Expand responses](https://developer.zuora.com/quickstart-api/tutorial/expand-responses/) section of the Quickstart API Tutorials for detailed instructions. (optional)
                    * @return ActivateSubscriptionParams
                    */
                    public ActivateSubscriptionParams 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 ActivateSubscriptionParams
                    */
                    public ActivateSubscriptionParams 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 ActivateSubscriptionParams
                    */
                    public ActivateSubscriptionParams pageSize(Integer pageSize) {
                    this.pageSize = pageSize;
                    return this;
                    }
                }

            /**
            * Activate a subscription
            * A subscription must be active before you can bill your subscribers. Activating a subscription requires entering at least one of the following dates: `contract_effective`, `service_activation`, and `customer_acceptance`. See [Billing Trigger Dates](https://knowledgecenter.zuora.com/Billing/Billing_and_Payments/WA_Dates_in_Zuora/B_Subscription_and_Amendment_Dates#Billing_Trigger_Dates) for more information.
                * @param subscriptionId Identifier for the subscription, either `subscription_number` or `subscription_id` (required)
                * @param subscriptionActivateRequest  (required)
            * @return Subscription
                * @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 ActivateSubscriptionParams activateSubscriptionParams(String subscriptionId, SubscriptionActivateRequest subscriptionActivateRequest) { return new ActivateSubscriptionParams(subscriptionId, subscriptionActivateRequest); } public Subscription activateSubscription(String subscriptionId, SubscriptionActivateRequest subscriptionActivateRequest) throws ApiException { ActivateSubscriptionParams params = new ActivateSubscriptionParams(subscriptionId, subscriptionActivateRequest); return executeActivateSubscriptionAPICall(params).getData(); } /** * Expose HTTP info public ApiResponse activateSubscriptionWithHttpInfo(String subscriptionId, SubscriptionActivateRequest subscriptionActivateRequest) throws ApiException { ActivateSubscriptionParams params = new ActivateSubscriptionParams(subscriptionId, subscriptionActivateRequest); return executeActivateSubscriptionAPICall(params); } **/ /** Legacy Query Params Requests **/ public Subscription activateSubscription( String subscriptionId , SubscriptionActivateRequest subscriptionActivateRequest , List expand) throws ApiException { ActivateSubscriptionParams params = new ActivateSubscriptionParams(subscriptionId, subscriptionActivateRequest); params.expand(expand); return executeActivateSubscriptionAPICall(params).getData(); } /* * add header methods */ public Subscription activateSubscription(String subscriptionId , SubscriptionActivateRequest subscriptionActivateRequest ,List expand,Headers headers) throws ApiException { ActivateSubscriptionParams params = new ActivateSubscriptionParams(subscriptionId, subscriptionActivateRequest) .expand(expand) .headers(headers); return executeActivateSubscriptionAPICall(params).getData(); } /** * Activate a subscription * A subscription must be active before you can bill your subscribers. Activating a subscription requires entering at least one of the following dates: `contract_effective`, `service_activation`, and `customer_acceptance`. See [Billing Trigger Dates](https://knowledgecenter.zuora.com/Billing/Billing_and_Payments/WA_Dates_in_Zuora/B_Subscription_and_Amendment_Dates#Billing_Trigger_Dates) for more information. * @param params ActivateSubscriptionParams * @return Subscription * @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 Subscription activate(ActivateSubscriptionParams params) throws ApiException { return executeActivateSubscriptionAPICall(params).getData(); } public ApiResponse activateWithHttpInfo(ActivateSubscriptionParams params) throws ApiException { return executeActivateSubscriptionAPICall(params); } ApiResponse executeActivateSubscriptionAPICall(ActivateSubscriptionParams params) throws ApiException { return activateSubscriptionWithHttpInfo(params.subscriptionId, params.subscriptionActivateRequest, params.fields, params.subscriptionFields, params.subscriptionPlansFields, params.subscriptionItemsFields, params.accountFields, params.invoiceOwnerAccountFields, params.planFields, params.productFields, params.priceFields, params.billToFields, params.prepaidBalanceFields, params.prepaidBalancesFields, params.validityPeriodFields, params.transactionsFields, params.expand, params.filter, params.pageSize, params.zuoraTrackId, params.async, params.zuoraCacheEnabled, params.zuoraEntityIds, params.idempotencyKey, params.acceptEncoding, params.contentEncoding, params.zuoraOrgIds); } private okhttp3.Call cancelSubscriptionCall(String subscriptionId, CancelSubscriptionRequest cancelSubscriptionRequest, List fields, List subscriptionFields, List subscriptionPlansFields, List subscriptionItemsFields, List accountFields, List invoiceOwnerAccountFields, List planFields, List productFields, List priceFields, List billToFields, List prepaidBalanceFields, List prepaidBalancesFields, List validityPeriodFields, List transactionsFields, List expand, List filter, Integer pageSize, String zuoraTrackId, Boolean async, Boolean zuoraCacheEnabled, String zuoraEntityIds, String idempotencyKey, String acceptEncoding, String contentEncoding, String zuoraOrgIds, final ApiCallback _callback) throws ApiException { String basePath = null; // Operation Servers String[] localBasePaths = new String[] { }; // Determine Base Path to Use if (localCustomBaseUrl != null){ basePath = localCustomBaseUrl; } else if ( localBasePaths.length > 0 ) { basePath = localBasePaths[localHostIndex]; } else { basePath = null; } Object localVarPostBody = cancelSubscriptionRequest; // create path and map variables String localVarPath = "/subscriptions/{subscription_id}/cancel" .replace("{" + "subscription_id" + "}", localVarApiClient.escapeString(subscriptionId.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 (subscriptionFields != null) { localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "subscription.fields[]", subscriptionFields)); } if (subscriptionPlansFields != null) { localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "subscription_plans.fields[]", subscriptionPlansFields)); } if (subscriptionItemsFields != null) { localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "subscription_items.fields[]", subscriptionItemsFields)); } if (accountFields != null) { localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "account.fields[]", accountFields)); } if (invoiceOwnerAccountFields != null) { localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "invoice_owner_account.fields[]", invoiceOwnerAccountFields)); } if (planFields != null) { localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "plan.fields[]", planFields)); } if (productFields != null) { localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "product.fields[]", productFields)); } if (priceFields != null) { localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "price.fields[]", priceFields)); } if (billToFields != null) { localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "bill_to.fields[]", billToFields)); } if (prepaidBalanceFields != null) { localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "prepaid_balance.fields[]", prepaidBalanceFields)); } if (prepaidBalancesFields != null) { localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "prepaid_balances.fields[]", prepaidBalancesFields)); } if (validityPeriodFields != null) { localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "validity_period.fields[]", validityPeriodFields)); } if (transactionsFields != null) { localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "transactions.fields[]", transactionsFields)); } if (expand != null) { localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "expand[]", expand)); } if (filter != null) { localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "filter[]", filter)); } if (pageSize != null) { localVarQueryParams.addAll(localVarApiClient.parameterToPair("page_size", pageSize)); } if (zuoraTrackId != null) { localVarHeaderParams.put("zuora-track-id", localVarApiClient.parameterToString(zuoraTrackId)); } if (async != null) { localVarHeaderParams.put("async", localVarApiClient.parameterToString(async)); } if (zuoraCacheEnabled != null) { localVarHeaderParams.put("zuora-cache-enabled", localVarApiClient.parameterToString(zuoraCacheEnabled)); } if (zuoraEntityIds != null) { localVarHeaderParams.put("zuora-entity-ids", localVarApiClient.parameterToString(zuoraEntityIds)); } if (idempotencyKey != null) { localVarHeaderParams.put("idempotency-key", localVarApiClient.parameterToString(idempotencyKey)); } if (acceptEncoding != null) { localVarHeaderParams.put("accept-encoding", localVarApiClient.parameterToString(acceptEncoding)); } if (contentEncoding != null) { localVarHeaderParams.put("content-encoding", localVarApiClient.parameterToString(contentEncoding)); } if (zuoraOrgIds != null) { localVarHeaderParams.put("zuora-org-ids", localVarApiClient.parameterToString(zuoraOrgIds)); } final String[] localVarAccepts = { "application/json" }; final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) { localVarHeaderParams.put("Accept", localVarAccept); } final String[] localVarContentTypes = { "application/json" }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } String[] localVarAuthNames = new String[] { "bearerAuth" }; return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") private okhttp3.Call cancelSubscriptionValidateBeforeCall(String subscriptionId, CancelSubscriptionRequest cancelSubscriptionRequest, List fields, List subscriptionFields, List subscriptionPlansFields, List subscriptionItemsFields, List accountFields, List invoiceOwnerAccountFields, List planFields, List productFields, List priceFields, List billToFields, List prepaidBalanceFields, List prepaidBalancesFields, List validityPeriodFields, List transactionsFields, List expand, List filter, Integer pageSize, String zuoraTrackId, Boolean async, Boolean zuoraCacheEnabled, String zuoraEntityIds, String idempotencyKey, String acceptEncoding, String contentEncoding, String zuoraOrgIds, final ApiCallback _callback) throws ApiException { // verify the required parameter 'subscriptionId' is set if (subscriptionId == null) { throw new ApiException("Missing the required parameter 'subscriptionId' when calling cancelSubscription(Async)"); } // verify the required parameter 'cancelSubscriptionRequest' is set if (cancelSubscriptionRequest == null) { throw new ApiException("Missing the required parameter 'cancelSubscriptionRequest' when calling cancelSubscription(Async)"); } return cancelSubscriptionCall(subscriptionId, cancelSubscriptionRequest, fields, subscriptionFields, subscriptionPlansFields, subscriptionItemsFields, accountFields, invoiceOwnerAccountFields, planFields, productFields, priceFields, billToFields, prepaidBalanceFields, prepaidBalancesFields, validityPeriodFields, transactionsFields, expand, filter, pageSize, zuoraTrackId, async, zuoraCacheEnabled, zuoraEntityIds, idempotencyKey, acceptEncoding, contentEncoding, zuoraOrgIds, _callback); } private ApiResponse cancelSubscriptionWithHttpInfo(String subscriptionId, CancelSubscriptionRequest cancelSubscriptionRequest, List fields, List subscriptionFields, List subscriptionPlansFields, List subscriptionItemsFields, List accountFields, List invoiceOwnerAccountFields, List planFields, List productFields, List priceFields, List billToFields, List prepaidBalanceFields, List prepaidBalancesFields, List validityPeriodFields, List transactionsFields, List expand, List filter, Integer pageSize, String zuoraTrackId, Boolean async, Boolean zuoraCacheEnabled, String zuoraEntityIds, String idempotencyKey, String acceptEncoding, String contentEncoding, String zuoraOrgIds) throws ApiException { okhttp3.Call localVarCall = cancelSubscriptionValidateBeforeCall(subscriptionId, cancelSubscriptionRequest, fields, subscriptionFields, subscriptionPlansFields, subscriptionItemsFields, accountFields, invoiceOwnerAccountFields, planFields, productFields, priceFields, billToFields, prepaidBalanceFields, prepaidBalancesFields, validityPeriodFields, transactionsFields, expand, filter, pageSize, zuoraTrackId, async, zuoraCacheEnabled, zuoraEntityIds, idempotencyKey, acceptEncoding, contentEncoding, zuoraOrgIds, null); try { Type localVarReturnType = new TypeToken(){}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } catch (ApiException e) { e.setErrorObject(localVarApiClient.getJSON().getGson().fromJson(e.getResponseBody(), new TypeToken(){}.getType())); throw e; } } private okhttp3.Call cancelSubscriptionAsync(String subscriptionId, CancelSubscriptionRequest cancelSubscriptionRequest, List fields, List subscriptionFields, List subscriptionPlansFields, List subscriptionItemsFields, List accountFields, List invoiceOwnerAccountFields, List planFields, List productFields, List priceFields, List billToFields, List prepaidBalanceFields, List prepaidBalancesFields, List validityPeriodFields, List transactionsFields, List expand, List filter, Integer pageSize, String zuoraTrackId, Boolean async, Boolean zuoraCacheEnabled, String zuoraEntityIds, String idempotencyKey, String acceptEncoding, String contentEncoding, String zuoraOrgIds, final ApiCallback _callback) throws ApiException { okhttp3.Call localVarCall = cancelSubscriptionValidateBeforeCall(subscriptionId, cancelSubscriptionRequest, fields, subscriptionFields, subscriptionPlansFields, subscriptionItemsFields, accountFields, invoiceOwnerAccountFields, planFields, productFields, priceFields, billToFields, prepaidBalanceFields, prepaidBalancesFields, validityPeriodFields, transactionsFields, expand, filter, pageSize, zuoraTrackId, async, zuoraCacheEnabled, zuoraEntityIds, idempotencyKey, acceptEncoding, contentEncoding, zuoraOrgIds, _callback); Type localVarReturnType = new TypeToken(){}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } public static class CancelSubscriptionParams { private final String subscriptionId; private final CancelSubscriptionRequest cancelSubscriptionRequest; private Headers headers; /* * Check for list params */ private GetByIdQueryParams getByIdQueryParams; private List fields; private List subscriptionFields; private List subscriptionPlansFields; private List subscriptionItemsFields; private List accountFields; private List invoiceOwnerAccountFields; private List planFields; private List productFields; private List priceFields; private List billToFields; private List prepaidBalanceFields; private List prepaidBalancesFields; private List validityPeriodFields; private List transactionsFields; private List expand; private List filter; private Integer pageSize; private String zuoraTrackId; private Boolean async; private Boolean zuoraCacheEnabled; private String zuoraEntityIds; private String idempotencyKey; private String acceptEncoding; private String contentEncoding; private String zuoraOrgIds; public CancelSubscriptionParams(String subscriptionId, CancelSubscriptionRequest cancelSubscriptionRequest) { this.subscriptionId = subscriptionId; this.cancelSubscriptionRequest = cancelSubscriptionRequest; } /** * Set getByIdQueryParams * @param getByIdQueryParams GetByIdQueryParams * @return CancelSubscriptionParams */ public CancelSubscriptionParams 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 CancelSubscriptionParams */ public CancelSubscriptionParams 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`, `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 CancelSubscriptionParams */ public CancelSubscriptionParams fields(List fields) { this.fields = fields; 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 CancelSubscriptionParams */ public CancelSubscriptionParams subscriptionFields(List subscriptionFields) { this.subscriptionFields = subscriptionFields; return this; } /** * Set subscriptionPlansFields * @param subscriptionPlansFields Allows you to specify which fields are returned in the response. <details> <summary> Accepted values </summary> `custom_fields`, `created_by_id`, `updated_by_id`, `created_time`, `id`, `updated_time`, `name`, `plan_id`, `subscription_id`, `product_id`, `subscription_plan_number` </details> (optional) * @return CancelSubscriptionParams */ public CancelSubscriptionParams subscriptionPlansFields(List subscriptionPlansFields) { this.subscriptionPlansFields = subscriptionPlansFields; return this; } /** * Set subscriptionItemsFields * @param subscriptionItemsFields Allows you to specify which fields are returned in the response. <details> <summary> Accepted values </summary> `custom_fields`, `created_by_id`, `updated_by_id`, `created_time`, `id`, `updated_time`, `start_date`, `end_date`, `charge_model`, `charge_type`, `tiers`, `subscription_item_number`, `name`, `description`, `charged_through_date`, `recurring`, `price_id`, `start_event`, `tax_code`, `tax_inclusive`, `unit_of_measure`, `quantity`, `price_base_interval`, `overage`, `subscription_plan_id`, `tiers_mode`, `processed_through_date`, `active`, `state`, `unit_amount`, `amount`, `discount_amount`, `discount_percent`, `price_change_percentage`, `price_change_option` </details> (optional) * @return CancelSubscriptionParams */ public CancelSubscriptionParams subscriptionItemsFields(List subscriptionItemsFields) { this.subscriptionItemsFields = subscriptionItemsFields; return this; } /** * Set accountFields * @param accountFields Allows you to specify which fields are returned in the response. <details> <summary> Accepted values </summary> `custom_fields`, `created_by_id`, `updated_by_id`, `created_time`, `id`, `updated_time`, `auto_pay`, `account_number`, `bill_to_id`, `sold_to_id`, `billing_document_settings`, `communication_profile_id`, `crm_id`, `sales_rep`, `parent_account_id`, `payment_gateway`, `payment_terms`, `remaining_credit_memo_balance`, `remaining_debit_memo_balance`, `remaining_invoice_balance`, `remaining_payment_balance`, `sequence_set_id`, `tax_certificate`, `batch`, `tax_identifier`, `bill_cycle_day`, `description`, `name`, `currency`, `default_payment_method_id`, `enabled`, `organization_id` </details> (optional) * @return CancelSubscriptionParams */ public CancelSubscriptionParams accountFields(List accountFields) { this.accountFields = accountFields; return this; } /** * Set invoiceOwnerAccountFields * @param invoiceOwnerAccountFields Allows you to specify which fields are returned in the response. <details> <summary> Accepted values </summary> `custom_fields`, `created_by_id`, `updated_by_id`, `created_time`, `id`, `updated_time`, `auto_pay`, `account_number`, `bill_to_id`, `sold_to_id`, `billing_document_settings`, `communication_profile_id`, `crm_id`, `sales_rep`, `parent_account_id`, `payment_gateway`, `payment_terms`, `remaining_credit_memo_balance`, `remaining_debit_memo_balance`, `remaining_invoice_balance`, `remaining_payment_balance`, `sequence_set_id`, `tax_certificate`, `batch`, `tax_identifier`, `bill_cycle_day`, `description`, `name`, `currency`, `default_payment_method_id`, `enabled`, `organization_id` </details> (optional) * @return CancelSubscriptionParams */ public CancelSubscriptionParams invoiceOwnerAccountFields(List invoiceOwnerAccountFields) { this.invoiceOwnerAccountFields = invoiceOwnerAccountFields; return this; } /** * Set planFields * @param planFields Allows you to specify which fields are returned in the response. <details> <summary> Accepted values </summary> `custom_fields`, `created_by_id`, `updated_by_id`, `created_time`, `id`, `updated_time`, `start_date`, `end_date`, `name`, `active`, `description`, `plan_number`, `product_id`, `active_currencies` </details> (optional) * @return CancelSubscriptionParams */ public CancelSubscriptionParams 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 CancelSubscriptionParams */ public CancelSubscriptionParams productFields(List productFields) { this.productFields = productFields; 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 CancelSubscriptionParams */ public CancelSubscriptionParams priceFields(List priceFields) { this.priceFields = priceFields; return this; } /** * Set billToFields * @param billToFields Allows you to specify which fields are returned in the response. <details> <summary> Accepted values </summary> `custom_fields`, `created_by_id`, `updated_by_id`, `created_time`, `id`, `updated_time`, `account_id`, `address`, `home_phone`, `first_name`, `last_name`, `email`, `work_email`, `nickname`, `other_phone`, `work_phone`, `mobile_phone`, `tax_region`, `other_phone_type`, `fax` </details> (optional) * @return CancelSubscriptionParams */ public CancelSubscriptionParams billToFields(List billToFields) { this.billToFields = billToFields; return this; } /** * Set prepaidBalanceFields * @param prepaidBalanceFields Allows you to specify which fields are returned in the response. <details> <summary> Accepted values </summary> `prepaid_UOM`, `start_date`, `end_date`, `total_balance`, `remaining_balance` </details> (optional) * @return CancelSubscriptionParams */ public CancelSubscriptionParams prepaidBalanceFields(List prepaidBalanceFields) { this.prepaidBalanceFields = prepaidBalanceFields; return this; } /** * Set prepaidBalancesFields * @param prepaidBalancesFields Allows you to specify which fields are returned in the response. <details> <summary> Accepted values </summary> `validity_periods` </details> (optional) * @return CancelSubscriptionParams */ public CancelSubscriptionParams prepaidBalancesFields(List prepaidBalancesFields) { this.prepaidBalancesFields = prepaidBalancesFields; return this; } /** * Set validityPeriodFields * @param validityPeriodFields Allows you to specify which fields are returned in the response. <details> <summary> Accepted values </summary> `prepaid_UOM`, `start_date`, `end_date`, `total_balance`, `remaining_balance`, `overage_rated_amount`, `overage_rated_quantity` </details> (optional) * @return CancelSubscriptionParams */ public CancelSubscriptionParams validityPeriodFields(List validityPeriodFields) { this.validityPeriodFields = validityPeriodFields; return this; } /** * Set transactionsFields * @param transactionsFields Allows you to specify which fields are returned in the response. <details> <summary> Accepted values </summary> `transaction_date`, `type`, `quantity` </details> (optional) * @return CancelSubscriptionParams */ public CancelSubscriptionParams transactionsFields(List transactionsFields) { this.transactionsFields = transactionsFields; return this; } /** * Set expand * @param expand Allows you to expand responses by including related object information in a single call. See the [Expand responses](https://developer.zuora.com/quickstart-api/tutorial/expand-responses/) section of the Quickstart API Tutorials for detailed instructions. (optional) * @return CancelSubscriptionParams */ public CancelSubscriptionParams 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 CancelSubscriptionParams */ public CancelSubscriptionParams 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 CancelSubscriptionParams */ public CancelSubscriptionParams pageSize(Integer pageSize) { this.pageSize = pageSize; return this; } } /** * Cancel a subscription * Cancels a subscription. * @param subscriptionId Identifier for the subscription, either `subscription_number` or `subscription_id` (required) * @param cancelSubscriptionRequest (required) * @return SubscriptionCancelResponse * @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 CancelSubscriptionParams cancelSubscriptionParams(String subscriptionId, CancelSubscriptionRequest cancelSubscriptionRequest) { return new CancelSubscriptionParams(subscriptionId, cancelSubscriptionRequest); } public SubscriptionCancelResponse cancelSubscription(String subscriptionId, CancelSubscriptionRequest cancelSubscriptionRequest) throws ApiException { CancelSubscriptionParams params = new CancelSubscriptionParams(subscriptionId, cancelSubscriptionRequest); return executeCancelSubscriptionAPICall(params).getData(); } /** * Expose HTTP info public ApiResponse cancelSubscriptionWithHttpInfo(String subscriptionId, CancelSubscriptionRequest cancelSubscriptionRequest) throws ApiException { CancelSubscriptionParams params = new CancelSubscriptionParams(subscriptionId, cancelSubscriptionRequest); return executeCancelSubscriptionAPICall(params); } **/ /** Legacy Query Params Requests **/ public SubscriptionCancelResponse cancelSubscription( String subscriptionId , CancelSubscriptionRequest cancelSubscriptionRequest , List expand) throws ApiException { CancelSubscriptionParams params = new CancelSubscriptionParams(subscriptionId, cancelSubscriptionRequest); params.expand(expand); return executeCancelSubscriptionAPICall(params).getData(); } /* * add header methods */ public SubscriptionCancelResponse cancelSubscription(String subscriptionId , CancelSubscriptionRequest cancelSubscriptionRequest ,List expand,Headers headers) throws ApiException { CancelSubscriptionParams params = new CancelSubscriptionParams(subscriptionId, cancelSubscriptionRequest) .expand(expand) .headers(headers); return executeCancelSubscriptionAPICall(params).getData(); } /** * Cancel a subscription * Cancels a subscription. * @param params CancelSubscriptionParams * @return SubscriptionCancelResponse * @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 SubscriptionCancelResponse cancel(CancelSubscriptionParams params) throws ApiException { return executeCancelSubscriptionAPICall(params).getData(); } public ApiResponse cancelWithHttpInfo(CancelSubscriptionParams params) throws ApiException { return executeCancelSubscriptionAPICall(params); } ApiResponse executeCancelSubscriptionAPICall(CancelSubscriptionParams params) throws ApiException { return cancelSubscriptionWithHttpInfo(params.subscriptionId, params.cancelSubscriptionRequest, params.fields, params.subscriptionFields, params.subscriptionPlansFields, params.subscriptionItemsFields, params.accountFields, params.invoiceOwnerAccountFields, params.planFields, params.productFields, params.priceFields, params.billToFields, params.prepaidBalanceFields, params.prepaidBalancesFields, params.validityPeriodFields, params.transactionsFields, params.expand, params.filter, params.pageSize, params.zuoraTrackId, params.async, params.zuoraCacheEnabled, params.zuoraEntityIds, params.idempotencyKey, params.acceptEncoding, params.contentEncoding, params.zuoraOrgIds); } private okhttp3.Call createSubscriptionCall(SubscriptionCreateRequest subscriptionCreateRequest, List fields, List subscriptionFields, List subscriptionPlansFields, List subscriptionItemsFields, List accountFields, List invoiceOwnerAccountFields, List planFields, List productFields, List priceFields, List billToFields, List prepaidBalanceFields, List prepaidBalancesFields, List validityPeriodFields, List transactionsFields, List expand, List filter, Integer pageSize, String zuoraTrackId, Boolean async, Boolean zuoraCacheEnabled, String zuoraEntityIds, String idempotencyKey, String acceptEncoding, String contentEncoding, String zuoraOrgIds, final ApiCallback _callback) throws ApiException { String basePath = null; // Operation Servers String[] localBasePaths = new String[] { }; // Determine Base Path to Use if (localCustomBaseUrl != null){ basePath = localCustomBaseUrl; } else if ( localBasePaths.length > 0 ) { basePath = localBasePaths[localHostIndex]; } else { basePath = null; } Object localVarPostBody = subscriptionCreateRequest; // create path and map variables String localVarPath = "/subscriptions"; 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 (subscriptionFields != null) { localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "subscription.fields[]", subscriptionFields)); } if (subscriptionPlansFields != null) { localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "subscription_plans.fields[]", subscriptionPlansFields)); } if (subscriptionItemsFields != null) { localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "subscription_items.fields[]", subscriptionItemsFields)); } if (accountFields != null) { localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "account.fields[]", accountFields)); } if (invoiceOwnerAccountFields != null) { localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "invoice_owner_account.fields[]", invoiceOwnerAccountFields)); } if (planFields != null) { localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "plan.fields[]", planFields)); } if (productFields != null) { localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "product.fields[]", productFields)); } if (priceFields != null) { localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "price.fields[]", priceFields)); } if (billToFields != null) { localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "bill_to.fields[]", billToFields)); } if (prepaidBalanceFields != null) { localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "prepaid_balance.fields[]", prepaidBalanceFields)); } if (prepaidBalancesFields != null) { localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "prepaid_balances.fields[]", prepaidBalancesFields)); } if (validityPeriodFields != null) { localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "validity_period.fields[]", validityPeriodFields)); } if (transactionsFields != null) { localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "transactions.fields[]", transactionsFields)); } if (expand != null) { localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "expand[]", expand)); } if (filter != null) { localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "filter[]", filter)); } if (pageSize != null) { localVarQueryParams.addAll(localVarApiClient.parameterToPair("page_size", pageSize)); } if (zuoraTrackId != null) { localVarHeaderParams.put("zuora-track-id", localVarApiClient.parameterToString(zuoraTrackId)); } if (async != null) { localVarHeaderParams.put("async", localVarApiClient.parameterToString(async)); } if (zuoraCacheEnabled != null) { localVarHeaderParams.put("zuora-cache-enabled", localVarApiClient.parameterToString(zuoraCacheEnabled)); } if (zuoraEntityIds != null) { localVarHeaderParams.put("zuora-entity-ids", localVarApiClient.parameterToString(zuoraEntityIds)); } if (idempotencyKey != null) { localVarHeaderParams.put("idempotency-key", localVarApiClient.parameterToString(idempotencyKey)); } if (acceptEncoding != null) { localVarHeaderParams.put("accept-encoding", localVarApiClient.parameterToString(acceptEncoding)); } if (contentEncoding != null) { localVarHeaderParams.put("content-encoding", localVarApiClient.parameterToString(contentEncoding)); } if (zuoraOrgIds != null) { localVarHeaderParams.put("zuora-org-ids", localVarApiClient.parameterToString(zuoraOrgIds)); } final String[] localVarAccepts = { "application/json" }; final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) { localVarHeaderParams.put("Accept", localVarAccept); } final String[] localVarContentTypes = { "application/json" }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } String[] localVarAuthNames = new String[] { "bearerAuth" }; return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") private okhttp3.Call createSubscriptionValidateBeforeCall(SubscriptionCreateRequest subscriptionCreateRequest, List fields, List subscriptionFields, List subscriptionPlansFields, List subscriptionItemsFields, List accountFields, List invoiceOwnerAccountFields, List planFields, List productFields, List priceFields, List billToFields, List prepaidBalanceFields, List prepaidBalancesFields, List validityPeriodFields, List transactionsFields, List expand, List filter, Integer pageSize, String zuoraTrackId, Boolean async, Boolean zuoraCacheEnabled, String zuoraEntityIds, String idempotencyKey, String acceptEncoding, String contentEncoding, String zuoraOrgIds, final ApiCallback _callback) throws ApiException { // verify the required parameter 'subscriptionCreateRequest' is set if (subscriptionCreateRequest == null) { throw new ApiException("Missing the required parameter 'subscriptionCreateRequest' when calling createSubscription(Async)"); } return createSubscriptionCall(subscriptionCreateRequest, fields, subscriptionFields, subscriptionPlansFields, subscriptionItemsFields, accountFields, invoiceOwnerAccountFields, planFields, productFields, priceFields, billToFields, prepaidBalanceFields, prepaidBalancesFields, validityPeriodFields, transactionsFields, expand, filter, pageSize, zuoraTrackId, async, zuoraCacheEnabled, zuoraEntityIds, idempotencyKey, acceptEncoding, contentEncoding, zuoraOrgIds, _callback); } private ApiResponse createSubscriptionWithHttpInfo(SubscriptionCreateRequest subscriptionCreateRequest, List fields, List subscriptionFields, List subscriptionPlansFields, List subscriptionItemsFields, List accountFields, List invoiceOwnerAccountFields, List planFields, List productFields, List priceFields, List billToFields, List prepaidBalanceFields, List prepaidBalancesFields, List validityPeriodFields, List transactionsFields, List expand, List filter, Integer pageSize, String zuoraTrackId, Boolean async, Boolean zuoraCacheEnabled, String zuoraEntityIds, String idempotencyKey, String acceptEncoding, String contentEncoding, String zuoraOrgIds) throws ApiException { okhttp3.Call localVarCall = createSubscriptionValidateBeforeCall(subscriptionCreateRequest, fields, subscriptionFields, subscriptionPlansFields, subscriptionItemsFields, accountFields, invoiceOwnerAccountFields, planFields, productFields, priceFields, billToFields, prepaidBalanceFields, prepaidBalancesFields, validityPeriodFields, transactionsFields, expand, filter, pageSize, zuoraTrackId, async, zuoraCacheEnabled, zuoraEntityIds, idempotencyKey, acceptEncoding, contentEncoding, zuoraOrgIds, null); try { Type localVarReturnType = new TypeToken(){}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } catch (ApiException e) { e.setErrorObject(localVarApiClient.getJSON().getGson().fromJson(e.getResponseBody(), new TypeToken(){}.getType())); throw e; } } private okhttp3.Call createSubscriptionAsync(SubscriptionCreateRequest subscriptionCreateRequest, List fields, List subscriptionFields, List subscriptionPlansFields, List subscriptionItemsFields, List accountFields, List invoiceOwnerAccountFields, List planFields, List productFields, List priceFields, List billToFields, List prepaidBalanceFields, List prepaidBalancesFields, List validityPeriodFields, List transactionsFields, List expand, List filter, Integer pageSize, String zuoraTrackId, Boolean async, Boolean zuoraCacheEnabled, String zuoraEntityIds, String idempotencyKey, String acceptEncoding, String contentEncoding, String zuoraOrgIds, final ApiCallback _callback) throws ApiException { okhttp3.Call localVarCall = createSubscriptionValidateBeforeCall(subscriptionCreateRequest, fields, subscriptionFields, subscriptionPlansFields, subscriptionItemsFields, accountFields, invoiceOwnerAccountFields, planFields, productFields, priceFields, billToFields, prepaidBalanceFields, prepaidBalancesFields, validityPeriodFields, transactionsFields, expand, filter, pageSize, zuoraTrackId, async, zuoraCacheEnabled, zuoraEntityIds, idempotencyKey, acceptEncoding, contentEncoding, zuoraOrgIds, _callback); Type localVarReturnType = new TypeToken(){}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } public static class CreateSubscriptionParams { private final SubscriptionCreateRequest subscriptionCreateRequest; private Headers headers; /* * Check for list params */ private GetByIdQueryParams getByIdQueryParams; private List fields; private List subscriptionFields; private List subscriptionPlansFields; private List subscriptionItemsFields; private List accountFields; private List invoiceOwnerAccountFields; private List planFields; private List productFields; private List priceFields; private List billToFields; private List prepaidBalanceFields; private List prepaidBalancesFields; private List validityPeriodFields; private List transactionsFields; private List expand; private List filter; private Integer pageSize; private String zuoraTrackId; private Boolean async; private Boolean zuoraCacheEnabled; private String zuoraEntityIds; private String idempotencyKey; private String acceptEncoding; private String contentEncoding; private String zuoraOrgIds; public CreateSubscriptionParams(SubscriptionCreateRequest subscriptionCreateRequest) { this.subscriptionCreateRequest = subscriptionCreateRequest; } /** * Set getByIdQueryParams * @param getByIdQueryParams GetByIdQueryParams * @return CreateSubscriptionParams */ public CreateSubscriptionParams 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 CreateSubscriptionParams */ public CreateSubscriptionParams 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`, `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 CreateSubscriptionParams */ public CreateSubscriptionParams fields(List fields) { this.fields = fields; 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 CreateSubscriptionParams */ public CreateSubscriptionParams subscriptionFields(List subscriptionFields) { this.subscriptionFields = subscriptionFields; return this; } /** * Set subscriptionPlansFields * @param subscriptionPlansFields Allows you to specify which fields are returned in the response. <details> <summary> Accepted values </summary> `custom_fields`, `created_by_id`, `updated_by_id`, `created_time`, `id`, `updated_time`, `name`, `plan_id`, `subscription_id`, `product_id`, `subscription_plan_number` </details> (optional) * @return CreateSubscriptionParams */ public CreateSubscriptionParams subscriptionPlansFields(List subscriptionPlansFields) { this.subscriptionPlansFields = subscriptionPlansFields; return this; } /** * Set subscriptionItemsFields * @param subscriptionItemsFields Allows you to specify which fields are returned in the response. <details> <summary> Accepted values </summary> `custom_fields`, `created_by_id`, `updated_by_id`, `created_time`, `id`, `updated_time`, `start_date`, `end_date`, `charge_model`, `charge_type`, `tiers`, `subscription_item_number`, `name`, `description`, `charged_through_date`, `recurring`, `price_id`, `start_event`, `tax_code`, `tax_inclusive`, `unit_of_measure`, `quantity`, `price_base_interval`, `overage`, `subscription_plan_id`, `tiers_mode`, `processed_through_date`, `active`, `state`, `unit_amount`, `amount`, `discount_amount`, `discount_percent`, `price_change_percentage`, `price_change_option` </details> (optional) * @return CreateSubscriptionParams */ public CreateSubscriptionParams subscriptionItemsFields(List subscriptionItemsFields) { this.subscriptionItemsFields = subscriptionItemsFields; return this; } /** * Set accountFields * @param accountFields Allows you to specify which fields are returned in the response. <details> <summary> Accepted values </summary> `custom_fields`, `created_by_id`, `updated_by_id`, `created_time`, `id`, `updated_time`, `auto_pay`, `account_number`, `bill_to_id`, `sold_to_id`, `billing_document_settings`, `communication_profile_id`, `crm_id`, `sales_rep`, `parent_account_id`, `payment_gateway`, `payment_terms`, `remaining_credit_memo_balance`, `remaining_debit_memo_balance`, `remaining_invoice_balance`, `remaining_payment_balance`, `sequence_set_id`, `tax_certificate`, `batch`, `tax_identifier`, `bill_cycle_day`, `description`, `name`, `currency`, `default_payment_method_id`, `enabled`, `organization_id` </details> (optional) * @return CreateSubscriptionParams */ public CreateSubscriptionParams accountFields(List accountFields) { this.accountFields = accountFields; return this; } /** * Set invoiceOwnerAccountFields * @param invoiceOwnerAccountFields Allows you to specify which fields are returned in the response. <details> <summary> Accepted values </summary> `custom_fields`, `created_by_id`, `updated_by_id`, `created_time`, `id`, `updated_time`, `auto_pay`, `account_number`, `bill_to_id`, `sold_to_id`, `billing_document_settings`, `communication_profile_id`, `crm_id`, `sales_rep`, `parent_account_id`, `payment_gateway`, `payment_terms`, `remaining_credit_memo_balance`, `remaining_debit_memo_balance`, `remaining_invoice_balance`, `remaining_payment_balance`, `sequence_set_id`, `tax_certificate`, `batch`, `tax_identifier`, `bill_cycle_day`, `description`, `name`, `currency`, `default_payment_method_id`, `enabled`, `organization_id` </details> (optional) * @return CreateSubscriptionParams */ public CreateSubscriptionParams invoiceOwnerAccountFields(List invoiceOwnerAccountFields) { this.invoiceOwnerAccountFields = invoiceOwnerAccountFields; return this; } /** * Set planFields * @param planFields Allows you to specify which fields are returned in the response. <details> <summary> Accepted values </summary> `custom_fields`, `created_by_id`, `updated_by_id`, `created_time`, `id`, `updated_time`, `start_date`, `end_date`, `name`, `active`, `description`, `plan_number`, `product_id`, `active_currencies` </details> (optional) * @return CreateSubscriptionParams */ public CreateSubscriptionParams 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 CreateSubscriptionParams */ public CreateSubscriptionParams productFields(List productFields) { this.productFields = productFields; 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 CreateSubscriptionParams */ public CreateSubscriptionParams priceFields(List priceFields) { this.priceFields = priceFields; return this; } /** * Set billToFields * @param billToFields Allows you to specify which fields are returned in the response. <details> <summary> Accepted values </summary> `custom_fields`, `created_by_id`, `updated_by_id`, `created_time`, `id`, `updated_time`, `account_id`, `address`, `home_phone`, `first_name`, `last_name`, `email`, `work_email`, `nickname`, `other_phone`, `work_phone`, `mobile_phone`, `tax_region`, `other_phone_type`, `fax` </details> (optional) * @return CreateSubscriptionParams */ public CreateSubscriptionParams billToFields(List billToFields) { this.billToFields = billToFields; return this; } /** * Set prepaidBalanceFields * @param prepaidBalanceFields Allows you to specify which fields are returned in the response. <details> <summary> Accepted values </summary> `prepaid_UOM`, `start_date`, `end_date`, `total_balance`, `remaining_balance` </details> (optional) * @return CreateSubscriptionParams */ public CreateSubscriptionParams prepaidBalanceFields(List prepaidBalanceFields) { this.prepaidBalanceFields = prepaidBalanceFields; return this; } /** * Set prepaidBalancesFields * @param prepaidBalancesFields Allows you to specify which fields are returned in the response. <details> <summary> Accepted values </summary> `validity_periods` </details> (optional) * @return CreateSubscriptionParams */ public CreateSubscriptionParams prepaidBalancesFields(List prepaidBalancesFields) { this.prepaidBalancesFields = prepaidBalancesFields; return this; } /** * Set validityPeriodFields * @param validityPeriodFields Allows you to specify which fields are returned in the response. <details> <summary> Accepted values </summary> `prepaid_UOM`, `start_date`, `end_date`, `total_balance`, `remaining_balance`, `overage_rated_amount`, `overage_rated_quantity` </details> (optional) * @return CreateSubscriptionParams */ public CreateSubscriptionParams validityPeriodFields(List validityPeriodFields) { this.validityPeriodFields = validityPeriodFields; return this; } /** * Set transactionsFields * @param transactionsFields Allows you to specify which fields are returned in the response. <details> <summary> Accepted values </summary> `transaction_date`, `type`, `quantity` </details> (optional) * @return CreateSubscriptionParams */ public CreateSubscriptionParams transactionsFields(List transactionsFields) { this.transactionsFields = transactionsFields; return this; } /** * Set expand * @param expand Allows you to expand responses by including related object information in a single call. See the [Expand responses](https://developer.zuora.com/quickstart-api/tutorial/expand-responses/) section of the Quickstart API Tutorials for detailed instructions. (optional) * @return CreateSubscriptionParams */ public CreateSubscriptionParams 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 CreateSubscriptionParams */ public CreateSubscriptionParams 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 CreateSubscriptionParams */ public CreateSubscriptionParams pageSize(Integer pageSize) { this.pageSize = pageSize; return this; } } /** * Create a subscription * Creates a new subscription. * @param subscriptionCreateRequest (required) * @return Subscription * @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 CreateSubscriptionParams createSubscriptionParams(SubscriptionCreateRequest subscriptionCreateRequest) { return new CreateSubscriptionParams(subscriptionCreateRequest); } public Subscription createSubscription(SubscriptionCreateRequest subscriptionCreateRequest) throws ApiException { CreateSubscriptionParams params = new CreateSubscriptionParams(subscriptionCreateRequest); return executeCreateSubscriptionAPICall(params).getData(); } /** * Expose HTTP info public ApiResponse createSubscriptionWithHttpInfo(SubscriptionCreateRequest subscriptionCreateRequest) throws ApiException { CreateSubscriptionParams params = new CreateSubscriptionParams(subscriptionCreateRequest); return executeCreateSubscriptionAPICall(params); } **/ /** Legacy Query Params Requests **/ public Subscription createSubscription( SubscriptionCreateRequest subscriptionCreateRequest , List expand) throws ApiException { CreateSubscriptionParams params = new CreateSubscriptionParams(subscriptionCreateRequest); params.expand(expand); return executeCreateSubscriptionAPICall(params).getData(); } /* * add header methods */ public Subscription createSubscription(SubscriptionCreateRequest subscriptionCreateRequest ,List expand,Headers headers) throws ApiException { CreateSubscriptionParams params = new CreateSubscriptionParams(subscriptionCreateRequest) .expand(expand) .headers(headers); return executeCreateSubscriptionAPICall(params).getData(); } /** * Create a subscription * Creates a new subscription. * @param params CreateSubscriptionParams * @return Subscription * @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 Subscription create(CreateSubscriptionParams params) throws ApiException { return executeCreateSubscriptionAPICall(params).getData(); } public ApiResponse createWithHttpInfo(CreateSubscriptionParams params) throws ApiException { return executeCreateSubscriptionAPICall(params); } ApiResponse executeCreateSubscriptionAPICall(CreateSubscriptionParams params) throws ApiException { return createSubscriptionWithHttpInfo(params.subscriptionCreateRequest, params.fields, params.subscriptionFields, params.subscriptionPlansFields, params.subscriptionItemsFields, params.accountFields, params.invoiceOwnerAccountFields, params.planFields, params.productFields, params.priceFields, params.billToFields, params.prepaidBalanceFields, params.prepaidBalancesFields, params.validityPeriodFields, params.transactionsFields, params.expand, params.filter, params.pageSize, params.zuoraTrackId, params.async, params.zuoraCacheEnabled, params.zuoraEntityIds, params.idempotencyKey, params.acceptEncoding, params.contentEncoding, params.zuoraOrgIds); } private okhttp3.Call getSubscriptionByKeyCall(String subscriptionId, List fields, List subscriptionFields, List subscriptionPlansFields, List subscriptionItemsFields, List accountFields, List invoiceOwnerAccountFields, List planFields, List productFields, List priceFields, List billToFields, List prepaidBalanceFields, List prepaidBalancesFields, List validityPeriodFields, List transactionsFields, List expand, List filter, Integer pageSize, String zuoraTrackId, Boolean async, Boolean zuoraCacheEnabled, String zuoraEntityIds, String idempotencyKey, String acceptEncoding, String contentEncoding, String zuoraOrgIds, final ApiCallback _callback) throws ApiException { String basePath = null; // Operation Servers String[] localBasePaths = new String[] { }; // Determine Base Path to Use if (localCustomBaseUrl != null){ basePath = localCustomBaseUrl; } else if ( localBasePaths.length > 0 ) { basePath = localBasePaths[localHostIndex]; } else { basePath = null; } Object localVarPostBody = null; // create path and map variables String localVarPath = "/subscriptions/{subscription_id}" .replace("{" + "subscription_id" + "}", localVarApiClient.escapeString(subscriptionId.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 (subscriptionFields != null) { localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "subscription.fields[]", subscriptionFields)); } if (subscriptionPlansFields != null) { localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "subscription_plans.fields[]", subscriptionPlansFields)); } if (subscriptionItemsFields != null) { localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "subscription_items.fields[]", subscriptionItemsFields)); } if (accountFields != null) { localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "account.fields[]", accountFields)); } if (invoiceOwnerAccountFields != null) { localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "invoice_owner_account.fields[]", invoiceOwnerAccountFields)); } if (planFields != null) { localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "plan.fields[]", planFields)); } if (productFields != null) { localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "product.fields[]", productFields)); } if (priceFields != null) { localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "price.fields[]", priceFields)); } if (billToFields != null) { localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "bill_to.fields[]", billToFields)); } if (prepaidBalanceFields != null) { localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "prepaid_balance.fields[]", prepaidBalanceFields)); } if (prepaidBalancesFields != null) { localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "prepaid_balances.fields[]", prepaidBalancesFields)); } if (validityPeriodFields != null) { localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "validity_period.fields[]", validityPeriodFields)); } if (transactionsFields != null) { localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "transactions.fields[]", transactionsFields)); } if (expand != null) { localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "expand[]", expand)); } if (filter != null) { localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "filter[]", filter)); } if (pageSize != null) { localVarQueryParams.addAll(localVarApiClient.parameterToPair("page_size", pageSize)); } if (zuoraTrackId != null) { localVarHeaderParams.put("zuora-track-id", localVarApiClient.parameterToString(zuoraTrackId)); } if (async != null) { localVarHeaderParams.put("async", localVarApiClient.parameterToString(async)); } if (zuoraCacheEnabled != null) { localVarHeaderParams.put("zuora-cache-enabled", localVarApiClient.parameterToString(zuoraCacheEnabled)); } if (zuoraEntityIds != null) { localVarHeaderParams.put("zuora-entity-ids", localVarApiClient.parameterToString(zuoraEntityIds)); } if (idempotencyKey != null) { localVarHeaderParams.put("idempotency-key", localVarApiClient.parameterToString(idempotencyKey)); } if (acceptEncoding != null) { localVarHeaderParams.put("accept-encoding", localVarApiClient.parameterToString(acceptEncoding)); } if (contentEncoding != null) { localVarHeaderParams.put("content-encoding", localVarApiClient.parameterToString(contentEncoding)); } if (zuoraOrgIds != null) { localVarHeaderParams.put("zuora-org-ids", localVarApiClient.parameterToString(zuoraOrgIds)); } final String[] localVarAccepts = { "application/json" }; final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) { localVarHeaderParams.put("Accept", localVarAccept); } final String[] localVarContentTypes = { }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } String[] localVarAuthNames = new String[] { "bearerAuth" }; return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") private okhttp3.Call getSubscriptionByKeyValidateBeforeCall(String subscriptionId, List fields, List subscriptionFields, List subscriptionPlansFields, List subscriptionItemsFields, List accountFields, List invoiceOwnerAccountFields, List planFields, List productFields, List priceFields, List billToFields, List prepaidBalanceFields, List prepaidBalancesFields, List validityPeriodFields, List transactionsFields, List expand, List filter, Integer pageSize, String zuoraTrackId, Boolean async, Boolean zuoraCacheEnabled, String zuoraEntityIds, String idempotencyKey, String acceptEncoding, String contentEncoding, String zuoraOrgIds, final ApiCallback _callback) throws ApiException { // verify the required parameter 'subscriptionId' is set if (subscriptionId == null) { throw new ApiException("Missing the required parameter 'subscriptionId' when calling getSubscriptionByKey(Async)"); } return getSubscriptionByKeyCall(subscriptionId, fields, subscriptionFields, subscriptionPlansFields, subscriptionItemsFields, accountFields, invoiceOwnerAccountFields, planFields, productFields, priceFields, billToFields, prepaidBalanceFields, prepaidBalancesFields, validityPeriodFields, transactionsFields, expand, filter, pageSize, zuoraTrackId, async, zuoraCacheEnabled, zuoraEntityIds, idempotencyKey, acceptEncoding, contentEncoding, zuoraOrgIds, _callback); } private ApiResponse getSubscriptionByKeyWithHttpInfo(String subscriptionId, List fields, List subscriptionFields, List subscriptionPlansFields, List subscriptionItemsFields, List accountFields, List invoiceOwnerAccountFields, List planFields, List productFields, List priceFields, List billToFields, List prepaidBalanceFields, List prepaidBalancesFields, List validityPeriodFields, List transactionsFields, List expand, List filter, Integer pageSize, String zuoraTrackId, Boolean async, Boolean zuoraCacheEnabled, String zuoraEntityIds, String idempotencyKey, String acceptEncoding, String contentEncoding, String zuoraOrgIds) throws ApiException { okhttp3.Call localVarCall = getSubscriptionByKeyValidateBeforeCall(subscriptionId, fields, subscriptionFields, subscriptionPlansFields, subscriptionItemsFields, accountFields, invoiceOwnerAccountFields, planFields, productFields, priceFields, billToFields, prepaidBalanceFields, prepaidBalancesFields, validityPeriodFields, transactionsFields, expand, filter, pageSize, zuoraTrackId, async, zuoraCacheEnabled, zuoraEntityIds, idempotencyKey, acceptEncoding, contentEncoding, zuoraOrgIds, null); try { Type localVarReturnType = new TypeToken(){}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } catch (ApiException e) { e.setErrorObject(localVarApiClient.getJSON().getGson().fromJson(e.getResponseBody(), new TypeToken(){}.getType())); throw e; } } private okhttp3.Call getSubscriptionByKeyAsync(String subscriptionId, List fields, List subscriptionFields, List subscriptionPlansFields, List subscriptionItemsFields, List accountFields, List invoiceOwnerAccountFields, List planFields, List productFields, List priceFields, List billToFields, List prepaidBalanceFields, List prepaidBalancesFields, List validityPeriodFields, List transactionsFields, List expand, List filter, Integer pageSize, String zuoraTrackId, Boolean async, Boolean zuoraCacheEnabled, String zuoraEntityIds, String idempotencyKey, String acceptEncoding, String contentEncoding, String zuoraOrgIds, final ApiCallback _callback) throws ApiException { okhttp3.Call localVarCall = getSubscriptionByKeyValidateBeforeCall(subscriptionId, fields, subscriptionFields, subscriptionPlansFields, subscriptionItemsFields, accountFields, invoiceOwnerAccountFields, planFields, productFields, priceFields, billToFields, prepaidBalanceFields, prepaidBalancesFields, validityPeriodFields, transactionsFields, expand, filter, pageSize, zuoraTrackId, async, zuoraCacheEnabled, zuoraEntityIds, idempotencyKey, acceptEncoding, contentEncoding, zuoraOrgIds, _callback); Type localVarReturnType = new TypeToken(){}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } public static class GetSubscriptionByKeyParams { private final String subscriptionId; private Headers headers; /* * Check for list params */ private GetByIdQueryParams getByIdQueryParams; private List fields; private List subscriptionFields; private List subscriptionPlansFields; private List subscriptionItemsFields; private List accountFields; private List invoiceOwnerAccountFields; private List planFields; private List productFields; private List priceFields; private List billToFields; private List prepaidBalanceFields; private List prepaidBalancesFields; private List validityPeriodFields; private List transactionsFields; private List expand; private List filter; private Integer pageSize; private String zuoraTrackId; private Boolean async; private Boolean zuoraCacheEnabled; private String zuoraEntityIds; private String idempotencyKey; private String acceptEncoding; private String contentEncoding; private String zuoraOrgIds; public GetSubscriptionByKeyParams(String subscriptionId) { this.subscriptionId = subscriptionId; } /** * Set getByIdQueryParams * @param getByIdQueryParams GetByIdQueryParams * @return GetSubscriptionByKeyParams */ public GetSubscriptionByKeyParams 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 GetSubscriptionByKeyParams */ public GetSubscriptionByKeyParams 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`, `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 GetSubscriptionByKeyParams */ public GetSubscriptionByKeyParams fields(List fields) { this.fields = fields; 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 GetSubscriptionByKeyParams */ public GetSubscriptionByKeyParams subscriptionFields(List subscriptionFields) { this.subscriptionFields = subscriptionFields; return this; } /** * Set subscriptionPlansFields * @param subscriptionPlansFields Allows you to specify which fields are returned in the response. <details> <summary> Accepted values </summary> `custom_fields`, `created_by_id`, `updated_by_id`, `created_time`, `id`, `updated_time`, `name`, `plan_id`, `subscription_id`, `product_id`, `subscription_plan_number` </details> (optional) * @return GetSubscriptionByKeyParams */ public GetSubscriptionByKeyParams subscriptionPlansFields(List subscriptionPlansFields) { this.subscriptionPlansFields = subscriptionPlansFields; return this; } /** * Set subscriptionItemsFields * @param subscriptionItemsFields Allows you to specify which fields are returned in the response. <details> <summary> Accepted values </summary> `custom_fields`, `created_by_id`, `updated_by_id`, `created_time`, `id`, `updated_time`, `start_date`, `end_date`, `charge_model`, `charge_type`, `tiers`, `subscription_item_number`, `name`, `description`, `charged_through_date`, `recurring`, `price_id`, `start_event`, `tax_code`, `tax_inclusive`, `unit_of_measure`, `quantity`, `price_base_interval`, `overage`, `subscription_plan_id`, `tiers_mode`, `processed_through_date`, `active`, `state`, `unit_amount`, `amount`, `discount_amount`, `discount_percent`, `price_change_percentage`, `price_change_option` </details> (optional) * @return GetSubscriptionByKeyParams */ public GetSubscriptionByKeyParams subscriptionItemsFields(List subscriptionItemsFields) { this.subscriptionItemsFields = subscriptionItemsFields; return this; } /** * Set accountFields * @param accountFields Allows you to specify which fields are returned in the response. <details> <summary> Accepted values </summary> `custom_fields`, `created_by_id`, `updated_by_id`, `created_time`, `id`, `updated_time`, `auto_pay`, `account_number`, `bill_to_id`, `sold_to_id`, `billing_document_settings`, `communication_profile_id`, `crm_id`, `sales_rep`, `parent_account_id`, `payment_gateway`, `payment_terms`, `remaining_credit_memo_balance`, `remaining_debit_memo_balance`, `remaining_invoice_balance`, `remaining_payment_balance`, `sequence_set_id`, `tax_certificate`, `batch`, `tax_identifier`, `bill_cycle_day`, `description`, `name`, `currency`, `default_payment_method_id`, `enabled`, `organization_id` </details> (optional) * @return GetSubscriptionByKeyParams */ public GetSubscriptionByKeyParams accountFields(List accountFields) { this.accountFields = accountFields; return this; } /** * Set invoiceOwnerAccountFields * @param invoiceOwnerAccountFields Allows you to specify which fields are returned in the response. <details> <summary> Accepted values </summary> `custom_fields`, `created_by_id`, `updated_by_id`, `created_time`, `id`, `updated_time`, `auto_pay`, `account_number`, `bill_to_id`, `sold_to_id`, `billing_document_settings`, `communication_profile_id`, `crm_id`, `sales_rep`, `parent_account_id`, `payment_gateway`, `payment_terms`, `remaining_credit_memo_balance`, `remaining_debit_memo_balance`, `remaining_invoice_balance`, `remaining_payment_balance`, `sequence_set_id`, `tax_certificate`, `batch`, `tax_identifier`, `bill_cycle_day`, `description`, `name`, `currency`, `default_payment_method_id`, `enabled`, `organization_id` </details> (optional) * @return GetSubscriptionByKeyParams */ public GetSubscriptionByKeyParams invoiceOwnerAccountFields(List invoiceOwnerAccountFields) { this.invoiceOwnerAccountFields = invoiceOwnerAccountFields; return this; } /** * Set planFields * @param planFields Allows you to specify which fields are returned in the response. <details> <summary> Accepted values </summary> `custom_fields`, `created_by_id`, `updated_by_id`, `created_time`, `id`, `updated_time`, `start_date`, `end_date`, `name`, `active`, `description`, `plan_number`, `product_id`, `active_currencies` </details> (optional) * @return GetSubscriptionByKeyParams */ public GetSubscriptionByKeyParams 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 GetSubscriptionByKeyParams */ public GetSubscriptionByKeyParams productFields(List productFields) { this.productFields = productFields; 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 GetSubscriptionByKeyParams */ public GetSubscriptionByKeyParams priceFields(List priceFields) { this.priceFields = priceFields; return this; } /** * Set billToFields * @param billToFields Allows you to specify which fields are returned in the response. <details> <summary> Accepted values </summary> `custom_fields`, `created_by_id`, `updated_by_id`, `created_time`, `id`, `updated_time`, `account_id`, `address`, `home_phone`, `first_name`, `last_name`, `email`, `work_email`, `nickname`, `other_phone`, `work_phone`, `mobile_phone`, `tax_region`, `other_phone_type`, `fax` </details> (optional) * @return GetSubscriptionByKeyParams */ public GetSubscriptionByKeyParams billToFields(List billToFields) { this.billToFields = billToFields; return this; } /** * Set prepaidBalanceFields * @param prepaidBalanceFields Allows you to specify which fields are returned in the response. <details> <summary> Accepted values </summary> `prepaid_UOM`, `start_date`, `end_date`, `total_balance`, `remaining_balance` </details> (optional) * @return GetSubscriptionByKeyParams */ public GetSubscriptionByKeyParams prepaidBalanceFields(List prepaidBalanceFields) { this.prepaidBalanceFields = prepaidBalanceFields; return this; } /** * Set prepaidBalancesFields * @param prepaidBalancesFields Allows you to specify which fields are returned in the response. <details> <summary> Accepted values </summary> `validity_periods` </details> (optional) * @return GetSubscriptionByKeyParams */ public GetSubscriptionByKeyParams prepaidBalancesFields(List prepaidBalancesFields) { this.prepaidBalancesFields = prepaidBalancesFields; return this; } /** * Set validityPeriodFields * @param validityPeriodFields Allows you to specify which fields are returned in the response. <details> <summary> Accepted values </summary> `prepaid_UOM`, `start_date`, `end_date`, `total_balance`, `remaining_balance`, `overage_rated_amount`, `overage_rated_quantity` </details> (optional) * @return GetSubscriptionByKeyParams */ public GetSubscriptionByKeyParams validityPeriodFields(List validityPeriodFields) { this.validityPeriodFields = validityPeriodFields; return this; } /** * Set transactionsFields * @param transactionsFields Allows you to specify which fields are returned in the response. <details> <summary> Accepted values </summary> `transaction_date`, `type`, `quantity` </details> (optional) * @return GetSubscriptionByKeyParams */ public GetSubscriptionByKeyParams transactionsFields(List transactionsFields) { this.transactionsFields = transactionsFields; return this; } /** * Set expand * @param expand Allows you to expand responses by including related object information in a single call. See the [Expand responses](https://developer.zuora.com/quickstart-api/tutorial/expand-responses/) section of the Quickstart API Tutorials for detailed instructions. (optional) * @return GetSubscriptionByKeyParams */ public GetSubscriptionByKeyParams 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 GetSubscriptionByKeyParams */ public GetSubscriptionByKeyParams 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 GetSubscriptionByKeyParams */ public GetSubscriptionByKeyParams pageSize(Integer pageSize) { this.pageSize = pageSize; return this; } } /** * Retrieve a subscription * Retrieves the subscription with the given subscription key (number or ID). * @param subscriptionId Identifier for the subscription, either `subscription_number` or `subscription_id` (required) * @return Subscription * @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 GetSubscriptionByKeyParams getSubscriptionByKeyParams(String subscriptionId) { return new GetSubscriptionByKeyParams(subscriptionId); } public Subscription getSubscriptionByKey(String subscriptionId) throws ApiException { GetSubscriptionByKeyParams params = new GetSubscriptionByKeyParams(subscriptionId); return executeGetSubscriptionByKeyAPICall(params).getData(); } /** * Expose HTTP info public ApiResponse getSubscriptionByKeyWithHttpInfo(String subscriptionId) throws ApiException { GetSubscriptionByKeyParams params = new GetSubscriptionByKeyParams(subscriptionId); return executeGetSubscriptionByKeyAPICall(params); } **/ /** Legacy Query Params Requests **/ public Subscription getSubscriptionByKey( String subscriptionId , List expand) throws ApiException { GetSubscriptionByKeyParams params = new GetSubscriptionByKeyParams(subscriptionId); params.expand(expand); return executeGetSubscriptionByKeyAPICall(params).getData(); } /* * add header methods */ public Subscription getSubscriptionByKey(String subscriptionId ,List expand,Headers headers) throws ApiException { GetSubscriptionByKeyParams params = new GetSubscriptionByKeyParams(subscriptionId) .expand(expand) .headers(headers); return executeGetSubscriptionByKeyAPICall(params).getData(); } /** * Retrieve a subscription * Retrieves the subscription with the given subscription key (number or ID). * @param params GetSubscriptionByKeyParams * @return Subscription * @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 Subscription get(GetSubscriptionByKeyParams params) throws ApiException { return executeGetSubscriptionByKeyAPICall(params).getData(); } public ApiResponse getWithHttpInfo(GetSubscriptionByKeyParams params) throws ApiException { return executeGetSubscriptionByKeyAPICall(params); } ApiResponse executeGetSubscriptionByKeyAPICall(GetSubscriptionByKeyParams params) throws ApiException { return getSubscriptionByKeyWithHttpInfo(params.subscriptionId, params.fields, params.subscriptionFields, params.subscriptionPlansFields, params.subscriptionItemsFields, params.accountFields, params.invoiceOwnerAccountFields, params.planFields, params.productFields, params.priceFields, params.billToFields, params.prepaidBalanceFields, params.prepaidBalancesFields, params.validityPeriodFields, params.transactionsFields, params.expand, params.filter, params.pageSize, params.zuoraTrackId, params.async, params.zuoraCacheEnabled, params.zuoraEntityIds, params.idempotencyKey, params.acceptEncoding, params.contentEncoding, params.zuoraOrgIds); } private okhttp3.Call getSubscriptionByVersionCall(String subscriptionId, List fields, List subscriptionVersionFields, List subscriptionPlansFields, List subscriptionItemsFields, List accountFields, List invoiceOwnerAccountFields, List planFields, List productFields, List priceFields, List billToFields, List prepaidBalanceFields, List prepaidBalancesFields, List validityPeriodFields, List transactionsFields, List actionsFields, String cursor, List expand, List filter, List sort, 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 = "/subscriptions/{subscription_id}/versions" .replace("{" + "subscription_id" + "}", localVarApiClient.escapeString(subscriptionId.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 (subscriptionVersionFields != null) { localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "subscription_version.fields[]", subscriptionVersionFields)); } if (subscriptionPlansFields != null) { localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "subscription_plans.fields[]", subscriptionPlansFields)); } if (subscriptionItemsFields != null) { localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "subscription_items.fields[]", subscriptionItemsFields)); } if (accountFields != null) { localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "account.fields[]", accountFields)); } if (invoiceOwnerAccountFields != null) { localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "invoice_owner_account.fields[]", invoiceOwnerAccountFields)); } if (planFields != null) { localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "plan.fields[]", planFields)); } if (productFields != null) { localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "product.fields[]", productFields)); } if (priceFields != null) { localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "price.fields[]", priceFields)); } if (billToFields != null) { localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "bill_to.fields[]", billToFields)); } if (prepaidBalanceFields != null) { localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "prepaid_balance.fields[]", prepaidBalanceFields)); } if (prepaidBalancesFields != null) { localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "prepaid_balances.fields[]", prepaidBalancesFields)); } if (validityPeriodFields != null) { localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "validity_period.fields[]", validityPeriodFields)); } if (transactionsFields != null) { localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "transactions.fields[]", transactionsFields)); } if (actionsFields != null) { localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "actions.fields[]", actionsFields)); } 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 (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 getSubscriptionByVersionValidateBeforeCall(String subscriptionId, List fields, List subscriptionVersionFields, List subscriptionPlansFields, List subscriptionItemsFields, List accountFields, List invoiceOwnerAccountFields, List planFields, List productFields, List priceFields, List billToFields, List prepaidBalanceFields, List prepaidBalancesFields, List validityPeriodFields, List transactionsFields, List actionsFields, String cursor, List expand, List filter, List sort, 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 'subscriptionId' is set if (subscriptionId == null) { throw new ApiException("Missing the required parameter 'subscriptionId' when calling getSubscriptionByVersion(Async)"); } return getSubscriptionByVersionCall(subscriptionId, fields, subscriptionVersionFields, subscriptionPlansFields, subscriptionItemsFields, accountFields, invoiceOwnerAccountFields, planFields, productFields, priceFields, billToFields, prepaidBalanceFields, prepaidBalancesFields, validityPeriodFields, transactionsFields, actionsFields, cursor, expand, filter, sort, pageSize, zuoraTrackId, async, zuoraCacheEnabled, zuoraEntityIds, idempotencyKey, acceptEncoding, contentEncoding, zuoraOrgIds, _callback); } private ApiResponse getSubscriptionByVersionWithHttpInfo(String subscriptionId, List fields, List subscriptionVersionFields, List subscriptionPlansFields, List subscriptionItemsFields, List accountFields, List invoiceOwnerAccountFields, List planFields, List productFields, List priceFields, List billToFields, List prepaidBalanceFields, List prepaidBalancesFields, List validityPeriodFields, List transactionsFields, List actionsFields, String cursor, List expand, List filter, List sort, Integer pageSize, String zuoraTrackId, Boolean async, Boolean zuoraCacheEnabled, String zuoraEntityIds, String idempotencyKey, String acceptEncoding, String contentEncoding, String zuoraOrgIds) throws ApiException { okhttp3.Call localVarCall = getSubscriptionByVersionValidateBeforeCall(subscriptionId, fields, subscriptionVersionFields, subscriptionPlansFields, subscriptionItemsFields, accountFields, invoiceOwnerAccountFields, planFields, productFields, priceFields, billToFields, prepaidBalanceFields, prepaidBalancesFields, validityPeriodFields, transactionsFields, actionsFields, cursor, expand, filter, sort, 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 getSubscriptionByVersionAsync(String subscriptionId, List fields, List subscriptionVersionFields, List subscriptionPlansFields, List subscriptionItemsFields, List accountFields, List invoiceOwnerAccountFields, List planFields, List productFields, List priceFields, List billToFields, List prepaidBalanceFields, List prepaidBalancesFields, List validityPeriodFields, List transactionsFields, List actionsFields, String cursor, List expand, List filter, List sort, 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 = getSubscriptionByVersionValidateBeforeCall(subscriptionId, fields, subscriptionVersionFields, subscriptionPlansFields, subscriptionItemsFields, accountFields, invoiceOwnerAccountFields, planFields, productFields, priceFields, billToFields, prepaidBalanceFields, prepaidBalancesFields, validityPeriodFields, transactionsFields, actionsFields, cursor, expand, filter, sort, 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 GetSubscriptionByVersionParams { private final String subscriptionId; private Headers headers; /* * Check for list params */ private ListQueryParams listQueryParams; private List fields; private List subscriptionVersionFields; private List subscriptionPlansFields; private List subscriptionItemsFields; private List accountFields; private List invoiceOwnerAccountFields; private List planFields; private List productFields; private List priceFields; private List billToFields; private List prepaidBalanceFields; private List prepaidBalancesFields; private List validityPeriodFields; private List transactionsFields; private List actionsFields; private String cursor; private List expand; private List filter; private List sort; 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 GetSubscriptionByVersionParams(String subscriptionId) { this.subscriptionId = subscriptionId; } /** * Set listQueryParams * @param listQueryParams ListQueryParams * @return GetSubscriptionByVersionParams */ public GetSubscriptionByVersionParams 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 GetSubscriptionByVersionParams */ public GetSubscriptionByVersionParams 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`, `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 GetSubscriptionByVersionParams */ public GetSubscriptionByVersionParams fields(List fields) { this.fields = fields; return this; } /** * Set subscriptionVersionFields * @param subscriptionVersionFields 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 GetSubscriptionByVersionParams */ public GetSubscriptionByVersionParams subscriptionVersionFields(List subscriptionVersionFields) { this.subscriptionVersionFields = subscriptionVersionFields; return this; } /** * Set subscriptionPlansFields * @param subscriptionPlansFields Allows you to specify which fields are returned in the response. <details> <summary> Accepted values </summary> `custom_fields`, `created_by_id`, `updated_by_id`, `created_time`, `id`, `updated_time`, `name`, `plan_id`, `subscription_id`, `product_id`, `subscription_plan_number`, `subscription_items` </details> (optional) * @return GetSubscriptionByVersionParams */ public GetSubscriptionByVersionParams subscriptionPlansFields(List subscriptionPlansFields) { this.subscriptionPlansFields = subscriptionPlansFields; return this; } /** * Set subscriptionItemsFields * @param subscriptionItemsFields Allows you to specify which fields are returned in the response. <details> <summary> Accepted values </summary> `custom_fields`, `created_by_id`, `updated_by_id`, `created_time`, `id`, `updated_time`, `start_date`, `end_date`, `charge_model`, `charge_type`, `tiers`, `subscription_item_number`, `name`, `description`, `charged_through_date`, `recurring`, `price_id`, `start_event`, `tax_code`, `tax_inclusive`, `unit_of_measure`, `quantity`, `price_base_interval`, `overage`, `subscription_plan_id`, `tiers_mode`, `processed_through_date`, `active`, `state`, `unit_amount`, `amount`, `discount_amount`, `discount_percent`, `price_change_percentage`, `price_change_option`, `price` </details> (optional) * @return GetSubscriptionByVersionParams */ public GetSubscriptionByVersionParams subscriptionItemsFields(List subscriptionItemsFields) { this.subscriptionItemsFields = subscriptionItemsFields; return this; } /** * Set accountFields * @param accountFields Allows you to specify which fields are returned in the response. <details> <summary> Accepted values </summary> `custom_fields`, `created_by_id`, `updated_by_id`, `created_time`, `id`, `updated_time`, `auto_pay`, `account_number`, `bill_to_id`, `sold_to_id`, `billing_document_settings`, `communication_profile_id`, `crm_id`, `sales_rep`, `parent_account_id`, `payment_gateway`, `payment_terms`, `remaining_credit_memo_balance`, `remaining_debit_memo_balance`, `remaining_invoice_balance`, `remaining_payment_balance`, `sequence_set_id`, `tax_certificate`, `batch`, `tax_identifier`, `bill_cycle_day`, `description`, `name`, `currency`, `default_payment_method_id`, `enabled`, `organization_id` </details> (optional) * @return GetSubscriptionByVersionParams */ public GetSubscriptionByVersionParams accountFields(List accountFields) { this.accountFields = accountFields; return this; } /** * Set invoiceOwnerAccountFields * @param invoiceOwnerAccountFields Allows you to specify which fields are returned in the response. <details> <summary> Accepted values </summary> `custom_fields`, `created_by_id`, `updated_by_id`, `created_time`, `id`, `updated_time`, `auto_pay`, `account_number`, `bill_to_id`, `sold_to_id`, `billing_document_settings`, `communication_profile_id`, `crm_id`, `sales_rep`, `parent_account_id`, `payment_gateway`, `payment_terms`, `remaining_credit_memo_balance`, `remaining_debit_memo_balance`, `remaining_invoice_balance`, `remaining_payment_balance`, `sequence_set_id`, `tax_certificate`, `batch`, `tax_identifier`, `bill_cycle_day`, `description`, `name`, `currency`, `default_payment_method_id`, `enabled`, `organization_id` </details> (optional) * @return GetSubscriptionByVersionParams */ public GetSubscriptionByVersionParams invoiceOwnerAccountFields(List invoiceOwnerAccountFields) { this.invoiceOwnerAccountFields = invoiceOwnerAccountFields; return this; } /** * Set planFields * @param planFields Allows you to specify which fields are returned in the response. <details> <summary> Accepted values </summary> `custom_fields`, `created_by_id`, `updated_by_id`, `created_time`, `id`, `updated_time`, `start_date`, `end_date`, `name`, `active`, `description`, `plan_number`, `product_id`, `active_currencies` </details> (optional) * @return GetSubscriptionByVersionParams */ public GetSubscriptionByVersionParams 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 GetSubscriptionByVersionParams */ public GetSubscriptionByVersionParams productFields(List productFields) { this.productFields = productFields; 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 GetSubscriptionByVersionParams */ public GetSubscriptionByVersionParams priceFields(List priceFields) { this.priceFields = priceFields; return this; } /** * Set billToFields * @param billToFields Allows you to specify which fields are returned in the response. <details> <summary> Accepted values </summary> `custom_fields`, `created_by_id`, `updated_by_id`, `created_time`, `id`, `updated_time`, `account_id`, `address`, `home_phone`, `first_name`, `last_name`, `email`, `work_email`, `nickname`, `other_phone`, `work_phone`, `mobile_phone`, `tax_region`, `other_phone_type`, `fax` </details> (optional) * @return GetSubscriptionByVersionParams */ public GetSubscriptionByVersionParams billToFields(List billToFields) { this.billToFields = billToFields; return this; } /** * Set prepaidBalanceFields * @param prepaidBalanceFields Allows you to specify which fields are returned in the response. <details> <summary> Accepted values </summary> `prepaid_UOM`, `start_date`, `end_date`, `total_balance`, `remaining_balance` </details> (optional) * @return GetSubscriptionByVersionParams */ public GetSubscriptionByVersionParams prepaidBalanceFields(List prepaidBalanceFields) { this.prepaidBalanceFields = prepaidBalanceFields; return this; } /** * Set prepaidBalancesFields * @param prepaidBalancesFields Allows you to specify which fields are returned in the response. <details> <summary> Accepted values </summary> `validity_periods` </details> (optional) * @return GetSubscriptionByVersionParams */ public GetSubscriptionByVersionParams prepaidBalancesFields(List prepaidBalancesFields) { this.prepaidBalancesFields = prepaidBalancesFields; return this; } /** * Set validityPeriodFields * @param validityPeriodFields Allows you to specify which fields are returned in the response. <details> <summary> Accepted values </summary> `prepaid_UOM`, `start_date`, `end_date`, `total_balance`, `remaining_balance`, `overage_rated_amount`, `overage_rated_quantity` </details> (optional) * @return GetSubscriptionByVersionParams */ public GetSubscriptionByVersionParams validityPeriodFields(List validityPeriodFields) { this.validityPeriodFields = validityPeriodFields; return this; } /** * Set transactionsFields * @param transactionsFields Allows you to specify which fields are returned in the response. <details> <summary> Accepted values </summary> `transaction_date`, `type`, `quantity` </details> (optional) * @return GetSubscriptionByVersionParams */ public GetSubscriptionByVersionParams transactionsFields(List transactionsFields) { this.transactionsFields = transactionsFields; return this; } /** * Set actionsFields * @param actionsFields Allows you to specify which fields are returned in the response. <details> <summary> Accepted values </summary> `type`, `action_id`, `sequence`, `start_on`, `subscription_plans`, `renew`, `terms`, `cancel`, `pause`, `resume`, `order` </details> (optional) * @return GetSubscriptionByVersionParams */ public GetSubscriptionByVersionParams actionsFields(List actionsFields) { this.actionsFields = actionsFields; 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 GetSubscriptionByVersionParams */ public GetSubscriptionByVersionParams 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 GetSubscriptionByVersionParams */ public GetSubscriptionByVersionParams 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 GetSubscriptionByVersionParams */ public GetSubscriptionByVersionParams 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 GetSubscriptionByVersionParams */ public GetSubscriptionByVersionParams 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 GetSubscriptionByVersionParams */ public GetSubscriptionByVersionParams pageSize(Integer pageSize) { this.pageSize = pageSize; return this; } } /** * List all versions of a subscription * Lists all versions of the specified subscription. * @param subscriptionId Identifier for the subscription, either `subscription_number` or `subscription_id` (required) * @return SubscriptionVersionListResponse * @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 GetSubscriptionByVersionParams getSubscriptionByVersionParams(String subscriptionId) { return new GetSubscriptionByVersionParams(subscriptionId); } public SubscriptionVersionListResponse getSubscriptionByVersion(String subscriptionId) throws ApiException { GetSubscriptionByVersionParams params = new GetSubscriptionByVersionParams(subscriptionId); return executeGetSubscriptionByVersionAPICall(params).getData(); } /** * Expose HTTP info public ApiResponse getSubscriptionByVersionWithHttpInfo(String subscriptionId) throws ApiException { GetSubscriptionByVersionParams params = new GetSubscriptionByVersionParams(subscriptionId); return executeGetSubscriptionByVersionAPICall(params); } **/ /** Legacy Query Params Requests **/ public SubscriptionVersionListResponse getSubscriptionByVersion( String subscriptionId , String cursor, List expand, List filter) throws ApiException { GetSubscriptionByVersionParams params = new GetSubscriptionByVersionParams(subscriptionId); params.cursor(cursor); params.expand(expand); params.filter(filter); return executeGetSubscriptionByVersionAPICall(params).getData(); } /* * add header methods */ public SubscriptionVersionListResponse getSubscriptionByVersion(String subscriptionId ,String cursor,List expand,List filter,Headers headers) throws ApiException { GetSubscriptionByVersionParams params = new GetSubscriptionByVersionParams(subscriptionId) .cursor(cursor) .expand(expand) .filter(filter) .headers(headers); return executeGetSubscriptionByVersionAPICall(params).getData(); } /** * List all versions of a subscription * Lists all versions of the specified subscription. * @param params GetSubscriptionByVersionParams * @return SubscriptionVersionListResponse * @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 SubscriptionVersionListResponse listVersions(GetSubscriptionByVersionParams params) throws ApiException { return executeGetSubscriptionByVersionAPICall(params).getData(); } public ApiResponse listVersionsWithHttpInfo(GetSubscriptionByVersionParams params) throws ApiException { return executeGetSubscriptionByVersionAPICall(params); } ApiResponse executeGetSubscriptionByVersionAPICall(GetSubscriptionByVersionParams params) throws ApiException { return getSubscriptionByVersionWithHttpInfo(params.subscriptionId, params.fields, params.subscriptionVersionFields, params.subscriptionPlansFields, params.subscriptionItemsFields, params.accountFields, params.invoiceOwnerAccountFields, params.planFields, params.productFields, params.priceFields, params.billToFields, params.prepaidBalanceFields, params.prepaidBalancesFields, params.validityPeriodFields, params.transactionsFields, params.actionsFields, params.cursor, params.expand, params.filter, params.sort, params.pageSize, params.zuoraTrackId, params.async, params.zuoraCacheEnabled, params.zuoraEntityIds, params.idempotencyKey, params.acceptEncoding, params.contentEncoding, params.zuoraOrgIds); } private okhttp3.Call getSubscriptionsCall(String cursor, List expand, List filter, List sort, Integer pageSize, List fields, List subscriptionFields, List subscriptionPlansFields, List subscriptionItemsFields, List accountFields, List invoiceOwnerAccountFields, List planFields, List productFields, List priceFields, List billToFields, List prepaidBalanceFields, List prepaidBalancesFields, List validityPeriodFields, List transactionsFields, 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 = "/subscriptions"; 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 (subscriptionFields != null) { localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "subscription.fields[]", subscriptionFields)); } if (subscriptionPlansFields != null) { localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "subscription_plans.fields[]", subscriptionPlansFields)); } if (subscriptionItemsFields != null) { localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "subscription_items.fields[]", subscriptionItemsFields)); } if (accountFields != null) { localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "account.fields[]", accountFields)); } if (invoiceOwnerAccountFields != null) { localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "invoice_owner_account.fields[]", invoiceOwnerAccountFields)); } if (planFields != null) { localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "plan.fields[]", planFields)); } if (productFields != null) { localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "product.fields[]", productFields)); } if (priceFields != null) { localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "price.fields[]", priceFields)); } if (billToFields != null) { localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "bill_to.fields[]", billToFields)); } if (prepaidBalanceFields != null) { localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "prepaid_balance.fields[]", prepaidBalanceFields)); } if (prepaidBalancesFields != null) { localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "prepaid_balances.fields[]", prepaidBalancesFields)); } if (validityPeriodFields != null) { localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "validity_period.fields[]", validityPeriodFields)); } if (transactionsFields != null) { localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "transactions.fields[]", transactionsFields)); } 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 getSubscriptionsValidateBeforeCall(String cursor, List expand, List filter, List sort, Integer pageSize, List fields, List subscriptionFields, List subscriptionPlansFields, List subscriptionItemsFields, List accountFields, List invoiceOwnerAccountFields, List planFields, List productFields, List priceFields, List billToFields, List prepaidBalanceFields, List prepaidBalancesFields, List validityPeriodFields, List transactionsFields, String zuoraTrackId, Boolean async, Boolean zuoraCacheEnabled, String zuoraEntityIds, String idempotencyKey, String acceptEncoding, String contentEncoding, String zuoraOrgIds, final ApiCallback _callback) throws ApiException { return getSubscriptionsCall(cursor, expand, filter, sort, pageSize, fields, subscriptionFields, subscriptionPlansFields, subscriptionItemsFields, accountFields, invoiceOwnerAccountFields, planFields, productFields, priceFields, billToFields, prepaidBalanceFields, prepaidBalancesFields, validityPeriodFields, transactionsFields, zuoraTrackId, async, zuoraCacheEnabled, zuoraEntityIds, idempotencyKey, acceptEncoding, contentEncoding, zuoraOrgIds, _callback); } private ApiResponse getSubscriptionsWithHttpInfo(String cursor, List expand, List filter, List sort, Integer pageSize, List fields, List subscriptionFields, List subscriptionPlansFields, List subscriptionItemsFields, List accountFields, List invoiceOwnerAccountFields, List planFields, List productFields, List priceFields, List billToFields, List prepaidBalanceFields, List prepaidBalancesFields, List validityPeriodFields, List transactionsFields, String zuoraTrackId, Boolean async, Boolean zuoraCacheEnabled, String zuoraEntityIds, String idempotencyKey, String acceptEncoding, String contentEncoding, String zuoraOrgIds) throws ApiException { okhttp3.Call localVarCall = getSubscriptionsValidateBeforeCall(cursor, expand, filter, sort, pageSize, fields, subscriptionFields, subscriptionPlansFields, subscriptionItemsFields, accountFields, invoiceOwnerAccountFields, planFields, productFields, priceFields, billToFields, prepaidBalanceFields, prepaidBalancesFields, validityPeriodFields, transactionsFields, 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 getSubscriptionsAsync(String cursor, List expand, List filter, List sort, Integer pageSize, List fields, List subscriptionFields, List subscriptionPlansFields, List subscriptionItemsFields, List accountFields, List invoiceOwnerAccountFields, List planFields, List productFields, List priceFields, List billToFields, List prepaidBalanceFields, List prepaidBalancesFields, List validityPeriodFields, List transactionsFields, String zuoraTrackId, Boolean async, Boolean zuoraCacheEnabled, String zuoraEntityIds, String idempotencyKey, String acceptEncoding, String contentEncoding, String zuoraOrgIds, final ApiCallback _callback) throws ApiException { okhttp3.Call localVarCall = getSubscriptionsValidateBeforeCall(cursor, expand, filter, sort, pageSize, fields, subscriptionFields, subscriptionPlansFields, subscriptionItemsFields, accountFields, invoiceOwnerAccountFields, planFields, productFields, priceFields, billToFields, prepaidBalanceFields, prepaidBalancesFields, validityPeriodFields, transactionsFields, zuoraTrackId, async, zuoraCacheEnabled, zuoraEntityIds, idempotencyKey, acceptEncoding, contentEncoding, zuoraOrgIds, _callback); Type localVarReturnType = new TypeToken(){}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } public static class GetSubscriptionsParams { 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 subscriptionFields; private List subscriptionPlansFields; private List subscriptionItemsFields; private List accountFields; private List invoiceOwnerAccountFields; private List planFields; private List productFields; private List priceFields; private List billToFields; private List prepaidBalanceFields; private List prepaidBalancesFields; private List validityPeriodFields; private List transactionsFields; 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 GetSubscriptionsParams() { } /** * Set listQueryParams * @param listQueryParams ListQueryParams * @return GetSubscriptionsParams */ public GetSubscriptionsParams 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 GetSubscriptionsParams */ public GetSubscriptionsParams 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 GetSubscriptionsParams */ public GetSubscriptionsParams 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 GetSubscriptionsParams */ public GetSubscriptionsParams 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 GetSubscriptionsParams */ public GetSubscriptionsParams 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 GetSubscriptionsParams */ public GetSubscriptionsParams 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 GetSubscriptionsParams */ public GetSubscriptionsParams 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`, `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 GetSubscriptionsParams */ public GetSubscriptionsParams fields(List fields) { this.fields = fields; 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 GetSubscriptionsParams */ public GetSubscriptionsParams subscriptionFields(List subscriptionFields) { this.subscriptionFields = subscriptionFields; return this; } /** * Set subscriptionPlansFields * @param subscriptionPlansFields Allows you to specify which fields are returned in the response. <details> <summary> Accepted values </summary> `custom_fields`, `created_by_id`, `updated_by_id`, `created_time`, `id`, `updated_time`, `name`, `plan_id`, `subscription_id`, `product_id`, `subscription_plan_number` </details> (optional) * @return GetSubscriptionsParams */ public GetSubscriptionsParams subscriptionPlansFields(List subscriptionPlansFields) { this.subscriptionPlansFields = subscriptionPlansFields; return this; } /** * Set subscriptionItemsFields * @param subscriptionItemsFields Allows you to specify which fields are returned in the response. <details> <summary> Accepted values </summary> `custom_fields`, `created_by_id`, `updated_by_id`, `created_time`, `id`, `updated_time`, `start_date`, `end_date`, `charge_model`, `charge_type`, `tiers`, `subscription_item_number`, `name`, `description`, `charged_through_date`, `recurring`, `price_id`, `start_event`, `tax_code`, `tax_inclusive`, `unit_of_measure`, `quantity`, `price_base_interval`, `overage`, `subscription_plan_id`, `tiers_mode`, `processed_through_date`, `active`, `state`, `unit_amount`, `amount`, `discount_amount`, `discount_percent`, `price_change_percentage`, `price_change_option` </details> (optional) * @return GetSubscriptionsParams */ public GetSubscriptionsParams subscriptionItemsFields(List subscriptionItemsFields) { this.subscriptionItemsFields = subscriptionItemsFields; return this; } /** * Set accountFields * @param accountFields Allows you to specify which fields are returned in the response. <details> <summary> Accepted values </summary> `custom_fields`, `created_by_id`, `updated_by_id`, `created_time`, `id`, `updated_time`, `auto_pay`, `account_number`, `bill_to_id`, `sold_to_id`, `billing_document_settings`, `communication_profile_id`, `crm_id`, `sales_rep`, `parent_account_id`, `payment_gateway`, `payment_terms`, `remaining_credit_memo_balance`, `remaining_debit_memo_balance`, `remaining_invoice_balance`, `remaining_payment_balance`, `sequence_set_id`, `tax_certificate`, `batch`, `tax_identifier`, `bill_cycle_day`, `description`, `name`, `currency`, `default_payment_method_id`, `enabled`, `organization_id` </details> (optional) * @return GetSubscriptionsParams */ public GetSubscriptionsParams accountFields(List accountFields) { this.accountFields = accountFields; return this; } /** * Set invoiceOwnerAccountFields * @param invoiceOwnerAccountFields Allows you to specify which fields are returned in the response. <details> <summary> Accepted values </summary> `custom_fields`, `created_by_id`, `updated_by_id`, `created_time`, `id`, `updated_time`, `auto_pay`, `account_number`, `bill_to_id`, `sold_to_id`, `billing_document_settings`, `communication_profile_id`, `crm_id`, `sales_rep`, `parent_account_id`, `payment_gateway`, `payment_terms`, `remaining_credit_memo_balance`, `remaining_debit_memo_balance`, `remaining_invoice_balance`, `remaining_payment_balance`, `sequence_set_id`, `tax_certificate`, `batch`, `tax_identifier`, `bill_cycle_day`, `description`, `name`, `currency`, `default_payment_method_id`, `enabled`, `organization_id` </details> (optional) * @return GetSubscriptionsParams */ public GetSubscriptionsParams invoiceOwnerAccountFields(List invoiceOwnerAccountFields) { this.invoiceOwnerAccountFields = invoiceOwnerAccountFields; return this; } /** * Set planFields * @param planFields Allows you to specify which fields are returned in the response. <details> <summary> Accepted values </summary> `custom_fields`, `created_by_id`, `updated_by_id`, `created_time`, `id`, `updated_time`, `start_date`, `end_date`, `name`, `active`, `description`, `plan_number`, `product_id`, `active_currencies` </details> (optional) * @return GetSubscriptionsParams */ public GetSubscriptionsParams 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 GetSubscriptionsParams */ public GetSubscriptionsParams productFields(List productFields) { this.productFields = productFields; 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 GetSubscriptionsParams */ public GetSubscriptionsParams priceFields(List priceFields) { this.priceFields = priceFields; return this; } /** * Set billToFields * @param billToFields Allows you to specify which fields are returned in the response. <details> <summary> Accepted values </summary> `custom_fields`, `created_by_id`, `updated_by_id`, `created_time`, `id`, `updated_time`, `account_id`, `address`, `home_phone`, `first_name`, `last_name`, `email`, `work_email`, `nickname`, `other_phone`, `work_phone`, `mobile_phone`, `tax_region`, `other_phone_type`, `fax` </details> (optional) * @return GetSubscriptionsParams */ public GetSubscriptionsParams billToFields(List billToFields) { this.billToFields = billToFields; return this; } /** * Set prepaidBalanceFields * @param prepaidBalanceFields Allows you to specify which fields are returned in the response. <details> <summary> Accepted values </summary> `prepaid_UOM`, `start_date`, `end_date`, `total_balance`, `remaining_balance` </details> (optional) * @return GetSubscriptionsParams */ public GetSubscriptionsParams prepaidBalanceFields(List prepaidBalanceFields) { this.prepaidBalanceFields = prepaidBalanceFields; return this; } /** * Set prepaidBalancesFields * @param prepaidBalancesFields Allows you to specify which fields are returned in the response. <details> <summary> Accepted values </summary> `validity_periods` </details> (optional) * @return GetSubscriptionsParams */ public GetSubscriptionsParams prepaidBalancesFields(List prepaidBalancesFields) { this.prepaidBalancesFields = prepaidBalancesFields; return this; } /** * Set validityPeriodFields * @param validityPeriodFields Allows you to specify which fields are returned in the response. <details> <summary> Accepted values </summary> `prepaid_UOM`, `start_date`, `end_date`, `total_balance`, `remaining_balance`, `overage_rated_amount`, `overage_rated_quantity` </details> (optional) * @return GetSubscriptionsParams */ public GetSubscriptionsParams validityPeriodFields(List validityPeriodFields) { this.validityPeriodFields = validityPeriodFields; return this; } /** * Set transactionsFields * @param transactionsFields Allows you to specify which fields are returned in the response. <details> <summary> Accepted values </summary> `transaction_date`, `type`, `quantity` </details> (optional) * @return GetSubscriptionsParams */ public GetSubscriptionsParams transactionsFields(List transactionsFields) { this.transactionsFields = transactionsFields; return this; } } /** * List subscriptions * Returns a dictionary with a data property that contains an array of subscriptions, starting after the cursor, if used. Each entry in the array is a separate subscription object. If no more subscriptions are available, the resulting array will be empty. This request should never return an error. * @return SubscriptionListResponse * @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 GetSubscriptionsParams getSubscriptionsParams() { return new GetSubscriptionsParams(); } public SubscriptionListResponse getSubscriptions() throws ApiException { GetSubscriptionsParams params = new GetSubscriptionsParams(); return executeGetSubscriptionsAPICall(params).getData(); } /** * Expose HTTP info public ApiResponse getSubscriptionsWithHttpInfo() throws ApiException { GetSubscriptionsParams params = new GetSubscriptionsParams(); return executeGetSubscriptionsAPICall(params); } **/ /** Legacy Query Params Requests **/ public SubscriptionListResponse getSubscriptions(String cursor, List expand, List filter) throws ApiException { GetSubscriptionsParams params = new GetSubscriptionsParams(); params.cursor(cursor); params.expand(expand); params.filter(filter); return executeGetSubscriptionsAPICall(params).getData(); } /* * add header methods */ public SubscriptionListResponse getSubscriptions(String cursor,List expand,List filter,Headers headers) throws ApiException { GetSubscriptionsParams params = new GetSubscriptionsParams() .cursor(cursor) .expand(expand) .filter(filter) .headers(headers); return executeGetSubscriptionsAPICall(params).getData(); } /** * List subscriptions * Returns a dictionary with a data property that contains an array of subscriptions, starting after the cursor, if used. Each entry in the array is a separate subscription object. If no more subscriptions are available, the resulting array will be empty. This request should never return an error. * @param params GetSubscriptionsParams * @return SubscriptionListResponse * @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 SubscriptionListResponse list(GetSubscriptionsParams params) throws ApiException { return executeGetSubscriptionsAPICall(params).getData(); } public ApiResponse listWithHttpInfo(GetSubscriptionsParams params) throws ApiException { return executeGetSubscriptionsAPICall(params); } ApiResponse executeGetSubscriptionsAPICall(GetSubscriptionsParams params) throws ApiException { return getSubscriptionsWithHttpInfo(params.cursor, params.expand, params.filter, params.sort, params.pageSize, params.fields, params.subscriptionFields, params.subscriptionPlansFields, params.subscriptionItemsFields, params.accountFields, params.invoiceOwnerAccountFields, params.planFields, params.productFields, params.priceFields, params.billToFields, params.prepaidBalanceFields, params.prepaidBalancesFields, params.validityPeriodFields, params.transactionsFields, params.zuoraTrackId, params.async, params.zuoraCacheEnabled, params.zuoraEntityIds, params.idempotencyKey, params.acceptEncoding, params.contentEncoding, params.zuoraOrgIds); } private okhttp3.Call patchSubscriptionCall(String subscriptionId, SubscriptionPatchRequest subscriptionPatchRequest, List fields, List subscriptionFields, List subscriptionPlansFields, List subscriptionItemsFields, List accountFields, List invoiceOwnerAccountFields, List planFields, List productFields, List priceFields, List billToFields, List prepaidBalanceFields, List prepaidBalancesFields, List validityPeriodFields, List transactionsFields, List expand, List filter, Integer pageSize, String zuoraTrackId, Boolean async, Boolean zuoraCacheEnabled, String zuoraEntityIds, String idempotencyKey, String acceptEncoding, String contentEncoding, String zuoraOrgIds, final ApiCallback _callback) throws ApiException { String basePath = null; // Operation Servers String[] localBasePaths = new String[] { }; // Determine Base Path to Use if (localCustomBaseUrl != null){ basePath = localCustomBaseUrl; } else if ( localBasePaths.length > 0 ) { basePath = localBasePaths[localHostIndex]; } else { basePath = null; } Object localVarPostBody = subscriptionPatchRequest; // create path and map variables String localVarPath = "/subscriptions/{subscription_id}" .replace("{" + "subscription_id" + "}", localVarApiClient.escapeString(subscriptionId.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 (subscriptionFields != null) { localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "subscription.fields[]", subscriptionFields)); } if (subscriptionPlansFields != null) { localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "subscription_plans.fields[]", subscriptionPlansFields)); } if (subscriptionItemsFields != null) { localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "subscription_items.fields[]", subscriptionItemsFields)); } if (accountFields != null) { localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "account.fields[]", accountFields)); } if (invoiceOwnerAccountFields != null) { localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "invoice_owner_account.fields[]", invoiceOwnerAccountFields)); } if (planFields != null) { localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "plan.fields[]", planFields)); } if (productFields != null) { localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "product.fields[]", productFields)); } if (priceFields != null) { localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "price.fields[]", priceFields)); } if (billToFields != null) { localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "bill_to.fields[]", billToFields)); } if (prepaidBalanceFields != null) { localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "prepaid_balance.fields[]", prepaidBalanceFields)); } if (prepaidBalancesFields != null) { localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "prepaid_balances.fields[]", prepaidBalancesFields)); } if (validityPeriodFields != null) { localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "validity_period.fields[]", validityPeriodFields)); } if (transactionsFields != null) { localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "transactions.fields[]", transactionsFields)); } if (expand != null) { localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "expand[]", expand)); } if (filter != null) { localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "filter[]", filter)); } if (pageSize != null) { localVarQueryParams.addAll(localVarApiClient.parameterToPair("page_size", pageSize)); } if (zuoraTrackId != null) { localVarHeaderParams.put("zuora-track-id", localVarApiClient.parameterToString(zuoraTrackId)); } if (async != null) { localVarHeaderParams.put("async", localVarApiClient.parameterToString(async)); } if (zuoraCacheEnabled != null) { localVarHeaderParams.put("zuora-cache-enabled", localVarApiClient.parameterToString(zuoraCacheEnabled)); } if (zuoraEntityIds != null) { localVarHeaderParams.put("zuora-entity-ids", localVarApiClient.parameterToString(zuoraEntityIds)); } if (idempotencyKey != null) { localVarHeaderParams.put("idempotency-key", localVarApiClient.parameterToString(idempotencyKey)); } if (acceptEncoding != null) { localVarHeaderParams.put("accept-encoding", localVarApiClient.parameterToString(acceptEncoding)); } if (contentEncoding != null) { localVarHeaderParams.put("content-encoding", localVarApiClient.parameterToString(contentEncoding)); } if (zuoraOrgIds != null) { localVarHeaderParams.put("zuora-org-ids", localVarApiClient.parameterToString(zuoraOrgIds)); } final String[] localVarAccepts = { "application/json" }; final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) { localVarHeaderParams.put("Accept", localVarAccept); } final String[] localVarContentTypes = { "application/json" }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } String[] localVarAuthNames = new String[] { "bearerAuth" }; return localVarApiClient.buildCall(basePath, localVarPath, "PATCH", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") private okhttp3.Call patchSubscriptionValidateBeforeCall(String subscriptionId, SubscriptionPatchRequest subscriptionPatchRequest, List fields, List subscriptionFields, List subscriptionPlansFields, List subscriptionItemsFields, List accountFields, List invoiceOwnerAccountFields, List planFields, List productFields, List priceFields, List billToFields, List prepaidBalanceFields, List prepaidBalancesFields, List validityPeriodFields, List transactionsFields, List expand, List filter, Integer pageSize, String zuoraTrackId, Boolean async, Boolean zuoraCacheEnabled, String zuoraEntityIds, String idempotencyKey, String acceptEncoding, String contentEncoding, String zuoraOrgIds, final ApiCallback _callback) throws ApiException { // verify the required parameter 'subscriptionId' is set if (subscriptionId == null) { throw new ApiException("Missing the required parameter 'subscriptionId' when calling patchSubscription(Async)"); } // verify the required parameter 'subscriptionPatchRequest' is set if (subscriptionPatchRequest == null) { throw new ApiException("Missing the required parameter 'subscriptionPatchRequest' when calling patchSubscription(Async)"); } return patchSubscriptionCall(subscriptionId, subscriptionPatchRequest, fields, subscriptionFields, subscriptionPlansFields, subscriptionItemsFields, accountFields, invoiceOwnerAccountFields, planFields, productFields, priceFields, billToFields, prepaidBalanceFields, prepaidBalancesFields, validityPeriodFields, transactionsFields, expand, filter, pageSize, zuoraTrackId, async, zuoraCacheEnabled, zuoraEntityIds, idempotencyKey, acceptEncoding, contentEncoding, zuoraOrgIds, _callback); } private ApiResponse patchSubscriptionWithHttpInfo(String subscriptionId, SubscriptionPatchRequest subscriptionPatchRequest, List fields, List subscriptionFields, List subscriptionPlansFields, List subscriptionItemsFields, List accountFields, List invoiceOwnerAccountFields, List planFields, List productFields, List priceFields, List billToFields, List prepaidBalanceFields, List prepaidBalancesFields, List validityPeriodFields, List transactionsFields, List expand, List filter, Integer pageSize, String zuoraTrackId, Boolean async, Boolean zuoraCacheEnabled, String zuoraEntityIds, String idempotencyKey, String acceptEncoding, String contentEncoding, String zuoraOrgIds) throws ApiException { okhttp3.Call localVarCall = patchSubscriptionValidateBeforeCall(subscriptionId, subscriptionPatchRequest, fields, subscriptionFields, subscriptionPlansFields, subscriptionItemsFields, accountFields, invoiceOwnerAccountFields, planFields, productFields, priceFields, billToFields, prepaidBalanceFields, prepaidBalancesFields, validityPeriodFields, transactionsFields, expand, filter, pageSize, zuoraTrackId, async, zuoraCacheEnabled, zuoraEntityIds, idempotencyKey, acceptEncoding, contentEncoding, zuoraOrgIds, null); try { Type localVarReturnType = new TypeToken(){}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } catch (ApiException e) { e.setErrorObject(localVarApiClient.getJSON().getGson().fromJson(e.getResponseBody(), new TypeToken(){}.getType())); throw e; } } private okhttp3.Call patchSubscriptionAsync(String subscriptionId, SubscriptionPatchRequest subscriptionPatchRequest, List fields, List subscriptionFields, List subscriptionPlansFields, List subscriptionItemsFields, List accountFields, List invoiceOwnerAccountFields, List planFields, List productFields, List priceFields, List billToFields, List prepaidBalanceFields, List prepaidBalancesFields, List validityPeriodFields, List transactionsFields, List expand, List filter, Integer pageSize, String zuoraTrackId, Boolean async, Boolean zuoraCacheEnabled, String zuoraEntityIds, String idempotencyKey, String acceptEncoding, String contentEncoding, String zuoraOrgIds, final ApiCallback _callback) throws ApiException { okhttp3.Call localVarCall = patchSubscriptionValidateBeforeCall(subscriptionId, subscriptionPatchRequest, fields, subscriptionFields, subscriptionPlansFields, subscriptionItemsFields, accountFields, invoiceOwnerAccountFields, planFields, productFields, priceFields, billToFields, prepaidBalanceFields, prepaidBalancesFields, validityPeriodFields, transactionsFields, expand, filter, pageSize, zuoraTrackId, async, zuoraCacheEnabled, zuoraEntityIds, idempotencyKey, acceptEncoding, contentEncoding, zuoraOrgIds, _callback); Type localVarReturnType = new TypeToken(){}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } public static class PatchSubscriptionParams { private final String subscriptionId; private final SubscriptionPatchRequest subscriptionPatchRequest; private Headers headers; /* * Check for list params */ private GetByIdQueryParams getByIdQueryParams; private List fields; private List subscriptionFields; private List subscriptionPlansFields; private List subscriptionItemsFields; private List accountFields; private List invoiceOwnerAccountFields; private List planFields; private List productFields; private List priceFields; private List billToFields; private List prepaidBalanceFields; private List prepaidBalancesFields; private List validityPeriodFields; private List transactionsFields; private List expand; private List filter; private Integer pageSize; private String zuoraTrackId; private Boolean async; private Boolean zuoraCacheEnabled; private String zuoraEntityIds; private String idempotencyKey; private String acceptEncoding; private String contentEncoding; private String zuoraOrgIds; public PatchSubscriptionParams(String subscriptionId, SubscriptionPatchRequest subscriptionPatchRequest) { this.subscriptionId = subscriptionId; this.subscriptionPatchRequest = subscriptionPatchRequest; } /** * Set getByIdQueryParams * @param getByIdQueryParams GetByIdQueryParams * @return PatchSubscriptionParams */ public PatchSubscriptionParams 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 PatchSubscriptionParams */ public PatchSubscriptionParams 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`, `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 PatchSubscriptionParams */ public PatchSubscriptionParams fields(List fields) { this.fields = fields; 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 PatchSubscriptionParams */ public PatchSubscriptionParams subscriptionFields(List subscriptionFields) { this.subscriptionFields = subscriptionFields; return this; } /** * Set subscriptionPlansFields * @param subscriptionPlansFields Allows you to specify which fields are returned in the response. <details> <summary> Accepted values </summary> `custom_fields`, `created_by_id`, `updated_by_id`, `created_time`, `id`, `updated_time`, `name`, `plan_id`, `subscription_id`, `product_id`, `subscription_plan_number` </details> (optional) * @return PatchSubscriptionParams */ public PatchSubscriptionParams subscriptionPlansFields(List subscriptionPlansFields) { this.subscriptionPlansFields = subscriptionPlansFields; return this; } /** * Set subscriptionItemsFields * @param subscriptionItemsFields Allows you to specify which fields are returned in the response. <details> <summary> Accepted values </summary> `custom_fields`, `created_by_id`, `updated_by_id`, `created_time`, `id`, `updated_time`, `start_date`, `end_date`, `charge_model`, `charge_type`, `tiers`, `subscription_item_number`, `name`, `description`, `charged_through_date`, `recurring`, `price_id`, `start_event`, `tax_code`, `tax_inclusive`, `unit_of_measure`, `quantity`, `price_base_interval`, `overage`, `subscription_plan_id`, `tiers_mode`, `processed_through_date`, `active`, `state`, `unit_amount`, `amount`, `discount_amount`, `discount_percent`, `price_change_percentage`, `price_change_option` </details> (optional) * @return PatchSubscriptionParams */ public PatchSubscriptionParams subscriptionItemsFields(List subscriptionItemsFields) { this.subscriptionItemsFields = subscriptionItemsFields; return this; } /** * Set accountFields * @param accountFields Allows you to specify which fields are returned in the response. <details> <summary> Accepted values </summary> `custom_fields`, `created_by_id`, `updated_by_id`, `created_time`, `id`, `updated_time`, `auto_pay`, `account_number`, `bill_to_id`, `sold_to_id`, `billing_document_settings`, `communication_profile_id`, `crm_id`, `sales_rep`, `parent_account_id`, `payment_gateway`, `payment_terms`, `remaining_credit_memo_balance`, `remaining_debit_memo_balance`, `remaining_invoice_balance`, `remaining_payment_balance`, `sequence_set_id`, `tax_certificate`, `batch`, `tax_identifier`, `bill_cycle_day`, `description`, `name`, `currency`, `default_payment_method_id`, `enabled`, `organization_id` </details> (optional) * @return PatchSubscriptionParams */ public PatchSubscriptionParams accountFields(List accountFields) { this.accountFields = accountFields; return this; } /** * Set invoiceOwnerAccountFields * @param invoiceOwnerAccountFields Allows you to specify which fields are returned in the response. <details> <summary> Accepted values </summary> `custom_fields`, `created_by_id`, `updated_by_id`, `created_time`, `id`, `updated_time`, `auto_pay`, `account_number`, `bill_to_id`, `sold_to_id`, `billing_document_settings`, `communication_profile_id`, `crm_id`, `sales_rep`, `parent_account_id`, `payment_gateway`, `payment_terms`, `remaining_credit_memo_balance`, `remaining_debit_memo_balance`, `remaining_invoice_balance`, `remaining_payment_balance`, `sequence_set_id`, `tax_certificate`, `batch`, `tax_identifier`, `bill_cycle_day`, `description`, `name`, `currency`, `default_payment_method_id`, `enabled`, `organization_id` </details> (optional) * @return PatchSubscriptionParams */ public PatchSubscriptionParams invoiceOwnerAccountFields(List invoiceOwnerAccountFields) { this.invoiceOwnerAccountFields = invoiceOwnerAccountFields; return this; } /** * Set planFields * @param planFields Allows you to specify which fields are returned in the response. <details> <summary> Accepted values </summary> `custom_fields`, `created_by_id`, `updated_by_id`, `created_time`, `id`, `updated_time`, `start_date`, `end_date`, `name`, `active`, `description`, `plan_number`, `product_id`, `active_currencies` </details> (optional) * @return PatchSubscriptionParams */ public PatchSubscriptionParams 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 PatchSubscriptionParams */ public PatchSubscriptionParams productFields(List productFields) { this.productFields = productFields; 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 PatchSubscriptionParams */ public PatchSubscriptionParams priceFields(List priceFields) { this.priceFields = priceFields; return this; } /** * Set billToFields * @param billToFields Allows you to specify which fields are returned in the response. <details> <summary> Accepted values </summary> `custom_fields`, `created_by_id`, `updated_by_id`, `created_time`, `id`, `updated_time`, `account_id`, `address`, `home_phone`, `first_name`, `last_name`, `email`, `work_email`, `nickname`, `other_phone`, `work_phone`, `mobile_phone`, `tax_region`, `other_phone_type`, `fax` </details> (optional) * @return PatchSubscriptionParams */ public PatchSubscriptionParams billToFields(List billToFields) { this.billToFields = billToFields; return this; } /** * Set prepaidBalanceFields * @param prepaidBalanceFields Allows you to specify which fields are returned in the response. <details> <summary> Accepted values </summary> `prepaid_UOM`, `start_date`, `end_date`, `total_balance`, `remaining_balance` </details> (optional) * @return PatchSubscriptionParams */ public PatchSubscriptionParams prepaidBalanceFields(List prepaidBalanceFields) { this.prepaidBalanceFields = prepaidBalanceFields; return this; } /** * Set prepaidBalancesFields * @param prepaidBalancesFields Allows you to specify which fields are returned in the response. <details> <summary> Accepted values </summary> `validity_periods` </details> (optional) * @return PatchSubscriptionParams */ public PatchSubscriptionParams prepaidBalancesFields(List prepaidBalancesFields) { this.prepaidBalancesFields = prepaidBalancesFields; return this; } /** * Set validityPeriodFields * @param validityPeriodFields Allows you to specify which fields are returned in the response. <details> <summary> Accepted values </summary> `prepaid_UOM`, `start_date`, `end_date`, `total_balance`, `remaining_balance`, `overage_rated_amount`, `overage_rated_quantity` </details> (optional) * @return PatchSubscriptionParams */ public PatchSubscriptionParams validityPeriodFields(List validityPeriodFields) { this.validityPeriodFields = validityPeriodFields; return this; } /** * Set transactionsFields * @param transactionsFields Allows you to specify which fields are returned in the response. <details> <summary> Accepted values </summary> `transaction_date`, `type`, `quantity` </details> (optional) * @return PatchSubscriptionParams */ public PatchSubscriptionParams transactionsFields(List transactionsFields) { this.transactionsFields = transactionsFields; return this; } /** * Set expand * @param expand Allows you to expand responses by including related object information in a single call. See the [Expand responses](https://developer.zuora.com/quickstart-api/tutorial/expand-responses/) section of the Quickstart API Tutorials for detailed instructions. (optional) * @return PatchSubscriptionParams */ public PatchSubscriptionParams 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 PatchSubscriptionParams */ public PatchSubscriptionParams 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 PatchSubscriptionParams */ public PatchSubscriptionParams pageSize(Integer pageSize) { this.pageSize = pageSize; return this; } } /** * Update a subscription * Updates the specified subscription by setting the values of the parameters passed. Any parameters not provided will be left unchanged. * @param subscriptionId Identifier for the subscription, either `subscription_number` or `subscription_id` (required) * @param subscriptionPatchRequest (required) * @return Subscription * @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 PatchSubscriptionParams patchSubscriptionParams(String subscriptionId, SubscriptionPatchRequest subscriptionPatchRequest) { return new PatchSubscriptionParams(subscriptionId, subscriptionPatchRequest); } public Subscription patchSubscription(String subscriptionId, SubscriptionPatchRequest subscriptionPatchRequest) throws ApiException { PatchSubscriptionParams params = new PatchSubscriptionParams(subscriptionId, subscriptionPatchRequest); return executePatchSubscriptionAPICall(params).getData(); } /** * Expose HTTP info public ApiResponse patchSubscriptionWithHttpInfo(String subscriptionId, SubscriptionPatchRequest subscriptionPatchRequest) throws ApiException { PatchSubscriptionParams params = new PatchSubscriptionParams(subscriptionId, subscriptionPatchRequest); return executePatchSubscriptionAPICall(params); } **/ /** Legacy Query Params Requests **/ public Subscription patchSubscription( String subscriptionId , SubscriptionPatchRequest subscriptionPatchRequest , List expand) throws ApiException { PatchSubscriptionParams params = new PatchSubscriptionParams(subscriptionId, subscriptionPatchRequest); params.expand(expand); return executePatchSubscriptionAPICall(params).getData(); } /* * add header methods */ public Subscription patchSubscription(String subscriptionId , SubscriptionPatchRequest subscriptionPatchRequest ,List expand,Headers headers) throws ApiException { PatchSubscriptionParams params = new PatchSubscriptionParams(subscriptionId, subscriptionPatchRequest) .expand(expand) .headers(headers); return executePatchSubscriptionAPICall(params).getData(); } /** * Update a subscription * Updates the specified subscription by setting the values of the parameters passed. Any parameters not provided will be left unchanged. * @param params PatchSubscriptionParams * @return Subscription * @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 Subscription update(PatchSubscriptionParams params) throws ApiException { return executePatchSubscriptionAPICall(params).getData(); } public ApiResponse updateWithHttpInfo(PatchSubscriptionParams params) throws ApiException { return executePatchSubscriptionAPICall(params); } ApiResponse executePatchSubscriptionAPICall(PatchSubscriptionParams params) throws ApiException { return patchSubscriptionWithHttpInfo(params.subscriptionId, params.subscriptionPatchRequest, params.fields, params.subscriptionFields, params.subscriptionPlansFields, params.subscriptionItemsFields, params.accountFields, params.invoiceOwnerAccountFields, params.planFields, params.productFields, params.priceFields, params.billToFields, params.prepaidBalanceFields, params.prepaidBalancesFields, params.validityPeriodFields, params.transactionsFields, params.expand, params.filter, params.pageSize, params.zuoraTrackId, params.async, params.zuoraCacheEnabled, params.zuoraEntityIds, params.idempotencyKey, params.acceptEncoding, params.contentEncoding, params.zuoraOrgIds); } private okhttp3.Call pauseSubscriptionCall(String subscriptionId, PauseSubscriptionRequest pauseSubscriptionRequest, List fields, List subscriptionFields, List subscriptionPlansFields, List subscriptionItemsFields, List accountFields, List invoiceOwnerAccountFields, List planFields, List productFields, List priceFields, List billToFields, List prepaidBalanceFields, List prepaidBalancesFields, List validityPeriodFields, List transactionsFields, List expand, List filter, Integer pageSize, String zuoraTrackId, Boolean async, Boolean zuoraCacheEnabled, String zuoraEntityIds, String idempotencyKey, String acceptEncoding, String contentEncoding, String zuoraOrgIds, final ApiCallback _callback) throws ApiException { String basePath = null; // Operation Servers String[] localBasePaths = new String[] { }; // Determine Base Path to Use if (localCustomBaseUrl != null){ basePath = localCustomBaseUrl; } else if ( localBasePaths.length > 0 ) { basePath = localBasePaths[localHostIndex]; } else { basePath = null; } Object localVarPostBody = pauseSubscriptionRequest; // create path and map variables String localVarPath = "/subscriptions/{subscription_id}/pause" .replace("{" + "subscription_id" + "}", localVarApiClient.escapeString(subscriptionId.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 (subscriptionFields != null) { localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "subscription.fields[]", subscriptionFields)); } if (subscriptionPlansFields != null) { localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "subscription_plans.fields[]", subscriptionPlansFields)); } if (subscriptionItemsFields != null) { localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "subscription_items.fields[]", subscriptionItemsFields)); } if (accountFields != null) { localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "account.fields[]", accountFields)); } if (invoiceOwnerAccountFields != null) { localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "invoice_owner_account.fields[]", invoiceOwnerAccountFields)); } if (planFields != null) { localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "plan.fields[]", planFields)); } if (productFields != null) { localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "product.fields[]", productFields)); } if (priceFields != null) { localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "price.fields[]", priceFields)); } if (billToFields != null) { localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "bill_to.fields[]", billToFields)); } if (prepaidBalanceFields != null) { localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "prepaid_balance.fields[]", prepaidBalanceFields)); } if (prepaidBalancesFields != null) { localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "prepaid_balances.fields[]", prepaidBalancesFields)); } if (validityPeriodFields != null) { localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "validity_period.fields[]", validityPeriodFields)); } if (transactionsFields != null) { localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "transactions.fields[]", transactionsFields)); } if (expand != null) { localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "expand[]", expand)); } if (filter != null) { localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "filter[]", filter)); } if (pageSize != null) { localVarQueryParams.addAll(localVarApiClient.parameterToPair("page_size", pageSize)); } if (zuoraTrackId != null) { localVarHeaderParams.put("zuora-track-id", localVarApiClient.parameterToString(zuoraTrackId)); } if (async != null) { localVarHeaderParams.put("async", localVarApiClient.parameterToString(async)); } if (zuoraCacheEnabled != null) { localVarHeaderParams.put("zuora-cache-enabled", localVarApiClient.parameterToString(zuoraCacheEnabled)); } if (zuoraEntityIds != null) { localVarHeaderParams.put("zuora-entity-ids", localVarApiClient.parameterToString(zuoraEntityIds)); } if (idempotencyKey != null) { localVarHeaderParams.put("idempotency-key", localVarApiClient.parameterToString(idempotencyKey)); } if (acceptEncoding != null) { localVarHeaderParams.put("accept-encoding", localVarApiClient.parameterToString(acceptEncoding)); } if (contentEncoding != null) { localVarHeaderParams.put("content-encoding", localVarApiClient.parameterToString(contentEncoding)); } if (zuoraOrgIds != null) { localVarHeaderParams.put("zuora-org-ids", localVarApiClient.parameterToString(zuoraOrgIds)); } final String[] localVarAccepts = { "application/json" }; final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) { localVarHeaderParams.put("Accept", localVarAccept); } final String[] localVarContentTypes = { "application/json" }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } String[] localVarAuthNames = new String[] { "bearerAuth" }; return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") private okhttp3.Call pauseSubscriptionValidateBeforeCall(String subscriptionId, PauseSubscriptionRequest pauseSubscriptionRequest, List fields, List subscriptionFields, List subscriptionPlansFields, List subscriptionItemsFields, List accountFields, List invoiceOwnerAccountFields, List planFields, List productFields, List priceFields, List billToFields, List prepaidBalanceFields, List prepaidBalancesFields, List validityPeriodFields, List transactionsFields, List expand, List filter, Integer pageSize, String zuoraTrackId, Boolean async, Boolean zuoraCacheEnabled, String zuoraEntityIds, String idempotencyKey, String acceptEncoding, String contentEncoding, String zuoraOrgIds, final ApiCallback _callback) throws ApiException { // verify the required parameter 'subscriptionId' is set if (subscriptionId == null) { throw new ApiException("Missing the required parameter 'subscriptionId' when calling pauseSubscription(Async)"); } // verify the required parameter 'pauseSubscriptionRequest' is set if (pauseSubscriptionRequest == null) { throw new ApiException("Missing the required parameter 'pauseSubscriptionRequest' when calling pauseSubscription(Async)"); } return pauseSubscriptionCall(subscriptionId, pauseSubscriptionRequest, fields, subscriptionFields, subscriptionPlansFields, subscriptionItemsFields, accountFields, invoiceOwnerAccountFields, planFields, productFields, priceFields, billToFields, prepaidBalanceFields, prepaidBalancesFields, validityPeriodFields, transactionsFields, expand, filter, pageSize, zuoraTrackId, async, zuoraCacheEnabled, zuoraEntityIds, idempotencyKey, acceptEncoding, contentEncoding, zuoraOrgIds, _callback); } private ApiResponse pauseSubscriptionWithHttpInfo(String subscriptionId, PauseSubscriptionRequest pauseSubscriptionRequest, List fields, List subscriptionFields, List subscriptionPlansFields, List subscriptionItemsFields, List accountFields, List invoiceOwnerAccountFields, List planFields, List productFields, List priceFields, List billToFields, List prepaidBalanceFields, List prepaidBalancesFields, List validityPeriodFields, List transactionsFields, List expand, List filter, Integer pageSize, String zuoraTrackId, Boolean async, Boolean zuoraCacheEnabled, String zuoraEntityIds, String idempotencyKey, String acceptEncoding, String contentEncoding, String zuoraOrgIds) throws ApiException { okhttp3.Call localVarCall = pauseSubscriptionValidateBeforeCall(subscriptionId, pauseSubscriptionRequest, fields, subscriptionFields, subscriptionPlansFields, subscriptionItemsFields, accountFields, invoiceOwnerAccountFields, planFields, productFields, priceFields, billToFields, prepaidBalanceFields, prepaidBalancesFields, validityPeriodFields, transactionsFields, expand, filter, pageSize, zuoraTrackId, async, zuoraCacheEnabled, zuoraEntityIds, idempotencyKey, acceptEncoding, contentEncoding, zuoraOrgIds, null); try { Type localVarReturnType = new TypeToken(){}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } catch (ApiException e) { e.setErrorObject(localVarApiClient.getJSON().getGson().fromJson(e.getResponseBody(), new TypeToken(){}.getType())); throw e; } } private okhttp3.Call pauseSubscriptionAsync(String subscriptionId, PauseSubscriptionRequest pauseSubscriptionRequest, List fields, List subscriptionFields, List subscriptionPlansFields, List subscriptionItemsFields, List accountFields, List invoiceOwnerAccountFields, List planFields, List productFields, List priceFields, List billToFields, List prepaidBalanceFields, List prepaidBalancesFields, List validityPeriodFields, List transactionsFields, List expand, List filter, Integer pageSize, String zuoraTrackId, Boolean async, Boolean zuoraCacheEnabled, String zuoraEntityIds, String idempotencyKey, String acceptEncoding, String contentEncoding, String zuoraOrgIds, final ApiCallback _callback) throws ApiException { okhttp3.Call localVarCall = pauseSubscriptionValidateBeforeCall(subscriptionId, pauseSubscriptionRequest, fields, subscriptionFields, subscriptionPlansFields, subscriptionItemsFields, accountFields, invoiceOwnerAccountFields, planFields, productFields, priceFields, billToFields, prepaidBalanceFields, prepaidBalancesFields, validityPeriodFields, transactionsFields, expand, filter, pageSize, zuoraTrackId, async, zuoraCacheEnabled, zuoraEntityIds, idempotencyKey, acceptEncoding, contentEncoding, zuoraOrgIds, _callback); Type localVarReturnType = new TypeToken(){}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } public static class PauseSubscriptionParams { private final String subscriptionId; private final PauseSubscriptionRequest pauseSubscriptionRequest; private Headers headers; /* * Check for list params */ private GetByIdQueryParams getByIdQueryParams; private List fields; private List subscriptionFields; private List subscriptionPlansFields; private List subscriptionItemsFields; private List accountFields; private List invoiceOwnerAccountFields; private List planFields; private List productFields; private List priceFields; private List billToFields; private List prepaidBalanceFields; private List prepaidBalancesFields; private List validityPeriodFields; private List transactionsFields; private List expand; private List filter; private Integer pageSize; private String zuoraTrackId; private Boolean async; private Boolean zuoraCacheEnabled; private String zuoraEntityIds; private String idempotencyKey; private String acceptEncoding; private String contentEncoding; private String zuoraOrgIds; public PauseSubscriptionParams(String subscriptionId, PauseSubscriptionRequest pauseSubscriptionRequest) { this.subscriptionId = subscriptionId; this.pauseSubscriptionRequest = pauseSubscriptionRequest; } /** * Set getByIdQueryParams * @param getByIdQueryParams GetByIdQueryParams * @return PauseSubscriptionParams */ public PauseSubscriptionParams 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 PauseSubscriptionParams */ public PauseSubscriptionParams 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`, `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 PauseSubscriptionParams */ public PauseSubscriptionParams fields(List fields) { this.fields = fields; 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 PauseSubscriptionParams */ public PauseSubscriptionParams subscriptionFields(List subscriptionFields) { this.subscriptionFields = subscriptionFields; return this; } /** * Set subscriptionPlansFields * @param subscriptionPlansFields Allows you to specify which fields are returned in the response. <details> <summary> Accepted values </summary> `custom_fields`, `created_by_id`, `updated_by_id`, `created_time`, `id`, `updated_time`, `name`, `plan_id`, `subscription_id`, `product_id`, `subscription_plan_number` </details> (optional) * @return PauseSubscriptionParams */ public PauseSubscriptionParams subscriptionPlansFields(List subscriptionPlansFields) { this.subscriptionPlansFields = subscriptionPlansFields; return this; } /** * Set subscriptionItemsFields * @param subscriptionItemsFields Allows you to specify which fields are returned in the response. <details> <summary> Accepted values </summary> `custom_fields`, `created_by_id`, `updated_by_id`, `created_time`, `id`, `updated_time`, `start_date`, `end_date`, `charge_model`, `charge_type`, `tiers`, `subscription_item_number`, `name`, `description`, `charged_through_date`, `recurring`, `price_id`, `start_event`, `tax_code`, `tax_inclusive`, `unit_of_measure`, `quantity`, `price_base_interval`, `overage`, `subscription_plan_id`, `tiers_mode`, `processed_through_date`, `active`, `state`, `unit_amount`, `amount`, `discount_amount`, `discount_percent`, `price_change_percentage`, `price_change_option` </details> (optional) * @return PauseSubscriptionParams */ public PauseSubscriptionParams subscriptionItemsFields(List subscriptionItemsFields) { this.subscriptionItemsFields = subscriptionItemsFields; return this; } /** * Set accountFields * @param accountFields Allows you to specify which fields are returned in the response. <details> <summary> Accepted values </summary> `custom_fields`, `created_by_id`, `updated_by_id`, `created_time`, `id`, `updated_time`, `auto_pay`, `account_number`, `bill_to_id`, `sold_to_id`, `billing_document_settings`, `communication_profile_id`, `crm_id`, `sales_rep`, `parent_account_id`, `payment_gateway`, `payment_terms`, `remaining_credit_memo_balance`, `remaining_debit_memo_balance`, `remaining_invoice_balance`, `remaining_payment_balance`, `sequence_set_id`, `tax_certificate`, `batch`, `tax_identifier`, `bill_cycle_day`, `description`, `name`, `currency`, `default_payment_method_id`, `enabled`, `organization_id` </details> (optional) * @return PauseSubscriptionParams */ public PauseSubscriptionParams accountFields(List accountFields) { this.accountFields = accountFields; return this; } /** * Set invoiceOwnerAccountFields * @param invoiceOwnerAccountFields Allows you to specify which fields are returned in the response. <details> <summary> Accepted values </summary> `custom_fields`, `created_by_id`, `updated_by_id`, `created_time`, `id`, `updated_time`, `auto_pay`, `account_number`, `bill_to_id`, `sold_to_id`, `billing_document_settings`, `communication_profile_id`, `crm_id`, `sales_rep`, `parent_account_id`, `payment_gateway`, `payment_terms`, `remaining_credit_memo_balance`, `remaining_debit_memo_balance`, `remaining_invoice_balance`, `remaining_payment_balance`, `sequence_set_id`, `tax_certificate`, `batch`, `tax_identifier`, `bill_cycle_day`, `description`, `name`, `currency`, `default_payment_method_id`, `enabled`, `organization_id` </details> (optional) * @return PauseSubscriptionParams */ public PauseSubscriptionParams invoiceOwnerAccountFields(List invoiceOwnerAccountFields) { this.invoiceOwnerAccountFields = invoiceOwnerAccountFields; return this; } /** * Set planFields * @param planFields Allows you to specify which fields are returned in the response. <details> <summary> Accepted values </summary> `custom_fields`, `created_by_id`, `updated_by_id`, `created_time`, `id`, `updated_time`, `start_date`, `end_date`, `name`, `active`, `description`, `plan_number`, `product_id`, `active_currencies` </details> (optional) * @return PauseSubscriptionParams */ public PauseSubscriptionParams 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 PauseSubscriptionParams */ public PauseSubscriptionParams productFields(List productFields) { this.productFields = productFields; 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 PauseSubscriptionParams */ public PauseSubscriptionParams priceFields(List priceFields) { this.priceFields = priceFields; return this; } /** * Set billToFields * @param billToFields Allows you to specify which fields are returned in the response. <details> <summary> Accepted values </summary> `custom_fields`, `created_by_id`, `updated_by_id`, `created_time`, `id`, `updated_time`, `account_id`, `address`, `home_phone`, `first_name`, `last_name`, `email`, `work_email`, `nickname`, `other_phone`, `work_phone`, `mobile_phone`, `tax_region`, `other_phone_type`, `fax` </details> (optional) * @return PauseSubscriptionParams */ public PauseSubscriptionParams billToFields(List billToFields) { this.billToFields = billToFields; return this; } /** * Set prepaidBalanceFields * @param prepaidBalanceFields Allows you to specify which fields are returned in the response. <details> <summary> Accepted values </summary> `prepaid_UOM`, `start_date`, `end_date`, `total_balance`, `remaining_balance` </details> (optional) * @return PauseSubscriptionParams */ public PauseSubscriptionParams prepaidBalanceFields(List prepaidBalanceFields) { this.prepaidBalanceFields = prepaidBalanceFields; return this; } /** * Set prepaidBalancesFields * @param prepaidBalancesFields Allows you to specify which fields are returned in the response. <details> <summary> Accepted values </summary> `validity_periods` </details> (optional) * @return PauseSubscriptionParams */ public PauseSubscriptionParams prepaidBalancesFields(List prepaidBalancesFields) { this.prepaidBalancesFields = prepaidBalancesFields; return this; } /** * Set validityPeriodFields * @param validityPeriodFields Allows you to specify which fields are returned in the response. <details> <summary> Accepted values </summary> `prepaid_UOM`, `start_date`, `end_date`, `total_balance`, `remaining_balance`, `overage_rated_amount`, `overage_rated_quantity` </details> (optional) * @return PauseSubscriptionParams */ public PauseSubscriptionParams validityPeriodFields(List validityPeriodFields) { this.validityPeriodFields = validityPeriodFields; return this; } /** * Set transactionsFields * @param transactionsFields Allows you to specify which fields are returned in the response. <details> <summary> Accepted values </summary> `transaction_date`, `type`, `quantity` </details> (optional) * @return PauseSubscriptionParams */ public PauseSubscriptionParams transactionsFields(List transactionsFields) { this.transactionsFields = transactionsFields; return this; } /** * Set expand * @param expand Allows you to expand responses by including related object information in a single call. See the [Expand responses](https://developer.zuora.com/quickstart-api/tutorial/expand-responses/) section of the Quickstart API Tutorials for detailed instructions. (optional) * @return PauseSubscriptionParams */ public PauseSubscriptionParams 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 PauseSubscriptionParams */ public PauseSubscriptionParams 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 PauseSubscriptionParams */ public PauseSubscriptionParams pageSize(Integer pageSize) { this.pageSize = pageSize; return this; } } /** * Pause a subscription * Pauses a subscription. * @param subscriptionId Identifier for the subscription, either `subscription_number` or `subscription_id` (required) * @param pauseSubscriptionRequest (required) * @return Subscription * @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 PauseSubscriptionParams pauseSubscriptionParams(String subscriptionId, PauseSubscriptionRequest pauseSubscriptionRequest) { return new PauseSubscriptionParams(subscriptionId, pauseSubscriptionRequest); } public Subscription pauseSubscription(String subscriptionId, PauseSubscriptionRequest pauseSubscriptionRequest) throws ApiException { PauseSubscriptionParams params = new PauseSubscriptionParams(subscriptionId, pauseSubscriptionRequest); return executePauseSubscriptionAPICall(params).getData(); } /** * Expose HTTP info public ApiResponse pauseSubscriptionWithHttpInfo(String subscriptionId, PauseSubscriptionRequest pauseSubscriptionRequest) throws ApiException { PauseSubscriptionParams params = new PauseSubscriptionParams(subscriptionId, pauseSubscriptionRequest); return executePauseSubscriptionAPICall(params); } **/ /** Legacy Query Params Requests **/ public Subscription pauseSubscription( String subscriptionId , PauseSubscriptionRequest pauseSubscriptionRequest , List expand) throws ApiException { PauseSubscriptionParams params = new PauseSubscriptionParams(subscriptionId, pauseSubscriptionRequest); params.expand(expand); return executePauseSubscriptionAPICall(params).getData(); } /* * add header methods */ public Subscription pauseSubscription(String subscriptionId , PauseSubscriptionRequest pauseSubscriptionRequest ,List expand,Headers headers) throws ApiException { PauseSubscriptionParams params = new PauseSubscriptionParams(subscriptionId, pauseSubscriptionRequest) .expand(expand) .headers(headers); return executePauseSubscriptionAPICall(params).getData(); } /** * Pause a subscription * Pauses a subscription. * @param params PauseSubscriptionParams * @return Subscription * @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 Subscription pause(PauseSubscriptionParams params) throws ApiException { return executePauseSubscriptionAPICall(params).getData(); } public ApiResponse pauseWithHttpInfo(PauseSubscriptionParams params) throws ApiException { return executePauseSubscriptionAPICall(params); } ApiResponse executePauseSubscriptionAPICall(PauseSubscriptionParams params) throws ApiException { return pauseSubscriptionWithHttpInfo(params.subscriptionId, params.pauseSubscriptionRequest, params.fields, params.subscriptionFields, params.subscriptionPlansFields, params.subscriptionItemsFields, params.accountFields, params.invoiceOwnerAccountFields, params.planFields, params.productFields, params.priceFields, params.billToFields, params.prepaidBalanceFields, params.prepaidBalancesFields, params.validityPeriodFields, params.transactionsFields, params.expand, params.filter, params.pageSize, params.zuoraTrackId, params.async, params.zuoraCacheEnabled, params.zuoraEntityIds, params.idempotencyKey, params.acceptEncoding, params.contentEncoding, params.zuoraOrgIds); } private okhttp3.Call previewExistingSubscriptionCall(String subscriptionId, SubscriptionPreviewExistingRequest subscriptionPreviewExistingRequest, 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 = subscriptionPreviewExistingRequest; // create path and map variables String localVarPath = "/subscriptions/{subscription_id}/preview" .replace("{" + "subscription_id" + "}", localVarApiClient.escapeString(subscriptionId.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); Map localVarHeaderParams = new HashMap(); Map localVarCookieParams = new HashMap(); Map localVarFormParams = new HashMap(); if (zuoraTrackId != null) { localVarHeaderParams.put("zuora-track-id", localVarApiClient.parameterToString(zuoraTrackId)); } if (async != null) { localVarHeaderParams.put("async", localVarApiClient.parameterToString(async)); } if (zuoraCacheEnabled != null) { localVarHeaderParams.put("zuora-cache-enabled", localVarApiClient.parameterToString(zuoraCacheEnabled)); } if (zuoraEntityIds != null) { localVarHeaderParams.put("zuora-entity-ids", localVarApiClient.parameterToString(zuoraEntityIds)); } if (idempotencyKey != null) { localVarHeaderParams.put("idempotency-key", localVarApiClient.parameterToString(idempotencyKey)); } if (acceptEncoding != null) { localVarHeaderParams.put("accept-encoding", localVarApiClient.parameterToString(acceptEncoding)); } if (contentEncoding != null) { localVarHeaderParams.put("content-encoding", localVarApiClient.parameterToString(contentEncoding)); } if (zuoraOrgIds != null) { localVarHeaderParams.put("zuora-org-ids", localVarApiClient.parameterToString(zuoraOrgIds)); } final String[] localVarAccepts = { "application/json" }; final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) { localVarHeaderParams.put("Accept", localVarAccept); } final String[] localVarContentTypes = { "application/json" }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } String[] localVarAuthNames = new String[] { "bearerAuth" }; return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") private okhttp3.Call previewExistingSubscriptionValidateBeforeCall(String subscriptionId, SubscriptionPreviewExistingRequest subscriptionPreviewExistingRequest, 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 'subscriptionId' is set if (subscriptionId == null) { throw new ApiException("Missing the required parameter 'subscriptionId' when calling previewExistingSubscription(Async)"); } // verify the required parameter 'subscriptionPreviewExistingRequest' is set if (subscriptionPreviewExistingRequest == null) { throw new ApiException("Missing the required parameter 'subscriptionPreviewExistingRequest' when calling previewExistingSubscription(Async)"); } return previewExistingSubscriptionCall(subscriptionId, subscriptionPreviewExistingRequest, zuoraTrackId, async, zuoraCacheEnabled, zuoraEntityIds, idempotencyKey, acceptEncoding, contentEncoding, zuoraOrgIds, _callback); } private ApiResponse previewExistingSubscriptionWithHttpInfo(String subscriptionId, SubscriptionPreviewExistingRequest subscriptionPreviewExistingRequest, String zuoraTrackId, Boolean async, Boolean zuoraCacheEnabled, String zuoraEntityIds, String idempotencyKey, String acceptEncoding, String contentEncoding, String zuoraOrgIds) throws ApiException { okhttp3.Call localVarCall = previewExistingSubscriptionValidateBeforeCall(subscriptionId, subscriptionPreviewExistingRequest, 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 previewExistingSubscriptionAsync(String subscriptionId, SubscriptionPreviewExistingRequest subscriptionPreviewExistingRequest, String zuoraTrackId, Boolean async, Boolean zuoraCacheEnabled, String zuoraEntityIds, String idempotencyKey, String acceptEncoding, String contentEncoding, String zuoraOrgIds, final ApiCallback _callback) throws ApiException { okhttp3.Call localVarCall = previewExistingSubscriptionValidateBeforeCall(subscriptionId, subscriptionPreviewExistingRequest, zuoraTrackId, async, zuoraCacheEnabled, zuoraEntityIds, idempotencyKey, acceptEncoding, contentEncoding, zuoraOrgIds, _callback); Type localVarReturnType = new TypeToken(){}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } public static class PreviewExistingSubscriptionParams { private final String subscriptionId; private final SubscriptionPreviewExistingRequest subscriptionPreviewExistingRequest; 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 PreviewExistingSubscriptionParams(String subscriptionId, SubscriptionPreviewExistingRequest subscriptionPreviewExistingRequest) { this.subscriptionId = subscriptionId; this.subscriptionPreviewExistingRequest = subscriptionPreviewExistingRequest; } /** * Set headers * @param headers Headers * @return PreviewExistingSubscriptionParams */ public PreviewExistingSubscriptionParams 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; } } /** * Preview an existing subscription * You can preview the billing document metrics or the order delta metrics across a specified time frame. * @param subscriptionId Identifier for the subscription, either `subscription_number` or `subscription_id` (required) * @param subscriptionPreviewExistingRequest (required) * @return SubscriptionPreviewResponse * @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 PreviewExistingSubscriptionParams previewExistingSubscriptionParams(String subscriptionId, SubscriptionPreviewExistingRequest subscriptionPreviewExistingRequest) { return new PreviewExistingSubscriptionParams(subscriptionId, subscriptionPreviewExistingRequest); } public SubscriptionPreviewResponse previewExistingSubscription(String subscriptionId, SubscriptionPreviewExistingRequest subscriptionPreviewExistingRequest) throws ApiException { PreviewExistingSubscriptionParams params = new PreviewExistingSubscriptionParams(subscriptionId, subscriptionPreviewExistingRequest); return executePreviewExistingSubscriptionAPICall(params).getData(); } /** * Expose HTTP info public ApiResponse previewExistingSubscriptionWithHttpInfo(String subscriptionId, SubscriptionPreviewExistingRequest subscriptionPreviewExistingRequest) throws ApiException { PreviewExistingSubscriptionParams params = new PreviewExistingSubscriptionParams(subscriptionId, subscriptionPreviewExistingRequest); return executePreviewExistingSubscriptionAPICall(params); } **/ /** Legacy Query Params Requests **/ /* * add header methods */ public SubscriptionPreviewResponse previewExistingSubscription(String subscriptionId , SubscriptionPreviewExistingRequest subscriptionPreviewExistingRequest ,Headers headers) throws ApiException { PreviewExistingSubscriptionParams params = new PreviewExistingSubscriptionParams(subscriptionId, subscriptionPreviewExistingRequest) .headers(headers); return executePreviewExistingSubscriptionAPICall(params).getData(); } /** * Preview an existing subscription * You can preview the billing document metrics or the order delta metrics across a specified time frame. * @param params PreviewExistingSubscriptionParams * @return SubscriptionPreviewResponse * @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 SubscriptionPreviewResponse previewExistingSubscription(PreviewExistingSubscriptionParams params) throws ApiException { return executePreviewExistingSubscriptionAPICall(params).getData(); } public ApiResponse previewExistingSubscriptionWithHttpInfo(PreviewExistingSubscriptionParams params) throws ApiException { return executePreviewExistingSubscriptionAPICall(params); } ApiResponse executePreviewExistingSubscriptionAPICall(PreviewExistingSubscriptionParams params) throws ApiException { return previewExistingSubscriptionWithHttpInfo(params.subscriptionId, params.subscriptionPreviewExistingRequest, params.zuoraTrackId, params.async, params.zuoraCacheEnabled, params.zuoraEntityIds, params.idempotencyKey, params.acceptEncoding, params.contentEncoding, params.zuoraOrgIds); } private okhttp3.Call previewSubscriptionCall(SubscriptionPreviewRequest subscriptionPreviewRequest, 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 = subscriptionPreviewRequest; // create path and map variables String localVarPath = "/subscriptions/preview"; List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); Map localVarHeaderParams = new HashMap(); Map localVarCookieParams = new HashMap(); Map localVarFormParams = new HashMap(); if (zuoraTrackId != null) { localVarHeaderParams.put("zuora-track-id", localVarApiClient.parameterToString(zuoraTrackId)); } if (async != null) { localVarHeaderParams.put("async", localVarApiClient.parameterToString(async)); } if (zuoraCacheEnabled != null) { localVarHeaderParams.put("zuora-cache-enabled", localVarApiClient.parameterToString(zuoraCacheEnabled)); } if (zuoraEntityIds != null) { localVarHeaderParams.put("zuora-entity-ids", localVarApiClient.parameterToString(zuoraEntityIds)); } if (idempotencyKey != null) { localVarHeaderParams.put("idempotency-key", localVarApiClient.parameterToString(idempotencyKey)); } if (acceptEncoding != null) { localVarHeaderParams.put("accept-encoding", localVarApiClient.parameterToString(acceptEncoding)); } if (contentEncoding != null) { localVarHeaderParams.put("content-encoding", localVarApiClient.parameterToString(contentEncoding)); } if (zuoraOrgIds != null) { localVarHeaderParams.put("zuora-org-ids", localVarApiClient.parameterToString(zuoraOrgIds)); } final String[] localVarAccepts = { "application/json" }; final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) { localVarHeaderParams.put("Accept", localVarAccept); } final String[] localVarContentTypes = { "application/json" }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } String[] localVarAuthNames = new String[] { "bearerAuth" }; return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") private okhttp3.Call previewSubscriptionValidateBeforeCall(SubscriptionPreviewRequest subscriptionPreviewRequest, 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 'subscriptionPreviewRequest' is set if (subscriptionPreviewRequest == null) { throw new ApiException("Missing the required parameter 'subscriptionPreviewRequest' when calling previewSubscription(Async)"); } return previewSubscriptionCall(subscriptionPreviewRequest, zuoraTrackId, async, zuoraCacheEnabled, zuoraEntityIds, idempotencyKey, acceptEncoding, contentEncoding, zuoraOrgIds, _callback); } private ApiResponse previewSubscriptionWithHttpInfo(SubscriptionPreviewRequest subscriptionPreviewRequest, String zuoraTrackId, Boolean async, Boolean zuoraCacheEnabled, String zuoraEntityIds, String idempotencyKey, String acceptEncoding, String contentEncoding, String zuoraOrgIds) throws ApiException { okhttp3.Call localVarCall = previewSubscriptionValidateBeforeCall(subscriptionPreviewRequest, 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 previewSubscriptionAsync(SubscriptionPreviewRequest subscriptionPreviewRequest, String zuoraTrackId, Boolean async, Boolean zuoraCacheEnabled, String zuoraEntityIds, String idempotencyKey, String acceptEncoding, String contentEncoding, String zuoraOrgIds, final ApiCallback _callback) throws ApiException { okhttp3.Call localVarCall = previewSubscriptionValidateBeforeCall(subscriptionPreviewRequest, zuoraTrackId, async, zuoraCacheEnabled, zuoraEntityIds, idempotencyKey, acceptEncoding, contentEncoding, zuoraOrgIds, _callback); Type localVarReturnType = new TypeToken(){}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } public static class PreviewSubscriptionParams { private final SubscriptionPreviewRequest subscriptionPreviewRequest; 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 PreviewSubscriptionParams(SubscriptionPreviewRequest subscriptionPreviewRequest) { this.subscriptionPreviewRequest = subscriptionPreviewRequest; } /** * Set headers * @param headers Headers * @return PreviewSubscriptionParams */ public PreviewSubscriptionParams 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; } } /** * Preview a subscription * You can preview the billing document metrics or the order delta metrics across a specified time frame. * @param subscriptionPreviewRequest (required) * @return SubscriptionPreviewResponse * @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 PreviewSubscriptionParams previewSubscriptionParams(SubscriptionPreviewRequest subscriptionPreviewRequest) { return new PreviewSubscriptionParams(subscriptionPreviewRequest); } public SubscriptionPreviewResponse previewSubscription(SubscriptionPreviewRequest subscriptionPreviewRequest) throws ApiException { PreviewSubscriptionParams params = new PreviewSubscriptionParams(subscriptionPreviewRequest); return executePreviewSubscriptionAPICall(params).getData(); } /** * Expose HTTP info public ApiResponse previewSubscriptionWithHttpInfo(SubscriptionPreviewRequest subscriptionPreviewRequest) throws ApiException { PreviewSubscriptionParams params = new PreviewSubscriptionParams(subscriptionPreviewRequest); return executePreviewSubscriptionAPICall(params); } **/ /** Legacy Query Params Requests **/ /* * add header methods */ public SubscriptionPreviewResponse previewSubscription(SubscriptionPreviewRequest subscriptionPreviewRequest ,Headers headers) throws ApiException { PreviewSubscriptionParams params = new PreviewSubscriptionParams(subscriptionPreviewRequest) .headers(headers); return executePreviewSubscriptionAPICall(params).getData(); } /** * Preview a subscription * You can preview the billing document metrics or the order delta metrics across a specified time frame. * @param params PreviewSubscriptionParams * @return SubscriptionPreviewResponse * @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 SubscriptionPreviewResponse preview(PreviewSubscriptionParams params) throws ApiException { return executePreviewSubscriptionAPICall(params).getData(); } public ApiResponse previewWithHttpInfo(PreviewSubscriptionParams params) throws ApiException { return executePreviewSubscriptionAPICall(params); } ApiResponse executePreviewSubscriptionAPICall(PreviewSubscriptionParams params) throws ApiException { return previewSubscriptionWithHttpInfo(params.subscriptionPreviewRequest, params.zuoraTrackId, params.async, params.zuoraCacheEnabled, params.zuoraEntityIds, params.idempotencyKey, params.acceptEncoding, params.contentEncoding, params.zuoraOrgIds); } private okhttp3.Call resumeSubscriptionCall(String subscriptionId, ResumeSubscriptionRequest resumeSubscriptionRequest, List fields, List subscriptionFields, List subscriptionPlansFields, List subscriptionItemsFields, List accountFields, List invoiceOwnerAccountFields, List planFields, List productFields, List priceFields, List billToFields, List prepaidBalanceFields, List prepaidBalancesFields, List validityPeriodFields, List transactionsFields, List expand, List filter, Integer pageSize, String zuoraTrackId, Boolean async, Boolean zuoraCacheEnabled, String zuoraEntityIds, String idempotencyKey, String acceptEncoding, String contentEncoding, String zuoraOrgIds, final ApiCallback _callback) throws ApiException { String basePath = null; // Operation Servers String[] localBasePaths = new String[] { }; // Determine Base Path to Use if (localCustomBaseUrl != null){ basePath = localCustomBaseUrl; } else if ( localBasePaths.length > 0 ) { basePath = localBasePaths[localHostIndex]; } else { basePath = null; } Object localVarPostBody = resumeSubscriptionRequest; // create path and map variables String localVarPath = "/subscriptions/{subscription_id}/resume" .replace("{" + "subscription_id" + "}", localVarApiClient.escapeString(subscriptionId.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 (subscriptionFields != null) { localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "subscription.fields[]", subscriptionFields)); } if (subscriptionPlansFields != null) { localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "subscription_plans.fields[]", subscriptionPlansFields)); } if (subscriptionItemsFields != null) { localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "subscription_items.fields[]", subscriptionItemsFields)); } if (accountFields != null) { localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "account.fields[]", accountFields)); } if (invoiceOwnerAccountFields != null) { localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "invoice_owner_account.fields[]", invoiceOwnerAccountFields)); } if (planFields != null) { localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "plan.fields[]", planFields)); } if (productFields != null) { localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "product.fields[]", productFields)); } if (priceFields != null) { localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "price.fields[]", priceFields)); } if (billToFields != null) { localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "bill_to.fields[]", billToFields)); } if (prepaidBalanceFields != null) { localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "prepaid_balance.fields[]", prepaidBalanceFields)); } if (prepaidBalancesFields != null) { localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "prepaid_balances.fields[]", prepaidBalancesFields)); } if (validityPeriodFields != null) { localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "validity_period.fields[]", validityPeriodFields)); } if (transactionsFields != null) { localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "transactions.fields[]", transactionsFields)); } if (expand != null) { localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "expand[]", expand)); } if (filter != null) { localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "filter[]", filter)); } if (pageSize != null) { localVarQueryParams.addAll(localVarApiClient.parameterToPair("page_size", pageSize)); } if (zuoraTrackId != null) { localVarHeaderParams.put("zuora-track-id", localVarApiClient.parameterToString(zuoraTrackId)); } if (async != null) { localVarHeaderParams.put("async", localVarApiClient.parameterToString(async)); } if (zuoraCacheEnabled != null) { localVarHeaderParams.put("zuora-cache-enabled", localVarApiClient.parameterToString(zuoraCacheEnabled)); } if (zuoraEntityIds != null) { localVarHeaderParams.put("zuora-entity-ids", localVarApiClient.parameterToString(zuoraEntityIds)); } if (idempotencyKey != null) { localVarHeaderParams.put("idempotency-key", localVarApiClient.parameterToString(idempotencyKey)); } if (acceptEncoding != null) { localVarHeaderParams.put("accept-encoding", localVarApiClient.parameterToString(acceptEncoding)); } if (contentEncoding != null) { localVarHeaderParams.put("content-encoding", localVarApiClient.parameterToString(contentEncoding)); } if (zuoraOrgIds != null) { localVarHeaderParams.put("zuora-org-ids", localVarApiClient.parameterToString(zuoraOrgIds)); } final String[] localVarAccepts = { "application/json" }; final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) { localVarHeaderParams.put("Accept", localVarAccept); } final String[] localVarContentTypes = { "application/json" }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } String[] localVarAuthNames = new String[] { "bearerAuth" }; return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") private okhttp3.Call resumeSubscriptionValidateBeforeCall(String subscriptionId, ResumeSubscriptionRequest resumeSubscriptionRequest, List fields, List subscriptionFields, List subscriptionPlansFields, List subscriptionItemsFields, List accountFields, List invoiceOwnerAccountFields, List planFields, List productFields, List priceFields, List billToFields, List prepaidBalanceFields, List prepaidBalancesFields, List validityPeriodFields, List transactionsFields, List expand, List filter, Integer pageSize, String zuoraTrackId, Boolean async, Boolean zuoraCacheEnabled, String zuoraEntityIds, String idempotencyKey, String acceptEncoding, String contentEncoding, String zuoraOrgIds, final ApiCallback _callback) throws ApiException { // verify the required parameter 'subscriptionId' is set if (subscriptionId == null) { throw new ApiException("Missing the required parameter 'subscriptionId' when calling resumeSubscription(Async)"); } // verify the required parameter 'resumeSubscriptionRequest' is set if (resumeSubscriptionRequest == null) { throw new ApiException("Missing the required parameter 'resumeSubscriptionRequest' when calling resumeSubscription(Async)"); } return resumeSubscriptionCall(subscriptionId, resumeSubscriptionRequest, fields, subscriptionFields, subscriptionPlansFields, subscriptionItemsFields, accountFields, invoiceOwnerAccountFields, planFields, productFields, priceFields, billToFields, prepaidBalanceFields, prepaidBalancesFields, validityPeriodFields, transactionsFields, expand, filter, pageSize, zuoraTrackId, async, zuoraCacheEnabled, zuoraEntityIds, idempotencyKey, acceptEncoding, contentEncoding, zuoraOrgIds, _callback); } private ApiResponse resumeSubscriptionWithHttpInfo(String subscriptionId, ResumeSubscriptionRequest resumeSubscriptionRequest, List fields, List subscriptionFields, List subscriptionPlansFields, List subscriptionItemsFields, List accountFields, List invoiceOwnerAccountFields, List planFields, List productFields, List priceFields, List billToFields, List prepaidBalanceFields, List prepaidBalancesFields, List validityPeriodFields, List transactionsFields, List expand, List filter, Integer pageSize, String zuoraTrackId, Boolean async, Boolean zuoraCacheEnabled, String zuoraEntityIds, String idempotencyKey, String acceptEncoding, String contentEncoding, String zuoraOrgIds) throws ApiException { okhttp3.Call localVarCall = resumeSubscriptionValidateBeforeCall(subscriptionId, resumeSubscriptionRequest, fields, subscriptionFields, subscriptionPlansFields, subscriptionItemsFields, accountFields, invoiceOwnerAccountFields, planFields, productFields, priceFields, billToFields, prepaidBalanceFields, prepaidBalancesFields, validityPeriodFields, transactionsFields, expand, filter, pageSize, zuoraTrackId, async, zuoraCacheEnabled, zuoraEntityIds, idempotencyKey, acceptEncoding, contentEncoding, zuoraOrgIds, null); try { Type localVarReturnType = new TypeToken(){}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } catch (ApiException e) { e.setErrorObject(localVarApiClient.getJSON().getGson().fromJson(e.getResponseBody(), new TypeToken(){}.getType())); throw e; } } private okhttp3.Call resumeSubscriptionAsync(String subscriptionId, ResumeSubscriptionRequest resumeSubscriptionRequest, List fields, List subscriptionFields, List subscriptionPlansFields, List subscriptionItemsFields, List accountFields, List invoiceOwnerAccountFields, List planFields, List productFields, List priceFields, List billToFields, List prepaidBalanceFields, List prepaidBalancesFields, List validityPeriodFields, List transactionsFields, List expand, List filter, Integer pageSize, String zuoraTrackId, Boolean async, Boolean zuoraCacheEnabled, String zuoraEntityIds, String idempotencyKey, String acceptEncoding, String contentEncoding, String zuoraOrgIds, final ApiCallback _callback) throws ApiException { okhttp3.Call localVarCall = resumeSubscriptionValidateBeforeCall(subscriptionId, resumeSubscriptionRequest, fields, subscriptionFields, subscriptionPlansFields, subscriptionItemsFields, accountFields, invoiceOwnerAccountFields, planFields, productFields, priceFields, billToFields, prepaidBalanceFields, prepaidBalancesFields, validityPeriodFields, transactionsFields, expand, filter, pageSize, zuoraTrackId, async, zuoraCacheEnabled, zuoraEntityIds, idempotencyKey, acceptEncoding, contentEncoding, zuoraOrgIds, _callback); Type localVarReturnType = new TypeToken(){}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } public static class ResumeSubscriptionParams { private final String subscriptionId; private final ResumeSubscriptionRequest resumeSubscriptionRequest; private Headers headers; /* * Check for list params */ private GetByIdQueryParams getByIdQueryParams; private List fields; private List subscriptionFields; private List subscriptionPlansFields; private List subscriptionItemsFields; private List accountFields; private List invoiceOwnerAccountFields; private List planFields; private List productFields; private List priceFields; private List billToFields; private List prepaidBalanceFields; private List prepaidBalancesFields; private List validityPeriodFields; private List transactionsFields; private List expand; private List filter; private Integer pageSize; private String zuoraTrackId; private Boolean async; private Boolean zuoraCacheEnabled; private String zuoraEntityIds; private String idempotencyKey; private String acceptEncoding; private String contentEncoding; private String zuoraOrgIds; public ResumeSubscriptionParams(String subscriptionId, ResumeSubscriptionRequest resumeSubscriptionRequest) { this.subscriptionId = subscriptionId; this.resumeSubscriptionRequest = resumeSubscriptionRequest; } /** * Set getByIdQueryParams * @param getByIdQueryParams GetByIdQueryParams * @return ResumeSubscriptionParams */ public ResumeSubscriptionParams 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 ResumeSubscriptionParams */ public ResumeSubscriptionParams 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`, `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 ResumeSubscriptionParams */ public ResumeSubscriptionParams fields(List fields) { this.fields = fields; 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 ResumeSubscriptionParams */ public ResumeSubscriptionParams subscriptionFields(List subscriptionFields) { this.subscriptionFields = subscriptionFields; return this; } /** * Set subscriptionPlansFields * @param subscriptionPlansFields Allows you to specify which fields are returned in the response. <details> <summary> Accepted values </summary> `custom_fields`, `created_by_id`, `updated_by_id`, `created_time`, `id`, `updated_time`, `name`, `plan_id`, `subscription_id`, `product_id`, `subscription_plan_number` </details> (optional) * @return ResumeSubscriptionParams */ public ResumeSubscriptionParams subscriptionPlansFields(List subscriptionPlansFields) { this.subscriptionPlansFields = subscriptionPlansFields; return this; } /** * Set subscriptionItemsFields * @param subscriptionItemsFields Allows you to specify which fields are returned in the response. <details> <summary> Accepted values </summary> `custom_fields`, `created_by_id`, `updated_by_id`, `created_time`, `id`, `updated_time`, `start_date`, `end_date`, `charge_model`, `charge_type`, `tiers`, `subscription_item_number`, `name`, `description`, `charged_through_date`, `recurring`, `price_id`, `start_event`, `tax_code`, `tax_inclusive`, `unit_of_measure`, `quantity`, `price_base_interval`, `overage`, `subscription_plan_id`, `tiers_mode`, `processed_through_date`, `active`, `state`, `unit_amount`, `amount`, `discount_amount`, `discount_percent`, `price_change_percentage`, `price_change_option` </details> (optional) * @return ResumeSubscriptionParams */ public ResumeSubscriptionParams subscriptionItemsFields(List subscriptionItemsFields) { this.subscriptionItemsFields = subscriptionItemsFields; return this; } /** * Set accountFields * @param accountFields Allows you to specify which fields are returned in the response. <details> <summary> Accepted values </summary> `custom_fields`, `created_by_id`, `updated_by_id`, `created_time`, `id`, `updated_time`, `auto_pay`, `account_number`, `bill_to_id`, `sold_to_id`, `billing_document_settings`, `communication_profile_id`, `crm_id`, `sales_rep`, `parent_account_id`, `payment_gateway`, `payment_terms`, `remaining_credit_memo_balance`, `remaining_debit_memo_balance`, `remaining_invoice_balance`, `remaining_payment_balance`, `sequence_set_id`, `tax_certificate`, `batch`, `tax_identifier`, `bill_cycle_day`, `description`, `name`, `currency`, `default_payment_method_id`, `enabled`, `organization_id` </details> (optional) * @return ResumeSubscriptionParams */ public ResumeSubscriptionParams accountFields(List accountFields) { this.accountFields = accountFields; return this; } /** * Set invoiceOwnerAccountFields * @param invoiceOwnerAccountFields Allows you to specify which fields are returned in the response. <details> <summary> Accepted values </summary> `custom_fields`, `created_by_id`, `updated_by_id`, `created_time`, `id`, `updated_time`, `auto_pay`, `account_number`, `bill_to_id`, `sold_to_id`, `billing_document_settings`, `communication_profile_id`, `crm_id`, `sales_rep`, `parent_account_id`, `payment_gateway`, `payment_terms`, `remaining_credit_memo_balance`, `remaining_debit_memo_balance`, `remaining_invoice_balance`, `remaining_payment_balance`, `sequence_set_id`, `tax_certificate`, `batch`, `tax_identifier`, `bill_cycle_day`, `description`, `name`, `currency`, `default_payment_method_id`, `enabled`, `organization_id` </details> (optional) * @return ResumeSubscriptionParams */ public ResumeSubscriptionParams invoiceOwnerAccountFields(List invoiceOwnerAccountFields) { this.invoiceOwnerAccountFields = invoiceOwnerAccountFields; return this; } /** * Set planFields * @param planFields Allows you to specify which fields are returned in the response. <details> <summary> Accepted values </summary> `custom_fields`, `created_by_id`, `updated_by_id`, `created_time`, `id`, `updated_time`, `start_date`, `end_date`, `name`, `active`, `description`, `plan_number`, `product_id`, `active_currencies` </details> (optional) * @return ResumeSubscriptionParams */ public ResumeSubscriptionParams 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 ResumeSubscriptionParams */ public ResumeSubscriptionParams productFields(List productFields) { this.productFields = productFields; 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 ResumeSubscriptionParams */ public ResumeSubscriptionParams priceFields(List priceFields) { this.priceFields = priceFields; return this; } /** * Set billToFields * @param billToFields Allows you to specify which fields are returned in the response. <details> <summary> Accepted values </summary> `custom_fields`, `created_by_id`, `updated_by_id`, `created_time`, `id`, `updated_time`, `account_id`, `address`, `home_phone`, `first_name`, `last_name`, `email`, `work_email`, `nickname`, `other_phone`, `work_phone`, `mobile_phone`, `tax_region`, `other_phone_type`, `fax` </details> (optional) * @return ResumeSubscriptionParams */ public ResumeSubscriptionParams billToFields(List billToFields) { this.billToFields = billToFields; return this; } /** * Set prepaidBalanceFields * @param prepaidBalanceFields Allows you to specify which fields are returned in the response. <details> <summary> Accepted values </summary> `prepaid_UOM`, `start_date`, `end_date`, `total_balance`, `remaining_balance` </details> (optional) * @return ResumeSubscriptionParams */ public ResumeSubscriptionParams prepaidBalanceFields(List prepaidBalanceFields) { this.prepaidBalanceFields = prepaidBalanceFields; return this; } /** * Set prepaidBalancesFields * @param prepaidBalancesFields Allows you to specify which fields are returned in the response. <details> <summary> Accepted values </summary> `validity_periods` </details> (optional) * @return ResumeSubscriptionParams */ public ResumeSubscriptionParams prepaidBalancesFields(List prepaidBalancesFields) { this.prepaidBalancesFields = prepaidBalancesFields; return this; } /** * Set validityPeriodFields * @param validityPeriodFields Allows you to specify which fields are returned in the response. <details> <summary> Accepted values </summary> `prepaid_UOM`, `start_date`, `end_date`, `total_balance`, `remaining_balance`, `overage_rated_amount`, `overage_rated_quantity` </details> (optional) * @return ResumeSubscriptionParams */ public ResumeSubscriptionParams validityPeriodFields(List validityPeriodFields) { this.validityPeriodFields = validityPeriodFields; return this; } /** * Set transactionsFields * @param transactionsFields Allows you to specify which fields are returned in the response. <details> <summary> Accepted values </summary> `transaction_date`, `type`, `quantity` </details> (optional) * @return ResumeSubscriptionParams */ public ResumeSubscriptionParams transactionsFields(List transactionsFields) { this.transactionsFields = transactionsFields; return this; } /** * Set expand * @param expand Allows you to expand responses by including related object information in a single call. See the [Expand responses](https://developer.zuora.com/quickstart-api/tutorial/expand-responses/) section of the Quickstart API Tutorials for detailed instructions. (optional) * @return ResumeSubscriptionParams */ public ResumeSubscriptionParams 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 ResumeSubscriptionParams */ public ResumeSubscriptionParams 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 ResumeSubscriptionParams */ public ResumeSubscriptionParams pageSize(Integer pageSize) { this.pageSize = pageSize; return this; } } /** * Resume a subscription * Resumes a subscription. * @param subscriptionId Identifier for the subscription, either `subscription_number` or `subscription_id` (required) * @param resumeSubscriptionRequest (required) * @return Subscription * @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 ResumeSubscriptionParams resumeSubscriptionParams(String subscriptionId, ResumeSubscriptionRequest resumeSubscriptionRequest) { return new ResumeSubscriptionParams(subscriptionId, resumeSubscriptionRequest); } public Subscription resumeSubscription(String subscriptionId, ResumeSubscriptionRequest resumeSubscriptionRequest) throws ApiException { ResumeSubscriptionParams params = new ResumeSubscriptionParams(subscriptionId, resumeSubscriptionRequest); return executeResumeSubscriptionAPICall(params).getData(); } /** * Expose HTTP info public ApiResponse resumeSubscriptionWithHttpInfo(String subscriptionId, ResumeSubscriptionRequest resumeSubscriptionRequest) throws ApiException { ResumeSubscriptionParams params = new ResumeSubscriptionParams(subscriptionId, resumeSubscriptionRequest); return executeResumeSubscriptionAPICall(params); } **/ /** Legacy Query Params Requests **/ public Subscription resumeSubscription( String subscriptionId , ResumeSubscriptionRequest resumeSubscriptionRequest , List expand) throws ApiException { ResumeSubscriptionParams params = new ResumeSubscriptionParams(subscriptionId, resumeSubscriptionRequest); params.expand(expand); return executeResumeSubscriptionAPICall(params).getData(); } /* * add header methods */ public Subscription resumeSubscription(String subscriptionId , ResumeSubscriptionRequest resumeSubscriptionRequest ,List expand,Headers headers) throws ApiException { ResumeSubscriptionParams params = new ResumeSubscriptionParams(subscriptionId, resumeSubscriptionRequest) .expand(expand) .headers(headers); return executeResumeSubscriptionAPICall(params).getData(); } /** * Resume a subscription * Resumes a subscription. * @param params ResumeSubscriptionParams * @return Subscription * @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 Subscription resume(ResumeSubscriptionParams params) throws ApiException { return executeResumeSubscriptionAPICall(params).getData(); } public ApiResponse resumeWithHttpInfo(ResumeSubscriptionParams params) throws ApiException { return executeResumeSubscriptionAPICall(params); } ApiResponse executeResumeSubscriptionAPICall(ResumeSubscriptionParams params) throws ApiException { return resumeSubscriptionWithHttpInfo(params.subscriptionId, params.resumeSubscriptionRequest, params.fields, params.subscriptionFields, params.subscriptionPlansFields, params.subscriptionItemsFields, params.accountFields, params.invoiceOwnerAccountFields, params.planFields, params.productFields, params.priceFields, params.billToFields, params.prepaidBalanceFields, params.prepaidBalancesFields, params.validityPeriodFields, params.transactionsFields, params.expand, params.filter, params.pageSize, params.zuoraTrackId, params.async, params.zuoraCacheEnabled, params.zuoraEntityIds, params.idempotencyKey, params.acceptEncoding, params.contentEncoding, params.zuoraOrgIds); } private okhttp3.Call uncancelSubscriptionCall(String subscriptionId, SubscriptionPatchRequest subscriptionPatchRequest, List fields, List subscriptionFields, List subscriptionPlansFields, List subscriptionItemsFields, List accountFields, List invoiceOwnerAccountFields, List planFields, List productFields, List priceFields, List billToFields, List prepaidBalanceFields, List prepaidBalancesFields, List validityPeriodFields, List transactionsFields, List expand, List filter, Integer pageSize, String zuoraTrackId, Boolean async, Boolean zuoraCacheEnabled, String zuoraEntityIds, String idempotencyKey, String acceptEncoding, String contentEncoding, String zuoraOrgIds, final ApiCallback _callback) throws ApiException { String basePath = null; // Operation Servers String[] localBasePaths = new String[] { }; // Determine Base Path to Use if (localCustomBaseUrl != null){ basePath = localCustomBaseUrl; } else if ( localBasePaths.length > 0 ) { basePath = localBasePaths[localHostIndex]; } else { basePath = null; } Object localVarPostBody = subscriptionPatchRequest; // create path and map variables String localVarPath = "/subscriptions/{subscription_id}/keep" .replace("{" + "subscription_id" + "}", localVarApiClient.escapeString(subscriptionId.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 (subscriptionFields != null) { localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "subscription.fields[]", subscriptionFields)); } if (subscriptionPlansFields != null) { localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "subscription_plans.fields[]", subscriptionPlansFields)); } if (subscriptionItemsFields != null) { localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "subscription_items.fields[]", subscriptionItemsFields)); } if (accountFields != null) { localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "account.fields[]", accountFields)); } if (invoiceOwnerAccountFields != null) { localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "invoice_owner_account.fields[]", invoiceOwnerAccountFields)); } if (planFields != null) { localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "plan.fields[]", planFields)); } if (productFields != null) { localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "product.fields[]", productFields)); } if (priceFields != null) { localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "price.fields[]", priceFields)); } if (billToFields != null) { localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "bill_to.fields[]", billToFields)); } if (prepaidBalanceFields != null) { localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "prepaid_balance.fields[]", prepaidBalanceFields)); } if (prepaidBalancesFields != null) { localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "prepaid_balances.fields[]", prepaidBalancesFields)); } if (validityPeriodFields != null) { localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "validity_period.fields[]", validityPeriodFields)); } if (transactionsFields != null) { localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "transactions.fields[]", transactionsFields)); } if (expand != null) { localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "expand[]", expand)); } if (filter != null) { localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "filter[]", filter)); } if (pageSize != null) { localVarQueryParams.addAll(localVarApiClient.parameterToPair("page_size", pageSize)); } if (zuoraTrackId != null) { localVarHeaderParams.put("zuora-track-id", localVarApiClient.parameterToString(zuoraTrackId)); } if (async != null) { localVarHeaderParams.put("async", localVarApiClient.parameterToString(async)); } if (zuoraCacheEnabled != null) { localVarHeaderParams.put("zuora-cache-enabled", localVarApiClient.parameterToString(zuoraCacheEnabled)); } if (zuoraEntityIds != null) { localVarHeaderParams.put("zuora-entity-ids", localVarApiClient.parameterToString(zuoraEntityIds)); } if (idempotencyKey != null) { localVarHeaderParams.put("idempotency-key", localVarApiClient.parameterToString(idempotencyKey)); } if (acceptEncoding != null) { localVarHeaderParams.put("accept-encoding", localVarApiClient.parameterToString(acceptEncoding)); } if (contentEncoding != null) { localVarHeaderParams.put("content-encoding", localVarApiClient.parameterToString(contentEncoding)); } if (zuoraOrgIds != null) { localVarHeaderParams.put("zuora-org-ids", localVarApiClient.parameterToString(zuoraOrgIds)); } final String[] localVarAccepts = { "application/json" }; final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) { localVarHeaderParams.put("Accept", localVarAccept); } final String[] localVarContentTypes = { "application/json" }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } String[] localVarAuthNames = new String[] { "bearerAuth" }; return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @Deprecated @SuppressWarnings("rawtypes") private okhttp3.Call uncancelSubscriptionValidateBeforeCall(String subscriptionId, SubscriptionPatchRequest subscriptionPatchRequest, List fields, List subscriptionFields, List subscriptionPlansFields, List subscriptionItemsFields, List accountFields, List invoiceOwnerAccountFields, List planFields, List productFields, List priceFields, List billToFields, List prepaidBalanceFields, List prepaidBalancesFields, List validityPeriodFields, List transactionsFields, List expand, List filter, Integer pageSize, String zuoraTrackId, Boolean async, Boolean zuoraCacheEnabled, String zuoraEntityIds, String idempotencyKey, String acceptEncoding, String contentEncoding, String zuoraOrgIds, final ApiCallback _callback) throws ApiException { // verify the required parameter 'subscriptionId' is set if (subscriptionId == null) { throw new ApiException("Missing the required parameter 'subscriptionId' when calling uncancelSubscription(Async)"); } // verify the required parameter 'subscriptionPatchRequest' is set if (subscriptionPatchRequest == null) { throw new ApiException("Missing the required parameter 'subscriptionPatchRequest' when calling uncancelSubscription(Async)"); } return uncancelSubscriptionCall(subscriptionId, subscriptionPatchRequest, fields, subscriptionFields, subscriptionPlansFields, subscriptionItemsFields, accountFields, invoiceOwnerAccountFields, planFields, productFields, priceFields, billToFields, prepaidBalanceFields, prepaidBalancesFields, validityPeriodFields, transactionsFields, expand, filter, pageSize, zuoraTrackId, async, zuoraCacheEnabled, zuoraEntityIds, idempotencyKey, acceptEncoding, contentEncoding, zuoraOrgIds, _callback); } private ApiResponse uncancelSubscriptionWithHttpInfo(String subscriptionId, SubscriptionPatchRequest subscriptionPatchRequest, List fields, List subscriptionFields, List subscriptionPlansFields, List subscriptionItemsFields, List accountFields, List invoiceOwnerAccountFields, List planFields, List productFields, List priceFields, List billToFields, List prepaidBalanceFields, List prepaidBalancesFields, List validityPeriodFields, List transactionsFields, List expand, List filter, Integer pageSize, String zuoraTrackId, Boolean async, Boolean zuoraCacheEnabled, String zuoraEntityIds, String idempotencyKey, String acceptEncoding, String contentEncoding, String zuoraOrgIds) throws ApiException { okhttp3.Call localVarCall = uncancelSubscriptionValidateBeforeCall(subscriptionId, subscriptionPatchRequest, fields, subscriptionFields, subscriptionPlansFields, subscriptionItemsFields, accountFields, invoiceOwnerAccountFields, planFields, productFields, priceFields, billToFields, prepaidBalanceFields, prepaidBalancesFields, validityPeriodFields, transactionsFields, expand, filter, pageSize, zuoraTrackId, async, zuoraCacheEnabled, zuoraEntityIds, idempotencyKey, acceptEncoding, contentEncoding, zuoraOrgIds, null); try { Type localVarReturnType = new TypeToken(){}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } catch (ApiException e) { e.setErrorObject(localVarApiClient.getJSON().getGson().fromJson(e.getResponseBody(), new TypeToken(){}.getType())); throw e; } } private okhttp3.Call uncancelSubscriptionAsync(String subscriptionId, SubscriptionPatchRequest subscriptionPatchRequest, List fields, List subscriptionFields, List subscriptionPlansFields, List subscriptionItemsFields, List accountFields, List invoiceOwnerAccountFields, List planFields, List productFields, List priceFields, List billToFields, List prepaidBalanceFields, List prepaidBalancesFields, List validityPeriodFields, List transactionsFields, List expand, List filter, Integer pageSize, String zuoraTrackId, Boolean async, Boolean zuoraCacheEnabled, String zuoraEntityIds, String idempotencyKey, String acceptEncoding, String contentEncoding, String zuoraOrgIds, final ApiCallback _callback) throws ApiException { okhttp3.Call localVarCall = uncancelSubscriptionValidateBeforeCall(subscriptionId, subscriptionPatchRequest, fields, subscriptionFields, subscriptionPlansFields, subscriptionItemsFields, accountFields, invoiceOwnerAccountFields, planFields, productFields, priceFields, billToFields, prepaidBalanceFields, prepaidBalancesFields, validityPeriodFields, transactionsFields, expand, filter, pageSize, zuoraTrackId, async, zuoraCacheEnabled, zuoraEntityIds, idempotencyKey, acceptEncoding, contentEncoding, zuoraOrgIds, _callback); Type localVarReturnType = new TypeToken(){}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } public static class UncancelSubscriptionParams { private final String subscriptionId; private final SubscriptionPatchRequest subscriptionPatchRequest; private Headers headers; /* * Check for list params */ private GetByIdQueryParams getByIdQueryParams; private List fields; private List subscriptionFields; private List subscriptionPlansFields; private List subscriptionItemsFields; private List accountFields; private List invoiceOwnerAccountFields; private List planFields; private List productFields; private List priceFields; private List billToFields; private List prepaidBalanceFields; private List prepaidBalancesFields; private List validityPeriodFields; private List transactionsFields; private List expand; private List filter; private Integer pageSize; private String zuoraTrackId; private Boolean async; private Boolean zuoraCacheEnabled; private String zuoraEntityIds; private String idempotencyKey; private String acceptEncoding; private String contentEncoding; private String zuoraOrgIds; public UncancelSubscriptionParams(String subscriptionId, SubscriptionPatchRequest subscriptionPatchRequest) { this.subscriptionId = subscriptionId; this.subscriptionPatchRequest = subscriptionPatchRequest; } /** * Set getByIdQueryParams * @param getByIdQueryParams GetByIdQueryParams * @return UncancelSubscriptionParams */ public UncancelSubscriptionParams 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 UncancelSubscriptionParams */ public UncancelSubscriptionParams 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`, `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 UncancelSubscriptionParams */ public UncancelSubscriptionParams fields(List fields) { this.fields = fields; 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 UncancelSubscriptionParams */ public UncancelSubscriptionParams subscriptionFields(List subscriptionFields) { this.subscriptionFields = subscriptionFields; return this; } /** * Set subscriptionPlansFields * @param subscriptionPlansFields Allows you to specify which fields are returned in the response. <details> <summary> Accepted values </summary> `custom_fields`, `created_by_id`, `updated_by_id`, `created_time`, `id`, `updated_time`, `name`, `plan_id`, `subscription_id`, `product_id`, `subscription_plan_number` </details> (optional) * @return UncancelSubscriptionParams */ public UncancelSubscriptionParams subscriptionPlansFields(List subscriptionPlansFields) { this.subscriptionPlansFields = subscriptionPlansFields; return this; } /** * Set subscriptionItemsFields * @param subscriptionItemsFields Allows you to specify which fields are returned in the response. <details> <summary> Accepted values </summary> `custom_fields`, `created_by_id`, `updated_by_id`, `created_time`, `id`, `updated_time`, `start_date`, `end_date`, `charge_model`, `charge_type`, `tiers`, `subscription_item_number`, `name`, `description`, `charged_through_date`, `recurring`, `price_id`, `start_event`, `tax_code`, `tax_inclusive`, `unit_of_measure`, `quantity`, `price_base_interval`, `overage`, `subscription_plan_id`, `tiers_mode`, `processed_through_date`, `active`, `state`, `unit_amount`, `amount`, `discount_amount`, `discount_percent`, `price_change_percentage`, `price_change_option` </details> (optional) * @return UncancelSubscriptionParams */ public UncancelSubscriptionParams subscriptionItemsFields(List subscriptionItemsFields) { this.subscriptionItemsFields = subscriptionItemsFields; return this; } /** * Set accountFields * @param accountFields Allows you to specify which fields are returned in the response. <details> <summary> Accepted values </summary> `custom_fields`, `created_by_id`, `updated_by_id`, `created_time`, `id`, `updated_time`, `auto_pay`, `account_number`, `bill_to_id`, `sold_to_id`, `billing_document_settings`, `communication_profile_id`, `crm_id`, `sales_rep`, `parent_account_id`, `payment_gateway`, `payment_terms`, `remaining_credit_memo_balance`, `remaining_debit_memo_balance`, `remaining_invoice_balance`, `remaining_payment_balance`, `sequence_set_id`, `tax_certificate`, `batch`, `tax_identifier`, `bill_cycle_day`, `description`, `name`, `currency`, `default_payment_method_id`, `enabled`, `organization_id` </details> (optional) * @return UncancelSubscriptionParams */ public UncancelSubscriptionParams accountFields(List accountFields) { this.accountFields = accountFields; return this; } /** * Set invoiceOwnerAccountFields * @param invoiceOwnerAccountFields Allows you to specify which fields are returned in the response. <details> <summary> Accepted values </summary> `custom_fields`, `created_by_id`, `updated_by_id`, `created_time`, `id`, `updated_time`, `auto_pay`, `account_number`, `bill_to_id`, `sold_to_id`, `billing_document_settings`, `communication_profile_id`, `crm_id`, `sales_rep`, `parent_account_id`, `payment_gateway`, `payment_terms`, `remaining_credit_memo_balance`, `remaining_debit_memo_balance`, `remaining_invoice_balance`, `remaining_payment_balance`, `sequence_set_id`, `tax_certificate`, `batch`, `tax_identifier`, `bill_cycle_day`, `description`, `name`, `currency`, `default_payment_method_id`, `enabled`, `organization_id` </details> (optional) * @return UncancelSubscriptionParams */ public UncancelSubscriptionParams invoiceOwnerAccountFields(List invoiceOwnerAccountFields) { this.invoiceOwnerAccountFields = invoiceOwnerAccountFields; return this; } /** * Set planFields * @param planFields Allows you to specify which fields are returned in the response. <details> <summary> Accepted values </summary> `custom_fields`, `created_by_id`, `updated_by_id`, `created_time`, `id`, `updated_time`, `start_date`, `end_date`, `name`, `active`, `description`, `plan_number`, `product_id`, `active_currencies` </details> (optional) * @return UncancelSubscriptionParams */ public UncancelSubscriptionParams 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 UncancelSubscriptionParams */ public UncancelSubscriptionParams productFields(List productFields) { this.productFields = productFields; 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 UncancelSubscriptionParams */ public UncancelSubscriptionParams priceFields(List priceFields) { this.priceFields = priceFields; return this; } /** * Set billToFields * @param billToFields Allows you to specify which fields are returned in the response. <details> <summary> Accepted values </summary> `custom_fields`, `created_by_id`, `updated_by_id`, `created_time`, `id`, `updated_time`, `account_id`, `address`, `home_phone`, `first_name`, `last_name`, `email`, `work_email`, `nickname`, `other_phone`, `work_phone`, `mobile_phone`, `tax_region`, `other_phone_type`, `fax` </details> (optional) * @return UncancelSubscriptionParams */ public UncancelSubscriptionParams billToFields(List billToFields) { this.billToFields = billToFields; return this; } /** * Set prepaidBalanceFields * @param prepaidBalanceFields Allows you to specify which fields are returned in the response. <details> <summary> Accepted values </summary> `prepaid_UOM`, `start_date`, `end_date`, `total_balance`, `remaining_balance` </details> (optional) * @return UncancelSubscriptionParams */ public UncancelSubscriptionParams prepaidBalanceFields(List prepaidBalanceFields) { this.prepaidBalanceFields = prepaidBalanceFields; return this; } /** * Set prepaidBalancesFields * @param prepaidBalancesFields Allows you to specify which fields are returned in the response. <details> <summary> Accepted values </summary> `validity_periods` </details> (optional) * @return UncancelSubscriptionParams */ public UncancelSubscriptionParams prepaidBalancesFields(List prepaidBalancesFields) { this.prepaidBalancesFields = prepaidBalancesFields; return this; } /** * Set validityPeriodFields * @param validityPeriodFields Allows you to specify which fields are returned in the response. <details> <summary> Accepted values </summary> `prepaid_UOM`, `start_date`, `end_date`, `total_balance`, `remaining_balance`, `overage_rated_amount`, `overage_rated_quantity` </details> (optional) * @return UncancelSubscriptionParams */ public UncancelSubscriptionParams validityPeriodFields(List validityPeriodFields) { this.validityPeriodFields = validityPeriodFields; return this; } /** * Set transactionsFields * @param transactionsFields Allows you to specify which fields are returned in the response. <details> <summary> Accepted values </summary> `transaction_date`, `type`, `quantity` </details> (optional) * @return UncancelSubscriptionParams */ public UncancelSubscriptionParams transactionsFields(List transactionsFields) { this.transactionsFields = transactionsFields; return this; } /** * Set expand * @param expand Allows you to expand responses by including related object information in a single call. See the [Expand responses](https://developer.zuora.com/quickstart-api/tutorial/expand-responses/) section of the Quickstart API Tutorials for detailed instructions. (optional) * @return UncancelSubscriptionParams */ public UncancelSubscriptionParams 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 UncancelSubscriptionParams */ public UncancelSubscriptionParams 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 UncancelSubscriptionParams */ public UncancelSubscriptionParams pageSize(Integer pageSize) { this.pageSize = pageSize; return this; } } /** * Uncancel a subscription * Uncancel a cancelled subscription. * @param subscriptionId Identifier for the subscription, either `subscription_number` or `subscription_id` (required) * @param subscriptionPatchRequest (required) * @return Subscription * @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 -
* @deprecated */ @Deprecated public UncancelSubscriptionParams uncancelSubscriptionParams(String subscriptionId, SubscriptionPatchRequest subscriptionPatchRequest) { return new UncancelSubscriptionParams(subscriptionId, subscriptionPatchRequest); } public Subscription uncancelSubscription(String subscriptionId, SubscriptionPatchRequest subscriptionPatchRequest) throws ApiException { UncancelSubscriptionParams params = new UncancelSubscriptionParams(subscriptionId, subscriptionPatchRequest); return executeUncancelSubscriptionAPICall(params).getData(); } /** * Expose HTTP info public ApiResponse uncancelSubscriptionWithHttpInfo(String subscriptionId, SubscriptionPatchRequest subscriptionPatchRequest) throws ApiException { UncancelSubscriptionParams params = new UncancelSubscriptionParams(subscriptionId, subscriptionPatchRequest); return executeUncancelSubscriptionAPICall(params); } **/ /** Legacy Query Params Requests **/ public Subscription uncancelSubscription( String subscriptionId , SubscriptionPatchRequest subscriptionPatchRequest , List expand) throws ApiException { UncancelSubscriptionParams params = new UncancelSubscriptionParams(subscriptionId, subscriptionPatchRequest); params.expand(expand); return executeUncancelSubscriptionAPICall(params).getData(); } /* * add header methods */ public Subscription uncancelSubscription(String subscriptionId , SubscriptionPatchRequest subscriptionPatchRequest ,List expand,Headers headers) throws ApiException { UncancelSubscriptionParams params = new UncancelSubscriptionParams(subscriptionId, subscriptionPatchRequest) .expand(expand) .headers(headers); return executeUncancelSubscriptionAPICall(params).getData(); } /** * Uncancel a subscription * Uncancel a cancelled subscription. * @param params UncancelSubscriptionParams * @return Subscription * @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 -
* @deprecated */ @Deprecated public Subscription cancel(UncancelSubscriptionParams params) throws ApiException { return executeUncancelSubscriptionAPICall(params).getData(); } public ApiResponse cancelWithHttpInfo(UncancelSubscriptionParams params) throws ApiException { return executeUncancelSubscriptionAPICall(params); } ApiResponse executeUncancelSubscriptionAPICall(UncancelSubscriptionParams params) throws ApiException { return uncancelSubscriptionWithHttpInfo(params.subscriptionId, params.subscriptionPatchRequest, params.fields, params.subscriptionFields, params.subscriptionPlansFields, params.subscriptionItemsFields, params.accountFields, params.invoiceOwnerAccountFields, params.planFields, params.productFields, params.priceFields, params.billToFields, params.prepaidBalanceFields, params.prepaidBalancesFields, params.validityPeriodFields, params.transactionsFields, 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