Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance. Project price only 1 $
You can buy this project and download/modify it how often you want.
/*
* 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 org.openapitools.client.model.ApplyUnapplyCreditMemo;
import java.math.BigDecimal;
import org.openapitools.client.model.CreditMemo;
import org.openapitools.client.model.CreditMemoCreateRequest;
import org.openapitools.client.model.CreditMemoItemListResponse;
import org.openapitools.client.model.CreditMemoListResponse;
import org.openapitools.client.model.CreditMemoPatchRequest;
import org.openapitools.client.model.ErrorResponse;
import org.openapitools.client.model.ErrorResponse;
import java.lang.reflect.Type;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
public class CreditMemosApi {
private ApiClient localVarApiClient;
private int localHostIndex;
private String localCustomBaseUrl;
public CreditMemosApi() {
this(Configuration.getDefaultApiClient());
}
public CreditMemosApi(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 applyCreditMemoCall(String creditMemoId, ApplyUnapplyCreditMemo applyUnapplyCreditMemo, List fields, List creditMemoFields, List appliedToFields, List creditMemoItemsFields, List taxationItemsFields, List accountFields, List billToFields, 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 = applyUnapplyCreditMemo;
// create path and map variables
String localVarPath = "/credit_memos/{credit_memo_id}/apply"
.replace("{" + "credit_memo_id" + "}", localVarApiClient.escapeString(creditMemoId.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 (creditMemoFields != null) {
localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "credit_memo.fields[]", creditMemoFields));
}
if (appliedToFields != null) {
localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "applied_to.fields[]", appliedToFields));
}
if (creditMemoItemsFields != null) {
localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "credit_memo_items.fields[]", creditMemoItemsFields));
}
if (taxationItemsFields != null) {
localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "taxation_items.fields[]", taxationItemsFields));
}
if (accountFields != null) {
localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "account.fields[]", accountFields));
}
if (billToFields != null) {
localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "bill_to.fields[]", billToFields));
}
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 applyCreditMemoValidateBeforeCall(String creditMemoId, ApplyUnapplyCreditMemo applyUnapplyCreditMemo, List fields, List creditMemoFields, List appliedToFields, List creditMemoItemsFields, List taxationItemsFields, List accountFields, List billToFields, 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 'creditMemoId' is set
if (creditMemoId == null) {
throw new ApiException("Missing the required parameter 'creditMemoId' when calling applyCreditMemo(Async)");
}
// verify the required parameter 'applyUnapplyCreditMemo' is set
if (applyUnapplyCreditMemo == null) {
throw new ApiException("Missing the required parameter 'applyUnapplyCreditMemo' when calling applyCreditMemo(Async)");
}
return applyCreditMemoCall(creditMemoId, applyUnapplyCreditMemo, fields, creditMemoFields, appliedToFields, creditMemoItemsFields, taxationItemsFields, accountFields, billToFields, expand, filter, pageSize, zuoraTrackId, async, zuoraCacheEnabled, zuoraEntityIds, idempotencyKey, acceptEncoding, contentEncoding, zuoraOrgIds, _callback);
}
private ApiResponse applyCreditMemoWithHttpInfo(String creditMemoId, ApplyUnapplyCreditMemo applyUnapplyCreditMemo, List fields, List creditMemoFields, List appliedToFields, List creditMemoItemsFields, List taxationItemsFields, List accountFields, List billToFields, 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 = applyCreditMemoValidateBeforeCall(creditMemoId, applyUnapplyCreditMemo, fields, creditMemoFields, appliedToFields, creditMemoItemsFields, taxationItemsFields, accountFields, billToFields, 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 applyCreditMemoAsync(String creditMemoId, ApplyUnapplyCreditMemo applyUnapplyCreditMemo, List fields, List creditMemoFields, List appliedToFields, List creditMemoItemsFields, List taxationItemsFields, List accountFields, List billToFields, 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 = applyCreditMemoValidateBeforeCall(creditMemoId, applyUnapplyCreditMemo, fields, creditMemoFields, appliedToFields, creditMemoItemsFields, taxationItemsFields, accountFields, billToFields, 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 ApplyCreditMemoParams {
private final String creditMemoId;
private final ApplyUnapplyCreditMemo applyUnapplyCreditMemo;
private Headers headers;
/*
* Check for list params
*/
private GetByIdQueryParams getByIdQueryParams;
private List fields;
private List creditMemoFields;
private List appliedToFields;
private List creditMemoItemsFields;
private List taxationItemsFields;
private List accountFields;
private List billToFields;
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 ApplyCreditMemoParams(String creditMemoId, ApplyUnapplyCreditMemo applyUnapplyCreditMemo) {
this.creditMemoId = creditMemoId;
this.applyUnapplyCreditMemo = applyUnapplyCreditMemo;
}
/**
* Set getByIdQueryParams
* @param getByIdQueryParams GetByIdQueryParams
* @return ApplyCreditMemoParams
*/
public ApplyCreditMemoParams 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 ApplyCreditMemoParams
*/
public ApplyCreditMemoParams 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`, `credit_memo_number`, `state_transitions`, `description`, `account_id`, `total`, `subtotal`, `tax`, `document_date`, `exclude_from_auto_apply_rules`, `posted_by_id`, `state`, `balance`, `invoice_id`, `reason_code`, `amount_refunded`, `bill_to_id`, `billing_document_settings`, `currency` </details> (optional)
* @return ApplyCreditMemoParams
*/
public ApplyCreditMemoParams fields(List fields) {
this.fields = fields;
return this;
}
/**
* Set creditMemoFields
* @param creditMemoFields 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`, `credit_memo_number`, `state_transitions`, `description`, `account_id`, `total`, `subtotal`, `tax`, `document_date`, `exclude_from_auto_apply_rules`, `posted_by_id`, `state`, `balance`, `invoice_id`, `reason_code`, `amount_refunded`, `bill_to_id`, `billing_document_settings`, `currency` </details> (optional)
* @return ApplyCreditMemoParams
*/
public ApplyCreditMemoParams creditMemoFields(List creditMemoFields) {
this.creditMemoFields = creditMemoFields;
return this;
}
/**
* Set appliedToFields
* @param appliedToFields Allows you to specify which fields are returned in the response. <details> <summary> Accepted values </summary> `id`, `amount`, `billing_document_id`, `billing_document_type` </details> (optional)
* @return ApplyCreditMemoParams
*/
public ApplyCreditMemoParams appliedToFields(List appliedToFields) {
this.appliedToFields = appliedToFields;
return this;
}
/**
* Set creditMemoItemsFields
* @param creditMemoItemsFields Allows you to specify which fields are returned in the response. <details> <summary> Accepted values </summary> `custom_fields`, `created_by_id`, `updated_by_id`, `created_time`, `id`, `updated_time`, `amount`, `applied_to_item_id`, `price_id`, `discount_item`, `deferred_revenue_account`, `description`, `credit_memo_id`, `sku`, `name`, `purchase_order_number`, `quantity`, `recognized_revenue_account`, `remaining_balance`, `revenue_recognition_rule_name`, `service_end`, `service_start`, `accounts_receivable_account`, `on_account_account`, `subscription_id`, `subscription_item_id`, `tax`, `tax_code`, `tax_inclusive`, `unit_amount`, `unit_of_measure`, `subtotal`, `invoice_item_id`, `document_item_date` </details> (optional)
* @return ApplyCreditMemoParams
*/
public ApplyCreditMemoParams creditMemoItemsFields(List creditMemoItemsFields) {
this.creditMemoItemsFields = creditMemoItemsFields;
return this;
}
/**
* Set taxationItemsFields
* @param taxationItemsFields Allows you to specify which fields are returned in the response. <details> <summary> Accepted values </summary> `custom_fields`, `created_by_id`, `updated_by_id`, `created_time`, `id`, `updated_time`, `amount`, `amount_exempt`, `tax_date`, `jurisdiction`, `location_code`, `name`, `sales_tax_payable_account`, `tax_code`, `tax_code_name`, `tax_rate`, `tax_rate_name`, `tax_inclusive`, `tax_rate_type`, `source_tax_item_id`, `amount_applied`, `amount_refunded`, `on_account_account` </details> (optional)
* @return ApplyCreditMemoParams
*/
public ApplyCreditMemoParams taxationItemsFields(List taxationItemsFields) {
this.taxationItemsFields = taxationItemsFields;
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 ApplyCreditMemoParams
*/
public ApplyCreditMemoParams accountFields(List accountFields) {
this.accountFields = accountFields;
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 ApplyCreditMemoParams
*/
public ApplyCreditMemoParams billToFields(List billToFields) {
this.billToFields = billToFields;
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 ApplyCreditMemoParams
*/
public ApplyCreditMemoParams 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 ApplyCreditMemoParams
*/
public ApplyCreditMemoParams 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 ApplyCreditMemoParams
*/
public ApplyCreditMemoParams pageSize(Integer pageSize) {
this.pageSize = pageSize;
return this;
}
}
/**
* Apply a credit memo
* Apply a credit memo to one or more other billing documents.
* @param creditMemoId Identifier for the credit memo, either `credit_memo_number` or `credit_memo_id` (required)
* @param applyUnapplyCreditMemo (required)
* @return CreditMemo
* @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 ApplyCreditMemoParams applyCreditMemoParams(String creditMemoId, ApplyUnapplyCreditMemo applyUnapplyCreditMemo) {
return new ApplyCreditMemoParams(creditMemoId, applyUnapplyCreditMemo);
}
public CreditMemo applyCreditMemo(String creditMemoId, ApplyUnapplyCreditMemo applyUnapplyCreditMemo) throws ApiException {
ApplyCreditMemoParams params = new ApplyCreditMemoParams(creditMemoId, applyUnapplyCreditMemo);
return executeApplyCreditMemoAPICall(params).getData();
}
/**
* Expose HTTP info
public ApiResponse applyCreditMemoWithHttpInfo(String creditMemoId, ApplyUnapplyCreditMemo applyUnapplyCreditMemo) throws ApiException {
ApplyCreditMemoParams params = new ApplyCreditMemoParams(creditMemoId, applyUnapplyCreditMemo);
return executeApplyCreditMemoAPICall(params);
}
**/
/**
Legacy Query Params Requests
**/
public CreditMemo applyCreditMemo( String creditMemoId , ApplyUnapplyCreditMemo applyUnapplyCreditMemo , List expand) throws ApiException {
ApplyCreditMemoParams params = new ApplyCreditMemoParams(creditMemoId, applyUnapplyCreditMemo);
params.expand(expand);
return executeApplyCreditMemoAPICall(params).getData();
}
/*
* add header methods
*/
public CreditMemo applyCreditMemo(String creditMemoId , ApplyUnapplyCreditMemo applyUnapplyCreditMemo ,List expand,Headers headers) throws ApiException {
ApplyCreditMemoParams params = new ApplyCreditMemoParams(creditMemoId, applyUnapplyCreditMemo)
.expand(expand)
.headers(headers);
return executeApplyCreditMemoAPICall(params).getData();
}
/**
* Apply a credit memo
* Apply a credit memo to one or more other billing documents.
* @param params ApplyCreditMemoParams
* @return CreditMemo
* @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 CreditMemo apply(ApplyCreditMemoParams params) throws ApiException {
return executeApplyCreditMemoAPICall(params).getData();
}
public ApiResponse applyWithHttpInfo(ApplyCreditMemoParams params) throws ApiException {
return executeApplyCreditMemoAPICall(params);
}
ApiResponse executeApplyCreditMemoAPICall(ApplyCreditMemoParams params) throws ApiException {
return applyCreditMemoWithHttpInfo(params.creditMemoId, params.applyUnapplyCreditMemo, params.fields, params.creditMemoFields, params.appliedToFields, params.creditMemoItemsFields, params.taxationItemsFields, params.accountFields, params.billToFields, 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 cancelCreditMemoCall(String creditMemoId, List fields, List creditMemoFields, List appliedToFields, List creditMemoItemsFields, List taxationItemsFields, List accountFields, List billToFields, 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 = "/credit_memos/{credit_memo_id}/cancel"
.replace("{" + "credit_memo_id" + "}", localVarApiClient.escapeString(creditMemoId.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 (creditMemoFields != null) {
localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "credit_memo.fields[]", creditMemoFields));
}
if (appliedToFields != null) {
localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "applied_to.fields[]", appliedToFields));
}
if (creditMemoItemsFields != null) {
localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "credit_memo_items.fields[]", creditMemoItemsFields));
}
if (taxationItemsFields != null) {
localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "taxation_items.fields[]", taxationItemsFields));
}
if (accountFields != null) {
localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "account.fields[]", accountFields));
}
if (billToFields != null) {
localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "bill_to.fields[]", billToFields));
}
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, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call cancelCreditMemoValidateBeforeCall(String creditMemoId, List fields, List creditMemoFields, List appliedToFields, List creditMemoItemsFields, List taxationItemsFields, List accountFields, List billToFields, 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 'creditMemoId' is set
if (creditMemoId == null) {
throw new ApiException("Missing the required parameter 'creditMemoId' when calling cancelCreditMemo(Async)");
}
return cancelCreditMemoCall(creditMemoId, fields, creditMemoFields, appliedToFields, creditMemoItemsFields, taxationItemsFields, accountFields, billToFields, expand, filter, pageSize, zuoraTrackId, async, zuoraCacheEnabled, zuoraEntityIds, idempotencyKey, acceptEncoding, contentEncoding, zuoraOrgIds, _callback);
}
private ApiResponse cancelCreditMemoWithHttpInfo(String creditMemoId, List fields, List creditMemoFields, List appliedToFields, List creditMemoItemsFields, List taxationItemsFields, List accountFields, List billToFields, 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 = cancelCreditMemoValidateBeforeCall(creditMemoId, fields, creditMemoFields, appliedToFields, creditMemoItemsFields, taxationItemsFields, accountFields, billToFields, 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 cancelCreditMemoAsync(String creditMemoId, List fields, List creditMemoFields, List appliedToFields, List creditMemoItemsFields, List taxationItemsFields, List accountFields, List billToFields, 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 = cancelCreditMemoValidateBeforeCall(creditMemoId, fields, creditMemoFields, appliedToFields, creditMemoItemsFields, taxationItemsFields, accountFields, billToFields, 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 CancelCreditMemoParams {
private final String creditMemoId;
private Headers headers;
/*
* Check for list params
*/
private GetByIdQueryParams getByIdQueryParams;
private List fields;
private List creditMemoFields;
private List appliedToFields;
private List creditMemoItemsFields;
private List taxationItemsFields;
private List accountFields;
private List billToFields;
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 CancelCreditMemoParams(String creditMemoId) {
this.creditMemoId = creditMemoId;
}
/**
* Set getByIdQueryParams
* @param getByIdQueryParams GetByIdQueryParams
* @return CancelCreditMemoParams
*/
public CancelCreditMemoParams 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 CancelCreditMemoParams
*/
public CancelCreditMemoParams 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`, `credit_memo_number`, `state_transitions`, `description`, `account_id`, `total`, `subtotal`, `tax`, `document_date`, `exclude_from_auto_apply_rules`, `posted_by_id`, `state`, `balance`, `invoice_id`, `reason_code`, `amount_refunded`, `bill_to_id`, `billing_document_settings`, `currency` </details> (optional)
* @return CancelCreditMemoParams
*/
public CancelCreditMemoParams fields(List fields) {
this.fields = fields;
return this;
}
/**
* Set creditMemoFields
* @param creditMemoFields 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`, `credit_memo_number`, `state_transitions`, `description`, `account_id`, `total`, `subtotal`, `tax`, `document_date`, `exclude_from_auto_apply_rules`, `posted_by_id`, `state`, `balance`, `invoice_id`, `reason_code`, `amount_refunded`, `bill_to_id`, `billing_document_settings`, `currency` </details> (optional)
* @return CancelCreditMemoParams
*/
public CancelCreditMemoParams creditMemoFields(List creditMemoFields) {
this.creditMemoFields = creditMemoFields;
return this;
}
/**
* Set appliedToFields
* @param appliedToFields Allows you to specify which fields are returned in the response. <details> <summary> Accepted values </summary> `id`, `amount`, `billing_document_id`, `billing_document_type` </details> (optional)
* @return CancelCreditMemoParams
*/
public CancelCreditMemoParams appliedToFields(List appliedToFields) {
this.appliedToFields = appliedToFields;
return this;
}
/**
* Set creditMemoItemsFields
* @param creditMemoItemsFields Allows you to specify which fields are returned in the response. <details> <summary> Accepted values </summary> `custom_fields`, `created_by_id`, `updated_by_id`, `created_time`, `id`, `updated_time`, `amount`, `applied_to_item_id`, `price_id`, `discount_item`, `deferred_revenue_account`, `description`, `credit_memo_id`, `sku`, `name`, `purchase_order_number`, `quantity`, `recognized_revenue_account`, `remaining_balance`, `revenue_recognition_rule_name`, `service_end`, `service_start`, `accounts_receivable_account`, `on_account_account`, `subscription_id`, `subscription_item_id`, `tax`, `tax_code`, `tax_inclusive`, `unit_amount`, `unit_of_measure`, `subtotal`, `invoice_item_id`, `document_item_date` </details> (optional)
* @return CancelCreditMemoParams
*/
public CancelCreditMemoParams creditMemoItemsFields(List creditMemoItemsFields) {
this.creditMemoItemsFields = creditMemoItemsFields;
return this;
}
/**
* Set taxationItemsFields
* @param taxationItemsFields Allows you to specify which fields are returned in the response. <details> <summary> Accepted values </summary> `custom_fields`, `created_by_id`, `updated_by_id`, `created_time`, `id`, `updated_time`, `amount`, `amount_exempt`, `tax_date`, `jurisdiction`, `location_code`, `name`, `sales_tax_payable_account`, `tax_code`, `tax_code_name`, `tax_rate`, `tax_rate_name`, `tax_inclusive`, `tax_rate_type`, `source_tax_item_id`, `amount_applied`, `amount_refunded`, `on_account_account` </details> (optional)
* @return CancelCreditMemoParams
*/
public CancelCreditMemoParams taxationItemsFields(List taxationItemsFields) {
this.taxationItemsFields = taxationItemsFields;
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 CancelCreditMemoParams
*/
public CancelCreditMemoParams accountFields(List accountFields) {
this.accountFields = accountFields;
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 CancelCreditMemoParams
*/
public CancelCreditMemoParams billToFields(List billToFields) {
this.billToFields = billToFields;
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 CancelCreditMemoParams
*/
public CancelCreditMemoParams 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 CancelCreditMemoParams
*/
public CancelCreditMemoParams 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 CancelCreditMemoParams
*/
public CancelCreditMemoParams pageSize(Integer pageSize) {
this.pageSize = pageSize;
return this;
}
}
/**
* Cancel a credit memo
* Cancels a credit memo. Only credit memos with the Draft status can be cancelled.
* @param creditMemoId Identifier for the credit memo, either `credit_memo_number` or `credit_memo_id` (required)
* @return CreditMemo
* @http.response.details
Status Code
Description
Response Headers
200
Default Response
-
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 CancelCreditMemoParams cancelCreditMemoParams(String creditMemoId) {
return new CancelCreditMemoParams(creditMemoId);
}
public CreditMemo cancelCreditMemo(String creditMemoId) throws ApiException {
CancelCreditMemoParams params = new CancelCreditMemoParams(creditMemoId);
return executeCancelCreditMemoAPICall(params).getData();
}
/**
* Expose HTTP info
public ApiResponse cancelCreditMemoWithHttpInfo(String creditMemoId) throws ApiException {
CancelCreditMemoParams params = new CancelCreditMemoParams(creditMemoId);
return executeCancelCreditMemoAPICall(params);
}
**/
/**
Legacy Query Params Requests
**/
public CreditMemo cancelCreditMemo( String creditMemoId , List expand) throws ApiException {
CancelCreditMemoParams params = new CancelCreditMemoParams(creditMemoId);
params.expand(expand);
return executeCancelCreditMemoAPICall(params).getData();
}
/*
* add header methods
*/
public CreditMemo cancelCreditMemo(String creditMemoId ,List expand,Headers headers) throws ApiException {
CancelCreditMemoParams params = new CancelCreditMemoParams(creditMemoId)
.expand(expand)
.headers(headers);
return executeCancelCreditMemoAPICall(params).getData();
}
/**
* Cancel a credit memo
* Cancels a credit memo. Only credit memos with the Draft status can be cancelled.
* @param params CancelCreditMemoParams
* @return CreditMemo
* @http.response.details
Status Code
Description
Response Headers
200
Default Response
-
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 CreditMemo cancel(CancelCreditMemoParams params) throws ApiException {
return executeCancelCreditMemoAPICall(params).getData();
}
public ApiResponse cancelWithHttpInfo(CancelCreditMemoParams params) throws ApiException {
return executeCancelCreditMemoAPICall(params);
}
ApiResponse executeCancelCreditMemoAPICall(CancelCreditMemoParams params) throws ApiException {
return cancelCreditMemoWithHttpInfo(params.creditMemoId, params.fields, params.creditMemoFields, params.appliedToFields, params.creditMemoItemsFields, params.taxationItemsFields, params.accountFields, params.billToFields, 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 createCreditMemoCall(CreditMemoCreateRequest creditMemoCreateRequest, List fields, List creditMemoFields, List appliedToFields, List creditMemoItemsFields, List taxationItemsFields, List accountFields, List billToFields, 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 = creditMemoCreateRequest;
// create path and map variables
String localVarPath = "/credit_memos";
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 (creditMemoFields != null) {
localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "credit_memo.fields[]", creditMemoFields));
}
if (appliedToFields != null) {
localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "applied_to.fields[]", appliedToFields));
}
if (creditMemoItemsFields != null) {
localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "credit_memo_items.fields[]", creditMemoItemsFields));
}
if (taxationItemsFields != null) {
localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "taxation_items.fields[]", taxationItemsFields));
}
if (accountFields != null) {
localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "account.fields[]", accountFields));
}
if (billToFields != null) {
localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "bill_to.fields[]", billToFields));
}
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 createCreditMemoValidateBeforeCall(CreditMemoCreateRequest creditMemoCreateRequest, List fields, List creditMemoFields, List appliedToFields, List creditMemoItemsFields, List taxationItemsFields, List accountFields, List billToFields, 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 'creditMemoCreateRequest' is set
if (creditMemoCreateRequest == null) {
throw new ApiException("Missing the required parameter 'creditMemoCreateRequest' when calling createCreditMemo(Async)");
}
return createCreditMemoCall(creditMemoCreateRequest, fields, creditMemoFields, appliedToFields, creditMemoItemsFields, taxationItemsFields, accountFields, billToFields, expand, filter, pageSize, zuoraTrackId, async, zuoraCacheEnabled, zuoraEntityIds, idempotencyKey, acceptEncoding, contentEncoding, zuoraOrgIds, _callback);
}
private ApiResponse createCreditMemoWithHttpInfo(CreditMemoCreateRequest creditMemoCreateRequest, List fields, List creditMemoFields, List appliedToFields, List creditMemoItemsFields, List taxationItemsFields, List accountFields, List billToFields, 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 = createCreditMemoValidateBeforeCall(creditMemoCreateRequest, fields, creditMemoFields, appliedToFields, creditMemoItemsFields, taxationItemsFields, accountFields, billToFields, 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 createCreditMemoAsync(CreditMemoCreateRequest creditMemoCreateRequest, List fields, List creditMemoFields, List appliedToFields, List creditMemoItemsFields, List taxationItemsFields, List accountFields, List billToFields, 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 = createCreditMemoValidateBeforeCall(creditMemoCreateRequest, fields, creditMemoFields, appliedToFields, creditMemoItemsFields, taxationItemsFields, accountFields, billToFields, 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 CreateCreditMemoParams {
private final CreditMemoCreateRequest creditMemoCreateRequest;
private Headers headers;
/*
* Check for list params
*/
private GetByIdQueryParams getByIdQueryParams;
private List fields;
private List creditMemoFields;
private List appliedToFields;
private List creditMemoItemsFields;
private List taxationItemsFields;
private List accountFields;
private List billToFields;
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 CreateCreditMemoParams(CreditMemoCreateRequest creditMemoCreateRequest) {
this.creditMemoCreateRequest = creditMemoCreateRequest;
}
/**
* Set getByIdQueryParams
* @param getByIdQueryParams GetByIdQueryParams
* @return CreateCreditMemoParams
*/
public CreateCreditMemoParams 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 CreateCreditMemoParams
*/
public CreateCreditMemoParams 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`, `credit_memo_number`, `state_transitions`, `description`, `account_id`, `total`, `subtotal`, `tax`, `document_date`, `exclude_from_auto_apply_rules`, `posted_by_id`, `state`, `balance`, `invoice_id`, `reason_code`, `amount_refunded`, `bill_to_id`, `billing_document_settings`, `currency` </details> (optional)
* @return CreateCreditMemoParams
*/
public CreateCreditMemoParams fields(List fields) {
this.fields = fields;
return this;
}
/**
* Set creditMemoFields
* @param creditMemoFields 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`, `credit_memo_number`, `state_transitions`, `description`, `account_id`, `total`, `subtotal`, `tax`, `document_date`, `exclude_from_auto_apply_rules`, `posted_by_id`, `state`, `balance`, `invoice_id`, `reason_code`, `amount_refunded`, `bill_to_id`, `billing_document_settings`, `currency` </details> (optional)
* @return CreateCreditMemoParams
*/
public CreateCreditMemoParams creditMemoFields(List creditMemoFields) {
this.creditMemoFields = creditMemoFields;
return this;
}
/**
* Set appliedToFields
* @param appliedToFields Allows you to specify which fields are returned in the response. <details> <summary> Accepted values </summary> `id`, `amount`, `billing_document_id`, `billing_document_type` </details> (optional)
* @return CreateCreditMemoParams
*/
public CreateCreditMemoParams appliedToFields(List appliedToFields) {
this.appliedToFields = appliedToFields;
return this;
}
/**
* Set creditMemoItemsFields
* @param creditMemoItemsFields Allows you to specify which fields are returned in the response. <details> <summary> Accepted values </summary> `custom_fields`, `created_by_id`, `updated_by_id`, `created_time`, `id`, `updated_time`, `amount`, `applied_to_item_id`, `price_id`, `discount_item`, `deferred_revenue_account`, `description`, `credit_memo_id`, `sku`, `name`, `purchase_order_number`, `quantity`, `recognized_revenue_account`, `remaining_balance`, `revenue_recognition_rule_name`, `service_end`, `service_start`, `accounts_receivable_account`, `on_account_account`, `subscription_id`, `subscription_item_id`, `tax`, `tax_code`, `tax_inclusive`, `unit_amount`, `unit_of_measure`, `subtotal`, `invoice_item_id`, `document_item_date` </details> (optional)
* @return CreateCreditMemoParams
*/
public CreateCreditMemoParams creditMemoItemsFields(List creditMemoItemsFields) {
this.creditMemoItemsFields = creditMemoItemsFields;
return this;
}
/**
* Set taxationItemsFields
* @param taxationItemsFields Allows you to specify which fields are returned in the response. <details> <summary> Accepted values </summary> `custom_fields`, `created_by_id`, `updated_by_id`, `created_time`, `id`, `updated_time`, `amount`, `amount_exempt`, `tax_date`, `jurisdiction`, `location_code`, `name`, `sales_tax_payable_account`, `tax_code`, `tax_code_name`, `tax_rate`, `tax_rate_name`, `tax_inclusive`, `tax_rate_type`, `source_tax_item_id`, `amount_applied`, `amount_refunded`, `on_account_account` </details> (optional)
* @return CreateCreditMemoParams
*/
public CreateCreditMemoParams taxationItemsFields(List taxationItemsFields) {
this.taxationItemsFields = taxationItemsFields;
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 CreateCreditMemoParams
*/
public CreateCreditMemoParams accountFields(List accountFields) {
this.accountFields = accountFields;
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 CreateCreditMemoParams
*/
public CreateCreditMemoParams billToFields(List billToFields) {
this.billToFields = billToFields;
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 CreateCreditMemoParams
*/
public CreateCreditMemoParams 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 CreateCreditMemoParams
*/
public CreateCreditMemoParams 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 CreateCreditMemoParams
*/
public CreateCreditMemoParams pageSize(Integer pageSize) {
this.pageSize = pageSize;
return this;
}
}
/**
* Create a credit memo
* Creates a new credit memo.
* @param creditMemoCreateRequest (required)
* @return CreditMemo
* @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 CreateCreditMemoParams createCreditMemoParams(CreditMemoCreateRequest creditMemoCreateRequest) {
return new CreateCreditMemoParams(creditMemoCreateRequest);
}
public CreditMemo createCreditMemo(CreditMemoCreateRequest creditMemoCreateRequest) throws ApiException {
CreateCreditMemoParams params = new CreateCreditMemoParams(creditMemoCreateRequest);
return executeCreateCreditMemoAPICall(params).getData();
}
/**
* Expose HTTP info
public ApiResponse createCreditMemoWithHttpInfo(CreditMemoCreateRequest creditMemoCreateRequest) throws ApiException {
CreateCreditMemoParams params = new CreateCreditMemoParams(creditMemoCreateRequest);
return executeCreateCreditMemoAPICall(params);
}
**/
/**
Legacy Query Params Requests
**/
public CreditMemo createCreditMemo( CreditMemoCreateRequest creditMemoCreateRequest , List expand) throws ApiException {
CreateCreditMemoParams params = new CreateCreditMemoParams(creditMemoCreateRequest);
params.expand(expand);
return executeCreateCreditMemoAPICall(params).getData();
}
/*
* add header methods
*/
public CreditMemo createCreditMemo(CreditMemoCreateRequest creditMemoCreateRequest ,List expand,Headers headers) throws ApiException {
CreateCreditMemoParams params = new CreateCreditMemoParams(creditMemoCreateRequest)
.expand(expand)
.headers(headers);
return executeCreateCreditMemoAPICall(params).getData();
}
/**
* Create a credit memo
* Creates a new credit memo.
* @param params CreateCreditMemoParams
* @return CreditMemo
* @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 CreditMemo create(CreateCreditMemoParams params) throws ApiException {
return executeCreateCreditMemoAPICall(params).getData();
}
public ApiResponse createWithHttpInfo(CreateCreditMemoParams params) throws ApiException {
return executeCreateCreditMemoAPICall(params);
}
ApiResponse executeCreateCreditMemoAPICall(CreateCreditMemoParams params) throws ApiException {
return createCreditMemoWithHttpInfo(params.creditMemoCreateRequest, params.fields, params.creditMemoFields, params.appliedToFields, params.creditMemoItemsFields, params.taxationItemsFields, params.accountFields, params.billToFields, 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 deleteCreditMemoCall(String creditMemoId, 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 = "/credit_memos/{credit_memo_id}"
.replace("{" + "credit_memo_id" + "}", localVarApiClient.escapeString(creditMemoId.toString()));
List localVarQueryParams = new ArrayList();
List localVarCollectionQueryParams = new ArrayList();
Map localVarHeaderParams = new HashMap();
Map localVarCookieParams = new HashMap();
Map localVarFormParams = new HashMap();
if (zuoraTrackId != null) {
localVarHeaderParams.put("zuora-track-id", localVarApiClient.parameterToString(zuoraTrackId));
}
if (async != null) {
localVarHeaderParams.put("async", localVarApiClient.parameterToString(async));
}
if (zuoraCacheEnabled != null) {
localVarHeaderParams.put("zuora-cache-enabled", localVarApiClient.parameterToString(zuoraCacheEnabled));
}
if (zuoraEntityIds != null) {
localVarHeaderParams.put("zuora-entity-ids", localVarApiClient.parameterToString(zuoraEntityIds));
}
if (idempotencyKey != null) {
localVarHeaderParams.put("idempotency-key", localVarApiClient.parameterToString(idempotencyKey));
}
if (acceptEncoding != null) {
localVarHeaderParams.put("accept-encoding", localVarApiClient.parameterToString(acceptEncoding));
}
if (contentEncoding != null) {
localVarHeaderParams.put("content-encoding", localVarApiClient.parameterToString(contentEncoding));
}
if (zuoraOrgIds != null) {
localVarHeaderParams.put("zuora-org-ids", localVarApiClient.parameterToString(zuoraOrgIds));
}
final String[] localVarAccepts = {
"application/json"
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
localVarHeaderParams.put("Accept", localVarAccept);
}
final String[] localVarContentTypes = {
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarContentType != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
String[] localVarAuthNames = new String[] { "bearerAuth" };
return localVarApiClient.buildCall(basePath, localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call deleteCreditMemoValidateBeforeCall(String creditMemoId, 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 'creditMemoId' is set
if (creditMemoId == null) {
throw new ApiException("Missing the required parameter 'creditMemoId' when calling deleteCreditMemo(Async)");
}
return deleteCreditMemoCall(creditMemoId, zuoraTrackId, async, zuoraCacheEnabled, zuoraEntityIds, idempotencyKey, acceptEncoding, contentEncoding, zuoraOrgIds, _callback);
}
private ApiResponse deleteCreditMemoWithHttpInfo(String creditMemoId, String zuoraTrackId, Boolean async, Boolean zuoraCacheEnabled, String zuoraEntityIds, String idempotencyKey, String acceptEncoding, String contentEncoding, String zuoraOrgIds) throws ApiException {
okhttp3.Call localVarCall = deleteCreditMemoValidateBeforeCall(creditMemoId, zuoraTrackId, async, zuoraCacheEnabled, zuoraEntityIds, idempotencyKey, acceptEncoding, contentEncoding, zuoraOrgIds, null);
return localVarApiClient.execute(localVarCall);
}
private okhttp3.Call deleteCreditMemoAsync(String creditMemoId, String zuoraTrackId, Boolean async, Boolean zuoraCacheEnabled, String zuoraEntityIds, String idempotencyKey, String acceptEncoding, String contentEncoding, String zuoraOrgIds, final ApiCallback _callback) throws ApiException {
okhttp3.Call localVarCall = deleteCreditMemoValidateBeforeCall(creditMemoId, zuoraTrackId, async, zuoraCacheEnabled, zuoraEntityIds, idempotencyKey, acceptEncoding, contentEncoding, zuoraOrgIds, _callback);
localVarApiClient.executeAsync(localVarCall, _callback);
return localVarCall;
}
public static class DeleteCreditMemoParams {
private final String creditMemoId;
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 DeleteCreditMemoParams(String creditMemoId) {
this.creditMemoId = creditMemoId;
}
/**
* Set headers
* @param headers Headers
* @return DeleteCreditMemoParams
*/
public DeleteCreditMemoParams headers(Headers headers) {
this.headers = headers;
if (headers.getZuoraTrackId() != null) {
this.zuoraTrackId = headers.getZuoraTrackId();
}
if (headers.getAsync() != null) {
this.async = headers.getAsync();
}
if (headers.getZuoraCacheEnabled() != null) {
this.zuoraCacheEnabled = headers.getZuoraCacheEnabled();
}
if (headers.getZuoraEntityIds() != null) {
this.zuoraEntityIds = headers.getZuoraEntityIds();
}
if (headers.getIdempotencyKey() != null) {
this.idempotencyKey = headers.getIdempotencyKey();
}
if (headers.getAcceptEncoding() != null) {
this.acceptEncoding = headers.getAcceptEncoding();
}
if (headers.getContentEncoding() != null) {
this.contentEncoding = headers.getContentEncoding();
}
if (headers.getZuoraOrgIds() != null) {
this.zuoraOrgIds = headers.getZuoraOrgIds();
}
return this;
}
}
/**
* Delete a credit memo
* Permanently deletes a credit memo. This operation cannot be undone once it is performed.
* @param creditMemoId Identifier for the credit memo, either `credit_memo_number` or `credit_memo_id` (required)
* @return
* @http.response.details
Status Code
Description
Response Headers
204
Default Response
* ratelimit-limit - The request limit quota for the time window closest to exhaustion. See [rate limits](https://developer.zuora.com/rest-api/general-concepts/rate-concurrency-limits/#rate-limits) for more information. * ratelimit-remaining - The number of requests remaining in the time window closest to quota exhaustion. See [rate limits](https://developer.zuora.com/rest-api/general-concepts/rate-concurrency-limits/#rate-limits) for more information. * ratelimit-reset - The number of seconds until the quota resets for the time window closest to quota exhaustion. See [rate limits](https://developer.zuora.com/rest-api/general-concepts/rate-concurrency-limits/#rate-limits) for more information. * zuora-request-id - Zuora’s internal identifier for this request. * zuora-track-id - A user-supplied identifier for this request. If you supply a `zuora-track-id` as a request header, Zuora returns the `zuora-track-id` as a response header.
400
Bad Request
-
401
Unauthorized
-
404
Not Found
-
405
Method Not Allowed
-
429
Too Many Requests
-
500
Internal Server Error
-
502
Bad Gateway
-
503
Service Unavailable
-
504
Gateway Timeout
-
*/
public DeleteCreditMemoParams deleteCreditMemoParams(String creditMemoId) {
return new DeleteCreditMemoParams(creditMemoId);
}
public void deleteCreditMemo(String creditMemoId) throws ApiException {
DeleteCreditMemoParams params = new DeleteCreditMemoParams(creditMemoId);
executeDeleteCreditMemoAPICall(params);
}
/**
* Expose HTTP info
public ApiResponse deleteCreditMemoWithHttpInfo(String creditMemoId) throws ApiException {
DeleteCreditMemoParams params = new DeleteCreditMemoParams(creditMemoId);
return executeDeleteCreditMemoAPICall(params);
}
**/
/**
Legacy Query Params Requests
**/
/*
* add header methods
*/
public void deleteCreditMemo(String creditMemoId ,Headers headers) throws ApiException {
DeleteCreditMemoParams params = new DeleteCreditMemoParams(creditMemoId)
.headers(headers);
executeDeleteCreditMemoAPICall(params);
}
/**
* Delete a credit memo
* Permanently deletes a credit memo. This operation cannot be undone once it is performed.
* @param params DeleteCreditMemoParams
* @return
* @http.response.details
Status Code
Description
Response Headers
204
Default Response
* ratelimit-limit - The request limit quota for the time window closest to exhaustion. See [rate limits](https://developer.zuora.com/rest-api/general-concepts/rate-concurrency-limits/#rate-limits) for more information. * ratelimit-remaining - The number of requests remaining in the time window closest to quota exhaustion. See [rate limits](https://developer.zuora.com/rest-api/general-concepts/rate-concurrency-limits/#rate-limits) for more information. * ratelimit-reset - The number of seconds until the quota resets for the time window closest to quota exhaustion. See [rate limits](https://developer.zuora.com/rest-api/general-concepts/rate-concurrency-limits/#rate-limits) for more information. * zuora-request-id - Zuora’s internal identifier for this request. * zuora-track-id - A user-supplied identifier for this request. If you supply a `zuora-track-id` as a request header, Zuora returns the `zuora-track-id` as a response header.
400
Bad Request
-
401
Unauthorized
-
404
Not Found
-
405
Method Not Allowed
-
429
Too Many Requests
-
500
Internal Server Error
-
502
Bad Gateway
-
503
Service Unavailable
-
504
Gateway Timeout
-
*/
public void delete(DeleteCreditMemoParams params) throws ApiException {
executeDeleteCreditMemoAPICall(params).getData();
}
public ApiResponse deleteWithHttpInfo(DeleteCreditMemoParams params) throws ApiException {
return executeDeleteCreditMemoAPICall(params);
}
ApiResponse executeDeleteCreditMemoAPICall(DeleteCreditMemoParams params) throws ApiException {
return deleteCreditMemoWithHttpInfo(params.creditMemoId, params.zuoraTrackId, params.async, params.zuoraCacheEnabled, params.zuoraEntityIds, params.idempotencyKey, params.acceptEncoding, params.contentEncoding, params.zuoraOrgIds);
}
private okhttp3.Call getCreditMemoCall(String creditMemoId, List fields, List creditMemoFields, List appliedToFields, List creditMemoItemsFields, List taxationItemsFields, List accountFields, List billToFields, 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 = "/credit_memos/{credit_memo_id}"
.replace("{" + "credit_memo_id" + "}", localVarApiClient.escapeString(creditMemoId.toString()));
List localVarQueryParams = new ArrayList();
List localVarCollectionQueryParams = new ArrayList();
Map