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.
package com.hellosign.openapi.api;
import com.hellosign.openapi.ApiException;
import com.hellosign.openapi.ApiClient;
import com.hellosign.openapi.ApiResponse;
import com.hellosign.openapi.Configuration;
import com.hellosign.openapi.Pair;
import javax.ws.rs.core.GenericType;
import com.hellosign.openapi.model.ErrorResponse;
import com.hellosign.openapi.model.FileResponse;
import com.hellosign.openapi.model.TemplateAddUserRequest;
import com.hellosign.openapi.model.TemplateCreateEmbeddedDraftRequest;
import com.hellosign.openapi.model.TemplateCreateEmbeddedDraftResponse;
import com.hellosign.openapi.model.TemplateGetResponse;
import com.hellosign.openapi.model.TemplateListResponse;
import com.hellosign.openapi.model.TemplateRemoveUserRequest;
import com.hellosign.openapi.model.TemplateUpdateFilesRequest;
import com.hellosign.openapi.model.TemplateUpdateFilesResponse;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen")
public class TemplateApi {
private ApiClient apiClient;
public TemplateApi() {
this(Configuration.getDefaultApiClient());
}
public TemplateApi(ApiClient apiClient) {
this.apiClient = apiClient;
}
/**
* Get the API client
*
* @return API client
*/
public ApiClient getApiClient() {
return apiClient;
}
/**
* Set the API client
*
* @param apiClient an instance of API client
*/
public void setApiClient(ApiClient apiClient) {
this.apiClient = apiClient;
}
/**
* Add User to Template
* Gives the specified Account access to the specified Template. The specified Account must be a part of your Team.
* @param templateId The id of the Template to give the Account access to. (required)
* @param templateAddUserRequest (required)
* @return TemplateGetResponse
* @throws ApiException if fails to make API call
* @http.response.details
*/
public TemplateGetResponse templateAddUser(String templateId, TemplateAddUserRequest templateAddUserRequest) throws ApiException {
return templateAddUserWithHttpInfo(templateId, templateAddUserRequest).getData();
}
/**
* Add User to Template
* Gives the specified Account access to the specified Template. The specified Account must be a part of your Team.
* @param templateId The id of the Template to give the Account access to. (required)
* @param templateAddUserRequest (required)
* @return ApiResponse<TemplateGetResponse>
* @throws ApiException if fails to make API call
* @http.response.details
*/
public ApiResponse templateAddUserWithHttpInfo(String templateId, TemplateAddUserRequest templateAddUserRequest) throws ApiException {
Object localVarPostBody = templateAddUserRequest;
// verify the required parameter 'templateId' is set
if (templateId == null) {
throw new ApiException(400, "Missing the required parameter 'templateId' when calling templateAddUser");
}
// verify the required parameter 'templateAddUserRequest' is set
if (templateAddUserRequest == null) {
throw new ApiException(400, "Missing the required parameter 'templateAddUserRequest' when calling templateAddUser");
}
// create path and map variables
String localVarPath = "/template/add_user/{template_id}"
.replaceAll("\\{" + "template_id" + "\\}", apiClient.escapeString(templateId.toString()));
// query params
List localVarQueryParams = new ArrayList();
Map localVarHeaderParams = new HashMap();
Map localVarCookieParams = new HashMap();
Map localVarFormParams = new HashMap();
final String[] localVarAccepts = {
"application/json"
};
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
final String[] localVarContentTypes = {
"application/json"
};
localVarFormParams = templateAddUserRequest.createFormData();
boolean isFileTypeFound = !localVarFormParams.isEmpty();
final String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType(localVarContentTypes);
String[] localVarAuthNames = new String[] { "api_key", "oauth2" };
GenericType localVarReturnType = new GenericType() {};
return apiClient.invokeAPI("TemplateApi.templateAddUser", localVarPath, "POST", localVarQueryParams, localVarPostBody,
localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType,
localVarAuthNames, localVarReturnType, false);
}
/**
* Create Embedded Template Draft
* The first step in an embedded template workflow. Creates a draft template that can then be further set up in the template 'edit' stage.
* @param templateCreateEmbeddedDraftRequest (required)
* @return TemplateCreateEmbeddedDraftResponse
* @throws ApiException if fails to make API call
* @http.response.details
*/
public TemplateCreateEmbeddedDraftResponse templateCreateEmbeddedDraft(TemplateCreateEmbeddedDraftRequest templateCreateEmbeddedDraftRequest) throws ApiException {
return templateCreateEmbeddedDraftWithHttpInfo(templateCreateEmbeddedDraftRequest).getData();
}
/**
* Create Embedded Template Draft
* The first step in an embedded template workflow. Creates a draft template that can then be further set up in the template 'edit' stage.
* @param templateCreateEmbeddedDraftRequest (required)
* @return ApiResponse<TemplateCreateEmbeddedDraftResponse>
* @throws ApiException if fails to make API call
* @http.response.details
*/
public void templateDelete(String templateId) throws ApiException {
templateDeleteWithHttpInfo(templateId);
}
/**
* Delete Template
* Completely deletes the template specified from the account.
* @param templateId The id of the Template to delete. (required)
* @return ApiResponse<Void>
* @throws ApiException if fails to make API call
* @http.response.details
*/
public ApiResponse templateDeleteWithHttpInfo(String templateId) throws ApiException {
Object localVarPostBody = null;
// verify the required parameter 'templateId' is set
if (templateId == null) {
throw new ApiException(400, "Missing the required parameter 'templateId' when calling templateDelete");
}
// create path and map variables
String localVarPath = "/template/delete/{template_id}"
.replaceAll("\\{" + "template_id" + "\\}", apiClient.escapeString(templateId.toString()));
// query params
List localVarQueryParams = new ArrayList();
Map localVarHeaderParams = new HashMap();
Map localVarCookieParams = new HashMap();
Map localVarFormParams = new HashMap();
final String[] localVarAccepts = {
"application/json"
};
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
final String[] localVarContentTypes = {
};
localVarFormParams = new HashMap();
boolean isFileTypeFound = !localVarFormParams.isEmpty();
final String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType(localVarContentTypes);
String[] localVarAuthNames = new String[] { "api_key", "oauth2" };
return apiClient.invokeAPI("TemplateApi.templateDelete", localVarPath, "POST", localVarQueryParams, localVarPostBody,
localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType,
localVarAuthNames, null, false);
}
/**
* Get Template Files
* Obtain a copy of the current documents specified by the `template_id` parameter. Returns a PDF or ZIP file, or if `get_url` is set, a JSON object with a url to the file (PDFs only). If `get_data_uri` is set, a JSON object with a `data_uri` representing the base64 encoded file (PDFs only) is returned. If the files are currently being prepared, a status code of `409` will be returned instead. In this case please wait for the `template_created` callback event.
* @param templateId The id of the template files to retrieve. (required)
* @param fileType Set to `pdf` for a single merged document or `zip` for a collection of individual documents. (optional)
* @param getUrl If `true`, the response will contain a url link to the file instead. Links are only available for PDFs and have a TTL of 3 days. (optional, default to false)
* @param getDataUri If `true`, the response will contain the file as base64 encoded string. Base64 encoding is only available for PDFs. (optional, default to false)
* @return FileResponse
* @throws ApiException if fails to make API call
* @http.response.details
*/
public FileResponse templateFiles(String templateId, String fileType, Boolean getUrl, Boolean getDataUri) throws ApiException {
return templateFilesWithHttpInfo(templateId, fileType, getUrl, getDataUri).getData();
}
/**
* Get Template Files
* Obtain a copy of the current documents specified by the `template_id` parameter. Returns a PDF or ZIP file, or if `get_url` is set, a JSON object with a url to the file (PDFs only). If `get_data_uri` is set, a JSON object with a `data_uri` representing the base64 encoded file (PDFs only) is returned. If the files are currently being prepared, a status code of `409` will be returned instead. In this case please wait for the `template_created` callback event.
* @param templateId The id of the template files to retrieve. (required)
* @param fileType Set to `pdf` for a single merged document or `zip` for a collection of individual documents. (optional)
* @param getUrl If `true`, the response will contain a url link to the file instead. Links are only available for PDFs and have a TTL of 3 days. (optional, default to false)
* @param getDataUri If `true`, the response will contain the file as base64 encoded string. Base64 encoding is only available for PDFs. (optional, default to false)
* @return ApiResponse<FileResponse>
* @throws ApiException if fails to make API call
* @http.response.details
*/
public TemplateGetResponse templateGet(String templateId) throws ApiException {
return templateGetWithHttpInfo(templateId).getData();
}
/**
* Get Template
* Returns the Template specified by the `template_id` parameter.
* @param templateId The id of the Template to retrieve. (required)
* @return ApiResponse<TemplateGetResponse>
* @throws ApiException if fails to make API call
* @http.response.details
*/
public ApiResponse templateGetWithHttpInfo(String templateId) throws ApiException {
Object localVarPostBody = null;
// verify the required parameter 'templateId' is set
if (templateId == null) {
throw new ApiException(400, "Missing the required parameter 'templateId' when calling templateGet");
}
// create path and map variables
String localVarPath = "/template/{template_id}"
.replaceAll("\\{" + "template_id" + "\\}", apiClient.escapeString(templateId.toString()));
// query params
List localVarQueryParams = new ArrayList();
Map localVarHeaderParams = new HashMap();
Map localVarCookieParams = new HashMap();
Map localVarFormParams = new HashMap();
final String[] localVarAccepts = {
"application/json"
};
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
final String[] localVarContentTypes = {
};
localVarFormParams = new HashMap();
boolean isFileTypeFound = !localVarFormParams.isEmpty();
final String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType(localVarContentTypes);
String[] localVarAuthNames = new String[] { "api_key", "oauth2" };
GenericType localVarReturnType = new GenericType() {};
return apiClient.invokeAPI("TemplateApi.templateGet", localVarPath, "GET", localVarQueryParams, localVarPostBody,
localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType,
localVarAuthNames, localVarReturnType, false);
}
/**
* List Templates
* Returns a list of the Templates that are accessible by you. Take a look at our [search guide](/api/reference/search/) to learn more about querying templates.
* @param accountId Which account to return Templates for. Must be a team member. Use `all` to indicate all team members. Defaults to your account. (optional)
* @param page Which page number of the Template List to return. Defaults to `1`. (optional, default to 1)
* @param pageSize Number of objects to be returned per page. Must be between `1` and `100`. Default is `20`. (optional, default to 20)
* @param query String that includes search terms and/or fields to be used to filter the Template objects. (optional)
* @return TemplateListResponse
* @throws ApiException if fails to make API call
* @http.response.details
*/
public TemplateListResponse templateList(String accountId, Integer page, Integer pageSize, String query) throws ApiException {
return templateListWithHttpInfo(accountId, page, pageSize, query).getData();
}
/**
* List Templates
* Returns a list of the Templates that are accessible by you. Take a look at our [search guide](/api/reference/search/) to learn more about querying templates.
* @param accountId Which account to return Templates for. Must be a team member. Use `all` to indicate all team members. Defaults to your account. (optional)
* @param page Which page number of the Template List to return. Defaults to `1`. (optional, default to 1)
* @param pageSize Number of objects to be returned per page. Must be between `1` and `100`. Default is `20`. (optional, default to 20)
* @param query String that includes search terms and/or fields to be used to filter the Template objects. (optional)
* @return ApiResponse<TemplateListResponse>
* @throws ApiException if fails to make API call
* @http.response.details
*/
public TemplateGetResponse templateRemoveUser(String templateId, TemplateRemoveUserRequest templateRemoveUserRequest) throws ApiException {
return templateRemoveUserWithHttpInfo(templateId, templateRemoveUserRequest).getData();
}
/**
* Remove User from Template
* Removes the specified Account's access to the specified Template.
* @param templateId The id of the Template to remove the Account's access to. (required)
* @param templateRemoveUserRequest (required)
* @return ApiResponse<TemplateGetResponse>
* @throws ApiException if fails to make API call
* @http.response.details
*/
public ApiResponse templateRemoveUserWithHttpInfo(String templateId, TemplateRemoveUserRequest templateRemoveUserRequest) throws ApiException {
Object localVarPostBody = templateRemoveUserRequest;
// verify the required parameter 'templateId' is set
if (templateId == null) {
throw new ApiException(400, "Missing the required parameter 'templateId' when calling templateRemoveUser");
}
// verify the required parameter 'templateRemoveUserRequest' is set
if (templateRemoveUserRequest == null) {
throw new ApiException(400, "Missing the required parameter 'templateRemoveUserRequest' when calling templateRemoveUser");
}
// create path and map variables
String localVarPath = "/template/remove_user/{template_id}"
.replaceAll("\\{" + "template_id" + "\\}", apiClient.escapeString(templateId.toString()));
// query params
List localVarQueryParams = new ArrayList();
Map localVarHeaderParams = new HashMap();
Map localVarCookieParams = new HashMap();
Map localVarFormParams = new HashMap();
final String[] localVarAccepts = {
"application/json"
};
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
final String[] localVarContentTypes = {
"application/json"
};
localVarFormParams = templateRemoveUserRequest.createFormData();
boolean isFileTypeFound = !localVarFormParams.isEmpty();
final String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType(localVarContentTypes);
String[] localVarAuthNames = new String[] { "api_key", "oauth2" };
GenericType localVarReturnType = new GenericType() {};
return apiClient.invokeAPI("TemplateApi.templateRemoveUser", localVarPath, "POST", localVarQueryParams, localVarPostBody,
localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType,
localVarAuthNames, localVarReturnType, false);
}
/**
* Update Template Files
* Overlays a new file with the overlay of an existing template. The new file(s) must: 1. have the same or higher page count 2. the same orientation as the file(s) being replaced. This will not overwrite or in any way affect the existing template. Both the existing template and new template will be available for use after executing this endpoint. Also note that this will decrement your template quota. Overlaying new files is asynchronous and a successful call to this endpoint will return 200 OK response if the request passes initial validation checks. It is recommended that a callback be implemented to listen for the callback event. A `template_created` event will be sent when the files are updated or a `template_error` event will be sent if there was a problem while updating the files. If a callback handler has been configured and the event has not been received within 60 minutes of making the call, check the status of the request in the API dashboard and retry the request if necessary. If the page orientation or page count is different from the original template document, we will notify you with a `template_error` [callback event](https://app.hellosign.com/api/eventsAndCallbacksWalkthrough).
* @param templateId The ID of the template whose files to update. (required)
* @param templateUpdateFilesRequest (required)
* @return TemplateUpdateFilesResponse
* @throws ApiException if fails to make API call
* @http.response.details
*/
public TemplateUpdateFilesResponse templateUpdateFiles(String templateId, TemplateUpdateFilesRequest templateUpdateFilesRequest) throws ApiException {
return templateUpdateFilesWithHttpInfo(templateId, templateUpdateFilesRequest).getData();
}
/**
* Update Template Files
* Overlays a new file with the overlay of an existing template. The new file(s) must: 1. have the same or higher page count 2. the same orientation as the file(s) being replaced. This will not overwrite or in any way affect the existing template. Both the existing template and new template will be available for use after executing this endpoint. Also note that this will decrement your template quota. Overlaying new files is asynchronous and a successful call to this endpoint will return 200 OK response if the request passes initial validation checks. It is recommended that a callback be implemented to listen for the callback event. A `template_created` event will be sent when the files are updated or a `template_error` event will be sent if there was a problem while updating the files. If a callback handler has been configured and the event has not been received within 60 minutes of making the call, check the status of the request in the API dashboard and retry the request if necessary. If the page orientation or page count is different from the original template document, we will notify you with a `template_error` [callback event](https://app.hellosign.com/api/eventsAndCallbacksWalkthrough).
* @param templateId The ID of the template whose files to update. (required)
* @param templateUpdateFilesRequest (required)
* @return ApiResponse<TemplateUpdateFilesResponse>
* @throws ApiException if fails to make API call
* @http.response.details