com.docusign.esign.api.CustomTabsApi Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of docusign-esign-java Show documentation
Show all versions of docusign-esign-java Show documentation
The official DocuSign eSignature JAVA client is based on version 2 of the DocuSign REST API and provides libraries for JAVA application integration. It is recommended that you use this version of the library for new development.
package com.docusign.esign.api;
import com.docusign.esign.client.ApiClient;
import com.docusign.esign.client.ApiException;
import com.docusign.esign.client.ApiResponse;
import com.docusign.esign.client.Configuration;
import com.docusign.esign.client.Pair;
import com.docusign.esign.model.*;
import jakarta.ws.rs.core.GenericType;
/** CustomTabsApi class. */
public class CustomTabsApi {
private ApiClient apiClient;
/** CustomTabsApi. */
public CustomTabsApi() {
this(Configuration.getDefaultApiClient());
}
/** CustomTabsApi. */
public CustomTabsApi(ApiClient apiClient) {
this.apiClient = apiClient;
}
/**
* getApiClient Method.
*
* @return ApiClient
*/
public ApiClient getApiClient() {
return apiClient;
}
/** setApiClient Method. */
public void setApiClient(ApiClient apiClient) {
this.apiClient = apiClient;
}
///
/// Gets a list of all account tabs. Retrieves a list of all tabs associated with the account.
///
/** CallListOptions Class. */
public class CallListOptions {
private String customTabOnly = null;
/** setCustomTabOnly method. */
public void setCustomTabOnly(String customTabOnly) {
this.customTabOnly = customTabOnly;
}
/**
* getCustomTabOnly method.
*
* @return String
*/
public String getCustomTabOnly() {
return this.customTabOnly;
}
}
/**
* Gets a list of all account tabs.. Retrieves a list of all tabs associated with the account.
*
* @param accountId The external account number (int) or account ID Guid. (required)
* @return TabMetadataList
*/
public TabMetadataList callList(String accountId) throws ApiException {
return callList(accountId, null);
}
/**
* Gets a list of all account tabs.. Retrieves a list of all tabs associated with the account.
*
* @param accountId The external account number (int) or account ID Guid. (required)
* @param options for modifying the method behavior.
* @return TabMetadataList
* @throws ApiException if fails to make API call
*/
public TabMetadataList callList(String accountId, CustomTabsApi.CallListOptions options)
throws ApiException {
ApiResponse localVarResponse = callListWithHttpInfo(accountId, options);
return localVarResponse.getData();
}
/**
* Gets a list of all account tabs. Retrieves a list of all tabs associated with the account.
*
* @param accountId The external account number (int) or account ID Guid. (required)
* @param options for modifying the method behavior.
* @return TabMetadataList
* @throws ApiException if fails to make API call
*/
public ApiResponse callListWithHttpInfo(
String accountId, CustomTabsApi.CallListOptions options) throws ApiException {
Object localVarPostBody = "{}";
// verify the required parameter 'accountId' is set
if (accountId == null) {
throw new ApiException(
400, "Missing the required parameter 'accountId' when calling callList");
}
// create path and map variables
String localVarPath =
"/v2.1/accounts/{accountId}/tab_definitions"
.replaceAll("\\{" + "accountId" + "\\}", apiClient.escapeString(accountId.toString()));
// query params
java.util.List localVarQueryParams = new java.util.ArrayList();
java.util.List localVarCollectionQueryParams = new java.util.ArrayList();
java.util.Map localVarHeaderParams = new java.util.HashMap();
java.util.Map localVarFormParams = new java.util.HashMap();
if (options != null) {
localVarQueryParams.addAll(
apiClient.parameterToPair("custom_tab_only", options.customTabOnly));
}
final String[] localVarAccepts = {"application/json"};
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
final String[] localVarContentTypes = {};
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
String[] localVarAuthNames = new String[] {"docusignAccessCode"};
GenericType localVarReturnType = new GenericType() {};
TabMetadataList localVarResponse =
apiClient.invokeAPI(
localVarPath,
"GET",
localVarQueryParams,
localVarCollectionQueryParams,
localVarPostBody,
localVarHeaderParams,
localVarFormParams,
localVarAccept,
localVarContentType,
localVarAuthNames,
localVarReturnType);
return new ApiResponse(
apiClient.getStatusCode(), apiClient.getResponseHeaders(), localVarResponse);
}
/**
* Creates a custom tab.. Creates a tab with pre-defined properties, such as a text tab with a
* certain font type and validation pattern. Users can access the custom tabs when sending
* documents through the DocuSign web application. Custom tabs can be created for approve,
* checkbox, company, date, date signed, decline, email, email address, envelope ID, first name,
* formula, full name, initial here, last name, list, note, number, radio, sign here, signer
* attachment, SSN, text, title, and zip tabs.
*
* @param accountId The external account number (int) or account ID Guid. (required)
* @param tabMetadata (optional)
* @return TabMetadata
* @throws ApiException if fails to make API call
*/
public TabMetadata create(String accountId, TabMetadata tabMetadata) throws ApiException {
ApiResponse localVarResponse = createWithHttpInfo(accountId, tabMetadata);
return localVarResponse.getData();
}
/**
* Creates a custom tab. Creates a tab with pre-defined properties, such as a text tab with a
* certain font type and validation pattern. Users can access the custom tabs when sending
* documents through the DocuSign web application. Custom tabs can be created for approve,
* checkbox, company, date, date signed, decline, email, email address, envelope ID, first name,
* formula, full name, initial here, last name, list, note, number, radio, sign here, signer
* attachment, SSN, text, title, and zip tabs.
*
* @param accountId The external account number (int) or account ID Guid. (required)
* @param tabMetadata (optional)
* @return TabMetadata
* @throws ApiException if fails to make API call
*/
public ApiResponse createWithHttpInfo(String accountId, TabMetadata tabMetadata)
throws ApiException {
Object localVarPostBody = tabMetadata;
// verify the required parameter 'accountId' is set
if (accountId == null) {
throw new ApiException(400, "Missing the required parameter 'accountId' when calling create");
}
// create path and map variables
String localVarPath =
"/v2.1/accounts/{accountId}/tab_definitions"
.replaceAll("\\{" + "accountId" + "\\}", apiClient.escapeString(accountId.toString()));
// query params
java.util.List localVarQueryParams = new java.util.ArrayList();
java.util.List localVarCollectionQueryParams = new java.util.ArrayList();
java.util.Map localVarHeaderParams = new java.util.HashMap();
java.util.Map localVarFormParams = new java.util.HashMap();
final String[] localVarAccepts = {"application/json"};
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
final String[] localVarContentTypes = {};
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
String[] localVarAuthNames = new String[] {"docusignAccessCode"};
GenericType localVarReturnType = new GenericType() {};
TabMetadata localVarResponse =
apiClient.invokeAPI(
localVarPath,
"POST",
localVarQueryParams,
localVarCollectionQueryParams,
localVarPostBody,
localVarHeaderParams,
localVarFormParams,
localVarAccept,
localVarContentType,
localVarAuthNames,
localVarReturnType);
return new ApiResponse(
apiClient.getStatusCode(), apiClient.getResponseHeaders(), localVarResponse);
}
/**
* Deletes custom tab information.. Deletes the custom from the specified account.
*
* @param accountId The external account number (int) or account ID Guid. (required)
* @param customTabId (required)
* @throws ApiException if fails to make API call
*/
public void delete(String accountId, String customTabId) throws ApiException {
deleteWithHttpInfo(accountId, customTabId);
}
/**
* Deletes custom tab information. Deletes the custom from the specified account.
*
* @param accountId The external account number (int) or account ID Guid. (required)
* @param customTabId (required)
* @throws ApiException if fails to make API call
*/
public ApiResponse
© 2015 - 2024 Weber Informatics LLC | Privacy Policy