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.
/*
* Zuora API Reference
* REST API reference for the Zuora Billing, Payments, and Central Platform! Check out the [REST API Overview](https://www.zuora.com/developer/api-references/api/overview/).
*
* The version of the OpenAPI document: 2024-05-20
* Contact: [email protected]
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
package com.zuora.api;
import com.zuora.ApiCallback;
import com.zuora.ApiClient;
import com.zuora.ApiException;
import com.zuora.ApiResponse;
import com.zuora.Configuration;
import com.zuora.Pair;
import com.zuora.ProgressRequestBody;
import com.zuora.ProgressResponseBody;
import com.google.gson.reflect.TypeToken;
import java.io.IOException;
import java.math.BigDecimal;
import com.zuora.model.CommonErrorResponse;
import com.zuora.model.CommonResponse;
import com.zuora.model.DeleteAttachmentResponse;
import java.io.File;
import com.zuora.model.GetAttachmentResponse;
import com.zuora.model.GetAttachmentsResponse;
import com.zuora.model.PostAttachmentResponse;
import com.zuora.model.ProxyUnauthorizedResponse;
import com.zuora.model.PutAttachmentRequest;
import java.lang.reflect.Type;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
public class AttachmentsApi {
private ApiClient localVarApiClient;
private int localHostIndex;
private String localCustomBaseUrl;
public AttachmentsApi() {
this(Configuration.getDefaultApiClient());
}
public AttachmentsApi(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 deleteAttachmentsCall(String attachmentId, String acceptEncoding, String contentEncoding, String authorization, String zuoraTrackId, String zuoraEntityIds, String zuoraVersion, 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 = "/v1/attachments/{attachment-id}"
.replace("{" + "attachment-id" + "}", localVarApiClient.escapeString(attachmentId.toString()));
List localVarQueryParams = new ArrayList();
List localVarCollectionQueryParams = new ArrayList();
Map localVarHeaderParams = new HashMap();
Map localVarCookieParams = new HashMap();
Map localVarFormParams = new HashMap();
if (acceptEncoding != null) {
localVarHeaderParams.put("Accept-Encoding", localVarApiClient.parameterToString(acceptEncoding));
}
if (contentEncoding != null) {
localVarHeaderParams.put("Content-Encoding", localVarApiClient.parameterToString(contentEncoding));
}
if (authorization != null) {
localVarHeaderParams.put("Authorization", localVarApiClient.parameterToString(authorization));
}
if (zuoraTrackId != null) {
localVarHeaderParams.put("Zuora-Track-Id", localVarApiClient.parameterToString(zuoraTrackId));
}
if (zuoraEntityIds != null) {
localVarHeaderParams.put("Zuora-Entity-Ids", localVarApiClient.parameterToString(zuoraEntityIds));
}
if (zuoraVersion != null) {
localVarHeaderParams.put("Zuora-Version", localVarApiClient.parameterToString(zuoraVersion));
}
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 deleteAttachmentsValidateBeforeCall(String attachmentId, String acceptEncoding, String contentEncoding, String authorization, String zuoraTrackId, String zuoraEntityIds, String zuoraVersion, String zuoraOrgIds, final ApiCallback _callback) throws ApiException {
// verify the required parameter 'attachmentId' is set
if (attachmentId == null) {
throw new ApiException("Missing the required parameter 'attachmentId' when calling deleteAttachments(Async)");
}
return deleteAttachmentsCall(attachmentId, acceptEncoding, contentEncoding, authorization, zuoraTrackId, zuoraEntityIds, zuoraVersion, zuoraOrgIds, _callback);
}
/**
* Delete an attachment
* Use the Delete Attachment REST request to delete an attachment from a Zuora object. You can only use this operation if you have a Billing role that includes the Manage Attachments permission and the Delete Attachments permission. For more information, see [Billing roles](https://knowledgecenter.zuora.com/Billing/Tenant_Management/A_Administrator_Settings/User_Roles/d_Billing_Roles). To change your Billing role, contact your Zuora platform administrator.
* @param attachmentId Id of the attachment to be deleted. (required)
* @param acceptEncoding Include the `Accept-Encoding: gzip` header to compress responses as a gzipped file. It can significantly reduce the bandwidth required for a response. If specified, Zuora automatically compresses responses that contain over 1000 bytes of data, and the response contains a `Content-Encoding` header with the compression algorithm so that your client can decompress it. (optional)
* @param contentEncoding Include the `Content-Encoding: gzip` header to compress a request. With this header specified, you should upload a gzipped file for the request payload instead of sending the JSON payload. (optional)
* @param authorization The value is in the `Bearer {token}` format where {token} is a valid OAuth token generated by calling [Create an OAuth token](https://www.zuora.com/developer/api-references/api/operation/createToken). (optional)
* @param zuoraTrackId A custom identifier for tracing the API call. If you set a value for this header, Zuora returns the same value in the response headers. This header enables you to associate your system process identifiers with Zuora API calls, to assist with troubleshooting in the event of an issue. The value of this field must use the US-ASCII character set and must not include any of the following characters: colon (`:`), semicolon (`;`), double quote (`\"`), and quote (`'`). (optional)
* @param zuoraEntityIds An entity ID. If you have [Zuora Multi-entity](https://knowledgecenter.zuora.com/BB_Introducing_Z_Business/Multi-entity) enabled and the OAuth token is valid for more than one entity, you must use this header to specify which entity to perform the operation in. If the OAuth token is only valid for a single entity, or you do not have Zuora Multi-entity enabled, you do not need to set this header. (optional)
* @param zuoraVersion The minor version of the Zuora REST API. (optional, default to 2024-05-20)
* @param zuoraOrgIds Comma separated IDs. If you have Zuora Multi-Org enabled, you can use this header to specify which orgs to perform the operation in. If you do not have Zuora Multi-Org enabled, you should not set this header. The IDs must be a sub-set of the user's accessible orgs. If you specify an org that the user does not have access to, the operation fails. If the header is not set, the operation is performed in scope of the user's accessible orgs. (optional)
* @return DeleteAttachmentResponse
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
*/
protected DeleteAttachmentResponse deleteAttachments(String attachmentId, String acceptEncoding, String contentEncoding, String authorization, String zuoraTrackId, String zuoraEntityIds, String zuoraVersion, String zuoraOrgIds) throws ApiException {
ApiResponse localVarResp = deleteAttachmentsWithHttpInfo(attachmentId, acceptEncoding, contentEncoding, authorization, zuoraTrackId, zuoraEntityIds, zuoraVersion, zuoraOrgIds);
return localVarResp.getData();
}
private ApiResponse deleteAttachmentsWithHttpInfo(String attachmentId, String acceptEncoding, String contentEncoding, String authorization, String zuoraTrackId, String zuoraEntityIds, String zuoraVersion, String zuoraOrgIds) throws ApiException {
okhttp3.Call localVarCall = deleteAttachmentsValidateBeforeCall(attachmentId, acceptEncoding, contentEncoding, authorization, zuoraTrackId, zuoraEntityIds, zuoraVersion, zuoraOrgIds, null);
Type localVarReturnType = new TypeToken(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
}
private okhttp3.Call deleteAttachmentsAsync(String attachmentId, String acceptEncoding, String contentEncoding, String authorization, String zuoraTrackId, String zuoraEntityIds, String zuoraVersion, String zuoraOrgIds, final ApiCallback _callback) throws ApiException {
okhttp3.Call localVarCall = deleteAttachmentsValidateBeforeCall(attachmentId, acceptEncoding, contentEncoding, authorization, zuoraTrackId, zuoraEntityIds, zuoraVersion, zuoraOrgIds, _callback);
Type localVarReturnType = new TypeToken(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
public class DeleteAttachmentsApi {
private final String attachmentId;
private String acceptEncoding;
private String contentEncoding;
private String authorization;
private String zuoraTrackId;
private String zuoraEntityIds;
private String zuoraVersion;
private String zuoraOrgIds;
private DeleteAttachmentsApi(String attachmentId) {
this.attachmentId = attachmentId;
}
/**
* Set acceptEncoding
* @param acceptEncoding Include the `Accept-Encoding: gzip` header to compress responses as a gzipped file. It can significantly reduce the bandwidth required for a response. If specified, Zuora automatically compresses responses that contain over 1000 bytes of data, and the response contains a `Content-Encoding` header with the compression algorithm so that your client can decompress it. (optional)
* @return DeleteAttachmentsApi
*/
public DeleteAttachmentsApi acceptEncoding(String acceptEncoding) {
this.acceptEncoding = acceptEncoding;
return this;
}
/**
* Set contentEncoding
* @param contentEncoding Include the `Content-Encoding: gzip` header to compress a request. With this header specified, you should upload a gzipped file for the request payload instead of sending the JSON payload. (optional)
* @return DeleteAttachmentsApi
*/
public DeleteAttachmentsApi contentEncoding(String contentEncoding) {
this.contentEncoding = contentEncoding;
return this;
}
/**
* Set authorization
* @param authorization The value is in the `Bearer {token}` format where {token} is a valid OAuth token generated by calling [Create an OAuth token](https://www.zuora.com/developer/api-references/api/operation/createToken). (optional)
* @return DeleteAttachmentsApi
*/
public DeleteAttachmentsApi authorization(String authorization) {
this.authorization = authorization;
return this;
}
/**
* Set zuoraTrackId
* @param zuoraTrackId A custom identifier for tracing the API call. If you set a value for this header, Zuora returns the same value in the response headers. This header enables you to associate your system process identifiers with Zuora API calls, to assist with troubleshooting in the event of an issue. The value of this field must use the US-ASCII character set and must not include any of the following characters: colon (`:`), semicolon (`;`), double quote (`\"`), and quote (`'`). (optional)
* @return DeleteAttachmentsApi
*/
public DeleteAttachmentsApi zuoraTrackId(String zuoraTrackId) {
this.zuoraTrackId = zuoraTrackId;
return this;
}
/**
* Set zuoraEntityIds
* @param zuoraEntityIds An entity ID. If you have [Zuora Multi-entity](https://knowledgecenter.zuora.com/BB_Introducing_Z_Business/Multi-entity) enabled and the OAuth token is valid for more than one entity, you must use this header to specify which entity to perform the operation in. If the OAuth token is only valid for a single entity, or you do not have Zuora Multi-entity enabled, you do not need to set this header. (optional)
* @return DeleteAttachmentsApi
*/
public DeleteAttachmentsApi zuoraEntityIds(String zuoraEntityIds) {
this.zuoraEntityIds = zuoraEntityIds;
return this;
}
/**
* Set zuoraVersion
* @param zuoraVersion The minor version of the Zuora REST API. (optional, default to 2024-05-20)
* @return DeleteAttachmentsApi
*/
public DeleteAttachmentsApi zuoraVersion(String zuoraVersion) {
this.zuoraVersion = zuoraVersion;
return this;
}
/**
* Set zuoraOrgIds
* @param zuoraOrgIds Comma separated IDs. If you have Zuora Multi-Org enabled, you can use this header to specify which orgs to perform the operation in. If you do not have Zuora Multi-Org enabled, you should not set this header. The IDs must be a sub-set of the user's accessible orgs. If you specify an org that the user does not have access to, the operation fails. If the header is not set, the operation is performed in scope of the user's accessible orgs. (optional)
* @return DeleteAttachmentsApi
*/
public DeleteAttachmentsApi zuoraOrgIds(String zuoraOrgIds) {
this.zuoraOrgIds = zuoraOrgIds;
return this;
}
/**
* Build call for deleteAttachments
* @param _callback ApiCallback API callback
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
* @http.response.details
*/
public DeleteAttachmentResponse execute() throws ApiException {
ApiResponse localVarResp = deleteAttachmentsWithHttpInfo(attachmentId, acceptEncoding, contentEncoding, authorization, zuoraTrackId, zuoraEntityIds, zuoraVersion, zuoraOrgIds);
return localVarResp.getData();
}
/**
* Execute deleteAttachments request with HTTP info returned
* @return ApiResponse<DeleteAttachmentResponse>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
*/
private ApiResponse executeWithHttpInfo() throws ApiException {
return deleteAttachmentsWithHttpInfo(attachmentId, acceptEncoding, contentEncoding, authorization, zuoraTrackId, zuoraEntityIds, zuoraVersion, zuoraOrgIds);
}
/**
* Execute deleteAttachments request (asynchronously)
* @param _callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
* @http.response.details
*/
public okhttp3.Call executeAsync(final ApiCallback _callback) throws ApiException {
return deleteAttachmentsAsync(attachmentId, acceptEncoding, contentEncoding, authorization, zuoraTrackId, zuoraEntityIds, zuoraVersion, zuoraOrgIds, _callback);
}
}
/**
* Delete an attachment
* Use the Delete Attachment REST request to delete an attachment from a Zuora object. You can only use this operation if you have a Billing role that includes the Manage Attachments permission and the Delete Attachments permission. For more information, see [Billing roles](https://knowledgecenter.zuora.com/Billing/Tenant_Management/A_Administrator_Settings/User_Roles/d_Billing_Roles). To change your Billing role, contact your Zuora platform administrator.
* @param attachmentId Id of the attachment to be deleted. (required)
* @return DeleteAttachmentsApi
*/
public DeleteAttachmentsApi deleteAttachmentsApi(String attachmentId) {
return new DeleteAttachmentsApi(attachmentId);
}
private okhttp3.Call getAttachmentsCall(String attachmentId, String acceptEncoding, String contentEncoding, String authorization, String zuoraTrackId, String zuoraEntityIds, String zuoraVersion, 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 = "/v1/attachments/{attachment-id}"
.replace("{" + "attachment-id" + "}", localVarApiClient.escapeString(attachmentId.toString()));
List localVarQueryParams = new ArrayList();
List localVarCollectionQueryParams = new ArrayList();
Map localVarHeaderParams = new HashMap();
Map localVarCookieParams = new HashMap();
Map localVarFormParams = new HashMap();
if (acceptEncoding != null) {
localVarHeaderParams.put("Accept-Encoding", localVarApiClient.parameterToString(acceptEncoding));
}
if (contentEncoding != null) {
localVarHeaderParams.put("Content-Encoding", localVarApiClient.parameterToString(contentEncoding));
}
if (authorization != null) {
localVarHeaderParams.put("Authorization", localVarApiClient.parameterToString(authorization));
}
if (zuoraTrackId != null) {
localVarHeaderParams.put("Zuora-Track-Id", localVarApiClient.parameterToString(zuoraTrackId));
}
if (zuoraEntityIds != null) {
localVarHeaderParams.put("Zuora-Entity-Ids", localVarApiClient.parameterToString(zuoraEntityIds));
}
if (zuoraVersion != null) {
localVarHeaderParams.put("Zuora-Version", localVarApiClient.parameterToString(zuoraVersion));
}
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 getAttachmentsValidateBeforeCall(String attachmentId, String acceptEncoding, String contentEncoding, String authorization, String zuoraTrackId, String zuoraEntityIds, String zuoraVersion, String zuoraOrgIds, final ApiCallback _callback) throws ApiException {
// verify the required parameter 'attachmentId' is set
if (attachmentId == null) {
throw new ApiException("Missing the required parameter 'attachmentId' when calling getAttachments(Async)");
}
return getAttachmentsCall(attachmentId, acceptEncoding, contentEncoding, authorization, zuoraTrackId, zuoraEntityIds, zuoraVersion, zuoraOrgIds, _callback);
}
/**
* Retrieve an attachment
* Use the View Attachment REST request to retrieve information about an attachment document. You can only use this operation if you have a Billing role that includes the Manage Attachments permission. For more information, see [Billing roles](https://knowledgecenter.zuora.com/Billing/Tenant_Management/A_Administrator_Settings/User_Roles/d_Billing_Roles). To change your Billing role, contact your Zuora platform administrator.
* @param attachmentId Id of the attachment you want to view. (required)
* @param acceptEncoding Include the `Accept-Encoding: gzip` header to compress responses as a gzipped file. It can significantly reduce the bandwidth required for a response. If specified, Zuora automatically compresses responses that contain over 1000 bytes of data, and the response contains a `Content-Encoding` header with the compression algorithm so that your client can decompress it. (optional)
* @param contentEncoding Include the `Content-Encoding: gzip` header to compress a request. With this header specified, you should upload a gzipped file for the request payload instead of sending the JSON payload. (optional)
* @param authorization The value is in the `Bearer {token}` format where {token} is a valid OAuth token generated by calling [Create an OAuth token](https://www.zuora.com/developer/api-references/api/operation/createToken). (optional)
* @param zuoraTrackId A custom identifier for tracing the API call. If you set a value for this header, Zuora returns the same value in the response headers. This header enables you to associate your system process identifiers with Zuora API calls, to assist with troubleshooting in the event of an issue. The value of this field must use the US-ASCII character set and must not include any of the following characters: colon (`:`), semicolon (`;`), double quote (`\"`), and quote (`'`). (optional)
* @param zuoraEntityIds An entity ID. If you have [Zuora Multi-entity](https://knowledgecenter.zuora.com/BB_Introducing_Z_Business/Multi-entity) enabled and the OAuth token is valid for more than one entity, you must use this header to specify which entity to perform the operation in. If the OAuth token is only valid for a single entity, or you do not have Zuora Multi-entity enabled, you do not need to set this header. (optional)
* @param zuoraVersion The minor version of the Zuora REST API. (optional, default to 2024-05-20)
* @param zuoraOrgIds Comma separated IDs. If you have Zuora Multi-Org enabled, you can use this header to specify which orgs to perform the operation in. If you do not have Zuora Multi-Org enabled, you should not set this header. The IDs must be a sub-set of the user's accessible orgs. If you specify an org that the user does not have access to, the operation fails. If the header is not set, the operation is performed in scope of the user's accessible orgs. (optional)
* @return GetAttachmentResponse
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
*/
protected GetAttachmentResponse getAttachments(String attachmentId, String acceptEncoding, String contentEncoding, String authorization, String zuoraTrackId, String zuoraEntityIds, String zuoraVersion, String zuoraOrgIds) throws ApiException {
ApiResponse localVarResp = getAttachmentsWithHttpInfo(attachmentId, acceptEncoding, contentEncoding, authorization, zuoraTrackId, zuoraEntityIds, zuoraVersion, zuoraOrgIds);
return localVarResp.getData();
}
private ApiResponse getAttachmentsWithHttpInfo(String attachmentId, String acceptEncoding, String contentEncoding, String authorization, String zuoraTrackId, String zuoraEntityIds, String zuoraVersion, String zuoraOrgIds) throws ApiException {
okhttp3.Call localVarCall = getAttachmentsValidateBeforeCall(attachmentId, acceptEncoding, contentEncoding, authorization, zuoraTrackId, zuoraEntityIds, zuoraVersion, zuoraOrgIds, null);
Type localVarReturnType = new TypeToken(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
}
private okhttp3.Call getAttachmentsAsync(String attachmentId, String acceptEncoding, String contentEncoding, String authorization, String zuoraTrackId, String zuoraEntityIds, String zuoraVersion, String zuoraOrgIds, final ApiCallback _callback) throws ApiException {
okhttp3.Call localVarCall = getAttachmentsValidateBeforeCall(attachmentId, acceptEncoding, contentEncoding, authorization, zuoraTrackId, zuoraEntityIds, zuoraVersion, zuoraOrgIds, _callback);
Type localVarReturnType = new TypeToken(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
public class GetAttachmentsApi {
private final String attachmentId;
private String acceptEncoding;
private String contentEncoding;
private String authorization;
private String zuoraTrackId;
private String zuoraEntityIds;
private String zuoraVersion;
private String zuoraOrgIds;
private GetAttachmentsApi(String attachmentId) {
this.attachmentId = attachmentId;
}
/**
* Set acceptEncoding
* @param acceptEncoding Include the `Accept-Encoding: gzip` header to compress responses as a gzipped file. It can significantly reduce the bandwidth required for a response. If specified, Zuora automatically compresses responses that contain over 1000 bytes of data, and the response contains a `Content-Encoding` header with the compression algorithm so that your client can decompress it. (optional)
* @return GetAttachmentsApi
*/
public GetAttachmentsApi acceptEncoding(String acceptEncoding) {
this.acceptEncoding = acceptEncoding;
return this;
}
/**
* Set contentEncoding
* @param contentEncoding Include the `Content-Encoding: gzip` header to compress a request. With this header specified, you should upload a gzipped file for the request payload instead of sending the JSON payload. (optional)
* @return GetAttachmentsApi
*/
public GetAttachmentsApi contentEncoding(String contentEncoding) {
this.contentEncoding = contentEncoding;
return this;
}
/**
* Set authorization
* @param authorization The value is in the `Bearer {token}` format where {token} is a valid OAuth token generated by calling [Create an OAuth token](https://www.zuora.com/developer/api-references/api/operation/createToken). (optional)
* @return GetAttachmentsApi
*/
public GetAttachmentsApi authorization(String authorization) {
this.authorization = authorization;
return this;
}
/**
* Set zuoraTrackId
* @param zuoraTrackId A custom identifier for tracing the API call. If you set a value for this header, Zuora returns the same value in the response headers. This header enables you to associate your system process identifiers with Zuora API calls, to assist with troubleshooting in the event of an issue. The value of this field must use the US-ASCII character set and must not include any of the following characters: colon (`:`), semicolon (`;`), double quote (`\"`), and quote (`'`). (optional)
* @return GetAttachmentsApi
*/
public GetAttachmentsApi zuoraTrackId(String zuoraTrackId) {
this.zuoraTrackId = zuoraTrackId;
return this;
}
/**
* Set zuoraEntityIds
* @param zuoraEntityIds An entity ID. If you have [Zuora Multi-entity](https://knowledgecenter.zuora.com/BB_Introducing_Z_Business/Multi-entity) enabled and the OAuth token is valid for more than one entity, you must use this header to specify which entity to perform the operation in. If the OAuth token is only valid for a single entity, or you do not have Zuora Multi-entity enabled, you do not need to set this header. (optional)
* @return GetAttachmentsApi
*/
public GetAttachmentsApi zuoraEntityIds(String zuoraEntityIds) {
this.zuoraEntityIds = zuoraEntityIds;
return this;
}
/**
* Set zuoraVersion
* @param zuoraVersion The minor version of the Zuora REST API. (optional, default to 2024-05-20)
* @return GetAttachmentsApi
*/
public GetAttachmentsApi zuoraVersion(String zuoraVersion) {
this.zuoraVersion = zuoraVersion;
return this;
}
/**
* Set zuoraOrgIds
* @param zuoraOrgIds Comma separated IDs. If you have Zuora Multi-Org enabled, you can use this header to specify which orgs to perform the operation in. If you do not have Zuora Multi-Org enabled, you should not set this header. The IDs must be a sub-set of the user's accessible orgs. If you specify an org that the user does not have access to, the operation fails. If the header is not set, the operation is performed in scope of the user's accessible orgs. (optional)
* @return GetAttachmentsApi
*/
public GetAttachmentsApi zuoraOrgIds(String zuoraOrgIds) {
this.zuoraOrgIds = zuoraOrgIds;
return this;
}
/**
* Build call for getAttachments
* @param _callback ApiCallback API callback
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
* @http.response.details
*/
public GetAttachmentResponse execute() throws ApiException {
ApiResponse localVarResp = getAttachmentsWithHttpInfo(attachmentId, acceptEncoding, contentEncoding, authorization, zuoraTrackId, zuoraEntityIds, zuoraVersion, zuoraOrgIds);
return localVarResp.getData();
}
/**
* Execute getAttachments request with HTTP info returned
* @return ApiResponse<GetAttachmentResponse>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
*/
private ApiResponse executeWithHttpInfo() throws ApiException {
return getAttachmentsWithHttpInfo(attachmentId, acceptEncoding, contentEncoding, authorization, zuoraTrackId, zuoraEntityIds, zuoraVersion, zuoraOrgIds);
}
/**
* Execute getAttachments request (asynchronously)
* @param _callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
* @http.response.details
*/
public okhttp3.Call executeAsync(final ApiCallback _callback) throws ApiException {
return getAttachmentsAsync(attachmentId, acceptEncoding, contentEncoding, authorization, zuoraTrackId, zuoraEntityIds, zuoraVersion, zuoraOrgIds, _callback);
}
}
/**
* Retrieve an attachment
* Use the View Attachment REST request to retrieve information about an attachment document. You can only use this operation if you have a Billing role that includes the Manage Attachments permission. For more information, see [Billing roles](https://knowledgecenter.zuora.com/Billing/Tenant_Management/A_Administrator_Settings/User_Roles/d_Billing_Roles). To change your Billing role, contact your Zuora platform administrator.
* @param attachmentId Id of the attachment you want to view. (required)
* @return GetAttachmentsApi
*/
public GetAttachmentsApi getAttachmentsApi(String attachmentId) {
return new GetAttachmentsApi(attachmentId);
}
private okhttp3.Call getAttachmentsListCall(String objectType, String objectKey, String acceptEncoding, String contentEncoding, String authorization, String zuoraTrackId, String zuoraEntityIds, Integer page, Integer pageSize, String zuoraVersion, 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 = "/v1/attachments/{object-type}/{object-key}"
.replace("{" + "object-type" + "}", localVarApiClient.escapeString(objectType.toString()))
.replace("{" + "object-key" + "}", localVarApiClient.escapeString(objectKey.toString()));
List localVarQueryParams = new ArrayList();
List localVarCollectionQueryParams = new ArrayList();
Map localVarHeaderParams = new HashMap();
Map localVarCookieParams = new HashMap();
Map localVarFormParams = new HashMap();
if (page != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("page", page));
}
if (pageSize != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("pageSize", pageSize));
}
if (acceptEncoding != null) {
localVarHeaderParams.put("Accept-Encoding", localVarApiClient.parameterToString(acceptEncoding));
}
if (contentEncoding != null) {
localVarHeaderParams.put("Content-Encoding", localVarApiClient.parameterToString(contentEncoding));
}
if (authorization != null) {
localVarHeaderParams.put("Authorization", localVarApiClient.parameterToString(authorization));
}
if (zuoraTrackId != null) {
localVarHeaderParams.put("Zuora-Track-Id", localVarApiClient.parameterToString(zuoraTrackId));
}
if (zuoraEntityIds != null) {
localVarHeaderParams.put("Zuora-Entity-Ids", localVarApiClient.parameterToString(zuoraEntityIds));
}
if (zuoraVersion != null) {
localVarHeaderParams.put("Zuora-Version", localVarApiClient.parameterToString(zuoraVersion));
}
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 getAttachmentsListValidateBeforeCall(String objectType, String objectKey, String acceptEncoding, String contentEncoding, String authorization, String zuoraTrackId, String zuoraEntityIds, Integer page, Integer pageSize, String zuoraVersion, String zuoraOrgIds, final ApiCallback _callback) throws ApiException {
// verify the required parameter 'objectType' is set
if (objectType == null) {
throw new ApiException("Missing the required parameter 'objectType' when calling getAttachmentsList(Async)");
}
// verify the required parameter 'objectKey' is set
if (objectKey == null) {
throw new ApiException("Missing the required parameter 'objectKey' when calling getAttachmentsList(Async)");
}
return getAttachmentsListCall(objectType, objectKey, acceptEncoding, contentEncoding, authorization, zuoraTrackId, zuoraEntityIds, page, pageSize, zuoraVersion, zuoraOrgIds, _callback);
}
/**
* List attachments by object type and key
* Use the View Attachment REST request to get a list of attachments on an account, an invoice, a subscription, a credit memo, or a debit memo. You can only use this operation if you have a Billing role that includes the Manage Attachments permission. For more information, see [Billing roles](https://knowledgecenter.zuora.com/Billing/Tenant_Management/A_Administrator_Settings/User_Roles/d_Billing_Roles). To change your Billing role, contact your Zuora platform administrator. **Note**: The Credit and Debit Memos feature is only available if you have [Invoice Settlement](https://knowledgecenter.zuora.com/Billing/Billing_and_Payments/Invoice_Settlement) enabled. The Invoice Settlement feature is generally available as of Zuora Billing Release 296 (March 2021). This feature includes Unapplied Payments, Credit and Debit Memo, and Invoice Item Settlement. If you want to enable Invoice Settlement, see [Invoice Settlement Enablement and Checklist Guide](https://knowledgecenter.zuora.com/Billing/Billing_and_Payments/Invoice_Settlement/Invoice_Settlement_Migration_Checklist_and_Guide) for more information.
* @param objectType The type of the object to list attachements for. (required)
* @param objectKey ID of the object to list attachements for. - If `object-type` is `account`, specify an account ID or number. - If `object-type` is `invoice`, specify an invoice ID. - If `object-type` is `subscription`, specify a subscription number. - If `object-type` is `creditmemo`, specify a credit memo ID or number. - If `object-type` is `debitmemo`, specify a debit memo ID or number. (required)
* @param acceptEncoding Include the `Accept-Encoding: gzip` header to compress responses as a gzipped file. It can significantly reduce the bandwidth required for a response. If specified, Zuora automatically compresses responses that contain over 1000 bytes of data, and the response contains a `Content-Encoding` header with the compression algorithm so that your client can decompress it. (optional)
* @param contentEncoding Include the `Content-Encoding: gzip` header to compress a request. With this header specified, you should upload a gzipped file for the request payload instead of sending the JSON payload. (optional)
* @param authorization The value is in the `Bearer {token}` format where {token} is a valid OAuth token generated by calling [Create an OAuth token](https://www.zuora.com/developer/api-references/api/operation/createToken). (optional)
* @param zuoraTrackId A custom identifier for tracing the API call. If you set a value for this header, Zuora returns the same value in the response headers. This header enables you to associate your system process identifiers with Zuora API calls, to assist with troubleshooting in the event of an issue. The value of this field must use the US-ASCII character set and must not include any of the following characters: colon (`:`), semicolon (`;`), double quote (`\"`), and quote (`'`). (optional)
* @param zuoraEntityIds An entity ID. If you have [Zuora Multi-entity](https://knowledgecenter.zuora.com/BB_Introducing_Z_Business/Multi-entity) enabled and the OAuth token is valid for more than one entity, you must use this header to specify which entity to perform the operation in. If the OAuth token is only valid for a single entity, or you do not have Zuora Multi-entity enabled, you do not need to set this header. (optional)
* @param page The index number of the page that you want to retrieve. This parameter is dependent on `pageSize`. You must set `pageSize` before specifying `page`. For example, if you set `pageSize` to `20` and `page` to `2`, the 21st to 40th records are returned in the response. (optional, default to 1)
* @param pageSize The number of records returned per page in the response. (optional, default to 20)
* @param zuoraVersion The minor version of the Zuora REST API. (optional, default to 2024-05-20)
* @param zuoraOrgIds Comma separated IDs. If you have Zuora Multi-Org enabled, you can use this header to specify which orgs to perform the operation in. If you do not have Zuora Multi-Org enabled, you should not set this header. The IDs must be a sub-set of the user's accessible orgs. If you specify an org that the user does not have access to, the operation fails. If the header is not set, the operation is performed in scope of the user's accessible orgs. (optional)
* @return GetAttachmentsResponse
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
*/
protected GetAttachmentsResponse getAttachmentsList(String objectType, String objectKey, String acceptEncoding, String contentEncoding, String authorization, String zuoraTrackId, String zuoraEntityIds, Integer page, Integer pageSize, String zuoraVersion, String zuoraOrgIds) throws ApiException {
ApiResponse localVarResp = getAttachmentsListWithHttpInfo(objectType, objectKey, acceptEncoding, contentEncoding, authorization, zuoraTrackId, zuoraEntityIds, page, pageSize, zuoraVersion, zuoraOrgIds);
return localVarResp.getData();
}
private ApiResponse getAttachmentsListWithHttpInfo(String objectType, String objectKey, String acceptEncoding, String contentEncoding, String authorization, String zuoraTrackId, String zuoraEntityIds, Integer page, Integer pageSize, String zuoraVersion, String zuoraOrgIds) throws ApiException {
okhttp3.Call localVarCall = getAttachmentsListValidateBeforeCall(objectType, objectKey, acceptEncoding, contentEncoding, authorization, zuoraTrackId, zuoraEntityIds, page, pageSize, zuoraVersion, zuoraOrgIds, null);
Type localVarReturnType = new TypeToken(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
}
private okhttp3.Call getAttachmentsListAsync(String objectType, String objectKey, String acceptEncoding, String contentEncoding, String authorization, String zuoraTrackId, String zuoraEntityIds, Integer page, Integer pageSize, String zuoraVersion, String zuoraOrgIds, final ApiCallback _callback) throws ApiException {
okhttp3.Call localVarCall = getAttachmentsListValidateBeforeCall(objectType, objectKey, acceptEncoding, contentEncoding, authorization, zuoraTrackId, zuoraEntityIds, page, pageSize, zuoraVersion, zuoraOrgIds, _callback);
Type localVarReturnType = new TypeToken(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
public class GetAttachmentsListApi {
private final String objectType;
private final String objectKey;
private String acceptEncoding;
private String contentEncoding;
private String authorization;
private String zuoraTrackId;
private String zuoraEntityIds;
private Integer page;
private Integer pageSize;
private String zuoraVersion;
private String zuoraOrgIds;
private GetAttachmentsListApi(String objectType, String objectKey) {
this.objectType = objectType;
this.objectKey = objectKey;
}
/**
* Set acceptEncoding
* @param acceptEncoding Include the `Accept-Encoding: gzip` header to compress responses as a gzipped file. It can significantly reduce the bandwidth required for a response. If specified, Zuora automatically compresses responses that contain over 1000 bytes of data, and the response contains a `Content-Encoding` header with the compression algorithm so that your client can decompress it. (optional)
* @return GetAttachmentsListApi
*/
public GetAttachmentsListApi acceptEncoding(String acceptEncoding) {
this.acceptEncoding = acceptEncoding;
return this;
}
/**
* Set contentEncoding
* @param contentEncoding Include the `Content-Encoding: gzip` header to compress a request. With this header specified, you should upload a gzipped file for the request payload instead of sending the JSON payload. (optional)
* @return GetAttachmentsListApi
*/
public GetAttachmentsListApi contentEncoding(String contentEncoding) {
this.contentEncoding = contentEncoding;
return this;
}
/**
* Set authorization
* @param authorization The value is in the `Bearer {token}` format where {token} is a valid OAuth token generated by calling [Create an OAuth token](https://www.zuora.com/developer/api-references/api/operation/createToken). (optional)
* @return GetAttachmentsListApi
*/
public GetAttachmentsListApi authorization(String authorization) {
this.authorization = authorization;
return this;
}
/**
* Set zuoraTrackId
* @param zuoraTrackId A custom identifier for tracing the API call. If you set a value for this header, Zuora returns the same value in the response headers. This header enables you to associate your system process identifiers with Zuora API calls, to assist with troubleshooting in the event of an issue. The value of this field must use the US-ASCII character set and must not include any of the following characters: colon (`:`), semicolon (`;`), double quote (`\"`), and quote (`'`). (optional)
* @return GetAttachmentsListApi
*/
public GetAttachmentsListApi zuoraTrackId(String zuoraTrackId) {
this.zuoraTrackId = zuoraTrackId;
return this;
}
/**
* Set zuoraEntityIds
* @param zuoraEntityIds An entity ID. If you have [Zuora Multi-entity](https://knowledgecenter.zuora.com/BB_Introducing_Z_Business/Multi-entity) enabled and the OAuth token is valid for more than one entity, you must use this header to specify which entity to perform the operation in. If the OAuth token is only valid for a single entity, or you do not have Zuora Multi-entity enabled, you do not need to set this header. (optional)
* @return GetAttachmentsListApi
*/
public GetAttachmentsListApi zuoraEntityIds(String zuoraEntityIds) {
this.zuoraEntityIds = zuoraEntityIds;
return this;
}
/**
* Set page
* @param page The index number of the page that you want to retrieve. This parameter is dependent on `pageSize`. You must set `pageSize` before specifying `page`. For example, if you set `pageSize` to `20` and `page` to `2`, the 21st to 40th records are returned in the response. (optional, default to 1)
* @return GetAttachmentsListApi
*/
public GetAttachmentsListApi page(Integer page) {
this.page = page;
return this;
}
/**
* Set pageSize
* @param pageSize The number of records returned per page in the response. (optional, default to 20)
* @return GetAttachmentsListApi
*/
public GetAttachmentsListApi pageSize(Integer pageSize) {
this.pageSize = pageSize;
return this;
}
/**
* Set zuoraVersion
* @param zuoraVersion The minor version of the Zuora REST API. (optional, default to 2024-05-20)
* @return GetAttachmentsListApi
*/
public GetAttachmentsListApi zuoraVersion(String zuoraVersion) {
this.zuoraVersion = zuoraVersion;
return this;
}
/**
* Set zuoraOrgIds
* @param zuoraOrgIds Comma separated IDs. If you have Zuora Multi-Org enabled, you can use this header to specify which orgs to perform the operation in. If you do not have Zuora Multi-Org enabled, you should not set this header. The IDs must be a sub-set of the user's accessible orgs. If you specify an org that the user does not have access to, the operation fails. If the header is not set, the operation is performed in scope of the user's accessible orgs. (optional)
* @return GetAttachmentsListApi
*/
public GetAttachmentsListApi zuoraOrgIds(String zuoraOrgIds) {
this.zuoraOrgIds = zuoraOrgIds;
return this;
}
/**
* Build call for getAttachmentsList
* @param _callback ApiCallback API callback
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
* @http.response.details
*/
public GetAttachmentsResponse execute() throws ApiException {
ApiResponse localVarResp = getAttachmentsListWithHttpInfo(objectType, objectKey, acceptEncoding, contentEncoding, authorization, zuoraTrackId, zuoraEntityIds, page, pageSize, zuoraVersion, zuoraOrgIds);
return localVarResp.getData();
}
/**
* Execute getAttachmentsList request with HTTP info returned
* @return ApiResponse<GetAttachmentsResponse>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
*/
private ApiResponse executeWithHttpInfo() throws ApiException {
return getAttachmentsListWithHttpInfo(objectType, objectKey, acceptEncoding, contentEncoding, authorization, zuoraTrackId, zuoraEntityIds, page, pageSize, zuoraVersion, zuoraOrgIds);
}
/**
* Execute getAttachmentsList request (asynchronously)
* @param _callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
* @http.response.details
*/
public okhttp3.Call executeAsync(final ApiCallback _callback) throws ApiException {
return getAttachmentsListAsync(objectType, objectKey, acceptEncoding, contentEncoding, authorization, zuoraTrackId, zuoraEntityIds, page, pageSize, zuoraVersion, zuoraOrgIds, _callback);
}
}
/**
* List attachments by object type and key
* Use the View Attachment REST request to get a list of attachments on an account, an invoice, a subscription, a credit memo, or a debit memo. You can only use this operation if you have a Billing role that includes the Manage Attachments permission. For more information, see [Billing roles](https://knowledgecenter.zuora.com/Billing/Tenant_Management/A_Administrator_Settings/User_Roles/d_Billing_Roles). To change your Billing role, contact your Zuora platform administrator. **Note**: The Credit and Debit Memos feature is only available if you have [Invoice Settlement](https://knowledgecenter.zuora.com/Billing/Billing_and_Payments/Invoice_Settlement) enabled. The Invoice Settlement feature is generally available as of Zuora Billing Release 296 (March 2021). This feature includes Unapplied Payments, Credit and Debit Memo, and Invoice Item Settlement. If you want to enable Invoice Settlement, see [Invoice Settlement Enablement and Checklist Guide](https://knowledgecenter.zuora.com/Billing/Billing_and_Payments/Invoice_Settlement/Invoice_Settlement_Migration_Checklist_and_Guide) for more information.
* @param objectType The type of the object to list attachements for. (required)
* @param objectKey ID of the object to list attachements for. - If `object-type` is `account`, specify an account ID or number. - If `object-type` is `invoice`, specify an invoice ID. - If `object-type` is `subscription`, specify a subscription number. - If `object-type` is `creditmemo`, specify a credit memo ID or number. - If `object-type` is `debitmemo`, specify a debit memo ID or number. (required)
* @return GetAttachmentsListApi
*/
public GetAttachmentsListApi getAttachmentsListApi(String objectType, String objectKey) {
return new GetAttachmentsListApi(objectType, objectKey);
}
private okhttp3.Call postAttachmentsCall(String associatedObjectType, String associatedObjectKey, File _file, String idempotencyKey, String acceptEncoding, String contentEncoding, String authorization, String zuoraTrackId, String zuoraEntityIds, String description, String zuoraVersion, 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 = "/v1/attachments";
List localVarQueryParams = new ArrayList();
List localVarCollectionQueryParams = new ArrayList();
Map localVarHeaderParams = new HashMap();
Map localVarCookieParams = new HashMap();
Map localVarFormParams = new HashMap();
if (_file != null) {
localVarFormParams.put("file", _file);
}
if (description != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("description", description));
}
if (associatedObjectType != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("associatedObjectType", associatedObjectType));
}
if (associatedObjectKey != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("associatedObjectKey", associatedObjectKey));
}
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 (authorization != null) {
localVarHeaderParams.put("Authorization", localVarApiClient.parameterToString(authorization));
}
if (zuoraTrackId != null) {
localVarHeaderParams.put("Zuora-Track-Id", localVarApiClient.parameterToString(zuoraTrackId));
}
if (zuoraEntityIds != null) {
localVarHeaderParams.put("Zuora-Entity-Ids", localVarApiClient.parameterToString(zuoraEntityIds));
}
if (zuoraVersion != null) {
localVarHeaderParams.put("Zuora-Version", localVarApiClient.parameterToString(zuoraVersion));
}
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 = {
"multipart/form-data"
};
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 postAttachmentsValidateBeforeCall(String associatedObjectType, String associatedObjectKey, File _file, String idempotencyKey, String acceptEncoding, String contentEncoding, String authorization, String zuoraTrackId, String zuoraEntityIds, String description, String zuoraVersion, String zuoraOrgIds, final ApiCallback _callback) throws ApiException {
// verify the required parameter 'associatedObjectType' is set
if (associatedObjectType == null) {
throw new ApiException("Missing the required parameter 'associatedObjectType' when calling postAttachments(Async)");
}
// verify the required parameter 'associatedObjectKey' is set
if (associatedObjectKey == null) {
throw new ApiException("Missing the required parameter 'associatedObjectKey' when calling postAttachments(Async)");
}
// verify the required parameter '_file' is set
if (_file == null) {
throw new ApiException("Missing the required parameter '_file' when calling postAttachments(Async)");
}
return postAttachmentsCall(associatedObjectType, associatedObjectKey, _file, idempotencyKey, acceptEncoding, contentEncoding, authorization, zuoraTrackId, zuoraEntityIds, description, zuoraVersion, zuoraOrgIds, _callback);
}
/**
* Create an attachment
* Use the Add Attachment REST request with a multipart/form-data to attach a document file to an Account, a Subscription, an Invoice, a Credit Memo, or a Debit Memo. You can only use this operation if you have a Billing role that includes the Manage Attachments permission. For more information, see [Billing roles](https://knowledgecenter.zuora.com/Billing/Tenant_Management/A_Administrator_Settings/User_Roles/d_Billing_Roles). To change your Billing role, contact your Zuora platform administrator. **Note**: The Credit and Debit Memos feature is only available if you have [Invoice Settlement](https://knowledgecenter.zuora.com/Billing/Billing_and_Payments/Invoice_Settlement) enabled. The Invoice Settlement feature is generally available as of Zuora Billing Release 296 (March 2021). This feature includes Unapplied Payments, Credit and Debit Memo, and Invoice Item Settlement. If you want to enable Invoice Settlement, see [Invoice Settlement Enablement and Checklist Guide](https://knowledgecenter.zuora.com/Billing/Billing_and_Payments/Invoice_Settlement/Invoice_Settlement_Migration_Checklist_and_Guide) for more information.
* @param associatedObjectType The type of the object to add attachements for. (required)
* @param associatedObjectKey For the Subscription type, specify the Subscription Number. An attachment is tied to the Subscription Number and thus viewable with every subscription version. For Account, Credit Memo, and Debit Memo, specify the corresponding ID or number. For Invoice, specify the corresponding ID. (required)
* @param _file The file to be attached. Files with the following extensions are supported: .pdf, .csv, .png, .xlsx, .xls, .doc, .docx, .msg, .jpg, .txt, .htm, .html, .eml, .pptx, .gif, .rtf, .xml, .jpeg, .log, .cls The maximum file size is 4 MB. (required)
* @param idempotencyKey Specify a unique idempotency key if you want to perform an idempotent POST or PATCH request. Do not use this header in other request types. With this header specified, the Zuora server can identify subsequent retries of the same request using this value, which prevents the same operation from being performed multiple times by accident. (optional)
* @param acceptEncoding Include the `Accept-Encoding: gzip` header to compress responses as a gzipped file. It can significantly reduce the bandwidth required for a response. If specified, Zuora automatically compresses responses that contain over 1000 bytes of data, and the response contains a `Content-Encoding` header with the compression algorithm so that your client can decompress it. (optional)
* @param contentEncoding Include the `Content-Encoding: gzip` header to compress a request. With this header specified, you should upload a gzipped file for the request payload instead of sending the JSON payload. (optional)
* @param authorization The value is in the `Bearer {token}` format where {token} is a valid OAuth token generated by calling [Create an OAuth token](https://www.zuora.com/developer/api-references/api/operation/createToken). (optional)
* @param zuoraTrackId A custom identifier for tracing the API call. If you set a value for this header, Zuora returns the same value in the response headers. This header enables you to associate your system process identifiers with Zuora API calls, to assist with troubleshooting in the event of an issue. The value of this field must use the US-ASCII character set and must not include any of the following characters: colon (`:`), semicolon (`;`), double quote (`\"`), and quote (`'`). (optional)
* @param zuoraEntityIds An entity ID. If you have [Zuora Multi-entity](https://knowledgecenter.zuora.com/BB_Introducing_Z_Business/Multi-entity) enabled and the OAuth token is valid for more than one entity, you must use this header to specify which entity to perform the operation in. If the OAuth token is only valid for a single entity, or you do not have Zuora Multi-entity enabled, you do not need to set this header. (optional)
* @param description Description of the attachment document. (optional)
* @param zuoraVersion The minor version of the Zuora REST API. (optional, default to 2024-05-20)
* @param zuoraOrgIds Comma separated IDs. If you have Zuora Multi-Org enabled, you can use this header to specify which orgs to perform the operation in. If you do not have Zuora Multi-Org enabled, you should not set this header. The IDs must be a sub-set of the user's accessible orgs. If you specify an org that the user does not have access to, the operation fails. If the header is not set, the operation is performed in scope of the user's accessible orgs. (optional)
* @return PostAttachmentResponse
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
*/
protected PostAttachmentResponse postAttachments(String associatedObjectType, String associatedObjectKey, File _file, String idempotencyKey, String acceptEncoding, String contentEncoding, String authorization, String zuoraTrackId, String zuoraEntityIds, String description, String zuoraVersion, String zuoraOrgIds) throws ApiException {
ApiResponse localVarResp = postAttachmentsWithHttpInfo(associatedObjectType, associatedObjectKey, _file, idempotencyKey, acceptEncoding, contentEncoding, authorization, zuoraTrackId, zuoraEntityIds, description, zuoraVersion, zuoraOrgIds);
return localVarResp.getData();
}
private ApiResponse postAttachmentsWithHttpInfo(String associatedObjectType, String associatedObjectKey, File _file, String idempotencyKey, String acceptEncoding, String contentEncoding, String authorization, String zuoraTrackId, String zuoraEntityIds, String description, String zuoraVersion, String zuoraOrgIds) throws ApiException {
okhttp3.Call localVarCall = postAttachmentsValidateBeforeCall(associatedObjectType, associatedObjectKey, _file, idempotencyKey, acceptEncoding, contentEncoding, authorization, zuoraTrackId, zuoraEntityIds, description, zuoraVersion, zuoraOrgIds, null);
Type localVarReturnType = new TypeToken(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
}
private okhttp3.Call postAttachmentsAsync(String associatedObjectType, String associatedObjectKey, File _file, String idempotencyKey, String acceptEncoding, String contentEncoding, String authorization, String zuoraTrackId, String zuoraEntityIds, String description, String zuoraVersion, String zuoraOrgIds, final ApiCallback _callback) throws ApiException {
okhttp3.Call localVarCall = postAttachmentsValidateBeforeCall(associatedObjectType, associatedObjectKey, _file, idempotencyKey, acceptEncoding, contentEncoding, authorization, zuoraTrackId, zuoraEntityIds, description, zuoraVersion, zuoraOrgIds, _callback);
Type localVarReturnType = new TypeToken(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
public class PostAttachmentsApi {
private final String associatedObjectType;
private final String associatedObjectKey;
private final File _file;
private String idempotencyKey;
private String acceptEncoding;
private String contentEncoding;
private String authorization;
private String zuoraTrackId;
private String zuoraEntityIds;
private String description;
private String zuoraVersion;
private String zuoraOrgIds;
private PostAttachmentsApi(String associatedObjectType, String associatedObjectKey, File _file) {
this.associatedObjectType = associatedObjectType;
this.associatedObjectKey = associatedObjectKey;
this._file = _file;
}
/**
* Set idempotencyKey
* @param idempotencyKey Specify a unique idempotency key if you want to perform an idempotent POST or PATCH request. Do not use this header in other request types. With this header specified, the Zuora server can identify subsequent retries of the same request using this value, which prevents the same operation from being performed multiple times by accident. (optional)
* @return PostAttachmentsApi
*/
public PostAttachmentsApi idempotencyKey(String idempotencyKey) {
this.idempotencyKey = idempotencyKey;
return this;
}
/**
* Set acceptEncoding
* @param acceptEncoding Include the `Accept-Encoding: gzip` header to compress responses as a gzipped file. It can significantly reduce the bandwidth required for a response. If specified, Zuora automatically compresses responses that contain over 1000 bytes of data, and the response contains a `Content-Encoding` header with the compression algorithm so that your client can decompress it. (optional)
* @return PostAttachmentsApi
*/
public PostAttachmentsApi acceptEncoding(String acceptEncoding) {
this.acceptEncoding = acceptEncoding;
return this;
}
/**
* Set contentEncoding
* @param contentEncoding Include the `Content-Encoding: gzip` header to compress a request. With this header specified, you should upload a gzipped file for the request payload instead of sending the JSON payload. (optional)
* @return PostAttachmentsApi
*/
public PostAttachmentsApi contentEncoding(String contentEncoding) {
this.contentEncoding = contentEncoding;
return this;
}
/**
* Set authorization
* @param authorization The value is in the `Bearer {token}` format where {token} is a valid OAuth token generated by calling [Create an OAuth token](https://www.zuora.com/developer/api-references/api/operation/createToken). (optional)
* @return PostAttachmentsApi
*/
public PostAttachmentsApi authorization(String authorization) {
this.authorization = authorization;
return this;
}
/**
* Set zuoraTrackId
* @param zuoraTrackId A custom identifier for tracing the API call. If you set a value for this header, Zuora returns the same value in the response headers. This header enables you to associate your system process identifiers with Zuora API calls, to assist with troubleshooting in the event of an issue. The value of this field must use the US-ASCII character set and must not include any of the following characters: colon (`:`), semicolon (`;`), double quote (`\"`), and quote (`'`). (optional)
* @return PostAttachmentsApi
*/
public PostAttachmentsApi zuoraTrackId(String zuoraTrackId) {
this.zuoraTrackId = zuoraTrackId;
return this;
}
/**
* Set zuoraEntityIds
* @param zuoraEntityIds An entity ID. If you have [Zuora Multi-entity](https://knowledgecenter.zuora.com/BB_Introducing_Z_Business/Multi-entity) enabled and the OAuth token is valid for more than one entity, you must use this header to specify which entity to perform the operation in. If the OAuth token is only valid for a single entity, or you do not have Zuora Multi-entity enabled, you do not need to set this header. (optional)
* @return PostAttachmentsApi
*/
public PostAttachmentsApi zuoraEntityIds(String zuoraEntityIds) {
this.zuoraEntityIds = zuoraEntityIds;
return this;
}
/**
* Set description
* @param description Description of the attachment document. (optional)
* @return PostAttachmentsApi
*/
public PostAttachmentsApi description(String description) {
this.description = description;
return this;
}
/**
* Set zuoraVersion
* @param zuoraVersion The minor version of the Zuora REST API. (optional, default to 2024-05-20)
* @return PostAttachmentsApi
*/
public PostAttachmentsApi zuoraVersion(String zuoraVersion) {
this.zuoraVersion = zuoraVersion;
return this;
}
/**
* Set zuoraOrgIds
* @param zuoraOrgIds Comma separated IDs. If you have Zuora Multi-Org enabled, you can use this header to specify which orgs to perform the operation in. If you do not have Zuora Multi-Org enabled, you should not set this header. The IDs must be a sub-set of the user's accessible orgs. If you specify an org that the user does not have access to, the operation fails. If the header is not set, the operation is performed in scope of the user's accessible orgs. (optional)
* @return PostAttachmentsApi
*/
public PostAttachmentsApi zuoraOrgIds(String zuoraOrgIds) {
this.zuoraOrgIds = zuoraOrgIds;
return this;
}
/**
* Build call for postAttachments
* @param _callback ApiCallback API callback
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
* @http.response.details
*/
public PostAttachmentResponse execute() throws ApiException {
ApiResponse localVarResp = postAttachmentsWithHttpInfo(associatedObjectType, associatedObjectKey, _file, idempotencyKey, acceptEncoding, contentEncoding, authorization, zuoraTrackId, zuoraEntityIds, description, zuoraVersion, zuoraOrgIds);
return localVarResp.getData();
}
/**
* Execute postAttachments request with HTTP info returned
* @return ApiResponse<PostAttachmentResponse>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
*/
private ApiResponse executeWithHttpInfo() throws ApiException {
return postAttachmentsWithHttpInfo(associatedObjectType, associatedObjectKey, _file, idempotencyKey, acceptEncoding, contentEncoding, authorization, zuoraTrackId, zuoraEntityIds, description, zuoraVersion, zuoraOrgIds);
}
/**
* Execute postAttachments request (asynchronously)
* @param _callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
* @http.response.details
*/
public okhttp3.Call executeAsync(final ApiCallback _callback) throws ApiException {
return postAttachmentsAsync(associatedObjectType, associatedObjectKey, _file, idempotencyKey, acceptEncoding, contentEncoding, authorization, zuoraTrackId, zuoraEntityIds, description, zuoraVersion, zuoraOrgIds, _callback);
}
}
/**
* Create an attachment
* Use the Add Attachment REST request with a multipart/form-data to attach a document file to an Account, a Subscription, an Invoice, a Credit Memo, or a Debit Memo. You can only use this operation if you have a Billing role that includes the Manage Attachments permission. For more information, see [Billing roles](https://knowledgecenter.zuora.com/Billing/Tenant_Management/A_Administrator_Settings/User_Roles/d_Billing_Roles). To change your Billing role, contact your Zuora platform administrator. **Note**: The Credit and Debit Memos feature is only available if you have [Invoice Settlement](https://knowledgecenter.zuora.com/Billing/Billing_and_Payments/Invoice_Settlement) enabled. The Invoice Settlement feature is generally available as of Zuora Billing Release 296 (March 2021). This feature includes Unapplied Payments, Credit and Debit Memo, and Invoice Item Settlement. If you want to enable Invoice Settlement, see [Invoice Settlement Enablement and Checklist Guide](https://knowledgecenter.zuora.com/Billing/Billing_and_Payments/Invoice_Settlement/Invoice_Settlement_Migration_Checklist_and_Guide) for more information.
* @param associatedObjectType The type of the object to add attachements for. (required)
* @param associatedObjectKey For the Subscription type, specify the Subscription Number. An attachment is tied to the Subscription Number and thus viewable with every subscription version. For Account, Credit Memo, and Debit Memo, specify the corresponding ID or number. For Invoice, specify the corresponding ID. (required)
* @param _file The file to be attached. Files with the following extensions are supported: .pdf, .csv, .png, .xlsx, .xls, .doc, .docx, .msg, .jpg, .txt, .htm, .html, .eml, .pptx, .gif, .rtf, .xml, .jpeg, .log, .cls The maximum file size is 4 MB. (required)
* @return PostAttachmentsApi
*/
public PostAttachmentsApi postAttachmentsApi(String associatedObjectType, String associatedObjectKey, File _file) {
return new PostAttachmentsApi(associatedObjectType, associatedObjectKey, _file);
}
private okhttp3.Call putAttachmentsCall(String attachmentId, String acceptEncoding, String contentEncoding, String authorization, String zuoraTrackId, String zuoraEntityIds, String zuoraVersion, String zuoraOrgIds, PutAttachmentRequest request, 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 = request;
// create path and map variables
String localVarPath = "/v1/attachments/{attachment-id}"
.replace("{" + "attachment-id" + "}", localVarApiClient.escapeString(attachmentId.toString()));
List localVarQueryParams = new ArrayList();
List localVarCollectionQueryParams = new ArrayList();
Map localVarHeaderParams = new HashMap();
Map localVarCookieParams = new HashMap();
Map localVarFormParams = new HashMap();
if (acceptEncoding != null) {
localVarHeaderParams.put("Accept-Encoding", localVarApiClient.parameterToString(acceptEncoding));
}
if (contentEncoding != null) {
localVarHeaderParams.put("Content-Encoding", localVarApiClient.parameterToString(contentEncoding));
}
if (authorization != null) {
localVarHeaderParams.put("Authorization", localVarApiClient.parameterToString(authorization));
}
if (zuoraTrackId != null) {
localVarHeaderParams.put("Zuora-Track-Id", localVarApiClient.parameterToString(zuoraTrackId));
}
if (zuoraEntityIds != null) {
localVarHeaderParams.put("Zuora-Entity-Ids", localVarApiClient.parameterToString(zuoraEntityIds));
}
if (zuoraVersion != null) {
localVarHeaderParams.put("Zuora-Version", localVarApiClient.parameterToString(zuoraVersion));
}
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, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call putAttachmentsValidateBeforeCall(String attachmentId, String acceptEncoding, String contentEncoding, String authorization, String zuoraTrackId, String zuoraEntityIds, String zuoraVersion, String zuoraOrgIds, PutAttachmentRequest request, final ApiCallback _callback) throws ApiException {
// verify the required parameter 'attachmentId' is set
if (attachmentId == null) {
throw new ApiException("Missing the required parameter 'attachmentId' when calling putAttachments(Async)");
}
return putAttachmentsCall(attachmentId, acceptEncoding, contentEncoding, authorization, zuoraTrackId, zuoraEntityIds, zuoraVersion, zuoraOrgIds, request, _callback);
}
/**
* Update an attachment
* Use the Edit Attachment REST request to make changes to the descriptive fields of an attachment, such as the description and the file name. You cannot change the actual content of the attached file in Zuora. If you need to change the actual content, you need to delete the attachment and add the updated file as a new attachment. You can only use this operation if you have a Billing role that includes the Manage Attachments permission. For more information, see [Billing roles](https://knowledgecenter.zuora.com/Billing/Tenant_Management/A_Administrator_Settings/User_Roles/d_Billing_Roles). To change your Billing role, contact your Zuora platform administrator.
* @param attachmentId Id of the attachment to be updated. (required)
* @param acceptEncoding Include the `Accept-Encoding: gzip` header to compress responses as a gzipped file. It can significantly reduce the bandwidth required for a response. If specified, Zuora automatically compresses responses that contain over 1000 bytes of data, and the response contains a `Content-Encoding` header with the compression algorithm so that your client can decompress it. (optional)
* @param contentEncoding Include the `Content-Encoding: gzip` header to compress a request. With this header specified, you should upload a gzipped file for the request payload instead of sending the JSON payload. (optional)
* @param authorization The value is in the `Bearer {token}` format where {token} is a valid OAuth token generated by calling [Create an OAuth token](https://www.zuora.com/developer/api-references/api/operation/createToken). (optional)
* @param zuoraTrackId A custom identifier for tracing the API call. If you set a value for this header, Zuora returns the same value in the response headers. This header enables you to associate your system process identifiers with Zuora API calls, to assist with troubleshooting in the event of an issue. The value of this field must use the US-ASCII character set and must not include any of the following characters: colon (`:`), semicolon (`;`), double quote (`\"`), and quote (`'`). (optional)
* @param zuoraEntityIds An entity ID. If you have [Zuora Multi-entity](https://knowledgecenter.zuora.com/BB_Introducing_Z_Business/Multi-entity) enabled and the OAuth token is valid for more than one entity, you must use this header to specify which entity to perform the operation in. If the OAuth token is only valid for a single entity, or you do not have Zuora Multi-entity enabled, you do not need to set this header. (optional)
* @param zuoraVersion The minor version of the Zuora REST API. (optional, default to 2024-05-20)
* @param zuoraOrgIds Comma separated IDs. If you have Zuora Multi-Org enabled, you can use this header to specify which orgs to perform the operation in. If you do not have Zuora Multi-Org enabled, you should not set this header. The IDs must be a sub-set of the user's accessible orgs. If you specify an org that the user does not have access to, the operation fails. If the header is not set, the operation is performed in scope of the user's accessible orgs. (optional)
* @param request (optional)
* @return CommonResponse
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
*/
protected CommonResponse putAttachments(String attachmentId, String acceptEncoding, String contentEncoding, String authorization, String zuoraTrackId, String zuoraEntityIds, String zuoraVersion, String zuoraOrgIds, PutAttachmentRequest request) throws ApiException {
ApiResponse localVarResp = putAttachmentsWithHttpInfo(attachmentId, acceptEncoding, contentEncoding, authorization, zuoraTrackId, zuoraEntityIds, zuoraVersion, zuoraOrgIds, request);
return localVarResp.getData();
}
private ApiResponse putAttachmentsWithHttpInfo(String attachmentId, String acceptEncoding, String contentEncoding, String authorization, String zuoraTrackId, String zuoraEntityIds, String zuoraVersion, String zuoraOrgIds, PutAttachmentRequest request) throws ApiException {
okhttp3.Call localVarCall = putAttachmentsValidateBeforeCall(attachmentId, acceptEncoding, contentEncoding, authorization, zuoraTrackId, zuoraEntityIds, zuoraVersion, zuoraOrgIds, request, null);
Type localVarReturnType = new TypeToken(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
}
private okhttp3.Call putAttachmentsAsync(String attachmentId, String acceptEncoding, String contentEncoding, String authorization, String zuoraTrackId, String zuoraEntityIds, String zuoraVersion, String zuoraOrgIds, PutAttachmentRequest request, final ApiCallback _callback) throws ApiException {
okhttp3.Call localVarCall = putAttachmentsValidateBeforeCall(attachmentId, acceptEncoding, contentEncoding, authorization, zuoraTrackId, zuoraEntityIds, zuoraVersion, zuoraOrgIds, request, _callback);
Type localVarReturnType = new TypeToken(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
public class PutAttachmentsApi {
private final String attachmentId;
private String acceptEncoding;
private String contentEncoding;
private String authorization;
private String zuoraTrackId;
private String zuoraEntityIds;
private String zuoraVersion;
private String zuoraOrgIds;
private PutAttachmentRequest request;
private PutAttachmentsApi(String attachmentId) {
this.attachmentId = attachmentId;
}
/**
* Set acceptEncoding
* @param acceptEncoding Include the `Accept-Encoding: gzip` header to compress responses as a gzipped file. It can significantly reduce the bandwidth required for a response. If specified, Zuora automatically compresses responses that contain over 1000 bytes of data, and the response contains a `Content-Encoding` header with the compression algorithm so that your client can decompress it. (optional)
* @return PutAttachmentsApi
*/
public PutAttachmentsApi acceptEncoding(String acceptEncoding) {
this.acceptEncoding = acceptEncoding;
return this;
}
/**
* Set contentEncoding
* @param contentEncoding Include the `Content-Encoding: gzip` header to compress a request. With this header specified, you should upload a gzipped file for the request payload instead of sending the JSON payload. (optional)
* @return PutAttachmentsApi
*/
public PutAttachmentsApi contentEncoding(String contentEncoding) {
this.contentEncoding = contentEncoding;
return this;
}
/**
* Set authorization
* @param authorization The value is in the `Bearer {token}` format where {token} is a valid OAuth token generated by calling [Create an OAuth token](https://www.zuora.com/developer/api-references/api/operation/createToken). (optional)
* @return PutAttachmentsApi
*/
public PutAttachmentsApi authorization(String authorization) {
this.authorization = authorization;
return this;
}
/**
* Set zuoraTrackId
* @param zuoraTrackId A custom identifier for tracing the API call. If you set a value for this header, Zuora returns the same value in the response headers. This header enables you to associate your system process identifiers with Zuora API calls, to assist with troubleshooting in the event of an issue. The value of this field must use the US-ASCII character set and must not include any of the following characters: colon (`:`), semicolon (`;`), double quote (`\"`), and quote (`'`). (optional)
* @return PutAttachmentsApi
*/
public PutAttachmentsApi zuoraTrackId(String zuoraTrackId) {
this.zuoraTrackId = zuoraTrackId;
return this;
}
/**
* Set zuoraEntityIds
* @param zuoraEntityIds An entity ID. If you have [Zuora Multi-entity](https://knowledgecenter.zuora.com/BB_Introducing_Z_Business/Multi-entity) enabled and the OAuth token is valid for more than one entity, you must use this header to specify which entity to perform the operation in. If the OAuth token is only valid for a single entity, or you do not have Zuora Multi-entity enabled, you do not need to set this header. (optional)
* @return PutAttachmentsApi
*/
public PutAttachmentsApi zuoraEntityIds(String zuoraEntityIds) {
this.zuoraEntityIds = zuoraEntityIds;
return this;
}
/**
* Set zuoraVersion
* @param zuoraVersion The minor version of the Zuora REST API. (optional, default to 2024-05-20)
* @return PutAttachmentsApi
*/
public PutAttachmentsApi zuoraVersion(String zuoraVersion) {
this.zuoraVersion = zuoraVersion;
return this;
}
/**
* Set zuoraOrgIds
* @param zuoraOrgIds Comma separated IDs. If you have Zuora Multi-Org enabled, you can use this header to specify which orgs to perform the operation in. If you do not have Zuora Multi-Org enabled, you should not set this header. The IDs must be a sub-set of the user's accessible orgs. If you specify an org that the user does not have access to, the operation fails. If the header is not set, the operation is performed in scope of the user's accessible orgs. (optional)
* @return PutAttachmentsApi
*/
public PutAttachmentsApi zuoraOrgIds(String zuoraOrgIds) {
this.zuoraOrgIds = zuoraOrgIds;
return this;
}
/**
* Set request
* @param request (optional)
* @return PutAttachmentsApi
*/
public PutAttachmentsApi request(PutAttachmentRequest request) {
this.request = request;
return this;
}
/**
* Build call for putAttachments
* @param _callback ApiCallback API callback
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
* @http.response.details
*/
public CommonResponse execute() throws ApiException {
ApiResponse localVarResp = putAttachmentsWithHttpInfo(attachmentId, acceptEncoding, contentEncoding, authorization, zuoraTrackId, zuoraEntityIds, zuoraVersion, zuoraOrgIds, request);
return localVarResp.getData();
}
/**
* Execute putAttachments request with HTTP info returned
* @return ApiResponse<CommonResponse>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
*/
private ApiResponse executeWithHttpInfo() throws ApiException {
return putAttachmentsWithHttpInfo(attachmentId, acceptEncoding, contentEncoding, authorization, zuoraTrackId, zuoraEntityIds, zuoraVersion, zuoraOrgIds, request);
}
/**
* Execute putAttachments request (asynchronously)
* @param _callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
* @http.response.details
*/
public okhttp3.Call executeAsync(final ApiCallback _callback) throws ApiException {
return putAttachmentsAsync(attachmentId, acceptEncoding, contentEncoding, authorization, zuoraTrackId, zuoraEntityIds, zuoraVersion, zuoraOrgIds, request, _callback);
}
}
/**
* Update an attachment
* Use the Edit Attachment REST request to make changes to the descriptive fields of an attachment, such as the description and the file name. You cannot change the actual content of the attached file in Zuora. If you need to change the actual content, you need to delete the attachment and add the updated file as a new attachment. You can only use this operation if you have a Billing role that includes the Manage Attachments permission. For more information, see [Billing roles](https://knowledgecenter.zuora.com/Billing/Tenant_Management/A_Administrator_Settings/User_Roles/d_Billing_Roles). To change your Billing role, contact your Zuora platform administrator.
* @param attachmentId Id of the attachment to be updated. (required)
* @return PutAttachmentsApi
*/
public PutAttachmentsApi putAttachmentsApi(String attachmentId) {
return new PutAttachmentsApi(attachmentId);
}
}