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.CustomObjectDefinition;
import com.zuora.model.GetAllCustomObjectDefinitionsInNamespaceResponse;
import com.zuora.model.MigrationUpdateCustomObjectDefinitionsRequest;
import com.zuora.model.MigrationUpdateCustomObjectDefinitionsResponse;
import com.zuora.model.PostCustomObjectDefinitionsRequest;
import com.zuora.model.ProxyUnauthorizedResponse;
import java.net.URI;
import java.lang.reflect.Type;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
public class CustomObjectDefinitionsApi {
private ApiClient localVarApiClient;
private int localHostIndex;
private String localCustomBaseUrl;
public CustomObjectDefinitionsApi() {
this(Configuration.getDefaultApiClient());
}
public CustomObjectDefinitionsApi(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 deleteCustomObjectDefinitionByTypeCall(String _object, String acceptEncoding, String contentEncoding, String zuoraTrackId, String zuoraEntityIds, String authorization, 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 = "/objects/definitions/default/{object}"
.replace("{" + "object" + "}", localVarApiClient.escapeString(_object.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 (zuoraTrackId != null) {
localVarHeaderParams.put("Zuora-Track-Id", localVarApiClient.parameterToString(zuoraTrackId));
}
if (zuoraEntityIds != null) {
localVarHeaderParams.put("Zuora-Entity-Ids", localVarApiClient.parameterToString(zuoraEntityIds));
}
if (authorization != null) {
localVarHeaderParams.put("Authorization", localVarApiClient.parameterToString(authorization));
}
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 deleteCustomObjectDefinitionByTypeValidateBeforeCall(String _object, String acceptEncoding, String contentEncoding, String zuoraTrackId, String zuoraEntityIds, String authorization, String zuoraVersion, String zuoraOrgIds, final ApiCallback _callback) throws ApiException {
// verify the required parameter '_object' is set
if (_object == null) {
throw new ApiException("Missing the required parameter '_object' when calling deleteCustomObjectDefinitionByType(Async)");
}
return deleteCustomObjectDefinitionByTypeCall(_object, acceptEncoding, contentEncoding, zuoraTrackId, zuoraEntityIds, authorization, zuoraVersion, zuoraOrgIds, _callback);
}
/**
* Delete a custom object definition
* Deletes the custom object definition for the provided type. **Note:** A custom object definition can only be deleted if no record of this custom object type exists.
* @param _object Specifies the custom object's API name as object. It is case-sensitive. (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 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 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 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 URI
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
*/
protected URI deleteCustomObjectDefinitionByType(String _object, String acceptEncoding, String contentEncoding, String zuoraTrackId, String zuoraEntityIds, String authorization, String zuoraVersion, String zuoraOrgIds) throws ApiException {
ApiResponse localVarResp = deleteCustomObjectDefinitionByTypeWithHttpInfo(_object, acceptEncoding, contentEncoding, zuoraTrackId, zuoraEntityIds, authorization, zuoraVersion, zuoraOrgIds);
return localVarResp.getData();
}
private ApiResponse deleteCustomObjectDefinitionByTypeWithHttpInfo(String _object, String acceptEncoding, String contentEncoding, String zuoraTrackId, String zuoraEntityIds, String authorization, String zuoraVersion, String zuoraOrgIds) throws ApiException {
okhttp3.Call localVarCall = deleteCustomObjectDefinitionByTypeValidateBeforeCall(_object, acceptEncoding, contentEncoding, zuoraTrackId, zuoraEntityIds, authorization, zuoraVersion, zuoraOrgIds, null);
Type localVarReturnType = new TypeToken(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
}
private okhttp3.Call deleteCustomObjectDefinitionByTypeAsync(String _object, String acceptEncoding, String contentEncoding, String zuoraTrackId, String zuoraEntityIds, String authorization, String zuoraVersion, String zuoraOrgIds, final ApiCallback _callback) throws ApiException {
okhttp3.Call localVarCall = deleteCustomObjectDefinitionByTypeValidateBeforeCall(_object, acceptEncoding, contentEncoding, zuoraTrackId, zuoraEntityIds, authorization, zuoraVersion, zuoraOrgIds, _callback);
Type localVarReturnType = new TypeToken(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
public class DeleteCustomObjectDefinitionByTypeApi {
private final String _object;
private String acceptEncoding;
private String contentEncoding;
private String zuoraTrackId;
private String zuoraEntityIds;
private String authorization;
private String zuoraVersion;
private String zuoraOrgIds;
private DeleteCustomObjectDefinitionByTypeApi(String _object) {
this._object = _object;
}
/**
* 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 DeleteCustomObjectDefinitionByTypeApi
*/
public DeleteCustomObjectDefinitionByTypeApi 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 DeleteCustomObjectDefinitionByTypeApi
*/
public DeleteCustomObjectDefinitionByTypeApi contentEncoding(String contentEncoding) {
this.contentEncoding = contentEncoding;
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 DeleteCustomObjectDefinitionByTypeApi
*/
public DeleteCustomObjectDefinitionByTypeApi 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 DeleteCustomObjectDefinitionByTypeApi
*/
public DeleteCustomObjectDefinitionByTypeApi zuoraEntityIds(String zuoraEntityIds) {
this.zuoraEntityIds = zuoraEntityIds;
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 DeleteCustomObjectDefinitionByTypeApi
*/
public DeleteCustomObjectDefinitionByTypeApi authorization(String authorization) {
this.authorization = authorization;
return this;
}
/**
* Set zuoraVersion
* @param zuoraVersion The minor version of the Zuora REST API. (optional, default to 2024-05-20)
* @return DeleteCustomObjectDefinitionByTypeApi
*/
public DeleteCustomObjectDefinitionByTypeApi 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 DeleteCustomObjectDefinitionByTypeApi
*/
public DeleteCustomObjectDefinitionByTypeApi zuoraOrgIds(String zuoraOrgIds) {
this.zuoraOrgIds = zuoraOrgIds;
return this;
}
/**
* Build call for deleteCustomObjectDefinitionByType
* @param _callback ApiCallback API callback
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
* @http.response.details
*/
public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException {
return deleteCustomObjectDefinitionByTypeCall(_object, acceptEncoding, contentEncoding, zuoraTrackId, zuoraEntityIds, authorization, zuoraVersion, zuoraOrgIds, _callback);
}
/**
* Execute deleteCustomObjectDefinitionByType request
* @return URI
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
*/
public URI execute() throws ApiException {
ApiResponse localVarResp = deleteCustomObjectDefinitionByTypeWithHttpInfo(_object, acceptEncoding, contentEncoding, zuoraTrackId, zuoraEntityIds, authorization, zuoraVersion, zuoraOrgIds);
return localVarResp.getData();
}
/**
* Execute deleteCustomObjectDefinitionByType request with HTTP info returned
* @return ApiResponse<URI>
* @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 deleteCustomObjectDefinitionByTypeWithHttpInfo(_object, acceptEncoding, contentEncoding, zuoraTrackId, zuoraEntityIds, authorization, zuoraVersion, zuoraOrgIds);
}
/**
* Execute deleteCustomObjectDefinitionByType 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 deleteCustomObjectDefinitionByTypeAsync(_object, acceptEncoding, contentEncoding, zuoraTrackId, zuoraEntityIds, authorization, zuoraVersion, zuoraOrgIds, _callback);
}
}
/**
* Delete a custom object definition
* Deletes the custom object definition for the provided type. **Note:** A custom object definition can only be deleted if no record of this custom object type exists.
* @param _object Specifies the custom object's API name as object. It is case-sensitive. (required)
* @return DeleteCustomObjectDefinitionByTypeApi
*/
public DeleteCustomObjectDefinitionByTypeApi deleteCustomObjectDefinitionByTypeApi(String _object) {
return new DeleteCustomObjectDefinitionByTypeApi(_object);
}
private okhttp3.Call getAllCustomObjectDefinitionsInNamespaceCall(String acceptEncoding, String contentEncoding, String zuoraTrackId, String zuoraEntityIds, String authorization, String zuoraVersion, String select, 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 = "/objects/definitions/default";
List localVarQueryParams = new ArrayList();
List localVarCollectionQueryParams = new ArrayList();
Map localVarHeaderParams = new HashMap();
Map localVarCookieParams = new HashMap();
Map localVarFormParams = new HashMap();
if (select != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("select", select));
}
if (acceptEncoding != null) {
localVarHeaderParams.put("Accept-Encoding", localVarApiClient.parameterToString(acceptEncoding));
}
if (contentEncoding != null) {
localVarHeaderParams.put("Content-Encoding", localVarApiClient.parameterToString(contentEncoding));
}
if (zuoraTrackId != null) {
localVarHeaderParams.put("Zuora-Track-Id", localVarApiClient.parameterToString(zuoraTrackId));
}
if (zuoraEntityIds != null) {
localVarHeaderParams.put("Zuora-Entity-Ids", localVarApiClient.parameterToString(zuoraEntityIds));
}
if (authorization != null) {
localVarHeaderParams.put("Authorization", localVarApiClient.parameterToString(authorization));
}
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 getAllCustomObjectDefinitionsInNamespaceValidateBeforeCall(String acceptEncoding, String contentEncoding, String zuoraTrackId, String zuoraEntityIds, String authorization, String zuoraVersion, String select, String zuoraOrgIds, final ApiCallback _callback) throws ApiException {
return getAllCustomObjectDefinitionsInNamespaceCall(acceptEncoding, contentEncoding, zuoraTrackId, zuoraEntityIds, authorization, zuoraVersion, select, zuoraOrgIds, _callback);
}
/**
* List custom object definitions
* Get all custom objects definitions for a given tenant. If you want to copy all the existing custom objects from an old tenant to a new tenant, you can call this operation in your old tenant and then use its response directly as the request of the [Create custom object definitions](https://www.zuora.com/developer/api-references/api/operation/Post_CustomObjectDefinitions) call in the new tenant to import all the custom objects from the old tenant.
* @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 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 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 zuoraVersion The minor version of the Zuora REST API. (optional, default to 2024-05-20)
* @param select If you set `select` to `type`, the response will only contain the `type` of each custom object. (optional)
* @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 GetAllCustomObjectDefinitionsInNamespaceResponse
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
*/
protected GetAllCustomObjectDefinitionsInNamespaceResponse getAllCustomObjectDefinitionsInNamespace(String acceptEncoding, String contentEncoding, String zuoraTrackId, String zuoraEntityIds, String authorization, String zuoraVersion, String select, String zuoraOrgIds) throws ApiException {
ApiResponse localVarResp = getAllCustomObjectDefinitionsInNamespaceWithHttpInfo(acceptEncoding, contentEncoding, zuoraTrackId, zuoraEntityIds, authorization, zuoraVersion, select, zuoraOrgIds);
return localVarResp.getData();
}
private ApiResponse getAllCustomObjectDefinitionsInNamespaceWithHttpInfo(String acceptEncoding, String contentEncoding, String zuoraTrackId, String zuoraEntityIds, String authorization, String zuoraVersion, String select, String zuoraOrgIds) throws ApiException {
okhttp3.Call localVarCall = getAllCustomObjectDefinitionsInNamespaceValidateBeforeCall(acceptEncoding, contentEncoding, zuoraTrackId, zuoraEntityIds, authorization, zuoraVersion, select, zuoraOrgIds, null);
Type localVarReturnType = new TypeToken(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
}
private okhttp3.Call getAllCustomObjectDefinitionsInNamespaceAsync(String acceptEncoding, String contentEncoding, String zuoraTrackId, String zuoraEntityIds, String authorization, String zuoraVersion, String select, String zuoraOrgIds, final ApiCallback _callback) throws ApiException {
okhttp3.Call localVarCall = getAllCustomObjectDefinitionsInNamespaceValidateBeforeCall(acceptEncoding, contentEncoding, zuoraTrackId, zuoraEntityIds, authorization, zuoraVersion, select, zuoraOrgIds, _callback);
Type localVarReturnType = new TypeToken(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
public class GetAllCustomObjectDefinitionsInNamespaceApi {
private String acceptEncoding;
private String contentEncoding;
private String zuoraTrackId;
private String zuoraEntityIds;
private String authorization;
private String zuoraVersion;
private String select;
private String zuoraOrgIds;
private GetAllCustomObjectDefinitionsInNamespaceApi() {
}
/**
* 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 GetAllCustomObjectDefinitionsInNamespaceApi
*/
public GetAllCustomObjectDefinitionsInNamespaceApi 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 GetAllCustomObjectDefinitionsInNamespaceApi
*/
public GetAllCustomObjectDefinitionsInNamespaceApi contentEncoding(String contentEncoding) {
this.contentEncoding = contentEncoding;
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 GetAllCustomObjectDefinitionsInNamespaceApi
*/
public GetAllCustomObjectDefinitionsInNamespaceApi 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 GetAllCustomObjectDefinitionsInNamespaceApi
*/
public GetAllCustomObjectDefinitionsInNamespaceApi zuoraEntityIds(String zuoraEntityIds) {
this.zuoraEntityIds = zuoraEntityIds;
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 GetAllCustomObjectDefinitionsInNamespaceApi
*/
public GetAllCustomObjectDefinitionsInNamespaceApi authorization(String authorization) {
this.authorization = authorization;
return this;
}
/**
* Set zuoraVersion
* @param zuoraVersion The minor version of the Zuora REST API. (optional, default to 2024-05-20)
* @return GetAllCustomObjectDefinitionsInNamespaceApi
*/
public GetAllCustomObjectDefinitionsInNamespaceApi zuoraVersion(String zuoraVersion) {
this.zuoraVersion = zuoraVersion;
return this;
}
/**
* Set select
* @param select If you set `select` to `type`, the response will only contain the `type` of each custom object. (optional)
* @return GetAllCustomObjectDefinitionsInNamespaceApi
*/
public GetAllCustomObjectDefinitionsInNamespaceApi select(String select) {
this.select = select;
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 GetAllCustomObjectDefinitionsInNamespaceApi
*/
public GetAllCustomObjectDefinitionsInNamespaceApi zuoraOrgIds(String zuoraOrgIds) {
this.zuoraOrgIds = zuoraOrgIds;
return this;
}
/**
* Build call for getAllCustomObjectDefinitionsInNamespace
* @param _callback ApiCallback API callback
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
* @http.response.details
*/
public GetAllCustomObjectDefinitionsInNamespaceResponse execute() throws ApiException {
ApiResponse localVarResp = getAllCustomObjectDefinitionsInNamespaceWithHttpInfo(acceptEncoding, contentEncoding, zuoraTrackId, zuoraEntityIds, authorization, zuoraVersion, select, zuoraOrgIds);
return localVarResp.getData();
}
/**
* Execute getAllCustomObjectDefinitionsInNamespace request with HTTP info returned
* @return ApiResponse<GetAllCustomObjectDefinitionsInNamespaceResponse>
* @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 getAllCustomObjectDefinitionsInNamespaceWithHttpInfo(acceptEncoding, contentEncoding, zuoraTrackId, zuoraEntityIds, authorization, zuoraVersion, select, zuoraOrgIds);
}
/**
* Execute getAllCustomObjectDefinitionsInNamespace 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 getAllCustomObjectDefinitionsInNamespaceAsync(acceptEncoding, contentEncoding, zuoraTrackId, zuoraEntityIds, authorization, zuoraVersion, select, zuoraOrgIds, _callback);
}
}
/**
* List custom object definitions
* Get all custom objects definitions for a given tenant. If you want to copy all the existing custom objects from an old tenant to a new tenant, you can call this operation in your old tenant and then use its response directly as the request of the [Create custom object definitions](https://www.zuora.com/developer/api-references/api/operation/Post_CustomObjectDefinitions) call in the new tenant to import all the custom objects from the old tenant.
* @return GetAllCustomObjectDefinitionsInNamespaceApi
*/
public GetAllCustomObjectDefinitionsInNamespaceApi getAllCustomObjectDefinitionsInNamespaceApi() {
return new GetAllCustomObjectDefinitionsInNamespaceApi();
}
private okhttp3.Call getCustomObjectDefinitionByTypeCall(String _object, String acceptEncoding, String contentEncoding, String zuoraTrackId, String zuoraEntityIds, String authorization, 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 = "/objects/definitions/default/{object}"
.replace("{" + "object" + "}", localVarApiClient.escapeString(_object.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 (zuoraTrackId != null) {
localVarHeaderParams.put("Zuora-Track-Id", localVarApiClient.parameterToString(zuoraTrackId));
}
if (zuoraEntityIds != null) {
localVarHeaderParams.put("Zuora-Entity-Ids", localVarApiClient.parameterToString(zuoraEntityIds));
}
if (authorization != null) {
localVarHeaderParams.put("Authorization", localVarApiClient.parameterToString(authorization));
}
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 getCustomObjectDefinitionByTypeValidateBeforeCall(String _object, String acceptEncoding, String contentEncoding, String zuoraTrackId, String zuoraEntityIds, String authorization, String zuoraVersion, String zuoraOrgIds, final ApiCallback _callback) throws ApiException {
// verify the required parameter '_object' is set
if (_object == null) {
throw new ApiException("Missing the required parameter '_object' when calling getCustomObjectDefinitionByType(Async)");
}
return getCustomObjectDefinitionByTypeCall(_object, acceptEncoding, contentEncoding, zuoraTrackId, zuoraEntityIds, authorization, zuoraVersion, zuoraOrgIds, _callback);
}
/**
* Retrieve a custom object definition
* Retrieves the custom object definition by type for the given tenant.
* @param _object Specifies the custom object's API name as object. It is case-sensitive. (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 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 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 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 CustomObjectDefinition
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
*/
protected CustomObjectDefinition getCustomObjectDefinitionByType(String _object, String acceptEncoding, String contentEncoding, String zuoraTrackId, String zuoraEntityIds, String authorization, String zuoraVersion, String zuoraOrgIds) throws ApiException {
ApiResponse localVarResp = getCustomObjectDefinitionByTypeWithHttpInfo(_object, acceptEncoding, contentEncoding, zuoraTrackId, zuoraEntityIds, authorization, zuoraVersion, zuoraOrgIds);
return localVarResp.getData();
}
private ApiResponse getCustomObjectDefinitionByTypeWithHttpInfo(String _object, String acceptEncoding, String contentEncoding, String zuoraTrackId, String zuoraEntityIds, String authorization, String zuoraVersion, String zuoraOrgIds) throws ApiException {
okhttp3.Call localVarCall = getCustomObjectDefinitionByTypeValidateBeforeCall(_object, acceptEncoding, contentEncoding, zuoraTrackId, zuoraEntityIds, authorization, zuoraVersion, zuoraOrgIds, null);
Type localVarReturnType = new TypeToken(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
}
private okhttp3.Call getCustomObjectDefinitionByTypeAsync(String _object, String acceptEncoding, String contentEncoding, String zuoraTrackId, String zuoraEntityIds, String authorization, String zuoraVersion, String zuoraOrgIds, final ApiCallback _callback) throws ApiException {
okhttp3.Call localVarCall = getCustomObjectDefinitionByTypeValidateBeforeCall(_object, acceptEncoding, contentEncoding, zuoraTrackId, zuoraEntityIds, authorization, zuoraVersion, zuoraOrgIds, _callback);
Type localVarReturnType = new TypeToken(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
public class GetCustomObjectDefinitionByTypeApi {
private final String _object;
private String acceptEncoding;
private String contentEncoding;
private String zuoraTrackId;
private String zuoraEntityIds;
private String authorization;
private String zuoraVersion;
private String zuoraOrgIds;
private GetCustomObjectDefinitionByTypeApi(String _object) {
this._object = _object;
}
/**
* 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 GetCustomObjectDefinitionByTypeApi
*/
public GetCustomObjectDefinitionByTypeApi 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 GetCustomObjectDefinitionByTypeApi
*/
public GetCustomObjectDefinitionByTypeApi contentEncoding(String contentEncoding) {
this.contentEncoding = contentEncoding;
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 GetCustomObjectDefinitionByTypeApi
*/
public GetCustomObjectDefinitionByTypeApi 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 GetCustomObjectDefinitionByTypeApi
*/
public GetCustomObjectDefinitionByTypeApi zuoraEntityIds(String zuoraEntityIds) {
this.zuoraEntityIds = zuoraEntityIds;
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 GetCustomObjectDefinitionByTypeApi
*/
public GetCustomObjectDefinitionByTypeApi authorization(String authorization) {
this.authorization = authorization;
return this;
}
/**
* Set zuoraVersion
* @param zuoraVersion The minor version of the Zuora REST API. (optional, default to 2024-05-20)
* @return GetCustomObjectDefinitionByTypeApi
*/
public GetCustomObjectDefinitionByTypeApi 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 GetCustomObjectDefinitionByTypeApi
*/
public GetCustomObjectDefinitionByTypeApi zuoraOrgIds(String zuoraOrgIds) {
this.zuoraOrgIds = zuoraOrgIds;
return this;
}
/**
* Build call for getCustomObjectDefinitionByType
* @param _callback ApiCallback API callback
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
* @http.response.details
*/
public CustomObjectDefinition execute() throws ApiException {
ApiResponse localVarResp = getCustomObjectDefinitionByTypeWithHttpInfo(_object, acceptEncoding, contentEncoding, zuoraTrackId, zuoraEntityIds, authorization, zuoraVersion, zuoraOrgIds);
return localVarResp.getData();
}
/**
* Execute getCustomObjectDefinitionByType request with HTTP info returned
* @return ApiResponse<CustomObjectDefinition>
* @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 getCustomObjectDefinitionByTypeWithHttpInfo(_object, acceptEncoding, contentEncoding, zuoraTrackId, zuoraEntityIds, authorization, zuoraVersion, zuoraOrgIds);
}
/**
* Execute getCustomObjectDefinitionByType 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 getCustomObjectDefinitionByTypeAsync(_object, acceptEncoding, contentEncoding, zuoraTrackId, zuoraEntityIds, authorization, zuoraVersion, zuoraOrgIds, _callback);
}
}
/**
* Retrieve a custom object definition
* Retrieves the custom object definition by type for the given tenant.
* @param _object Specifies the custom object's API name as object. It is case-sensitive. (required)
* @return GetCustomObjectDefinitionByTypeApi
*/
public GetCustomObjectDefinitionByTypeApi getCustomObjectDefinitionByTypeApi(String _object) {
return new GetCustomObjectDefinitionByTypeApi(_object);
}
private okhttp3.Call postCustomObjectDefinitionsCall(PostCustomObjectDefinitionsRequest customObjectDefinitions, String idempotencyKey, String acceptEncoding, String contentEncoding, String zuoraTrackId, String zuoraEntityIds, String authorization, 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 = customObjectDefinitions;
// create path and map variables
String localVarPath = "/objects/definitions/default";
List localVarQueryParams = new ArrayList();
List localVarCollectionQueryParams = new ArrayList();
Map localVarHeaderParams = new HashMap();
Map localVarCookieParams = new HashMap();
Map localVarFormParams = new HashMap();
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 (zuoraTrackId != null) {
localVarHeaderParams.put("Zuora-Track-Id", localVarApiClient.parameterToString(zuoraTrackId));
}
if (zuoraEntityIds != null) {
localVarHeaderParams.put("Zuora-Entity-Ids", localVarApiClient.parameterToString(zuoraEntityIds));
}
if (authorization != null) {
localVarHeaderParams.put("Authorization", localVarApiClient.parameterToString(authorization));
}
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, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call postCustomObjectDefinitionsValidateBeforeCall(PostCustomObjectDefinitionsRequest customObjectDefinitions, String idempotencyKey, String acceptEncoding, String contentEncoding, String zuoraTrackId, String zuoraEntityIds, String authorization, String zuoraVersion, String zuoraOrgIds, final ApiCallback _callback) throws ApiException {
// verify the required parameter 'customObjectDefinitions' is set
if (customObjectDefinitions == null) {
throw new ApiException("Missing the required parameter 'customObjectDefinitions' when calling postCustomObjectDefinitions(Async)");
}
return postCustomObjectDefinitionsCall(customObjectDefinitions, idempotencyKey, acceptEncoding, contentEncoding, zuoraTrackId, zuoraEntityIds, authorization, zuoraVersion, zuoraOrgIds, _callback);
}
/**
* Create custom object definitions
* You can post custom object definitions with the request body schema described below. This operation also allows you to use the [List custom object definitions](https://www.zuora.com/developer/api-references/api/operation/Get_AllCustomObjectDefinitionsInNamespace) response schema as its request schema. If you want to copy all the existing custom objects from an old tenant to a new tenant, you can make a [List custom object definitions](https://www.zuora.com/developer/api-references/api/operation/Get_AllCustomObjectDefinitionsInNamespace) call in your old tenant and then use its response directly as the request of this operation in the new tenant to import all the custom objects from the old tenant. The `label` field is the UI label of the custom object. The `object` field contains the API Name of the custom object. ### Limitations This custom object definition has the following limitations: * The maximum number of characters for the Custom Object API Name (`object`) is 64. * The maximum number of characters for the Custom Object Label (`label`) is 64. * The maximum number of characters for the Custom Object Description 250. * The maximum number of custom fields in an custom object is 50. * The maximum number of characters for the custom field API name is 64. * The maximum number of characters for the custom field label (`label`) is 64. * The maximum number of characters for the custom field Description is 250. * The maximum number of picklist or multiselect options is 250. * The default maximum number of characters for the Text field is 512. You can configure the max length up to 8,192 characters when creating or updating the custom object definition via API. However, if the Text field is filterable, the max length must be 512 or less. * The maximum number of digits to the left of the decimal point for the Number field is 13, and to the right is 9.
* @param customObjectDefinitions The custom object definitions to be created (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 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 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 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 GetAllCustomObjectDefinitionsInNamespaceResponse
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
*/
protected GetAllCustomObjectDefinitionsInNamespaceResponse postCustomObjectDefinitions(PostCustomObjectDefinitionsRequest customObjectDefinitions, String idempotencyKey, String acceptEncoding, String contentEncoding, String zuoraTrackId, String zuoraEntityIds, String authorization, String zuoraVersion, String zuoraOrgIds) throws ApiException {
ApiResponse localVarResp = postCustomObjectDefinitionsWithHttpInfo(customObjectDefinitions, idempotencyKey, acceptEncoding, contentEncoding, zuoraTrackId, zuoraEntityIds, authorization, zuoraVersion, zuoraOrgIds);
return localVarResp.getData();
}
private ApiResponse postCustomObjectDefinitionsWithHttpInfo(PostCustomObjectDefinitionsRequest customObjectDefinitions, String idempotencyKey, String acceptEncoding, String contentEncoding, String zuoraTrackId, String zuoraEntityIds, String authorization, String zuoraVersion, String zuoraOrgIds) throws ApiException {
okhttp3.Call localVarCall = postCustomObjectDefinitionsValidateBeforeCall(customObjectDefinitions, idempotencyKey, acceptEncoding, contentEncoding, zuoraTrackId, zuoraEntityIds, authorization, zuoraVersion, zuoraOrgIds, null);
Type localVarReturnType = new TypeToken(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
}
private okhttp3.Call postCustomObjectDefinitionsAsync(PostCustomObjectDefinitionsRequest customObjectDefinitions, String idempotencyKey, String acceptEncoding, String contentEncoding, String zuoraTrackId, String zuoraEntityIds, String authorization, String zuoraVersion, String zuoraOrgIds, final ApiCallback _callback) throws ApiException {
okhttp3.Call localVarCall = postCustomObjectDefinitionsValidateBeforeCall(customObjectDefinitions, idempotencyKey, acceptEncoding, contentEncoding, zuoraTrackId, zuoraEntityIds, authorization, zuoraVersion, zuoraOrgIds, _callback);
Type localVarReturnType = new TypeToken(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
public class PostCustomObjectDefinitionsApi {
private final PostCustomObjectDefinitionsRequest customObjectDefinitions;
private String idempotencyKey;
private String acceptEncoding;
private String contentEncoding;
private String zuoraTrackId;
private String zuoraEntityIds;
private String authorization;
private String zuoraVersion;
private String zuoraOrgIds;
private PostCustomObjectDefinitionsApi(PostCustomObjectDefinitionsRequest customObjectDefinitions) {
this.customObjectDefinitions = customObjectDefinitions;
}
/**
* 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 PostCustomObjectDefinitionsApi
*/
public PostCustomObjectDefinitionsApi 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 PostCustomObjectDefinitionsApi
*/
public PostCustomObjectDefinitionsApi 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 PostCustomObjectDefinitionsApi
*/
public PostCustomObjectDefinitionsApi contentEncoding(String contentEncoding) {
this.contentEncoding = contentEncoding;
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 PostCustomObjectDefinitionsApi
*/
public PostCustomObjectDefinitionsApi 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 PostCustomObjectDefinitionsApi
*/
public PostCustomObjectDefinitionsApi zuoraEntityIds(String zuoraEntityIds) {
this.zuoraEntityIds = zuoraEntityIds;
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 PostCustomObjectDefinitionsApi
*/
public PostCustomObjectDefinitionsApi authorization(String authorization) {
this.authorization = authorization;
return this;
}
/**
* Set zuoraVersion
* @param zuoraVersion The minor version of the Zuora REST API. (optional, default to 2024-05-20)
* @return PostCustomObjectDefinitionsApi
*/
public PostCustomObjectDefinitionsApi 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 PostCustomObjectDefinitionsApi
*/
public PostCustomObjectDefinitionsApi zuoraOrgIds(String zuoraOrgIds) {
this.zuoraOrgIds = zuoraOrgIds;
return this;
}
/**
* Build call for postCustomObjectDefinitions
* @param _callback ApiCallback API callback
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
* @http.response.details
*/
public GetAllCustomObjectDefinitionsInNamespaceResponse execute() throws ApiException {
ApiResponse localVarResp = postCustomObjectDefinitionsWithHttpInfo(customObjectDefinitions, idempotencyKey, acceptEncoding, contentEncoding, zuoraTrackId, zuoraEntityIds, authorization, zuoraVersion, zuoraOrgIds);
return localVarResp.getData();
}
/**
* Execute postCustomObjectDefinitions request with HTTP info returned
* @return ApiResponse<GetAllCustomObjectDefinitionsInNamespaceResponse>
* @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 postCustomObjectDefinitionsWithHttpInfo(customObjectDefinitions, idempotencyKey, acceptEncoding, contentEncoding, zuoraTrackId, zuoraEntityIds, authorization, zuoraVersion, zuoraOrgIds);
}
/**
* Execute postCustomObjectDefinitions 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 postCustomObjectDefinitionsAsync(customObjectDefinitions, idempotencyKey, acceptEncoding, contentEncoding, zuoraTrackId, zuoraEntityIds, authorization, zuoraVersion, zuoraOrgIds, _callback);
}
}
/**
* Create custom object definitions
* You can post custom object definitions with the request body schema described below. This operation also allows you to use the [List custom object definitions](https://www.zuora.com/developer/api-references/api/operation/Get_AllCustomObjectDefinitionsInNamespace) response schema as its request schema. If you want to copy all the existing custom objects from an old tenant to a new tenant, you can make a [List custom object definitions](https://www.zuora.com/developer/api-references/api/operation/Get_AllCustomObjectDefinitionsInNamespace) call in your old tenant and then use its response directly as the request of this operation in the new tenant to import all the custom objects from the old tenant. The `label` field is the UI label of the custom object. The `object` field contains the API Name of the custom object. ### Limitations This custom object definition has the following limitations: * The maximum number of characters for the Custom Object API Name (`object`) is 64. * The maximum number of characters for the Custom Object Label (`label`) is 64. * The maximum number of characters for the Custom Object Description 250. * The maximum number of custom fields in an custom object is 50. * The maximum number of characters for the custom field API name is 64. * The maximum number of characters for the custom field label (`label`) is 64. * The maximum number of characters for the custom field Description is 250. * The maximum number of picklist or multiselect options is 250. * The default maximum number of characters for the Text field is 512. You can configure the max length up to 8,192 characters when creating or updating the custom object definition via API. However, if the Text field is filterable, the max length must be 512 or less. * The maximum number of digits to the left of the decimal point for the Number field is 13, and to the right is 9.
* @param customObjectDefinitions The custom object definitions to be created (required)
* @return PostCustomObjectDefinitionsApi
*/
public PostCustomObjectDefinitionsApi postCustomObjectDefinitionsApi(PostCustomObjectDefinitionsRequest customObjectDefinitions) {
return new PostCustomObjectDefinitionsApi(customObjectDefinitions);
}
private okhttp3.Call postUpdateCustomObjectDefinitionCall(MigrationUpdateCustomObjectDefinitionsRequest migration, String idempotencyKey, String acceptEncoding, String contentEncoding, String zuoraTrackId, String zuoraEntityIds, String authorization, 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 = migration;
// create path and map variables
String localVarPath = "/objects/migrations";
List localVarQueryParams = new ArrayList();
List localVarCollectionQueryParams = new ArrayList();
Map localVarHeaderParams = new HashMap();
Map localVarCookieParams = new HashMap();
Map localVarFormParams = new HashMap();
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 (zuoraTrackId != null) {
localVarHeaderParams.put("Zuora-Track-Id", localVarApiClient.parameterToString(zuoraTrackId));
}
if (zuoraEntityIds != null) {
localVarHeaderParams.put("Zuora-Entity-Ids", localVarApiClient.parameterToString(zuoraEntityIds));
}
if (authorization != null) {
localVarHeaderParams.put("Authorization", localVarApiClient.parameterToString(authorization));
}
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, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call postUpdateCustomObjectDefinitionValidateBeforeCall(MigrationUpdateCustomObjectDefinitionsRequest migration, String idempotencyKey, String acceptEncoding, String contentEncoding, String zuoraTrackId, String zuoraEntityIds, String authorization, String zuoraVersion, String zuoraOrgIds, final ApiCallback _callback) throws ApiException {
// verify the required parameter 'migration' is set
if (migration == null) {
throw new ApiException("Missing the required parameter 'migration' when calling postUpdateCustomObjectDefinition(Async)");
}
return postUpdateCustomObjectDefinitionCall(migration, idempotencyKey, acceptEncoding, contentEncoding, zuoraTrackId, zuoraEntityIds, authorization, zuoraVersion, zuoraOrgIds, _callback);
}
/**
* Update a custom object definition
* Updates a custom object definition by posting migration resource to initiate the migration of definitions. ### Limitations Updating custom field definition has the following limitations: * You can only have one action per update request. * You cannot delete fields from custom objects that contain records. * You can only add required fields to custom objects with no records. * You can change optional fields to required only on the custom objects with no records.
* @param migration Migration resource for object and namespace changes. (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 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 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 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 MigrationUpdateCustomObjectDefinitionsResponse
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
*/
protected MigrationUpdateCustomObjectDefinitionsResponse postUpdateCustomObjectDefinition(MigrationUpdateCustomObjectDefinitionsRequest migration, String idempotencyKey, String acceptEncoding, String contentEncoding, String zuoraTrackId, String zuoraEntityIds, String authorization, String zuoraVersion, String zuoraOrgIds) throws ApiException {
ApiResponse localVarResp = postUpdateCustomObjectDefinitionWithHttpInfo(migration, idempotencyKey, acceptEncoding, contentEncoding, zuoraTrackId, zuoraEntityIds, authorization, zuoraVersion, zuoraOrgIds);
return localVarResp.getData();
}
private ApiResponse postUpdateCustomObjectDefinitionWithHttpInfo(MigrationUpdateCustomObjectDefinitionsRequest migration, String idempotencyKey, String acceptEncoding, String contentEncoding, String zuoraTrackId, String zuoraEntityIds, String authorization, String zuoraVersion, String zuoraOrgIds) throws ApiException {
okhttp3.Call localVarCall = postUpdateCustomObjectDefinitionValidateBeforeCall(migration, idempotencyKey, acceptEncoding, contentEncoding, zuoraTrackId, zuoraEntityIds, authorization, zuoraVersion, zuoraOrgIds, null);
Type localVarReturnType = new TypeToken(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
}
private okhttp3.Call postUpdateCustomObjectDefinitionAsync(MigrationUpdateCustomObjectDefinitionsRequest migration, String idempotencyKey, String acceptEncoding, String contentEncoding, String zuoraTrackId, String zuoraEntityIds, String authorization, String zuoraVersion, String zuoraOrgIds, final ApiCallback _callback) throws ApiException {
okhttp3.Call localVarCall = postUpdateCustomObjectDefinitionValidateBeforeCall(migration, idempotencyKey, acceptEncoding, contentEncoding, zuoraTrackId, zuoraEntityIds, authorization, zuoraVersion, zuoraOrgIds, _callback);
Type localVarReturnType = new TypeToken(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
public class PostUpdateCustomObjectDefinitionApi {
private final MigrationUpdateCustomObjectDefinitionsRequest migration;
private String idempotencyKey;
private String acceptEncoding;
private String contentEncoding;
private String zuoraTrackId;
private String zuoraEntityIds;
private String authorization;
private String zuoraVersion;
private String zuoraOrgIds;
private PostUpdateCustomObjectDefinitionApi(MigrationUpdateCustomObjectDefinitionsRequest migration) {
this.migration = migration;
}
/**
* 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 PostUpdateCustomObjectDefinitionApi
*/
public PostUpdateCustomObjectDefinitionApi 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 PostUpdateCustomObjectDefinitionApi
*/
public PostUpdateCustomObjectDefinitionApi 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 PostUpdateCustomObjectDefinitionApi
*/
public PostUpdateCustomObjectDefinitionApi contentEncoding(String contentEncoding) {
this.contentEncoding = contentEncoding;
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 PostUpdateCustomObjectDefinitionApi
*/
public PostUpdateCustomObjectDefinitionApi 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 PostUpdateCustomObjectDefinitionApi
*/
public PostUpdateCustomObjectDefinitionApi zuoraEntityIds(String zuoraEntityIds) {
this.zuoraEntityIds = zuoraEntityIds;
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 PostUpdateCustomObjectDefinitionApi
*/
public PostUpdateCustomObjectDefinitionApi authorization(String authorization) {
this.authorization = authorization;
return this;
}
/**
* Set zuoraVersion
* @param zuoraVersion The minor version of the Zuora REST API. (optional, default to 2024-05-20)
* @return PostUpdateCustomObjectDefinitionApi
*/
public PostUpdateCustomObjectDefinitionApi 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 PostUpdateCustomObjectDefinitionApi
*/
public PostUpdateCustomObjectDefinitionApi zuoraOrgIds(String zuoraOrgIds) {
this.zuoraOrgIds = zuoraOrgIds;
return this;
}
/**
* Build call for postUpdateCustomObjectDefinition
* @param _callback ApiCallback API callback
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
* @http.response.details
*/
public MigrationUpdateCustomObjectDefinitionsResponse execute() throws ApiException {
ApiResponse localVarResp = postUpdateCustomObjectDefinitionWithHttpInfo(migration, idempotencyKey, acceptEncoding, contentEncoding, zuoraTrackId, zuoraEntityIds, authorization, zuoraVersion, zuoraOrgIds);
return localVarResp.getData();
}
/**
* Execute postUpdateCustomObjectDefinition request with HTTP info returned
* @return ApiResponse<MigrationUpdateCustomObjectDefinitionsResponse>
* @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 postUpdateCustomObjectDefinitionWithHttpInfo(migration, idempotencyKey, acceptEncoding, contentEncoding, zuoraTrackId, zuoraEntityIds, authorization, zuoraVersion, zuoraOrgIds);
}
/**
* Execute postUpdateCustomObjectDefinition 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 postUpdateCustomObjectDefinitionAsync(migration, idempotencyKey, acceptEncoding, contentEncoding, zuoraTrackId, zuoraEntityIds, authorization, zuoraVersion, zuoraOrgIds, _callback);
}
}
/**
* Update a custom object definition
* Updates a custom object definition by posting migration resource to initiate the migration of definitions. ### Limitations Updating custom field definition has the following limitations: * You can only have one action per update request. * You cannot delete fields from custom objects that contain records. * You can only add required fields to custom objects with no records. * You can change optional fields to required only on the custom objects with no records.
* @param migration Migration resource for object and namespace changes. (required)
* @return PostUpdateCustomObjectDefinitionApi
*/
public PostUpdateCustomObjectDefinitionApi postUpdateCustomObjectDefinitionApi(MigrationUpdateCustomObjectDefinitionsRequest migration) {
return new PostUpdateCustomObjectDefinitionApi(migration);
}
}