diff --git a/examples/TemplateEditExample.cs b/examples/TemplateEditExample.cs new file mode 100644 index 000000000..fbbee34bb --- /dev/null +++ b/examples/TemplateEditExample.cs @@ -0,0 +1,43 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Text.Json; + +using Dropbox.Sign.Api; +using Dropbox.Sign.Client; +using Dropbox.Sign.Model; + +namespace Dropbox.SignSandbox; + +public class TemplateEditExample +{ + public static void Run() + { + var config = new Configuration(); + config.Username = "YOUR_API_KEY"; + // config.AccessToken = "YOUR_ACCESS_TOKEN"; + + var templateEditRequest = new TemplateEditRequest( + ccRoles: [ + "Role 1", + "Role 2", + ] + ); + + try + { + var response = new TemplateApi(config).TemplateEdit( + templateId: "f57db65d3f933b5316d398057a36176831451a35", + templateEditRequest: templateEditRequest + ); + + Console.WriteLine(response); + } + catch (ApiException e) + { + Console.WriteLine("Exception when calling TemplateApi#TemplateEdit: " + e.Message); + Console.WriteLine("Status Code: " + e.ErrorCode); + Console.WriteLine(e.StackTrace); + } + } +} diff --git a/examples/TemplateEditExample.java b/examples/TemplateEditExample.java new file mode 100644 index 000000000..ce182825f --- /dev/null +++ b/examples/TemplateEditExample.java @@ -0,0 +1,48 @@ +package com.dropbox.sign_sandbox; + +import com.dropbox.sign.ApiException; +import com.dropbox.sign.Configuration; +import com.dropbox.sign.api.*; +import com.dropbox.sign.auth.*; +import com.dropbox.sign.JSON; +import com.dropbox.sign.model.*; + +import java.io.File; +import java.math.BigDecimal; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; + +public class TemplateEditExample +{ + public static void main(String[] args) + { + var config = Configuration.getDefaultApiClient(); + ((HttpBasicAuth) config.getAuthentication("api_key")).setUsername("YOUR_API_KEY"); + // ((HttpBearerAuth) config.getAuthentication("oauth2")).setBearerToken("YOUR_ACCESS_TOKEN"); + + var templateEditRequest = new TemplateEditRequest(); + templateEditRequest.ccRoles(List.of ( + "Role 1", + "Role 2" + )); + + try + { + var response = new TemplateApi(config).templateEdit( + "f57db65d3f933b5316d398057a36176831451a35", // templateId + templateEditRequest + ); + + System.out.println(response); + } catch (ApiException e) { + System.err.println("Exception when calling TemplateApi#templateEdit"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} diff --git a/examples/TemplateEditExample.php b/examples/TemplateEditExample.php new file mode 100644 index 000000000..fd4151942 --- /dev/null +++ b/examples/TemplateEditExample.php @@ -0,0 +1,29 @@ +setUsername("YOUR_API_KEY"); +// $config->setAccessToken("YOUR_ACCESS_TOKEN"); + +$template_edit_request = (new Dropbox\Sign\Model\TemplateEditRequest()) + ->setCcRoles([ + "Role 1", + "Role 2", + ]); + +try { + $response = (new Dropbox\Sign\Api\TemplateApi(config: $config))->templateEdit( + template_id: "f57db65d3f933b5316d398057a36176831451a35", + template_edit_request: $template_edit_request, + ); + + print_r($response); +} catch (Dropbox\Sign\ApiException $e) { + echo "Exception when calling TemplateApi#templateEdit: {$e->getMessage()}"; +} diff --git a/examples/TemplateEditExample.py b/examples/TemplateEditExample.py new file mode 100644 index 000000000..5267aa41a --- /dev/null +++ b/examples/TemplateEditExample.py @@ -0,0 +1,28 @@ +import json +from datetime import date, datetime +from pprint import pprint + +from dropbox_sign import ApiClient, ApiException, Configuration, api, models + +configuration = Configuration( + username="YOUR_API_KEY", + # access_token="YOUR_ACCESS_TOKEN", +) + +with ApiClient(configuration) as api_client: + template_edit_request = models.TemplateEditRequest( + cc_roles=[ + "Role 1", + "Role 2", + ], + ) + + try: + response = api.TemplateApi(api_client).template_edit( + template_id="f57db65d3f933b5316d398057a36176831451a35", + template_edit_request=template_edit_request, + ) + + pprint(response) + except ApiException as e: + print("Exception when calling TemplateApi#template_edit: %s\n" % e) diff --git a/examples/TemplateEditExample.rb b/examples/TemplateEditExample.rb new file mode 100644 index 000000000..28c89d79d --- /dev/null +++ b/examples/TemplateEditExample.rb @@ -0,0 +1,24 @@ +require "json" +require "dropbox-sign" + +Dropbox::Sign.configure do |config| + config.username = "YOUR_API_KEY" + # config.access_token = "YOUR_ACCESS_TOKEN" +end + +template_edit_request = Dropbox::Sign::TemplateEditRequest.new +template_edit_request.cc_roles = [ + "Role 1", + "Role 2", +] + +begin + response = Dropbox::Sign::TemplateApi.new.template_edit( + "f57db65d3f933b5316d398057a36176831451a35", # template_id + template_edit_request, + ) + + p response +rescue Dropbox::Sign::ApiError => e + puts "Exception when calling TemplateApi#template_edit: #{e}" +end diff --git a/examples/TemplateEditExample.sh b/examples/TemplateEditExample.sh new file mode 100644 index 000000000..b359b0ac0 --- /dev/null +++ b/examples/TemplateEditExample.sh @@ -0,0 +1,4 @@ +curl -X POST 'https://api.hellosign.com/v3/template/edit/{template_id}' \ + -u 'YOUR_API_KEY:' \ + -F 'cc_roles[]=Role 1' \ + -F 'cc_roles[]=Role 2' diff --git a/examples/TemplateEditExample.ts b/examples/TemplateEditExample.ts new file mode 100644 index 000000000..f5aa7c248 --- /dev/null +++ b/examples/TemplateEditExample.ts @@ -0,0 +1,24 @@ +import * as fs from 'fs'; +import api from "@dropbox/sign" +import models from "@dropbox/sign" + +const apiCaller = new api.TemplateApi(); +apiCaller.username = "YOUR_API_KEY"; +// apiCaller.accessToken = "YOUR_ACCESS_TOKEN"; + +const templateEditRequest: models.TemplateEditRequest = { + ccRoles: [ + "Role 1", + "Role 2", + ], +}; + +apiCaller.templateEdit( + "f57db65d3f933b5316d398057a36176831451a35", // templateId + templateEditRequest, +).then(response => { + console.log(response.body); +}).catch(error => { + console.log("Exception when calling TemplateApi#templateEdit:"); + console.log(error.body); +}); diff --git a/examples/json/TemplateEditRequest.json b/examples/json/TemplateEditRequest.json new file mode 100644 index 000000000..31b5f6be7 --- /dev/null +++ b/examples/json/TemplateEditRequest.json @@ -0,0 +1,3 @@ +{ + "cc_roles": ["Role 1", "Role 2"] +} diff --git a/openapi-raw.yaml b/openapi-raw.yaml index 9f264f89f..1f894be1e 100644 --- a/openapi-raw.yaml +++ b/openapi-raw.yaml @@ -6513,6 +6513,118 @@ paths: seo: title: '_t__TemplateDelete::SEO::TITLE' description: '_t__TemplateDelete::SEO::DESCRIPTION' + '/template/edit/{template_id}': + post: + tags: + - Template + summary: '_t__TemplateEdit::SUMMARY' + description: '_t__TemplateEdit::DESCRIPTION' + operationId: templateEdit + parameters: + - + name: template_id + in: path + description: '_t__TemplateEdit::TEMPLATE_ID' + required: true + schema: + type: string + example: f57db65d3f933b5316d398057a36176831451a35 + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/TemplateEditRequest' + examples: + example: + $ref: '#/components/examples/TemplateEditRequest' + responses: + '200': + description: 'successful operation' + headers: + X-RateLimit-Limit: + $ref: '#/components/headers/X-RateLimit-Limit' + X-RateLimit-Remaining: + $ref: '#/components/headers/X-RateLimit-Remaining' + X-Ratelimit-Reset: + $ref: '#/components/headers/X-Ratelimit-Reset' + content: + application/json: + schema: + $ref: '#/components/schemas/TemplateGetResponse' + examples: + example: + $ref: '#/components/examples/TemplateGetResponse' + 4XX: + description: failed_operation + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + 400_example: + $ref: '#/components/examples/Error400Response' + 401_example: + $ref: '#/components/examples/Error401Response' + 402_example: + $ref: '#/components/examples/Error402Response' + 403_example: + $ref: '#/components/examples/Error403Response' + 429_example: + $ref: '#/components/examples/Error429Response' + 404_example: + $ref: '#/components/examples/Error404Response' + 409_example: + $ref: '#/components/examples/Error409Response' + 4XX_example: + $ref: '#/components/examples/Error4XXResponse' + security: + - + api_key: [] + - + oauth2: + - template_access + x-codeSamples: + - + lang: PHP + label: PHP + source: + $ref: examples/TemplateEditExample.php + - + lang: 'C#' + label: 'C#' + source: + $ref: examples/TemplateEditExample.cs + - + lang: TypeScript + label: TypeScript + source: + $ref: examples/TemplateEditExample.ts + - + lang: Java + label: Java + source: + $ref: examples/TemplateEditExample.java + - + lang: Ruby + label: Ruby + source: + $ref: examples/TemplateEditExample.rb + - + lang: Python + label: Python + source: + $ref: examples/TemplateEditExample.py + - + lang: cURL + label: cURL + source: + $ref: examples/TemplateEditExample.sh + x-meta: + seo: + title: '_t__TemplateEdit::SEO::TITLE' + description: '_t__TemplateEdit::SEO::DESCRIPTION' + x-hideOn: doc '/template/files/{template_id}': get: tags: @@ -10179,6 +10291,17 @@ components: type: boolean default: false type: object + TemplateEditRequest: + properties: + cc_roles: + description: '_t__TemplateEdit::CC_ROLES' + type: array + items: + type: string + allow_form_view: + description: '_t__TemplateEdit::ALLOW_FORM_VIEW' + type: boolean + type: object TemplateRemoveUserRequest: properties: account_id: @@ -12767,14 +12890,6 @@ components: $ref: '#/components/schemas/WarningResponse' type: object x-internal-class: true - TemplateEditResponse: - required: - - template_id - properties: - template_id: - description: '_t__TemplateResponse::TEMPLATE_ID' - type: string - type: object TemplateGetResponse: required: - template @@ -13098,6 +13213,10 @@ components: summary: 'Form Fields Per Document and Rules Example' value: $ref: examples/json/TemplateCreateEmbeddedDraftRequestFormFieldRules.json + TemplateEditRequest: + summary: 'Default Example' + value: + $ref: examples/json/TemplateEditRequest.json TemplateRemoveUserRequest: summary: 'Default Example' value: diff --git a/openapi-sdk.yaml b/openapi-sdk.yaml index 707ba5ab3..85167e639 100644 --- a/openapi-sdk.yaml +++ b/openapi-sdk.yaml @@ -6574,6 +6574,118 @@ paths: seo: title: 'Delete Template | API Documentation | Dropbox Sign for Developers' description: 'The RESTful Dropbox Sign API easily allows you to build custom integrations. To find out how to completely delete a template from the account, click here.' + '/template/edit/{template_id}': + post: + tags: + - Template + summary: 'Edit Template' + description: 'Edits an existing template.' + operationId: templateEdit + parameters: + - + name: template_id + in: path + description: 'The id of the Template to edit.' + required: true + schema: + type: string + example: f57db65d3f933b5316d398057a36176831451a35 + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/TemplateEditRequest' + examples: + example: + $ref: '#/components/examples/TemplateEditRequest' + responses: + '200': + description: 'successful operation' + headers: + X-RateLimit-Limit: + $ref: '#/components/headers/X-RateLimit-Limit' + X-RateLimit-Remaining: + $ref: '#/components/headers/X-RateLimit-Remaining' + X-Ratelimit-Reset: + $ref: '#/components/headers/X-Ratelimit-Reset' + content: + application/json: + schema: + $ref: '#/components/schemas/TemplateGetResponse' + examples: + example: + $ref: '#/components/examples/TemplateGetResponse' + '4XX': + description: failed_operation + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + 400_example: + $ref: '#/components/examples/Error400Response' + 401_example: + $ref: '#/components/examples/Error401Response' + 402_example: + $ref: '#/components/examples/Error402Response' + 403_example: + $ref: '#/components/examples/Error403Response' + 429_example: + $ref: '#/components/examples/Error429Response' + 404_example: + $ref: '#/components/examples/Error404Response' + 409_example: + $ref: '#/components/examples/Error409Response' + 4XX_example: + $ref: '#/components/examples/Error4XXResponse' + security: + - + api_key: [] + - + oauth2: + - template_access + x-codeSamples: + - + lang: PHP + label: PHP + source: + $ref: examples/TemplateEditExample.php + - + lang: 'C#' + label: 'C#' + source: + $ref: examples/TemplateEditExample.cs + - + lang: TypeScript + label: TypeScript + source: + $ref: examples/TemplateEditExample.ts + - + lang: Java + label: Java + source: + $ref: examples/TemplateEditExample.java + - + lang: Ruby + label: Ruby + source: + $ref: examples/TemplateEditExample.rb + - + lang: Python + label: Python + source: + $ref: examples/TemplateEditExample.py + - + lang: cURL + label: cURL + source: + $ref: examples/TemplateEditExample.sh + x-meta: + seo: + title: 'Edit Template | API Documentation | Dropbox Sign for Developers' + description: 'The RESTful Dropbox Sign API easily allows you to build custom eSign integrations. To find out how to edit a template, click here.' + x-hideOn: doc '/template/files/{template_id}': get: tags: @@ -10816,6 +10928,17 @@ components: type: boolean default: false type: object + TemplateEditRequest: + properties: + cc_roles: + description: 'The CC roles that must be assigned when using the template to send a signature request' + type: array + items: + type: string + allow_form_view: + description: 'Allows signers to view the form fields before signing if set to `true`.' + type: boolean + type: object TemplateRemoveUserRequest: properties: account_id: @@ -13691,14 +13814,6 @@ components: $ref: '#/components/schemas/WarningResponse' type: object x-internal-class: true - TemplateEditResponse: - required: - - template_id - properties: - template_id: - description: 'The id of the Template.' - type: string - type: object TemplateGetResponse: required: - template @@ -14022,6 +14137,10 @@ components: summary: 'Form Fields Per Document and Rules Example' value: $ref: examples/json/TemplateCreateEmbeddedDraftRequestFormFieldRules.json + TemplateEditRequest: + summary: 'Default Example' + value: + $ref: examples/json/TemplateEditRequest.json TemplateRemoveUserRequest: summary: 'Default Example' value: diff --git a/openapi.yaml b/openapi.yaml index 998bc4ebd..a976d732b 100644 --- a/openapi.yaml +++ b/openapi.yaml @@ -10794,6 +10794,17 @@ components: type: boolean default: false type: object + TemplateEditRequest: + properties: + cc_roles: + description: 'The CC roles that must be assigned when using the template to send a signature request' + type: array + items: + type: string + allow_form_view: + description: 'Allows signers to view the form fields before signing if set to `true`.' + type: boolean + type: object TemplateRemoveUserRequest: properties: account_id: @@ -13669,14 +13680,6 @@ components: $ref: '#/components/schemas/WarningResponse' type: object x-internal-class: true - TemplateEditResponse: - required: - - template_id - properties: - template_id: - description: 'The id of the Template.' - type: string - type: object TemplateGetResponse: required: - template @@ -14000,6 +14003,10 @@ components: summary: 'Form Fields Per Document and Rules Example' value: $ref: examples/json/TemplateCreateEmbeddedDraftRequestFormFieldRules.json + TemplateEditRequest: + summary: 'Default Example' + value: + $ref: examples/json/TemplateEditRequest.json TemplateRemoveUserRequest: summary: 'Default Example' value: diff --git a/sandbox/dotnet/src/Dropbox.SignSandbox/TemplateEditExample.cs b/sandbox/dotnet/src/Dropbox.SignSandbox/TemplateEditExample.cs new file mode 100644 index 000000000..fbbee34bb --- /dev/null +++ b/sandbox/dotnet/src/Dropbox.SignSandbox/TemplateEditExample.cs @@ -0,0 +1,43 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Text.Json; + +using Dropbox.Sign.Api; +using Dropbox.Sign.Client; +using Dropbox.Sign.Model; + +namespace Dropbox.SignSandbox; + +public class TemplateEditExample +{ + public static void Run() + { + var config = new Configuration(); + config.Username = "YOUR_API_KEY"; + // config.AccessToken = "YOUR_ACCESS_TOKEN"; + + var templateEditRequest = new TemplateEditRequest( + ccRoles: [ + "Role 1", + "Role 2", + ] + ); + + try + { + var response = new TemplateApi(config).TemplateEdit( + templateId: "f57db65d3f933b5316d398057a36176831451a35", + templateEditRequest: templateEditRequest + ); + + Console.WriteLine(response); + } + catch (ApiException e) + { + Console.WriteLine("Exception when calling TemplateApi#TemplateEdit: " + e.Message); + Console.WriteLine("Status Code: " + e.ErrorCode); + Console.WriteLine(e.StackTrace); + } + } +} diff --git a/sandbox/java/src/main/java/com/dropbox/sign_sandbox/TemplateEditExample.java b/sandbox/java/src/main/java/com/dropbox/sign_sandbox/TemplateEditExample.java new file mode 100644 index 000000000..ce182825f --- /dev/null +++ b/sandbox/java/src/main/java/com/dropbox/sign_sandbox/TemplateEditExample.java @@ -0,0 +1,48 @@ +package com.dropbox.sign_sandbox; + +import com.dropbox.sign.ApiException; +import com.dropbox.sign.Configuration; +import com.dropbox.sign.api.*; +import com.dropbox.sign.auth.*; +import com.dropbox.sign.JSON; +import com.dropbox.sign.model.*; + +import java.io.File; +import java.math.BigDecimal; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; + +public class TemplateEditExample +{ + public static void main(String[] args) + { + var config = Configuration.getDefaultApiClient(); + ((HttpBasicAuth) config.getAuthentication("api_key")).setUsername("YOUR_API_KEY"); + // ((HttpBearerAuth) config.getAuthentication("oauth2")).setBearerToken("YOUR_ACCESS_TOKEN"); + + var templateEditRequest = new TemplateEditRequest(); + templateEditRequest.ccRoles(List.of ( + "Role 1", + "Role 2" + )); + + try + { + var response = new TemplateApi(config).templateEdit( + "f57db65d3f933b5316d398057a36176831451a35", // templateId + templateEditRequest + ); + + System.out.println(response); + } catch (ApiException e) { + System.err.println("Exception when calling TemplateApi#templateEdit"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} diff --git a/sandbox/node/src/TemplateEditExample.ts b/sandbox/node/src/TemplateEditExample.ts new file mode 100644 index 000000000..f5aa7c248 --- /dev/null +++ b/sandbox/node/src/TemplateEditExample.ts @@ -0,0 +1,24 @@ +import * as fs from 'fs'; +import api from "@dropbox/sign" +import models from "@dropbox/sign" + +const apiCaller = new api.TemplateApi(); +apiCaller.username = "YOUR_API_KEY"; +// apiCaller.accessToken = "YOUR_ACCESS_TOKEN"; + +const templateEditRequest: models.TemplateEditRequest = { + ccRoles: [ + "Role 1", + "Role 2", + ], +}; + +apiCaller.templateEdit( + "f57db65d3f933b5316d398057a36176831451a35", // templateId + templateEditRequest, +).then(response => { + console.log(response.body); +}).catch(error => { + console.log("Exception when calling TemplateApi#templateEdit:"); + console.log(error.body); +}); diff --git a/sandbox/php/src/TemplateEditExample.php b/sandbox/php/src/TemplateEditExample.php new file mode 100644 index 000000000..fd4151942 --- /dev/null +++ b/sandbox/php/src/TemplateEditExample.php @@ -0,0 +1,29 @@ +setUsername("YOUR_API_KEY"); +// $config->setAccessToken("YOUR_ACCESS_TOKEN"); + +$template_edit_request = (new Dropbox\Sign\Model\TemplateEditRequest()) + ->setCcRoles([ + "Role 1", + "Role 2", + ]); + +try { + $response = (new Dropbox\Sign\Api\TemplateApi(config: $config))->templateEdit( + template_id: "f57db65d3f933b5316d398057a36176831451a35", + template_edit_request: $template_edit_request, + ); + + print_r($response); +} catch (Dropbox\Sign\ApiException $e) { + echo "Exception when calling TemplateApi#templateEdit: {$e->getMessage()}"; +} diff --git a/sandbox/python/src/TemplateEditExample.py b/sandbox/python/src/TemplateEditExample.py new file mode 100644 index 000000000..5267aa41a --- /dev/null +++ b/sandbox/python/src/TemplateEditExample.py @@ -0,0 +1,28 @@ +import json +from datetime import date, datetime +from pprint import pprint + +from dropbox_sign import ApiClient, ApiException, Configuration, api, models + +configuration = Configuration( + username="YOUR_API_KEY", + # access_token="YOUR_ACCESS_TOKEN", +) + +with ApiClient(configuration) as api_client: + template_edit_request = models.TemplateEditRequest( + cc_roles=[ + "Role 1", + "Role 2", + ], + ) + + try: + response = api.TemplateApi(api_client).template_edit( + template_id="f57db65d3f933b5316d398057a36176831451a35", + template_edit_request=template_edit_request, + ) + + pprint(response) + except ApiException as e: + print("Exception when calling TemplateApi#template_edit: %s\n" % e) diff --git a/sandbox/ruby/src/TemplateEditExample.rb b/sandbox/ruby/src/TemplateEditExample.rb new file mode 100644 index 000000000..28c89d79d --- /dev/null +++ b/sandbox/ruby/src/TemplateEditExample.rb @@ -0,0 +1,24 @@ +require "json" +require "dropbox-sign" + +Dropbox::Sign.configure do |config| + config.username = "YOUR_API_KEY" + # config.access_token = "YOUR_ACCESS_TOKEN" +end + +template_edit_request = Dropbox::Sign::TemplateEditRequest.new +template_edit_request.cc_roles = [ + "Role 1", + "Role 2", +] + +begin + response = Dropbox::Sign::TemplateApi.new.template_edit( + "f57db65d3f933b5316d398057a36176831451a35", # template_id + template_edit_request, + ) + + p response +rescue Dropbox::Sign::ApiError => e + puts "Exception when calling TemplateApi#template_edit: #{e}" +end diff --git a/sdks/dotnet/README.md b/sdks/dotnet/README.md index c8323efa3..d94acefcd 100644 --- a/sdks/dotnet/README.md +++ b/sdks/dotnet/README.md @@ -193,6 +193,7 @@ Class | Method | HTTP request | Description *TemplateApi* | [**TemplateCreate**](docs/TemplateApi.md#templatecreate) | **POST** /template/create | Create Template *TemplateApi* | [**TemplateCreateEmbeddedDraft**](docs/TemplateApi.md#templatecreateembeddeddraft) | **POST** /template/create_embedded_draft | Create Embedded Template Draft *TemplateApi* | [**TemplateDelete**](docs/TemplateApi.md#templatedelete) | **POST** /template/delete/{template_id} | Delete Template +*TemplateApi* | [**TemplateEdit**](docs/TemplateApi.md#templateedit) | **POST** /template/edit/{template_id} | Edit Template *TemplateApi* | [**TemplateFiles**](docs/TemplateApi.md#templatefiles) | **GET** /template/files/{template_id} | Get Template Files *TemplateApi* | [**TemplateFilesAsDataUri**](docs/TemplateApi.md#templatefilesasdatauri) | **GET** /template/files_as_data_uri/{template_id} | Get Template Files as Data Uri *TemplateApi* | [**TemplateFilesAsFileUrl**](docs/TemplateApi.md#templatefilesasfileurl) | **GET** /template/files_as_file_url/{template_id} | Get Template Files as File Url @@ -357,7 +358,7 @@ Class | Method | HTTP request | Description - [Model.TemplateCreateRequest](docs/TemplateCreateRequest.md) - [Model.TemplateCreateResponse](docs/TemplateCreateResponse.md) - [Model.TemplateCreateResponseTemplate](docs/TemplateCreateResponseTemplate.md) - - [Model.TemplateEditResponse](docs/TemplateEditResponse.md) + - [Model.TemplateEditRequest](docs/TemplateEditRequest.md) - [Model.TemplateGetResponse](docs/TemplateGetResponse.md) - [Model.TemplateListResponse](docs/TemplateListResponse.md) - [Model.TemplateRemoveUserRequest](docs/TemplateRemoveUserRequest.md) diff --git a/sdks/dotnet/docs/TemplateApi.md b/sdks/dotnet/docs/TemplateApi.md index f9c66e11c..88143375a 100644 --- a/sdks/dotnet/docs/TemplateApi.md +++ b/sdks/dotnet/docs/TemplateApi.md @@ -8,6 +8,7 @@ All URIs are relative to *https://api.hellosign.com/v3* | [**TemplateCreate**](TemplateApi.md#templatecreate) | **POST** /template/create | Create Template | | [**TemplateCreateEmbeddedDraft**](TemplateApi.md#templatecreateembeddeddraft) | **POST** /template/create_embedded_draft | Create Embedded Template Draft | | [**TemplateDelete**](TemplateApi.md#templatedelete) | **POST** /template/delete/{template_id} | Delete Template | +| [**TemplateEdit**](TemplateApi.md#templateedit) | **POST** /template/edit/{template_id} | Edit Template | | [**TemplateFiles**](TemplateApi.md#templatefiles) | **GET** /template/files/{template_id} | Get Template Files | | [**TemplateFilesAsDataUri**](TemplateApi.md#templatefilesasdatauri) | **GET** /template/files_as_data_uri/{template_id} | Get Template Files as Data Uri | | [**TemplateFilesAsFileUrl**](TemplateApi.md#templatefilesasfileurl) | **GET** /template/files_as_file_url/{template_id} | Get Template Files as File Url | @@ -544,6 +545,111 @@ void (empty response body) - **Accept**: application/json +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | * X-RateLimit-Limit - * X-RateLimit-Remaining - * X-Ratelimit-Reset - | +| **4XX** | failed_operation | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +# **TemplateEdit** +> TemplateGetResponse TemplateEdit (string templateId, TemplateEditRequest templateEditRequest) + +Edit Template + +Edits an existing template. + +### Example +```csharp +using System; +using System.Collections.Generic; +using System.IO; +using System.Text.Json; + +using Dropbox.Sign.Api; +using Dropbox.Sign.Client; +using Dropbox.Sign.Model; + +namespace Dropbox.SignSandbox; + +public class TemplateEditExample +{ + public static void Run() + { + var config = new Configuration(); + config.Username = "YOUR_API_KEY"; + // config.AccessToken = "YOUR_ACCESS_TOKEN"; + + var templateEditRequest = new TemplateEditRequest( + ccRoles: [ + "Role 1", + "Role 2", + ] + ); + + try + { + var response = new TemplateApi(config).TemplateEdit( + templateId: "f57db65d3f933b5316d398057a36176831451a35", + templateEditRequest: templateEditRequest + ); + + Console.WriteLine(response); + } + catch (ApiException e) + { + Console.WriteLine("Exception when calling TemplateApi#TemplateEdit: " + e.Message); + Console.WriteLine("Status Code: " + e.ErrorCode); + Console.WriteLine(e.StackTrace); + } + } +} + +``` + +#### Using the TemplateEditWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // Edit Template + ApiResponse response = apiInstance.TemplateEditWithHttpInfo(templateId, templateEditRequest); + Debug.Write("Status Code: " + response.StatusCode); + Debug.Write("Response Headers: " + response.Headers); + Debug.Write("Response Body: " + response.Data); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling TemplateApi.TemplateEditWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **templateId** | **string** | The id of the Template to edit. | | +| **templateEditRequest** | [**TemplateEditRequest**](TemplateEditRequest.md) | | | + +### Return type + +[**TemplateGetResponse**](TemplateGetResponse.md) + +### Authorization + +[api_key](../README.md#api_key), [oauth2](../README.md#oauth2) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| diff --git a/sdks/dotnet/docs/TemplateEditRequest.md b/sdks/dotnet/docs/TemplateEditRequest.md new file mode 100644 index 000000000..93bd43dbc --- /dev/null +++ b/sdks/dotnet/docs/TemplateEditRequest.md @@ -0,0 +1,10 @@ +# Dropbox.Sign.Model.TemplateEditRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**CcRoles** | **List<string>** | The CC roles that must be assigned when using the template to send a signature request | [optional] **AllowFormView** | **bool** | Allows signers to view the form fields before signing if set to `true`. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/sdks/dotnet/docs/TemplateEditResponse.md b/sdks/dotnet/docs/TemplateEditResponse.md deleted file mode 100644 index 830c7a9ed..000000000 --- a/sdks/dotnet/docs/TemplateEditResponse.md +++ /dev/null @@ -1,10 +0,0 @@ -# Dropbox.Sign.Model.TemplateEditResponse - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**TemplateId** | **string** | The id of the Template. | - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/sdks/dotnet/src/Dropbox.Sign/Api/TemplateApi.cs b/sdks/dotnet/src/Dropbox.Sign/Api/TemplateApi.cs index f98f0671c..b5c1d0140 100644 --- a/sdks/dotnet/src/Dropbox.Sign/Api/TemplateApi.cs +++ b/sdks/dotnet/src/Dropbox.Sign/Api/TemplateApi.cs @@ -122,6 +122,31 @@ public interface ITemplateApiSync : IApiAccessor /// ApiResponse of Object(void) ApiResponse TemplateDeleteWithHttpInfo(string templateId, int operationIndex = 0); /// + /// Edit Template + /// + /// + /// Edits an existing template. + /// + /// Thrown when fails to make API call + /// The id of the Template to edit. + /// + /// Index associated with the operation. + /// TemplateGetResponse + TemplateGetResponse TemplateEdit(string templateId, TemplateEditRequest templateEditRequest, int operationIndex = 0); + + /// + /// Edit Template + /// + /// + /// Edits an existing template. + /// + /// Thrown when fails to make API call + /// The id of the Template to edit. + /// + /// Index associated with the operation. + /// ApiResponse of TemplateGetResponse + ApiResponse TemplateEditWithHttpInfo(string templateId, TemplateEditRequest templateEditRequest, int operationIndex = 0); + /// /// Get Template Files /// /// @@ -408,6 +433,33 @@ public interface ITemplateApiAsync : IApiAccessor /// Task of ApiResponse System.Threading.Tasks.Task> TemplateDeleteWithHttpInfoAsync(string templateId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); /// + /// Edit Template + /// + /// + /// Edits an existing template. + /// + /// Thrown when fails to make API call + /// The id of the Template to edit. + /// + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of TemplateGetResponse + System.Threading.Tasks.Task TemplateEditAsync(string templateId, TemplateEditRequest templateEditRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + + /// + /// Edit Template + /// + /// + /// Edits an existing template. + /// + /// Thrown when fails to make API call + /// The id of the Template to edit. + /// + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (TemplateGetResponse) + System.Threading.Tasks.Task> TemplateEditWithHttpInfoAsync(string templateId, TemplateEditRequest templateEditRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + /// /// Get Template Files /// /// @@ -1452,6 +1504,208 @@ public Dropbox.Sign.Client.ApiResponse TemplateDeleteWithHttpInfo(string return localVarResponse; } + /// + /// Edit Template Edits an existing template. + /// + /// Thrown when fails to make API call + /// The id of the Template to edit. + /// + /// Index associated with the operation. + /// TemplateGetResponse + public TemplateGetResponse TemplateEdit(string templateId, TemplateEditRequest templateEditRequest, int operationIndex = 0) + { + Dropbox.Sign.Client.ApiResponse localVarResponse = TemplateEditWithHttpInfo(templateId, templateEditRequest); + return localVarResponse.Data; + } + + /// + /// Edit Template Edits an existing template. + /// + /// Thrown when fails to make API call + /// The id of the Template to edit. + /// + /// Index associated with the operation. + /// ApiResponse of TemplateGetResponse + public Dropbox.Sign.Client.ApiResponse TemplateEditWithHttpInfo(string templateId, TemplateEditRequest templateEditRequest, int operationIndex = 0) + { + // verify the required parameter 'templateId' is set + if (templateId == null) + { + throw new Dropbox.Sign.Client.ApiException(400, "Missing required parameter 'templateId' when calling TemplateApi->TemplateEdit"); + } + + // verify the required parameter 'templateEditRequest' is set + if (templateEditRequest == null) + { + throw new Dropbox.Sign.Client.ApiException(400, "Missing required parameter 'templateEditRequest' when calling TemplateApi->TemplateEdit"); + } + + Dropbox.Sign.Client.RequestOptions localVarRequestOptions = new Dropbox.Sign.Client.RequestOptions(); + + var localVarContentType = ""; + var openApiTypes = templateEditRequest.GetOpenApiTypes(); + if (ClientUtils.HasFileType(openApiTypes)) + { + ClientUtils.SetFormData(localVarRequestOptions, openApiTypes); + localVarContentType = "multipart/form-data"; + } + else + { + localVarContentType = "application/json"; + localVarRequestOptions.Data = templateEditRequest; + } + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } + + var localVarAccept = Dropbox.Sign.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } + + localVarRequestOptions.PathParameters.Add("template_id", Dropbox.Sign.Client.ClientUtils.ParameterToString(templateId)); // path parameter + + localVarRequestOptions.Operation = "TemplateApi.TemplateEdit"; + localVarRequestOptions.OperationIndex = operationIndex; + + // authentication (api_key) required + // http basic authentication required + if (!string.IsNullOrEmpty(this.Configuration.Username) || !string.IsNullOrEmpty(this.Configuration.Password) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Basic " + Dropbox.Sign.Client.ClientUtils.Base64Encode(this.Configuration.Username + ":" + this.Configuration.Password)); + } + // authentication (oauth2) required + // bearer authentication required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + + // make the HTTP request + var localVarResponse = this.Client.Post("/template/edit/{template_id}", localVarRequestOptions, this.Configuration); + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("TemplateEdit", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + + /// + /// Edit Template Edits an existing template. + /// + /// Thrown when fails to make API call + /// The id of the Template to edit. + /// + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of TemplateGetResponse + public async System.Threading.Tasks.Task TemplateEditAsync(string templateId, TemplateEditRequest templateEditRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + { + Dropbox.Sign.Client.ApiResponse localVarResponse = await TemplateEditWithHttpInfoAsync(templateId, templateEditRequest, operationIndex, cancellationToken).ConfigureAwait(false); + return localVarResponse.Data; + } + + /// + /// Edit Template Edits an existing template. + /// + /// Thrown when fails to make API call + /// The id of the Template to edit. + /// + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (TemplateGetResponse) + public async System.Threading.Tasks.Task> TemplateEditWithHttpInfoAsync(string templateId, TemplateEditRequest templateEditRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + { + // verify the required parameter 'templateId' is set + if (templateId == null) + { + throw new Dropbox.Sign.Client.ApiException(400, "Missing required parameter 'templateId' when calling TemplateApi->TemplateEdit"); + } + + // verify the required parameter 'templateEditRequest' is set + if (templateEditRequest == null) + { + throw new Dropbox.Sign.Client.ApiException(400, "Missing required parameter 'templateEditRequest' when calling TemplateApi->TemplateEdit"); + } + + + Dropbox.Sign.Client.RequestOptions localVarRequestOptions = new Dropbox.Sign.Client.RequestOptions(); + + var localVarContentType = ""; + var openApiTypes = templateEditRequest.GetOpenApiTypes(); + if (ClientUtils.HasFileType(openApiTypes)) + { + ClientUtils.SetFormData(localVarRequestOptions, openApiTypes); + localVarContentType = "multipart/form-data"; + } + else + { + localVarContentType = "application/json"; + localVarRequestOptions.Data = templateEditRequest; + } + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } + + var localVarAccept = Dropbox.Sign.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } + + localVarRequestOptions.PathParameters.Add("template_id", Dropbox.Sign.Client.ClientUtils.ParameterToString(templateId)); // path parameter + + localVarRequestOptions.Operation = "TemplateApi.TemplateEdit"; + localVarRequestOptions.OperationIndex = operationIndex; + + // authentication (api_key) required + // http basic authentication required + if (!string.IsNullOrEmpty(this.Configuration.Username) || !string.IsNullOrEmpty(this.Configuration.Password) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Basic " + Dropbox.Sign.Client.ClientUtils.Base64Encode(this.Configuration.Username + ":" + this.Configuration.Password)); + } + // authentication (oauth2) required + // bearer authentication required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + + // make the HTTP request + var localVarResponse = await this.AsynchronousClient.PostAsync("/template/edit/{template_id}", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("TemplateEdit", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + /// /// Get Template Files Obtain a copy of the current documents specified by the `template_id` parameter. Returns a PDF or ZIP file. 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. /// diff --git a/sdks/dotnet/src/Dropbox.Sign/Model/TemplateEditResponse.cs b/sdks/dotnet/src/Dropbox.Sign/Model/TemplateEditRequest.cs similarity index 55% rename from sdks/dotnet/src/Dropbox.Sign/Model/TemplateEditResponse.cs rename to sdks/dotnet/src/Dropbox.Sign/Model/TemplateEditRequest.cs index f76b5eb4f..8191c2cfa 100644 --- a/sdks/dotnet/src/Dropbox.Sign/Model/TemplateEditResponse.cs +++ b/sdks/dotnet/src/Dropbox.Sign/Model/TemplateEditRequest.cs @@ -27,54 +27,58 @@ namespace Dropbox.Sign.Model { /// - /// TemplateEditResponse + /// TemplateEditRequest /// - [DataContract(Name = "TemplateEditResponse")] + [DataContract(Name = "TemplateEditRequest")] [JsonObject(ItemNullValueHandling = NullValueHandling.Ignore)] - public partial class TemplateEditResponse : IEquatable, IValidatableObject + public partial class TemplateEditRequest : IEquatable, IValidatableObject { /// - /// Initializes a new instance of the class. + /// Initializes a new instance of the class. /// [JsonConstructorAttribute] - protected TemplateEditResponse() { } + protected TemplateEditRequest() { } /// - /// Initializes a new instance of the class. + /// Initializes a new instance of the class. /// - /// The id of the Template. (required). - public TemplateEditResponse(string templateId = default(string)) + /// The CC roles that must be assigned when using the template to send a signature request. + /// Allows signers to view the form fields before signing if set to `true`.. + public TemplateEditRequest(List ccRoles = default(List), bool allowFormView = default(bool)) { - // to ensure "templateId" is required (not null) - if (templateId == null) - { - throw new ArgumentNullException("templateId is a required property for TemplateEditResponse and cannot be null"); - } - this.TemplateId = templateId; + this.CcRoles = ccRoles; + this.AllowFormView = allowFormView; } /// /// Attempt to instantiate and hydrate a new instance of this class /// /// String of JSON data representing target object - public static TemplateEditResponse Init(string jsonData) + public static TemplateEditRequest Init(string jsonData) { - var obj = JsonConvert.DeserializeObject(jsonData); + var obj = JsonConvert.DeserializeObject(jsonData); if (obj == null) { - throw new Exception("Unable to deserialize JSON to instance of TemplateEditResponse"); + throw new Exception("Unable to deserialize JSON to instance of TemplateEditRequest"); } return obj; } /// - /// The id of the Template. + /// The CC roles that must be assigned when using the template to send a signature request + /// + /// The CC roles that must be assigned when using the template to send a signature request + [DataMember(Name = "cc_roles", EmitDefaultValue = true)] + public List CcRoles { get; set; } + + /// + /// Allows signers to view the form fields before signing if set to `true`. /// - /// The id of the Template. - [DataMember(Name = "template_id", IsRequired = true, EmitDefaultValue = true)] - public string TemplateId { get; set; } + /// Allows signers to view the form fields before signing if set to `true`. + [DataMember(Name = "allow_form_view", EmitDefaultValue = true)] + public bool AllowFormView { get; set; } /// /// Returns the string presentation of the object @@ -83,8 +87,9 @@ public static TemplateEditResponse Init(string jsonData) public override string ToString() { StringBuilder sb = new StringBuilder(); - sb.Append("class TemplateEditResponse {\n"); - sb.Append(" TemplateId: ").Append(TemplateId).Append("\n"); + sb.Append("class TemplateEditRequest {\n"); + sb.Append(" CcRoles: ").Append(CcRoles).Append("\n"); + sb.Append(" AllowFormView: ").Append(AllowFormView).Append("\n"); sb.Append("}\n"); return sb.ToString(); } @@ -105,15 +110,15 @@ public virtual string ToJson() /// Boolean public override bool Equals(object input) { - return this.Equals(input as TemplateEditResponse); + return this.Equals(input as TemplateEditRequest); } /// - /// Returns true if TemplateEditResponse instances are equal + /// Returns true if TemplateEditRequest instances are equal /// - /// Instance of TemplateEditResponse to be compared + /// Instance of TemplateEditRequest to be compared /// Boolean - public bool Equals(TemplateEditResponse input) + public bool Equals(TemplateEditRequest input) { if (input == null) { @@ -121,9 +126,14 @@ public bool Equals(TemplateEditResponse input) } return ( - this.TemplateId == input.TemplateId || - (this.TemplateId != null && - this.TemplateId.Equals(input.TemplateId)) + this.CcRoles == input.CcRoles || + this.CcRoles != null && + input.CcRoles != null && + this.CcRoles.SequenceEqual(input.CcRoles) + ) && + ( + this.AllowFormView == input.AllowFormView || + this.AllowFormView.Equals(input.AllowFormView) ); } @@ -136,10 +146,11 @@ public override int GetHashCode() unchecked // Overflow is fine, just wrap { int hashCode = 41; - if (this.TemplateId != null) + if (this.CcRoles != null) { - hashCode = (hashCode * 59) + this.TemplateId.GetHashCode(); + hashCode = (hashCode * 59) + this.CcRoles.GetHashCode(); } + hashCode = (hashCode * 59) + this.AllowFormView.GetHashCode(); return hashCode; } } @@ -158,10 +169,17 @@ public List GetOpenApiTypes() var types = new List(); types.Add(new OpenApiType() { - Name = "template_id", - Property = "TemplateId", - Type = "string", - Value = TemplateId, + Name = "cc_roles", + Property = "CcRoles", + Type = "List", + Value = CcRoles, + }); + types.Add(new OpenApiType() + { + Name = "allow_form_view", + Property = "AllowFormView", + Type = "bool", + Value = AllowFormView, }); return types; diff --git a/sdks/java-v1/README.md b/sdks/java-v1/README.md index 50dab15bb..9440e7e36 100644 --- a/sdks/java-v1/README.md +++ b/sdks/java-v1/README.md @@ -236,6 +236,7 @@ Class | Method | HTTP request | Description *TemplateApi* | [**templateCreate**](docs/TemplateApi.md#templateCreate) | **POST** /template/create | Create Template *TemplateApi* | [**templateCreateEmbeddedDraft**](docs/TemplateApi.md#templateCreateEmbeddedDraft) | **POST** /template/create_embedded_draft | Create Embedded Template Draft *TemplateApi* | [**templateDelete**](docs/TemplateApi.md#templateDelete) | **POST** /template/delete/{template_id} | Delete Template +*TemplateApi* | [**templateEdit**](docs/TemplateApi.md#templateEdit) | **POST** /template/edit/{template_id} | Edit Template *TemplateApi* | [**templateFiles**](docs/TemplateApi.md#templateFiles) | **GET** /template/files/{template_id} | Get Template Files *TemplateApi* | [**templateFilesAsDataUri**](docs/TemplateApi.md#templateFilesAsDataUri) | **GET** /template/files_as_data_uri/{template_id} | Get Template Files as Data Uri *TemplateApi* | [**templateFilesAsFileUrl**](docs/TemplateApi.md#templateFilesAsFileUrl) | **GET** /template/files_as_file_url/{template_id} | Get Template Files as File Url @@ -399,7 +400,7 @@ Class | Method | HTTP request | Description - [TemplateCreateRequest](docs/TemplateCreateRequest.md) - [TemplateCreateResponse](docs/TemplateCreateResponse.md) - [TemplateCreateResponseTemplate](docs/TemplateCreateResponseTemplate.md) - - [TemplateEditResponse](docs/TemplateEditResponse.md) + - [TemplateEditRequest](docs/TemplateEditRequest.md) - [TemplateGetResponse](docs/TemplateGetResponse.md) - [TemplateListResponse](docs/TemplateListResponse.md) - [TemplateRemoveUserRequest](docs/TemplateRemoveUserRequest.md) diff --git a/sdks/java-v1/docs/TemplateApi.md b/sdks/java-v1/docs/TemplateApi.md index dd470487b..168f2ad66 100644 --- a/sdks/java-v1/docs/TemplateApi.md +++ b/sdks/java-v1/docs/TemplateApi.md @@ -8,6 +8,7 @@ All URIs are relative to *https://api.hellosign.com/v3* [**templateCreate**](TemplateApi.md#templateCreate) | **POST** /template/create | Create Template [**templateCreateEmbeddedDraft**](TemplateApi.md#templateCreateEmbeddedDraft) | **POST** /template/create_embedded_draft | Create Embedded Template Draft [**templateDelete**](TemplateApi.md#templateDelete) | **POST** /template/delete/{template_id} | Delete Template +[**templateEdit**](TemplateApi.md#templateEdit) | **POST** /template/edit/{template_id} | Edit Template [**templateFiles**](TemplateApi.md#templateFiles) | **GET** /template/files/{template_id} | Get Template Files [**templateFilesAsDataUri**](TemplateApi.md#templateFilesAsDataUri) | **GET** /template/files_as_data_uri/{template_id} | Get Template Files as Data Uri [**templateFilesAsFileUrl**](TemplateApi.md#templateFilesAsFileUrl) | **GET** /template/files_as_file_url/{template_id} | Get Template Files as File Url @@ -473,6 +474,96 @@ null (empty response body) | **4XX** | failed_operation | - | +## templateEdit + +> TemplateGetResponse templateEdit(templateId, templateEditRequest) + +Edit Template + +Edits an existing template. + +### Example + +```java +package com.dropbox.sign_sandbox; + +import com.dropbox.sign.ApiException; +import com.dropbox.sign.Configuration; +import com.dropbox.sign.api.*; +import com.dropbox.sign.auth.*; +import com.dropbox.sign.JSON; +import com.dropbox.sign.model.*; + +import java.io.File; +import java.math.BigDecimal; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; + +public class TemplateEditExample +{ + public static void main(String[] args) + { + var config = Configuration.getDefaultApiClient(); + ((HttpBasicAuth) config.getAuthentication("api_key")).setUsername("YOUR_API_KEY"); + // ((HttpBearerAuth) config.getAuthentication("oauth2")).setBearerToken("YOUR_ACCESS_TOKEN"); + + var templateEditRequest = new TemplateEditRequest(); + templateEditRequest.ccRoles(List.of ( + "Role 1", + "Role 2" + )); + + try + { + var response = new TemplateApi(config).templateEdit( + "f57db65d3f933b5316d398057a36176831451a35", // templateId + templateEditRequest + ); + + System.out.println(response); + } catch (ApiException e) { + System.err.println("Exception when calling TemplateApi#templateEdit"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} + +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| + **templateId** | **String**| The id of the Template to edit. | + **templateEditRequest** | [**TemplateEditRequest**](TemplateEditRequest.md)| | + +### Return type + +[**TemplateGetResponse**](TemplateGetResponse.md) + +### Authorization + +[api_key](../README.md#api_key), [oauth2](../README.md#oauth2) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | * X-RateLimit-Limit - * X-RateLimit-Remaining - * X-Ratelimit-Reset - | +| **4XX** | failed_operation | - | + + ## templateFiles > File templateFiles(templateId, fileType) diff --git a/sdks/java-v1/docs/TemplateEditRequest.md b/sdks/java-v1/docs/TemplateEditRequest.md new file mode 100644 index 000000000..9e9536e9d --- /dev/null +++ b/sdks/java-v1/docs/TemplateEditRequest.md @@ -0,0 +1,15 @@ + + +# TemplateEditRequest + + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +| `ccRoles` | ```List``` | The CC roles that must be assigned when using the template to send a signature request | | +| `allowFormView` | ```Boolean``` | Allows signers to view the form fields before signing if set to `true`. | | + + + diff --git a/sdks/java-v1/docs/TemplateEditResponse.md b/sdks/java-v1/docs/TemplateEditResponse.md deleted file mode 100644 index 88d225e68..000000000 --- a/sdks/java-v1/docs/TemplateEditResponse.md +++ /dev/null @@ -1,14 +0,0 @@ - - -# TemplateEditResponse - - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -| `templateId`*_required_ | ```String``` | The id of the Template. | | - - - diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/api/TemplateApi.java b/sdks/java-v1/src/main/java/com/dropbox/sign/api/TemplateApi.java index 14eeae070..5c539ad49 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/api/TemplateApi.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/api/TemplateApi.java @@ -12,6 +12,7 @@ import com.dropbox.sign.model.TemplateCreateEmbeddedDraftResponse; import com.dropbox.sign.model.TemplateCreateRequest; import com.dropbox.sign.model.TemplateCreateResponse; +import com.dropbox.sign.model.TemplateEditRequest; import com.dropbox.sign.model.TemplateGetResponse; import com.dropbox.sign.model.TemplateListResponse; import com.dropbox.sign.model.TemplateRemoveUserRequest; @@ -360,6 +361,89 @@ public ApiResponse templateDeleteWithHttpInfo(String templateId) throws Ap false); } + /** + * Edit Template Edits an existing template. + * + * @param templateId The id of the Template to edit. (required) + * @param templateEditRequest (required) + * @return TemplateGetResponse + * @throws ApiException if fails to make API call + * @http.response.details + * + * Response Details + * Status Code Description Response Headers + * 200 successful operation * X-RateLimit-Limit - * X-RateLimit-Remaining - * X-Ratelimit-Reset - + * 4XX failed_operation - + * + */ + public TemplateGetResponse templateEdit( + String templateId, TemplateEditRequest templateEditRequest) throws ApiException { + return templateEditWithHttpInfo(templateId, templateEditRequest).getData(); + } + + /** + * Edit Template Edits an existing template. + * + * @param templateId The id of the Template to edit. (required) + * @param templateEditRequest (required) + * @return ApiResponse<TemplateGetResponse> + * @throws ApiException if fails to make API call + * @http.response.details + * + * Response Details + * Status Code Description Response Headers + * 200 successful operation * X-RateLimit-Limit - * X-RateLimit-Remaining - * X-Ratelimit-Reset - + * 4XX failed_operation - + * + */ + public ApiResponse templateEditWithHttpInfo( + String templateId, TemplateEditRequest templateEditRequest) throws ApiException { + + // Check required parameters + if (templateId == null) { + throw new ApiException( + 400, "Missing the required parameter 'templateId' when calling templateEdit"); + } + if (templateEditRequest == null) { + throw new ApiException( + 400, + "Missing the required parameter 'templateEditRequest' when calling" + + " templateEdit"); + } + + // Path parameters + String localVarPath = + "/template/edit/{template_id}" + .replaceAll( + "\\{template_id}", apiClient.escapeString(templateId.toString())); + + String localVarAccept = apiClient.selectHeaderAccept("application/json"); + Map localVarFormParams = new LinkedHashMap<>(); + localVarFormParams = templateEditRequest.createFormData(); + boolean isFileTypeFound = !localVarFormParams.isEmpty(); + String localVarContentType = + isFileTypeFound + ? "multipart/form-data" + : apiClient.selectHeaderContentType("application/json"); + String[] localVarAuthNames = new String[] {"api_key", "oauth2"}; + GenericType localVarReturnType = + new GenericType() {}; + return apiClient.invokeAPI( + "TemplateApi.templateEdit", + localVarPath, + "POST", + new ArrayList<>(), + isFileTypeFound ? null : templateEditRequest, + new LinkedHashMap<>(), + new LinkedHashMap<>(), + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType, + false); + } + /** * Get Template Files Obtain a copy of the current documents specified by the * `template_id` parameter. Returns a PDF or ZIP file. If the files are currently diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/model/TemplateEditRequest.java b/sdks/java-v1/src/main/java/com/dropbox/sign/model/TemplateEditRequest.java new file mode 100644 index 000000000..4c803ca8d --- /dev/null +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/model/TemplateEditRequest.java @@ -0,0 +1,225 @@ +/* + * Dropbox Sign API + * Dropbox Sign v3 API + * + * The version of the OpenAPI document: 3.0.0 + * Contact: apisupport@hellosign.com + * + * 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.dropbox.sign.model; + +import com.dropbox.sign.ApiException; +import com.dropbox.sign.JSON; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.databind.ObjectMapper; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; + +/** TemplateEditRequest */ +@JsonPropertyOrder({ + TemplateEditRequest.JSON_PROPERTY_CC_ROLES, + TemplateEditRequest.JSON_PROPERTY_ALLOW_FORM_VIEW +}) +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +@JsonIgnoreProperties(ignoreUnknown = true) +public class TemplateEditRequest { + public static final String JSON_PROPERTY_CC_ROLES = "cc_roles"; + @javax.annotation.Nullable private List ccRoles = null; + + public static final String JSON_PROPERTY_ALLOW_FORM_VIEW = "allow_form_view"; + @javax.annotation.Nullable private Boolean allowFormView; + + public TemplateEditRequest() {} + + /** + * Attempt to instantiate and hydrate a new instance of this class + * + * @param jsonData String of JSON data representing target object + */ + public static TemplateEditRequest init(String jsonData) throws Exception { + return new ObjectMapper().readValue(jsonData, TemplateEditRequest.class); + } + + public static TemplateEditRequest init(HashMap data) throws Exception { + return new ObjectMapper() + .readValue(new ObjectMapper().writeValueAsString(data), TemplateEditRequest.class); + } + + public TemplateEditRequest ccRoles(@javax.annotation.Nullable List ccRoles) { + this.ccRoles = ccRoles; + return this; + } + + public TemplateEditRequest addCcRolesItem(String ccRolesItem) { + if (this.ccRoles == null) { + this.ccRoles = new ArrayList<>(); + } + this.ccRoles.add(ccRolesItem); + return this; + } + + /** + * The CC roles that must be assigned when using the template to send a signature request + * + * @return ccRoles + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_CC_ROLES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getCcRoles() { + return ccRoles; + } + + @JsonProperty(JSON_PROPERTY_CC_ROLES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCcRoles(@javax.annotation.Nullable List ccRoles) { + this.ccRoles = ccRoles; + } + + public TemplateEditRequest allowFormView(@javax.annotation.Nullable Boolean allowFormView) { + this.allowFormView = allowFormView; + return this; + } + + /** + * Allows signers to view the form fields before signing if set to `true`. + * + * @return allowFormView + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ALLOW_FORM_VIEW) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getAllowFormView() { + return allowFormView; + } + + @JsonProperty(JSON_PROPERTY_ALLOW_FORM_VIEW) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAllowFormView(@javax.annotation.Nullable Boolean allowFormView) { + this.allowFormView = allowFormView; + } + + /** Return true if this TemplateEditRequest object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TemplateEditRequest templateEditRequest = (TemplateEditRequest) o; + return Objects.equals(this.ccRoles, templateEditRequest.ccRoles) + && Objects.equals(this.allowFormView, templateEditRequest.allowFormView); + } + + @Override + public int hashCode() { + return Objects.hash(ccRoles, allowFormView); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TemplateEditRequest {\n"); + sb.append(" ccRoles: ").append(toIndentedString(ccRoles)).append("\n"); + sb.append(" allowFormView: ").append(toIndentedString(allowFormView)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public Map createFormData() throws ApiException { + Map map = new HashMap<>(); + boolean fileTypeFound = false; + try { + if (ccRoles != null) { + if (isFileTypeOrListOfFiles(ccRoles)) { + fileTypeFound = true; + } + + if (ccRoles.getClass().equals(java.io.File.class) + || ccRoles.getClass().equals(Integer.class) + || ccRoles.getClass().equals(String.class) + || ccRoles.getClass().isEnum()) { + map.put("cc_roles", ccRoles); + } else if (isListOfFile(ccRoles)) { + for (int i = 0; i < getListSize(ccRoles); i++) { + map.put("cc_roles[" + i + "]", getFromList(ccRoles, i)); + } + } else { + map.put("cc_roles", JSON.getDefault().getMapper().writeValueAsString(ccRoles)); + } + } + if (allowFormView != null) { + if (isFileTypeOrListOfFiles(allowFormView)) { + fileTypeFound = true; + } + + if (allowFormView.getClass().equals(java.io.File.class) + || allowFormView.getClass().equals(Integer.class) + || allowFormView.getClass().equals(String.class) + || allowFormView.getClass().isEnum()) { + map.put("allow_form_view", allowFormView); + } else if (isListOfFile(allowFormView)) { + for (int i = 0; i < getListSize(allowFormView); i++) { + map.put("allow_form_view[" + i + "]", getFromList(allowFormView, i)); + } + } else { + map.put( + "allow_form_view", + JSON.getDefault().getMapper().writeValueAsString(allowFormView)); + } + } + } catch (Exception e) { + throw new ApiException(e); + } + + return fileTypeFound ? map : new HashMap<>(); + } + + private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { + return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); + } + + private boolean isListOfFile(Object obj) throws Exception { + return obj instanceof java.util.List + && !isListEmpty(obj) + && getFromList(obj, 0) instanceof java.io.File; + } + + private boolean isListEmpty(Object obj) throws Exception { + return (boolean) + Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); + } + + private Object getFromList(Object obj, int index) throws Exception { + return Class.forName(java.util.List.class.getName()) + .getMethod("get", int.class) + .invoke(obj, index); + } + + private int getListSize(Object obj) throws Exception { + return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/model/TemplateEditResponse.java b/sdks/java-v1/src/main/java/com/dropbox/sign/model/TemplateEditResponse.java deleted file mode 100644 index 095b796a1..000000000 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/model/TemplateEditResponse.java +++ /dev/null @@ -1,168 +0,0 @@ -/* - * Dropbox Sign API - * Dropbox Sign v3 API - * - * The version of the OpenAPI document: 3.0.0 - * Contact: apisupport@hellosign.com - * - * 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.dropbox.sign.model; - -import com.dropbox.sign.ApiException; -import com.dropbox.sign.JSON; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import com.fasterxml.jackson.databind.ObjectMapper; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; - -/** TemplateEditResponse */ -@JsonPropertyOrder({TemplateEditResponse.JSON_PROPERTY_TEMPLATE_ID}) -@javax.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.12.0") -@JsonIgnoreProperties(ignoreUnknown = true) -public class TemplateEditResponse { - public static final String JSON_PROPERTY_TEMPLATE_ID = "template_id"; - @javax.annotation.Nonnull private String templateId; - - public TemplateEditResponse() {} - - /** - * Attempt to instantiate and hydrate a new instance of this class - * - * @param jsonData String of JSON data representing target object - */ - public static TemplateEditResponse init(String jsonData) throws Exception { - return new ObjectMapper().readValue(jsonData, TemplateEditResponse.class); - } - - public static TemplateEditResponse init(HashMap data) throws Exception { - return new ObjectMapper() - .readValue(new ObjectMapper().writeValueAsString(data), TemplateEditResponse.class); - } - - public TemplateEditResponse templateId(@javax.annotation.Nonnull String templateId) { - this.templateId = templateId; - return this; - } - - /** - * The id of the Template. - * - * @return templateId - */ - @javax.annotation.Nonnull - @JsonProperty(JSON_PROPERTY_TEMPLATE_ID) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public String getTemplateId() { - return templateId; - } - - @JsonProperty(JSON_PROPERTY_TEMPLATE_ID) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setTemplateId(@javax.annotation.Nonnull String templateId) { - this.templateId = templateId; - } - - /** Return true if this TemplateEditResponse object is equal to o. */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - TemplateEditResponse templateEditResponse = (TemplateEditResponse) o; - return Objects.equals(this.templateId, templateEditResponse.templateId); - } - - @Override - public int hashCode() { - return Objects.hash(templateId); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class TemplateEditResponse {\n"); - sb.append(" templateId: ").append(toIndentedString(templateId)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - public Map createFormData() throws ApiException { - Map map = new HashMap<>(); - boolean fileTypeFound = false; - try { - if (templateId != null) { - if (isFileTypeOrListOfFiles(templateId)) { - fileTypeFound = true; - } - - if (templateId.getClass().equals(java.io.File.class) - || templateId.getClass().equals(Integer.class) - || templateId.getClass().equals(String.class) - || templateId.getClass().isEnum()) { - map.put("template_id", templateId); - } else if (isListOfFile(templateId)) { - for (int i = 0; i < getListSize(templateId); i++) { - map.put("template_id[" + i + "]", getFromList(templateId, i)); - } - } else { - map.put( - "template_id", - JSON.getDefault().getMapper().writeValueAsString(templateId)); - } - } - } catch (Exception e) { - throw new ApiException(e); - } - - return fileTypeFound ? map : new HashMap<>(); - } - - private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { - return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); - } - - private boolean isListOfFile(Object obj) throws Exception { - return obj instanceof java.util.List - && !isListEmpty(obj) - && getFromList(obj, 0) instanceof java.io.File; - } - - private boolean isListEmpty(Object obj) throws Exception { - return (boolean) - Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); - } - - private Object getFromList(Object obj, int index) throws Exception { - return Class.forName(java.util.List.class.getName()) - .getMethod("get", int.class) - .invoke(obj, index); - } - - private int getListSize(Object obj) throws Exception { - return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} diff --git a/sdks/java-v2/README.md b/sdks/java-v2/README.md index bf70604a9..ac6414ec7 100644 --- a/sdks/java-v2/README.md +++ b/sdks/java-v2/README.md @@ -212,6 +212,7 @@ Class | Method | HTTP request | Description *TemplateApi* | [**templateCreate**](docs/TemplateApi.md#templateCreate) | **POST** /template/create | Create Template *TemplateApi* | [**templateCreateEmbeddedDraft**](docs/TemplateApi.md#templateCreateEmbeddedDraft) | **POST** /template/create_embedded_draft | Create Embedded Template Draft *TemplateApi* | [**templateDelete**](docs/TemplateApi.md#templateDelete) | **POST** /template/delete/{template_id} | Delete Template +*TemplateApi* | [**templateEdit**](docs/TemplateApi.md#templateEdit) | **POST** /template/edit/{template_id} | Edit Template *TemplateApi* | [**templateFiles**](docs/TemplateApi.md#templateFiles) | **GET** /template/files/{template_id} | Get Template Files *TemplateApi* | [**templateFilesAsDataUri**](docs/TemplateApi.md#templateFilesAsDataUri) | **GET** /template/files_as_data_uri/{template_id} | Get Template Files as Data Uri *TemplateApi* | [**templateFilesAsFileUrl**](docs/TemplateApi.md#templateFilesAsFileUrl) | **GET** /template/files_as_file_url/{template_id} | Get Template Files as File Url @@ -375,7 +376,7 @@ Class | Method | HTTP request | Description - [TemplateCreateRequest](docs/TemplateCreateRequest.md) - [TemplateCreateResponse](docs/TemplateCreateResponse.md) - [TemplateCreateResponseTemplate](docs/TemplateCreateResponseTemplate.md) - - [TemplateEditResponse](docs/TemplateEditResponse.md) + - [TemplateEditRequest](docs/TemplateEditRequest.md) - [TemplateGetResponse](docs/TemplateGetResponse.md) - [TemplateListResponse](docs/TemplateListResponse.md) - [TemplateRemoveUserRequest](docs/TemplateRemoveUserRequest.md) diff --git a/sdks/java-v2/docs/TemplateApi.md b/sdks/java-v2/docs/TemplateApi.md index dd470487b..168f2ad66 100644 --- a/sdks/java-v2/docs/TemplateApi.md +++ b/sdks/java-v2/docs/TemplateApi.md @@ -8,6 +8,7 @@ All URIs are relative to *https://api.hellosign.com/v3* [**templateCreate**](TemplateApi.md#templateCreate) | **POST** /template/create | Create Template [**templateCreateEmbeddedDraft**](TemplateApi.md#templateCreateEmbeddedDraft) | **POST** /template/create_embedded_draft | Create Embedded Template Draft [**templateDelete**](TemplateApi.md#templateDelete) | **POST** /template/delete/{template_id} | Delete Template +[**templateEdit**](TemplateApi.md#templateEdit) | **POST** /template/edit/{template_id} | Edit Template [**templateFiles**](TemplateApi.md#templateFiles) | **GET** /template/files/{template_id} | Get Template Files [**templateFilesAsDataUri**](TemplateApi.md#templateFilesAsDataUri) | **GET** /template/files_as_data_uri/{template_id} | Get Template Files as Data Uri [**templateFilesAsFileUrl**](TemplateApi.md#templateFilesAsFileUrl) | **GET** /template/files_as_file_url/{template_id} | Get Template Files as File Url @@ -473,6 +474,96 @@ null (empty response body) | **4XX** | failed_operation | - | +## templateEdit + +> TemplateGetResponse templateEdit(templateId, templateEditRequest) + +Edit Template + +Edits an existing template. + +### Example + +```java +package com.dropbox.sign_sandbox; + +import com.dropbox.sign.ApiException; +import com.dropbox.sign.Configuration; +import com.dropbox.sign.api.*; +import com.dropbox.sign.auth.*; +import com.dropbox.sign.JSON; +import com.dropbox.sign.model.*; + +import java.io.File; +import java.math.BigDecimal; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; + +public class TemplateEditExample +{ + public static void main(String[] args) + { + var config = Configuration.getDefaultApiClient(); + ((HttpBasicAuth) config.getAuthentication("api_key")).setUsername("YOUR_API_KEY"); + // ((HttpBearerAuth) config.getAuthentication("oauth2")).setBearerToken("YOUR_ACCESS_TOKEN"); + + var templateEditRequest = new TemplateEditRequest(); + templateEditRequest.ccRoles(List.of ( + "Role 1", + "Role 2" + )); + + try + { + var response = new TemplateApi(config).templateEdit( + "f57db65d3f933b5316d398057a36176831451a35", // templateId + templateEditRequest + ); + + System.out.println(response); + } catch (ApiException e) { + System.err.println("Exception when calling TemplateApi#templateEdit"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} + +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| + **templateId** | **String**| The id of the Template to edit. | + **templateEditRequest** | [**TemplateEditRequest**](TemplateEditRequest.md)| | + +### Return type + +[**TemplateGetResponse**](TemplateGetResponse.md) + +### Authorization + +[api_key](../README.md#api_key), [oauth2](../README.md#oauth2) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | * X-RateLimit-Limit - * X-RateLimit-Remaining - * X-Ratelimit-Reset - | +| **4XX** | failed_operation | - | + + ## templateFiles > File templateFiles(templateId, fileType) diff --git a/sdks/java-v2/docs/TemplateEditRequest.md b/sdks/java-v2/docs/TemplateEditRequest.md new file mode 100644 index 000000000..9e9536e9d --- /dev/null +++ b/sdks/java-v2/docs/TemplateEditRequest.md @@ -0,0 +1,15 @@ + + +# TemplateEditRequest + + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +| `ccRoles` | ```List``` | The CC roles that must be assigned when using the template to send a signature request | | +| `allowFormView` | ```Boolean``` | Allows signers to view the form fields before signing if set to `true`. | | + + + diff --git a/sdks/java-v2/docs/TemplateEditResponse.md b/sdks/java-v2/docs/TemplateEditResponse.md deleted file mode 100644 index 88d225e68..000000000 --- a/sdks/java-v2/docs/TemplateEditResponse.md +++ /dev/null @@ -1,14 +0,0 @@ - - -# TemplateEditResponse - - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -| `templateId`*_required_ | ```String``` | The id of the Template. | | - - - diff --git a/sdks/java-v2/src/main/java/com/dropbox/sign/api/TemplateApi.java b/sdks/java-v2/src/main/java/com/dropbox/sign/api/TemplateApi.java index 974e61c40..11ca2356a 100644 --- a/sdks/java-v2/src/main/java/com/dropbox/sign/api/TemplateApi.java +++ b/sdks/java-v2/src/main/java/com/dropbox/sign/api/TemplateApi.java @@ -17,6 +17,7 @@ import com.dropbox.sign.model.TemplateCreateEmbeddedDraftResponse; import com.dropbox.sign.model.TemplateCreateRequest; import com.dropbox.sign.model.TemplateCreateResponse; +import com.dropbox.sign.model.TemplateEditRequest; import com.dropbox.sign.model.TemplateGetResponse; import com.dropbox.sign.model.TemplateListResponse; import com.dropbox.sign.model.TemplateRemoveUserRequest; @@ -322,6 +323,78 @@ public ApiResponse templateDeleteWithHttpInfo(String templateId) throws Ap false ); } + /** + * Edit Template + * Edits an existing template. + * @param templateId The id of the Template to edit. (required) + * @param templateEditRequest (required) + * @return TemplateGetResponse + * @throws ApiException if fails to make API call + * @http.response.details + + Response Details + Status Code Description Response Headers + 200 successful operation * X-RateLimit-Limit - * X-RateLimit-Remaining - * X-Ratelimit-Reset - + 4XX failed_operation - + + */ + public TemplateGetResponse templateEdit(String templateId, TemplateEditRequest templateEditRequest) throws ApiException { + return templateEditWithHttpInfo(templateId, templateEditRequest).getData(); + } + + + /** + * Edit Template + * Edits an existing template. + * @param templateId The id of the Template to edit. (required) + * @param templateEditRequest (required) + * @return ApiResponse<TemplateGetResponse> + * @throws ApiException if fails to make API call + * @http.response.details + + Response Details + Status Code Description Response Headers + 200 successful operation * X-RateLimit-Limit - * X-RateLimit-Remaining - * X-Ratelimit-Reset - + 4XX failed_operation - + + */ + public ApiResponse templateEditWithHttpInfo(String templateId, TemplateEditRequest templateEditRequest) throws ApiException { + + // Check required parameters + if (templateId == null) { + throw new ApiException(400, "Missing the required parameter 'templateId' when calling templateEdit"); + } + if (templateEditRequest == null) { + throw new ApiException(400, "Missing the required parameter 'templateEditRequest' when calling templateEdit"); + } + + // Path parameters + String localVarPath = "/template/edit/{template_id}" + .replaceAll("\\{template_id}", apiClient.escapeString(templateId.toString())); + + String localVarAccept = apiClient.selectHeaderAccept("application/json"); + Map localVarFormParams = new LinkedHashMap<>(); + localVarFormParams = templateEditRequest.createFormData(); + boolean isFileTypeFound = !localVarFormParams.isEmpty(); + String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType("application/json"); + String[] localVarAuthNames = new String[] {"api_key", "oauth2"}; + GenericType localVarReturnType = new GenericType() {}; + return apiClient.invokeAPI( + "TemplateApi.templateEdit", + localVarPath, + "POST", + new ArrayList<>(), + isFileTypeFound ? null : templateEditRequest, + new LinkedHashMap<>(), + new LinkedHashMap<>(), + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType, + false + ); + } /** * Get Template Files * Obtain a copy of the current documents specified by the `template_id` parameter. Returns a PDF or ZIP file. 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. diff --git a/sdks/java-v2/src/main/java/com/dropbox/sign/model/TemplateEditRequest.java b/sdks/java-v2/src/main/java/com/dropbox/sign/model/TemplateEditRequest.java new file mode 100644 index 000000000..240cd3045 --- /dev/null +++ b/sdks/java-v2/src/main/java/com/dropbox/sign/model/TemplateEditRequest.java @@ -0,0 +1,240 @@ +/* + * Dropbox Sign API + * Dropbox Sign v3 API + * + * The version of the OpenAPI document: 3.0.0 + * Contact: apisupport@hellosign.com + * + * 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.dropbox.sign.model; + +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.dropbox.sign.JSON; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.databind.ObjectMapper; + + +import com.dropbox.sign.ApiException; +/** + * TemplateEditRequest + */ +@JsonPropertyOrder({ + TemplateEditRequest.JSON_PROPERTY_CC_ROLES, + TemplateEditRequest.JSON_PROPERTY_ALLOW_FORM_VIEW +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.12.0") +@JsonIgnoreProperties(ignoreUnknown=true) +public class TemplateEditRequest { + public static final String JSON_PROPERTY_CC_ROLES = "cc_roles"; + @jakarta.annotation.Nullable + private List ccRoles = null; + + public static final String JSON_PROPERTY_ALLOW_FORM_VIEW = "allow_form_view"; + @jakarta.annotation.Nullable + private Boolean allowFormView; + + public TemplateEditRequest() { + } + + /** + * Attempt to instantiate and hydrate a new instance of this class + * @param jsonData String of JSON data representing target object + */ + static public TemplateEditRequest init(String jsonData) throws Exception { + return new ObjectMapper().readValue(jsonData, TemplateEditRequest.class); + } + + static public TemplateEditRequest init(HashMap data) throws Exception { + return new ObjectMapper().readValue( + new ObjectMapper().writeValueAsString(data), + TemplateEditRequest.class + ); + } + + public TemplateEditRequest ccRoles(@jakarta.annotation.Nullable List ccRoles) { + this.ccRoles = ccRoles; + return this; + } + + public TemplateEditRequest addCcRolesItem(String ccRolesItem) { + if (this.ccRoles == null) { + this.ccRoles = new ArrayList<>(); + } + this.ccRoles.add(ccRolesItem); + return this; + } + + /** + * The CC roles that must be assigned when using the template to send a signature request + * @return ccRoles + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CC_ROLES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getCcRoles() { + return ccRoles; + } + + + @JsonProperty(JSON_PROPERTY_CC_ROLES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCcRoles(@jakarta.annotation.Nullable List ccRoles) { + this.ccRoles = ccRoles; + } + + + public TemplateEditRequest allowFormView(@jakarta.annotation.Nullable Boolean allowFormView) { + this.allowFormView = allowFormView; + return this; + } + + /** + * Allows signers to view the form fields before signing if set to `true`. + * @return allowFormView + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ALLOW_FORM_VIEW) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Boolean getAllowFormView() { + return allowFormView; + } + + + @JsonProperty(JSON_PROPERTY_ALLOW_FORM_VIEW) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAllowFormView(@jakarta.annotation.Nullable Boolean allowFormView) { + this.allowFormView = allowFormView; + } + + + /** + * Return true if this TemplateEditRequest object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TemplateEditRequest templateEditRequest = (TemplateEditRequest) o; + return Objects.equals(this.ccRoles, templateEditRequest.ccRoles) && + Objects.equals(this.allowFormView, templateEditRequest.allowFormView); + } + + @Override + public int hashCode() { + return Objects.hash(ccRoles, allowFormView); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TemplateEditRequest {\n"); + sb.append(" ccRoles: ").append(toIndentedString(ccRoles)).append("\n"); + sb.append(" allowFormView: ").append(toIndentedString(allowFormView)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public Map createFormData() throws ApiException { + Map map = new HashMap<>(); + boolean fileTypeFound = false; + try { + if (ccRoles != null) { + if (isFileTypeOrListOfFiles(ccRoles)) { + fileTypeFound = true; + } + + if (ccRoles.getClass().equals(java.io.File.class) || + ccRoles.getClass().equals(Integer.class) || + ccRoles.getClass().equals(String.class) || + ccRoles.getClass().isEnum()) { + map.put("cc_roles", ccRoles); + } else if (isListOfFile(ccRoles)) { + for(int i = 0; i< getListSize(ccRoles); i++) { + map.put("cc_roles[" + i + "]", getFromList(ccRoles, i)); + } + } + else { + map.put("cc_roles", JSON.getDefault().getMapper().writeValueAsString(ccRoles)); + } + } + if (allowFormView != null) { + if (isFileTypeOrListOfFiles(allowFormView)) { + fileTypeFound = true; + } + + if (allowFormView.getClass().equals(java.io.File.class) || + allowFormView.getClass().equals(Integer.class) || + allowFormView.getClass().equals(String.class) || + allowFormView.getClass().isEnum()) { + map.put("allow_form_view", allowFormView); + } else if (isListOfFile(allowFormView)) { + for(int i = 0; i< getListSize(allowFormView); i++) { + map.put("allow_form_view[" + i + "]", getFromList(allowFormView, i)); + } + } + else { + map.put("allow_form_view", JSON.getDefault().getMapper().writeValueAsString(allowFormView)); + } + } + } catch (Exception e) { + throw new ApiException(e); + } + + return fileTypeFound ? map : new HashMap<>(); + } + + private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { + return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); + } + + private boolean isListOfFile(Object obj) throws Exception { + return obj instanceof java.util.List && !isListEmpty(obj) && getFromList(obj, 0) instanceof java.io.File; + } + + private boolean isListEmpty(Object obj) throws Exception { + return (boolean) Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); + } + + private Object getFromList(Object obj, int index) throws Exception { + return Class.forName(java.util.List.class.getName()).getMethod("get", int.class).invoke(obj, index); + } + + private int getListSize(Object obj) throws Exception { + return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/sdks/java-v2/src/main/java/com/dropbox/sign/model/TemplateEditResponse.java b/sdks/java-v2/src/main/java/com/dropbox/sign/model/TemplateEditResponse.java deleted file mode 100644 index 866a87fa3..000000000 --- a/sdks/java-v2/src/main/java/com/dropbox/sign/model/TemplateEditResponse.java +++ /dev/null @@ -1,179 +0,0 @@ -/* - * Dropbox Sign API - * Dropbox Sign v3 API - * - * The version of the OpenAPI document: 3.0.0 - * Contact: apisupport@hellosign.com - * - * 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.dropbox.sign.model; - -import java.util.Objects; -import java.util.Map; -import java.util.HashMap; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonTypeName; -import com.fasterxml.jackson.annotation.JsonValue; -import java.util.Arrays; -import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import com.dropbox.sign.JSON; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.databind.ObjectMapper; - - -import com.dropbox.sign.ApiException; -/** - * TemplateEditResponse - */ -@JsonPropertyOrder({ - TemplateEditResponse.JSON_PROPERTY_TEMPLATE_ID -}) -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.12.0") -@JsonIgnoreProperties(ignoreUnknown=true) -public class TemplateEditResponse { - public static final String JSON_PROPERTY_TEMPLATE_ID = "template_id"; - @jakarta.annotation.Nonnull - private String templateId; - - public TemplateEditResponse() { - } - - /** - * Attempt to instantiate and hydrate a new instance of this class - * @param jsonData String of JSON data representing target object - */ - static public TemplateEditResponse init(String jsonData) throws Exception { - return new ObjectMapper().readValue(jsonData, TemplateEditResponse.class); - } - - static public TemplateEditResponse init(HashMap data) throws Exception { - return new ObjectMapper().readValue( - new ObjectMapper().writeValueAsString(data), - TemplateEditResponse.class - ); - } - - public TemplateEditResponse templateId(@jakarta.annotation.Nonnull String templateId) { - this.templateId = templateId; - return this; - } - - /** - * The id of the Template. - * @return templateId - */ - @jakarta.annotation.Nonnull - @JsonProperty(JSON_PROPERTY_TEMPLATE_ID) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - - public String getTemplateId() { - return templateId; - } - - - @JsonProperty(JSON_PROPERTY_TEMPLATE_ID) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setTemplateId(@jakarta.annotation.Nonnull String templateId) { - this.templateId = templateId; - } - - - /** - * Return true if this TemplateEditResponse object is equal to o. - */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - TemplateEditResponse templateEditResponse = (TemplateEditResponse) o; - return Objects.equals(this.templateId, templateEditResponse.templateId); - } - - @Override - public int hashCode() { - return Objects.hash(templateId); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class TemplateEditResponse {\n"); - sb.append(" templateId: ").append(toIndentedString(templateId)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - public Map createFormData() throws ApiException { - Map map = new HashMap<>(); - boolean fileTypeFound = false; - try { - if (templateId != null) { - if (isFileTypeOrListOfFiles(templateId)) { - fileTypeFound = true; - } - - if (templateId.getClass().equals(java.io.File.class) || - templateId.getClass().equals(Integer.class) || - templateId.getClass().equals(String.class) || - templateId.getClass().isEnum()) { - map.put("template_id", templateId); - } else if (isListOfFile(templateId)) { - for(int i = 0; i< getListSize(templateId); i++) { - map.put("template_id[" + i + "]", getFromList(templateId, i)); - } - } - else { - map.put("template_id", JSON.getDefault().getMapper().writeValueAsString(templateId)); - } - } - } catch (Exception e) { - throw new ApiException(e); - } - - return fileTypeFound ? map : new HashMap<>(); - } - - private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { - return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); - } - - private boolean isListOfFile(Object obj) throws Exception { - return obj instanceof java.util.List && !isListEmpty(obj) && getFromList(obj, 0) instanceof java.io.File; - } - - private boolean isListEmpty(Object obj) throws Exception { - return (boolean) Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); - } - - private Object getFromList(Object obj, int index) throws Exception { - return Class.forName(java.util.List.class.getName()).getMethod("get", int.class).invoke(obj, index); - } - - private int getListSize(Object obj) throws Exception { - return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - -} - diff --git a/sdks/node/README.md b/sdks/node/README.md index 93d2bfdfd..a9cc03c50 100644 --- a/sdks/node/README.md +++ b/sdks/node/README.md @@ -141,6 +141,7 @@ All URIs are relative to *https://api.hellosign.com/v3* | *TemplateApi* | [**templateCreate**](./docs/api/TemplateApi.md#templatecreate) | **POST** /template/create | Create Template | | *TemplateApi* | [**templateCreateEmbeddedDraft**](./docs/api/TemplateApi.md#templatecreateembeddeddraft) | **POST** /template/create_embedded_draft | Create Embedded Template Draft | | *TemplateApi* | [**templateDelete**](./docs/api/TemplateApi.md#templatedelete) | **POST** /template/delete/{template_id} | Delete Template | +| *TemplateApi* | [**templateEdit**](./docs/api/TemplateApi.md#templateedit) | **POST** /template/edit/{template_id} | Edit Template | | *TemplateApi* | [**templateFiles**](./docs/api/TemplateApi.md#templatefiles) | **GET** /template/files/{template_id} | Get Template Files | | *TemplateApi* | [**templateFilesAsDataUri**](./docs/api/TemplateApi.md#templatefilesasdatauri) | **GET** /template/files_as_data_uri/{template_id} | Get Template Files as Data Uri | | *TemplateApi* | [**templateFilesAsFileUrl**](./docs/api/TemplateApi.md#templatefilesasfileurl) | **GET** /template/files_as_file_url/{template_id} | Get Template Files as File Url | @@ -303,7 +304,7 @@ All URIs are relative to *https://api.hellosign.com/v3* - [TemplateCreateRequest](./docs/model/TemplateCreateRequest.md) - [TemplateCreateResponse](./docs/model/TemplateCreateResponse.md) - [TemplateCreateResponseTemplate](./docs/model/TemplateCreateResponseTemplate.md) -- [TemplateEditResponse](./docs/model/TemplateEditResponse.md) +- [TemplateEditRequest](./docs/model/TemplateEditRequest.md) - [TemplateGetResponse](./docs/model/TemplateGetResponse.md) - [TemplateListResponse](./docs/model/TemplateListResponse.md) - [TemplateRemoveUserRequest](./docs/model/TemplateRemoveUserRequest.md) diff --git a/sdks/node/api/templateApi.ts b/sdks/node/api/templateApi.ts index 35ac24648..5320897a4 100644 --- a/sdks/node/api/templateApi.ts +++ b/sdks/node/api/templateApi.ts @@ -37,6 +37,7 @@ import { TemplateCreateEmbeddedDraftResponse, TemplateCreateRequest, TemplateCreateResponse, + TemplateEditRequest, TemplateGetResponse, TemplateListResponse, TemplateRemoveUserRequest, @@ -688,6 +689,165 @@ export class TemplateApi { }); }); } + /** + * Edits an existing template. + * @summary Edit Template + * @param templateId The id of the Template to edit. + * @param templateEditRequest + * @param options + */ + public async templateEdit( + templateId: string, + templateEditRequest: TemplateEditRequest, + options: optionsI = { headers: {} } + ): Promise> { + templateEditRequest = deserializeIfNeeded( + templateEditRequest, + "TemplateEditRequest" + ); + const localVarPath = + this.basePath + + "/template/edit/{template_id}".replace( + "{" + "template_id" + "}", + encodeURIComponent(String(templateId)) + ); + let localVarQueryParameters: any = {}; + let localVarHeaderParams: any = (Object).assign( + {}, + this._defaultHeaders + ); + const produces = ["application/json"]; + // give precedence to 'application/json' + if (produces.indexOf("application/json") >= 0) { + localVarHeaderParams["content-type"] = "application/json"; + } else { + localVarHeaderParams["content-type"] = produces.join(","); + } + let localVarFormParams: any = {}; + let localVarBodyParams: any = undefined; + + // verify required parameter 'templateId' is not null or undefined + if (templateId === null || templateId === undefined) { + throw new Error( + "Required parameter templateId was null or undefined when calling templateEdit." + ); + } + + // verify required parameter 'templateEditRequest' is not null or undefined + if (templateEditRequest === null || templateEditRequest === undefined) { + throw new Error( + "Required parameter templateEditRequest was null or undefined when calling templateEdit." + ); + } + + (Object).assign(localVarHeaderParams, options.headers); + + let localVarUseFormData = false; + + const result = generateFormData( + templateEditRequest, + TemplateEditRequest.attributeTypeMap + ); + localVarUseFormData = result.localVarUseFormData; + + let data = {}; + if (localVarUseFormData) { + const formData = toFormData(result.data); + data = formData; + localVarHeaderParams = { + ...localVarHeaderParams, + ...formData.getHeaders(), + }; + } else { + data = ObjectSerializer.serialize( + templateEditRequest, + "TemplateEditRequest" + ); + } + + let localVarRequestOptions: AxiosRequestConfig = { + method: "POST", + params: localVarQueryParameters, + headers: localVarHeaderParams, + url: localVarPath, + paramsSerializer: this._useQuerystring + ? queryParamsSerializer + : undefined, + maxContentLength: Infinity, + maxBodyLength: Infinity, + responseType: "json", + data, + }; + + let authenticationPromise = Promise.resolve(); + if (this.authentications.api_key.username) { + authenticationPromise = authenticationPromise.then(() => + this.authentications.api_key.applyToRequest(localVarRequestOptions) + ); + } + if (this.authentications.oauth2.accessToken) { + authenticationPromise = authenticationPromise.then(() => + this.authentications.oauth2.applyToRequest(localVarRequestOptions) + ); + } + authenticationPromise = authenticationPromise.then(() => + this.authentications.default.applyToRequest(localVarRequestOptions) + ); + + let interceptorPromise = authenticationPromise; + for (const interceptor of this.interceptors) { + interceptorPromise = interceptorPromise.then(() => + interceptor(localVarRequestOptions) + ); + } + + return interceptorPromise.then(() => { + return new Promise>( + (resolve, reject) => { + axios.request(localVarRequestOptions).then( + (response) => { + handleSuccessfulResponse( + resolve, + reject, + response, + "TemplateGetResponse" + ); + }, + (error: AxiosError) => { + if (error.response == null) { + reject(error); + return; + } + + if ( + handleErrorCodeResponse( + reject, + error.response, + 200, + "TemplateGetResponse" + ) + ) { + return; + } + + if ( + handleErrorRangeResponse( + reject, + error.response, + "4XX", + "ErrorResponse" + ) + ) { + return; + } + + reject(error); + } + ); + } + ); + }); + } /** * Obtain a copy of the current documents specified by the `template_id` parameter. Returns a PDF or ZIP file. 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. * @summary Get Template Files diff --git a/sdks/node/dist/api.js b/sdks/node/dist/api.js index f8478972a..28a202589 100644 --- a/sdks/node/dist/api.js +++ b/sdks/node/dist/api.js @@ -13310,7 +13310,7 @@ __export(api_exports, { TemplateCreateRequest: () => TemplateCreateRequest, TemplateCreateResponse: () => TemplateCreateResponse, TemplateCreateResponseTemplate: () => TemplateCreateResponseTemplate, - TemplateEditResponse: () => TemplateEditResponse, + TemplateEditRequest: () => TemplateEditRequest, TemplateGetResponse: () => TemplateGetResponse, TemplateListResponse: () => TemplateListResponse, TemplateRemoveUserRequest: () => TemplateRemoveUserRequest, @@ -24399,26 +24399,31 @@ var TemplateCreateResponseTemplate = class _TemplateCreateResponseTemplate { } }; -// model/templateEditResponse.ts -var TemplateEditResponse = class _TemplateEditResponse { +// model/templateEditRequest.ts +var TemplateEditRequest = class _TemplateEditRequest { static { this.discriminator = void 0; } static { this.attributeTypeMap = [ { - name: "templateId", - baseName: "template_id", - type: "string" + name: "ccRoles", + baseName: "cc_roles", + type: "Array" + }, + { + name: "allowFormView", + baseName: "allow_form_view", + type: "boolean" } ]; } static getAttributeTypeMap() { - return _TemplateEditResponse.attributeTypeMap; + return _TemplateEditRequest.attributeTypeMap; } /** Attempt to instantiate and hydrate a new instance of this class */ static init(data) { - return ObjectSerializer.deserialize(data, "TemplateEditResponse"); + return ObjectSerializer.deserialize(data, "TemplateEditRequest"); } }; @@ -27025,7 +27030,7 @@ var typeMap = { TemplateCreateRequest, TemplateCreateResponse, TemplateCreateResponseTemplate, - TemplateEditResponse, + TemplateEditRequest, TemplateGetResponse, TemplateListResponse, TemplateRemoveUserRequest, @@ -34889,6 +34894,137 @@ var TemplateApi = class { }); }); } + /** + * Edits an existing template. + * @summary Edit Template + * @param templateId The id of the Template to edit. + * @param templateEditRequest + * @param options + */ + async templateEdit(templateId, templateEditRequest, options = { headers: {} }) { + templateEditRequest = deserializeIfNeeded10( + templateEditRequest, + "TemplateEditRequest" + ); + const localVarPath = this.basePath + "/template/edit/{template_id}".replace( + "{template_id}", + encodeURIComponent(String(templateId)) + ); + let localVarQueryParameters = {}; + let localVarHeaderParams = Object.assign( + {}, + this._defaultHeaders + ); + const produces = ["application/json"]; + if (produces.indexOf("application/json") >= 0) { + localVarHeaderParams["content-type"] = "application/json"; + } else { + localVarHeaderParams["content-type"] = produces.join(","); + } + let localVarFormParams = {}; + let localVarBodyParams = void 0; + if (templateId === null || templateId === void 0) { + throw new Error( + "Required parameter templateId was null or undefined when calling templateEdit." + ); + } + if (templateEditRequest === null || templateEditRequest === void 0) { + throw new Error( + "Required parameter templateEditRequest was null or undefined when calling templateEdit." + ); + } + Object.assign(localVarHeaderParams, options.headers); + let localVarUseFormData = false; + const result = generateFormData( + templateEditRequest, + TemplateEditRequest.attributeTypeMap + ); + localVarUseFormData = result.localVarUseFormData; + let data = {}; + if (localVarUseFormData) { + const formData2 = toFormData3(result.data); + data = formData2; + localVarHeaderParams = { + ...localVarHeaderParams, + ...formData2.getHeaders() + }; + } else { + data = ObjectSerializer.serialize( + templateEditRequest, + "TemplateEditRequest" + ); + } + let localVarRequestOptions = { + method: "POST", + params: localVarQueryParameters, + headers: localVarHeaderParams, + url: localVarPath, + paramsSerializer: this._useQuerystring ? queryParamsSerializer : void 0, + maxContentLength: Infinity, + maxBodyLength: Infinity, + responseType: "json", + data + }; + let authenticationPromise = Promise.resolve(); + if (this.authentications.api_key.username) { + authenticationPromise = authenticationPromise.then( + () => this.authentications.api_key.applyToRequest(localVarRequestOptions) + ); + } + if (this.authentications.oauth2.accessToken) { + authenticationPromise = authenticationPromise.then( + () => this.authentications.oauth2.applyToRequest(localVarRequestOptions) + ); + } + authenticationPromise = authenticationPromise.then( + () => this.authentications.default.applyToRequest(localVarRequestOptions) + ); + let interceptorPromise = authenticationPromise; + for (const interceptor of this.interceptors) { + interceptorPromise = interceptorPromise.then( + () => interceptor(localVarRequestOptions) + ); + } + return interceptorPromise.then(() => { + return new Promise( + (resolve, reject) => { + axios_default.request(localVarRequestOptions).then( + (response) => { + handleSuccessfulResponse11( + resolve, + reject, + response, + "TemplateGetResponse" + ); + }, + (error) => { + if (error.response == null) { + reject(error); + return; + } + if (handleErrorCodeResponse11( + reject, + error.response, + 200, + "TemplateGetResponse" + )) { + return; + } + if (handleErrorRangeResponse11( + reject, + error.response, + "4XX", + "ErrorResponse" + )) { + return; + } + reject(error); + } + ); + } + ); + }); + } /** * Obtain a copy of the current documents specified by the `template_id` parameter. Returns a PDF or ZIP file. 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. * @summary Get Template Files @@ -36562,7 +36698,7 @@ var APIS = [ TemplateCreateRequest, TemplateCreateResponse, TemplateCreateResponseTemplate, - TemplateEditResponse, + TemplateEditRequest, TemplateGetResponse, TemplateListResponse, TemplateRemoveUserRequest, diff --git a/sdks/node/docs/api/TemplateApi.md b/sdks/node/docs/api/TemplateApi.md index d86551c72..e12656bd3 100644 --- a/sdks/node/docs/api/TemplateApi.md +++ b/sdks/node/docs/api/TemplateApi.md @@ -8,6 +8,7 @@ All URIs are relative to https://api.hellosign.com/v3. | [**templateCreate()**](TemplateApi.md#templateCreate) | **POST** /template/create | Create Template | | [**templateCreateEmbeddedDraft()**](TemplateApi.md#templateCreateEmbeddedDraft) | **POST** /template/create_embedded_draft | Create Embedded Template Draft | | [**templateDelete()**](TemplateApi.md#templateDelete) | **POST** /template/delete/{template_id} | Delete Template | +| [**templateEdit()**](TemplateApi.md#templateEdit) | **POST** /template/edit/{template_id} | Edit Template | | [**templateFiles()**](TemplateApi.md#templateFiles) | **GET** /template/files/{template_id} | Get Template Files | | [**templateFilesAsDataUri()**](TemplateApi.md#templateFilesAsDataUri) | **GET** /template/files_as_data_uri/{template_id} | Get Template Files as Data Uri | | [**templateFilesAsFileUrl()**](TemplateApi.md#templateFilesAsFileUrl) | **GET** /template/files_as_file_url/{template_id} | Get Template Files as File Url | @@ -379,6 +380,70 @@ void (empty response body) [[Back to Model list]](../../README.md#models) [[Back to README]](../../README.md) +## `templateEdit()` + +```typescript +templateEdit(templateId: string, templateEditRequest: TemplateEditRequest): TemplateGetResponse +``` + +Edit Template + +Edits an existing template. + +### TypeScript Example + +```typescript +import * as fs from 'fs'; +import api from "@dropbox/sign" +import models from "@dropbox/sign" + +const apiCaller = new api.TemplateApi(); +apiCaller.username = "YOUR_API_KEY"; +// apiCaller.accessToken = "YOUR_ACCESS_TOKEN"; + +const templateEditRequest: models.TemplateEditRequest = { + ccRoles: [ + "Role 1", + "Role 2", + ], +}; + +apiCaller.templateEdit( + "f57db65d3f933b5316d398057a36176831451a35", // templateId + templateEditRequest, +).then(response => { + console.log(response.body); +}).catch(error => { + console.log("Exception when calling TemplateApi#templateEdit:"); + console.log(error.body); +}); + +``` + +### Parameters + +|Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **templateId** | **string**| The id of the Template to edit. | | +| **templateEditRequest** | [**TemplateEditRequest**](../model/TemplateEditRequest.md)| | | + +### Return type + +[**TemplateGetResponse**](../model/TemplateGetResponse.md) + +### Authorization + +[api_key](../../README.md#api_key), [oauth2](../../README.md#oauth2) + +### HTTP request headers + +- **Content-Type**: `application/json` +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + ## `templateFiles()` ```typescript diff --git a/sdks/node/docs/model/TemplateEditRequest.md b/sdks/node/docs/model/TemplateEditRequest.md new file mode 100644 index 000000000..ae87b18db --- /dev/null +++ b/sdks/node/docs/model/TemplateEditRequest.md @@ -0,0 +1,12 @@ +# # TemplateEditRequest + + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +| `ccRoles` | ```Array``` | The CC roles that must be assigned when using the template to send a signature request | | +| `allowFormView` | ```boolean``` | Allows signers to view the form fields before signing if set to `true`. | | + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/sdks/node/docs/model/TemplateEditResponse.md b/sdks/node/docs/model/TemplateEditResponse.md deleted file mode 100644 index 2f40ccbad..000000000 --- a/sdks/node/docs/model/TemplateEditResponse.md +++ /dev/null @@ -1,11 +0,0 @@ -# # TemplateEditResponse - - - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -| `templateId`*_required_ | ```string``` | The id of the Template. | | - -[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/sdks/node/model/index.ts b/sdks/node/model/index.ts index 1f2ea9c97..d9d022402 100644 --- a/sdks/node/model/index.ts +++ b/sdks/node/model/index.ts @@ -160,7 +160,7 @@ import { TemplateCreateEmbeddedDraftResponseTemplate } from "./templateCreateEmb import { TemplateCreateRequest } from "./templateCreateRequest"; import { TemplateCreateResponse } from "./templateCreateResponse"; import { TemplateCreateResponseTemplate } from "./templateCreateResponseTemplate"; -import { TemplateEditResponse } from "./templateEditResponse"; +import { TemplateEditRequest } from "./templateEditRequest"; import { TemplateGetResponse } from "./templateGetResponse"; import { TemplateListResponse } from "./templateListResponse"; import { TemplateRemoveUserRequest } from "./templateRemoveUserRequest"; @@ -415,7 +415,7 @@ export let typeMap: { [index: string]: any } = { TemplateCreateRequest: TemplateCreateRequest, TemplateCreateResponse: TemplateCreateResponse, TemplateCreateResponseTemplate: TemplateCreateResponseTemplate, - TemplateEditResponse: TemplateEditResponse, + TemplateEditRequest: TemplateEditRequest, TemplateGetResponse: TemplateGetResponse, TemplateListResponse: TemplateListResponse, TemplateRemoveUserRequest: TemplateRemoveUserRequest, @@ -642,7 +642,7 @@ export { TemplateCreateRequest, TemplateCreateResponse, TemplateCreateResponseTemplate, - TemplateEditResponse, + TemplateEditRequest, TemplateGetResponse, TemplateListResponse, TemplateRemoveUserRequest, diff --git a/sdks/node/model/templateEditResponse.ts b/sdks/node/model/templateEditRequest.ts similarity index 70% rename from sdks/node/model/templateEditResponse.ts rename to sdks/node/model/templateEditRequest.ts index aa51f43d0..e1f1346a6 100644 --- a/sdks/node/model/templateEditResponse.ts +++ b/sdks/node/model/templateEditRequest.ts @@ -24,28 +24,37 @@ import { AttributeTypeMap, ObjectSerializer } from "./"; -export class TemplateEditResponse { +export class TemplateEditRequest { /** - * The id of the Template. + * The CC roles that must be assigned when using the template to send a signature request */ - "templateId": string; + "ccRoles"?: Array; + /** + * Allows signers to view the form fields before signing if set to `true`. + */ + "allowFormView"?: boolean; static discriminator: string | undefined = undefined; static attributeTypeMap: AttributeTypeMap = [ { - name: "templateId", - baseName: "template_id", - type: "string", + name: "ccRoles", + baseName: "cc_roles", + type: "Array", + }, + { + name: "allowFormView", + baseName: "allow_form_view", + type: "boolean", }, ]; static getAttributeTypeMap(): AttributeTypeMap { - return TemplateEditResponse.attributeTypeMap; + return TemplateEditRequest.attributeTypeMap; } /** Attempt to instantiate and hydrate a new instance of this class */ - static init(data: any): TemplateEditResponse { - return ObjectSerializer.deserialize(data, "TemplateEditResponse"); + static init(data: any): TemplateEditRequest { + return ObjectSerializer.deserialize(data, "TemplateEditRequest"); } } diff --git a/sdks/node/types/api/templateApi.d.ts b/sdks/node/types/api/templateApi.d.ts index aeaa69a46..d45603e2f 100644 --- a/sdks/node/types/api/templateApi.d.ts +++ b/sdks/node/types/api/templateApi.d.ts @@ -1,4 +1,4 @@ -import { Authentication, FileResponse, FileResponseDataUri, HttpBasicAuth, HttpBearerAuth, Interceptor, TemplateAddUserRequest, TemplateCreateEmbeddedDraftRequest, TemplateCreateEmbeddedDraftResponse, TemplateCreateRequest, TemplateCreateResponse, TemplateGetResponse, TemplateListResponse, TemplateRemoveUserRequest, TemplateUpdateFilesRequest, TemplateUpdateFilesResponse } from "../model"; +import { Authentication, FileResponse, FileResponseDataUri, HttpBasicAuth, HttpBearerAuth, Interceptor, TemplateAddUserRequest, TemplateCreateEmbeddedDraftRequest, TemplateCreateEmbeddedDraftResponse, TemplateCreateRequest, TemplateCreateResponse, TemplateEditRequest, TemplateGetResponse, TemplateListResponse, TemplateRemoveUserRequest, TemplateUpdateFilesRequest, TemplateUpdateFilesResponse } from "../model"; import { optionsI, returnTypeI, returnTypeT } from "./"; export declare enum TemplateApiApiKeys { } @@ -28,6 +28,7 @@ export declare class TemplateApi { templateCreate(templateCreateRequest: TemplateCreateRequest, options?: optionsI): Promise>; templateCreateEmbeddedDraft(templateCreateEmbeddedDraftRequest: TemplateCreateEmbeddedDraftRequest, options?: optionsI): Promise>; templateDelete(templateId: string, options?: optionsI): Promise; + templateEdit(templateId: string, templateEditRequest: TemplateEditRequest, options?: optionsI): Promise>; templateFiles(templateId: string, fileType?: "pdf" | "zip", options?: optionsI): Promise>; templateFilesAsDataUri(templateId: string, options?: optionsI): Promise>; templateFilesAsFileUrl(templateId: string, forceDownload?: number, options?: optionsI): Promise>; diff --git a/sdks/node/types/model/index.d.ts b/sdks/node/types/model/index.d.ts index 99010c62f..3bc4c0121 100644 --- a/sdks/node/types/model/index.d.ts +++ b/sdks/node/types/model/index.d.ts @@ -148,7 +148,7 @@ import { TemplateCreateEmbeddedDraftResponseTemplate } from "./templateCreateEmb import { TemplateCreateRequest } from "./templateCreateRequest"; import { TemplateCreateResponse } from "./templateCreateResponse"; import { TemplateCreateResponseTemplate } from "./templateCreateResponseTemplate"; -import { TemplateEditResponse } from "./templateEditResponse"; +import { TemplateEditRequest } from "./templateEditRequest"; import { TemplateGetResponse } from "./templateGetResponse"; import { TemplateListResponse } from "./templateListResponse"; import { TemplateRemoveUserRequest } from "./templateRemoveUserRequest"; @@ -198,4 +198,4 @@ export declare let enumsMap: { export declare let typeMap: { [index: string]: any; }; -export { AccountCreateRequest, AccountCreateResponse, AccountGetResponse, AccountResponse, AccountResponseQuotas, AccountResponseUsage, AccountUpdateRequest, AccountVerifyRequest, AccountVerifyResponse, AccountVerifyResponseAccount, ApiAppCreateRequest, ApiAppGetResponse, ApiAppListResponse, ApiAppResponse, ApiAppResponseOAuth, ApiAppResponseOptions, ApiAppResponseOwnerAccount, ApiAppResponseWhiteLabelingOptions, ApiAppUpdateRequest, ApiKeyAuth, AttributeTypeMap, Authentication, BulkSendJobGetResponse, BulkSendJobGetResponseSignatureRequests, BulkSendJobListResponse, BulkSendJobResponse, BulkSendJobSendResponse, EmbeddedEditUrlRequest, EmbeddedEditUrlResponse, EmbeddedEditUrlResponseEmbedded, EmbeddedSignUrlResponse, EmbeddedSignUrlResponseEmbedded, ErrorResponse, ErrorResponseError, EventCallbackHelper, EventCallbackRequest, EventCallbackRequestEvent, EventCallbackRequestEventMetadata, FaxGetResponse, FaxLineAddUserRequest, FaxLineAreaCodeGetCountryEnum, FaxLineAreaCodeGetProvinceEnum, FaxLineAreaCodeGetResponse, FaxLineAreaCodeGetStateEnum, FaxLineCreateRequest, FaxLineDeleteRequest, FaxLineListResponse, FaxLineRemoveUserRequest, FaxLineResponse, FaxLineResponseFaxLine, FaxListResponse, FaxResponse, FaxResponseTransmission, FaxSendRequest, FileResponse, FileResponseDataUri, HttpBasicAuth, HttpBearerAuth, Interceptor, ListInfoResponse, OAuth, OAuthTokenGenerateRequest, OAuthTokenRefreshRequest, OAuthTokenResponse, ObjectSerializer, ReportCreateRequest, ReportCreateResponse, ReportResponse, RequestDetailedFile, RequestFile, SignatureRequestBulkCreateEmbeddedWithTemplateRequest, SignatureRequestBulkSendWithTemplateRequest, SignatureRequestCreateEmbeddedRequest, SignatureRequestCreateEmbeddedWithTemplateRequest, SignatureRequestEditEmbeddedRequest, SignatureRequestEditEmbeddedWithTemplateRequest, SignatureRequestEditRequest, SignatureRequestEditWithTemplateRequest, SignatureRequestGetResponse, SignatureRequestListResponse, SignatureRequestRemindRequest, SignatureRequestResponse, SignatureRequestResponseAttachment, SignatureRequestResponseCustomFieldBase, SignatureRequestResponseCustomFieldCheckbox, SignatureRequestResponseCustomFieldText, SignatureRequestResponseCustomFieldTypeEnum, SignatureRequestResponseDataBase, SignatureRequestResponseDataTypeEnum, SignatureRequestResponseDataValueCheckbox, SignatureRequestResponseDataValueCheckboxMerge, SignatureRequestResponseDataValueDateSigned, SignatureRequestResponseDataValueDropdown, SignatureRequestResponseDataValueInitials, SignatureRequestResponseDataValueRadio, SignatureRequestResponseDataValueSignature, SignatureRequestResponseDataValueText, SignatureRequestResponseDataValueTextMerge, SignatureRequestResponseSignatures, SignatureRequestSendRequest, SignatureRequestSendWithTemplateRequest, SignatureRequestUpdateRequest, SubAttachment, SubBulkSignerList, SubBulkSignerListCustomField, SubCC, SubCustomField, SubEditorOptions, SubFieldOptions, SubFormFieldGroup, SubFormFieldRule, SubFormFieldRuleAction, SubFormFieldRuleTrigger, SubFormFieldsPerDocumentBase, SubFormFieldsPerDocumentCheckbox, SubFormFieldsPerDocumentCheckboxMerge, SubFormFieldsPerDocumentDateSigned, SubFormFieldsPerDocumentDropdown, SubFormFieldsPerDocumentFontEnum, SubFormFieldsPerDocumentHyperlink, SubFormFieldsPerDocumentInitials, SubFormFieldsPerDocumentRadio, SubFormFieldsPerDocumentSignature, SubFormFieldsPerDocumentText, SubFormFieldsPerDocumentTextMerge, SubFormFieldsPerDocumentTypeEnum, SubMergeField, SubOAuth, SubOptions, SubSignatureRequestGroupedSigners, SubSignatureRequestSigner, SubSignatureRequestTemplateSigner, SubSigningOptions, SubTeamResponse, SubTemplateRole, SubUnclaimedDraftSigner, SubUnclaimedDraftTemplateSigner, SubWhiteLabelingOptions, TeamAddMemberRequest, TeamCreateRequest, TeamGetInfoResponse, TeamGetResponse, TeamInfoResponse, TeamInviteResponse, TeamInvitesResponse, TeamMemberResponse, TeamMembersResponse, TeamParentResponse, TeamRemoveMemberRequest, TeamResponse, TeamSubTeamsResponse, TeamUpdateRequest, TemplateAddUserRequest, TemplateCreateEmbeddedDraftRequest, TemplateCreateEmbeddedDraftResponse, TemplateCreateEmbeddedDraftResponseTemplate, TemplateCreateRequest, TemplateCreateResponse, TemplateCreateResponseTemplate, TemplateEditResponse, TemplateGetResponse, TemplateListResponse, TemplateRemoveUserRequest, TemplateResponse, TemplateResponseAccount, TemplateResponseAccountQuota, TemplateResponseCCRole, TemplateResponseDocument, TemplateResponseDocumentCustomFieldBase, TemplateResponseDocumentCustomFieldCheckbox, TemplateResponseDocumentCustomFieldText, TemplateResponseDocumentFieldGroup, TemplateResponseDocumentFieldGroupRule, TemplateResponseDocumentFormFieldBase, TemplateResponseDocumentFormFieldCheckbox, TemplateResponseDocumentFormFieldDateSigned, TemplateResponseDocumentFormFieldDropdown, TemplateResponseDocumentFormFieldHyperlink, TemplateResponseDocumentFormFieldInitials, TemplateResponseDocumentFormFieldRadio, TemplateResponseDocumentFormFieldSignature, TemplateResponseDocumentFormFieldText, TemplateResponseDocumentStaticFieldBase, TemplateResponseDocumentStaticFieldCheckbox, TemplateResponseDocumentStaticFieldDateSigned, TemplateResponseDocumentStaticFieldDropdown, TemplateResponseDocumentStaticFieldHyperlink, TemplateResponseDocumentStaticFieldInitials, TemplateResponseDocumentStaticFieldRadio, TemplateResponseDocumentStaticFieldSignature, TemplateResponseDocumentStaticFieldText, TemplateResponseFieldAvgTextLength, TemplateResponseSignerRole, TemplateUpdateFilesRequest, TemplateUpdateFilesResponse, TemplateUpdateFilesResponseTemplate, UnclaimedDraftCreateEmbeddedRequest, UnclaimedDraftCreateEmbeddedWithTemplateRequest, UnclaimedDraftCreateRequest, UnclaimedDraftCreateResponse, UnclaimedDraftEditAndResendRequest, UnclaimedDraftResponse, VoidAuth, WarningResponse, }; +export { AccountCreateRequest, AccountCreateResponse, AccountGetResponse, AccountResponse, AccountResponseQuotas, AccountResponseUsage, AccountUpdateRequest, AccountVerifyRequest, AccountVerifyResponse, AccountVerifyResponseAccount, ApiAppCreateRequest, ApiAppGetResponse, ApiAppListResponse, ApiAppResponse, ApiAppResponseOAuth, ApiAppResponseOptions, ApiAppResponseOwnerAccount, ApiAppResponseWhiteLabelingOptions, ApiAppUpdateRequest, ApiKeyAuth, AttributeTypeMap, Authentication, BulkSendJobGetResponse, BulkSendJobGetResponseSignatureRequests, BulkSendJobListResponse, BulkSendJobResponse, BulkSendJobSendResponse, EmbeddedEditUrlRequest, EmbeddedEditUrlResponse, EmbeddedEditUrlResponseEmbedded, EmbeddedSignUrlResponse, EmbeddedSignUrlResponseEmbedded, ErrorResponse, ErrorResponseError, EventCallbackHelper, EventCallbackRequest, EventCallbackRequestEvent, EventCallbackRequestEventMetadata, FaxGetResponse, FaxLineAddUserRequest, FaxLineAreaCodeGetCountryEnum, FaxLineAreaCodeGetProvinceEnum, FaxLineAreaCodeGetResponse, FaxLineAreaCodeGetStateEnum, FaxLineCreateRequest, FaxLineDeleteRequest, FaxLineListResponse, FaxLineRemoveUserRequest, FaxLineResponse, FaxLineResponseFaxLine, FaxListResponse, FaxResponse, FaxResponseTransmission, FaxSendRequest, FileResponse, FileResponseDataUri, HttpBasicAuth, HttpBearerAuth, Interceptor, ListInfoResponse, OAuth, OAuthTokenGenerateRequest, OAuthTokenRefreshRequest, OAuthTokenResponse, ObjectSerializer, ReportCreateRequest, ReportCreateResponse, ReportResponse, RequestDetailedFile, RequestFile, SignatureRequestBulkCreateEmbeddedWithTemplateRequest, SignatureRequestBulkSendWithTemplateRequest, SignatureRequestCreateEmbeddedRequest, SignatureRequestCreateEmbeddedWithTemplateRequest, SignatureRequestEditEmbeddedRequest, SignatureRequestEditEmbeddedWithTemplateRequest, SignatureRequestEditRequest, SignatureRequestEditWithTemplateRequest, SignatureRequestGetResponse, SignatureRequestListResponse, SignatureRequestRemindRequest, SignatureRequestResponse, SignatureRequestResponseAttachment, SignatureRequestResponseCustomFieldBase, SignatureRequestResponseCustomFieldCheckbox, SignatureRequestResponseCustomFieldText, SignatureRequestResponseCustomFieldTypeEnum, SignatureRequestResponseDataBase, SignatureRequestResponseDataTypeEnum, SignatureRequestResponseDataValueCheckbox, SignatureRequestResponseDataValueCheckboxMerge, SignatureRequestResponseDataValueDateSigned, SignatureRequestResponseDataValueDropdown, SignatureRequestResponseDataValueInitials, SignatureRequestResponseDataValueRadio, SignatureRequestResponseDataValueSignature, SignatureRequestResponseDataValueText, SignatureRequestResponseDataValueTextMerge, SignatureRequestResponseSignatures, SignatureRequestSendRequest, SignatureRequestSendWithTemplateRequest, SignatureRequestUpdateRequest, SubAttachment, SubBulkSignerList, SubBulkSignerListCustomField, SubCC, SubCustomField, SubEditorOptions, SubFieldOptions, SubFormFieldGroup, SubFormFieldRule, SubFormFieldRuleAction, SubFormFieldRuleTrigger, SubFormFieldsPerDocumentBase, SubFormFieldsPerDocumentCheckbox, SubFormFieldsPerDocumentCheckboxMerge, SubFormFieldsPerDocumentDateSigned, SubFormFieldsPerDocumentDropdown, SubFormFieldsPerDocumentFontEnum, SubFormFieldsPerDocumentHyperlink, SubFormFieldsPerDocumentInitials, SubFormFieldsPerDocumentRadio, SubFormFieldsPerDocumentSignature, SubFormFieldsPerDocumentText, SubFormFieldsPerDocumentTextMerge, SubFormFieldsPerDocumentTypeEnum, SubMergeField, SubOAuth, SubOptions, SubSignatureRequestGroupedSigners, SubSignatureRequestSigner, SubSignatureRequestTemplateSigner, SubSigningOptions, SubTeamResponse, SubTemplateRole, SubUnclaimedDraftSigner, SubUnclaimedDraftTemplateSigner, SubWhiteLabelingOptions, TeamAddMemberRequest, TeamCreateRequest, TeamGetInfoResponse, TeamGetResponse, TeamInfoResponse, TeamInviteResponse, TeamInvitesResponse, TeamMemberResponse, TeamMembersResponse, TeamParentResponse, TeamRemoveMemberRequest, TeamResponse, TeamSubTeamsResponse, TeamUpdateRequest, TemplateAddUserRequest, TemplateCreateEmbeddedDraftRequest, TemplateCreateEmbeddedDraftResponse, TemplateCreateEmbeddedDraftResponseTemplate, TemplateCreateRequest, TemplateCreateResponse, TemplateCreateResponseTemplate, TemplateEditRequest, TemplateGetResponse, TemplateListResponse, TemplateRemoveUserRequest, TemplateResponse, TemplateResponseAccount, TemplateResponseAccountQuota, TemplateResponseCCRole, TemplateResponseDocument, TemplateResponseDocumentCustomFieldBase, TemplateResponseDocumentCustomFieldCheckbox, TemplateResponseDocumentCustomFieldText, TemplateResponseDocumentFieldGroup, TemplateResponseDocumentFieldGroupRule, TemplateResponseDocumentFormFieldBase, TemplateResponseDocumentFormFieldCheckbox, TemplateResponseDocumentFormFieldDateSigned, TemplateResponseDocumentFormFieldDropdown, TemplateResponseDocumentFormFieldHyperlink, TemplateResponseDocumentFormFieldInitials, TemplateResponseDocumentFormFieldRadio, TemplateResponseDocumentFormFieldSignature, TemplateResponseDocumentFormFieldText, TemplateResponseDocumentStaticFieldBase, TemplateResponseDocumentStaticFieldCheckbox, TemplateResponseDocumentStaticFieldDateSigned, TemplateResponseDocumentStaticFieldDropdown, TemplateResponseDocumentStaticFieldHyperlink, TemplateResponseDocumentStaticFieldInitials, TemplateResponseDocumentStaticFieldRadio, TemplateResponseDocumentStaticFieldSignature, TemplateResponseDocumentStaticFieldText, TemplateResponseFieldAvgTextLength, TemplateResponseSignerRole, TemplateUpdateFilesRequest, TemplateUpdateFilesResponse, TemplateUpdateFilesResponseTemplate, UnclaimedDraftCreateEmbeddedRequest, UnclaimedDraftCreateEmbeddedWithTemplateRequest, UnclaimedDraftCreateRequest, UnclaimedDraftCreateResponse, UnclaimedDraftEditAndResendRequest, UnclaimedDraftResponse, VoidAuth, WarningResponse, }; diff --git a/sdks/node/types/model/templateEditResponse.d.ts b/sdks/node/types/model/templateEditRequest.d.ts similarity index 54% rename from sdks/node/types/model/templateEditResponse.d.ts rename to sdks/node/types/model/templateEditRequest.d.ts index dba3ddce6..4b1aaf7d1 100644 --- a/sdks/node/types/model/templateEditResponse.d.ts +++ b/sdks/node/types/model/templateEditRequest.d.ts @@ -1,8 +1,9 @@ import { AttributeTypeMap } from "./"; -export declare class TemplateEditResponse { - "templateId": string; +export declare class TemplateEditRequest { + "ccRoles"?: Array; + "allowFormView"?: boolean; static discriminator: string | undefined; static attributeTypeMap: AttributeTypeMap; static getAttributeTypeMap(): AttributeTypeMap; - static init(data: any): TemplateEditResponse; + static init(data: any): TemplateEditRequest; } diff --git a/sdks/php/README.md b/sdks/php/README.md index ddc1ded08..cbcb93159 100644 --- a/sdks/php/README.md +++ b/sdks/php/README.md @@ -209,6 +209,7 @@ All URIs are relative to *https://api.hellosign.com/v3* | *TemplateApi* | [**templateCreate**](docs/Api/TemplateApi.md#templatecreate) | **POST** /template/create | Create Template | | *TemplateApi* | [**templateCreateEmbeddedDraft**](docs/Api/TemplateApi.md#templatecreateembeddeddraft) | **POST** /template/create_embedded_draft | Create Embedded Template Draft | | *TemplateApi* | [**templateDelete**](docs/Api/TemplateApi.md#templatedelete) | **POST** /template/delete/{template_id} | Delete Template | +| *TemplateApi* | [**templateEdit**](docs/Api/TemplateApi.md#templateedit) | **POST** /template/edit/{template_id} | Edit Template | | *TemplateApi* | [**templateFiles**](docs/Api/TemplateApi.md#templatefiles) | **GET** /template/files/{template_id} | Get Template Files | | *TemplateApi* | [**templateFilesAsDataUri**](docs/Api/TemplateApi.md#templatefilesasdatauri) | **GET** /template/files_as_data_uri/{template_id} | Get Template Files as Data Uri | | *TemplateApi* | [**templateFilesAsFileUrl**](docs/Api/TemplateApi.md#templatefilesasfileurl) | **GET** /template/files_as_file_url/{template_id} | Get Template Files as File Url | @@ -372,7 +373,7 @@ All URIs are relative to *https://api.hellosign.com/v3* - [TemplateCreateRequest](docs/Model/TemplateCreateRequest.md) - [TemplateCreateResponse](docs/Model/TemplateCreateResponse.md) - [TemplateCreateResponseTemplate](docs/Model/TemplateCreateResponseTemplate.md) -- [TemplateEditResponse](docs/Model/TemplateEditResponse.md) +- [TemplateEditRequest](docs/Model/TemplateEditRequest.md) - [TemplateGetResponse](docs/Model/TemplateGetResponse.md) - [TemplateListResponse](docs/Model/TemplateListResponse.md) - [TemplateRemoveUserRequest](docs/Model/TemplateRemoveUserRequest.md) diff --git a/sdks/php/docs/Api/TemplateApi.md b/sdks/php/docs/Api/TemplateApi.md index 23d1d5a98..5496c4241 100644 --- a/sdks/php/docs/Api/TemplateApi.md +++ b/sdks/php/docs/Api/TemplateApi.md @@ -8,6 +8,7 @@ All URIs are relative to https://api.hellosign.com/v3. | [**templateCreate()**](TemplateApi.md#templateCreate) | **POST** /template/create | Create Template | | [**templateCreateEmbeddedDraft()**](TemplateApi.md#templateCreateEmbeddedDraft) | **POST** /template/create_embedded_draft | Create Embedded Template Draft | | [**templateDelete()**](TemplateApi.md#templateDelete) | **POST** /template/delete/{template_id} | Delete Template | +| [**templateEdit()**](TemplateApi.md#templateEdit) | **POST** /template/edit/{template_id} | Edit Template | | [**templateFiles()**](TemplateApi.md#templateFiles) | **GET** /template/files/{template_id} | Get Template Files | | [**templateFilesAsDataUri()**](TemplateApi.md#templateFilesAsDataUri) | **GET** /template/files_as_data_uri/{template_id} | Get Template Files as Data Uri | | [**templateFilesAsFileUrl()**](TemplateApi.md#templateFilesAsFileUrl) | **GET** /template/files_as_file_url/{template_id} | Get Template Files as File Url | @@ -382,6 +383,74 @@ void (empty response body) [[Back to Model list]](../../README.md#models) [[Back to README]](../../README.md) +## `templateEdit()` + +```php +templateEdit($template_id, $template_edit_request): \Dropbox\Sign\Model\TemplateGetResponse +``` +Edit Template + +Edits an existing template. + +### Example + +```php +setUsername("YOUR_API_KEY"); +// $config->setAccessToken("YOUR_ACCESS_TOKEN"); + +$template_edit_request = (new Dropbox\Sign\Model\TemplateEditRequest()) + ->setCcRoles([ + "Role 1", + "Role 2", + ]); + +try { + $response = (new Dropbox\Sign\Api\TemplateApi(config: $config))->templateEdit( + template_id: "f57db65d3f933b5316d398057a36176831451a35", + template_edit_request: $template_edit_request, + ); + + print_r($response); +} catch (Dropbox\Sign\ApiException $e) { + echo "Exception when calling TemplateApi#templateEdit: {$e->getMessage()}"; +} + +``` + +### Parameters + +|Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **template_id** | **string**| The id of the Template to edit. | | +| **template_edit_request** | [**\Dropbox\Sign\Model\TemplateEditRequest**](../Model/TemplateEditRequest.md)| | | + +### Return type + +[**\Dropbox\Sign\Model\TemplateGetResponse**](../Model/TemplateGetResponse.md) + +### Authorization + +[api_key](../../README.md#api_key), [oauth2](../../README.md#oauth2) + +### HTTP request headers + +- **Content-Type**: `application/json` +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + ## `templateFiles()` ```php diff --git a/sdks/php/docs/Model/TemplateEditRequest.md b/sdks/php/docs/Model/TemplateEditRequest.md new file mode 100644 index 000000000..928e76278 --- /dev/null +++ b/sdks/php/docs/Model/TemplateEditRequest.md @@ -0,0 +1,12 @@ +# # TemplateEditRequest + + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +| `cc_roles` | ```string[]``` | The CC roles that must be assigned when using the template to send a signature request | | +| `allow_form_view` | ```bool``` | Allows signers to view the form fields before signing if set to `true`. | | + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/sdks/php/docs/Model/TemplateEditResponse.md b/sdks/php/docs/Model/TemplateEditResponse.md deleted file mode 100644 index b343db573..000000000 --- a/sdks/php/docs/Model/TemplateEditResponse.md +++ /dev/null @@ -1,11 +0,0 @@ -# # TemplateEditResponse - - - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -| `template_id`*_required_ | ```string``` | The id of the Template. | | - -[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/sdks/php/src/Api/TemplateApi.php b/sdks/php/src/Api/TemplateApi.php index 2d39bc886..0753f424a 100644 --- a/sdks/php/src/Api/TemplateApi.php +++ b/sdks/php/src/Api/TemplateApi.php @@ -82,6 +82,9 @@ class TemplateApi 'templateDelete' => [ 'application/json', ], + 'templateEdit' => [ + 'application/json', + ], 'templateFiles' => [ 'application/json', ], @@ -1431,6 +1434,366 @@ public function templateDeleteRequest(string $template_id, string $contentType = ); } + /** + * Operation templateEdit + * + * Edit Template + * + * @param string $template_id The id of the Template to edit. (required) + * @param Model\TemplateEditRequest $template_edit_request template_edit_request (required) + * + * @return Model\TemplateGetResponse + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + */ + public function templateEdit(string $template_id, Model\TemplateEditRequest $template_edit_request) + { + list($response) = $this->templateEditWithHttpInfo($template_id, $template_edit_request); + return $response; + } + + /** + * Operation templateEditWithHttpInfo + * + * Edit Template + * + * @param string $template_id The id of the Template to edit. (required) + * @param Model\TemplateEditRequest $template_edit_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['templateEdit'] to see the possible values for this operation + * + * @return array of Model\TemplateGetResponse, HTTP status code, HTTP response headers (array of strings) + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @deprecated Prefer to use ::templateEdit. This method will eventually become unavailable + */ + public function templateEditWithHttpInfo(string $template_id, Model\TemplateEditRequest $template_edit_request, string $contentType = self::contentTypes['templateEdit'][0]) + { + $request = $this->templateEditRequest($template_id, $template_edit_request, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + $this->response = $response; + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int)$e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string)$e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int)$e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + $result = $this->handleRangeCodeResponse( + $response, + '4XX', + '\Dropbox\Sign\Model\ErrorResponse' + ); + if ($result) { + return $result; + } + + switch ($statusCode) { + case 200: + if ('\Dropbox\Sign\Model\TemplateGetResponse' === '\SplFileObject') { + $content = $response->getBody(); // stream goes to serializer + } else { + $content = (string)$response->getBody(); + if ('\Dropbox\Sign\Model\TemplateGetResponse' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\Dropbox\Sign\Model\TemplateGetResponse', []), + $response->getStatusCode(), + $response->getHeaders(), + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string)$request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string)$response->getBody() + ); + } + + $returnType = '\Dropbox\Sign\Model\TemplateGetResponse'; + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); // stream goes to serializer + } else { + $content = (string)$response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders(), + ]; + } catch (ApiException $e) { + if ($this->handleRangeCodeException($e, '4XX', '\Dropbox\Sign\Model\ErrorResponse')) { + throw $e; + } + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Dropbox\Sign\Model\TemplateGetResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation templateEditAsync + * + * Edit Template + * + * @param string $template_id The id of the Template to edit. (required) + * @param Model\TemplateEditRequest $template_edit_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['templateEdit'] to see the possible values for this operation + * + * @return \GuzzleHttp\Promise\PromiseInterface + * @throws InvalidArgumentException + * @deprecated Prefer to use ::templateEdit. This method will eventually become unavailable + */ + public function templateEditAsync(string $template_id, Model\TemplateEditRequest $template_edit_request, string $contentType = self::contentTypes['templateEdit'][0]) + { + return $this->templateEditAsyncWithHttpInfo($template_id, $template_edit_request, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation templateEditAsyncWithHttpInfo + * + * Edit Template + * + * @param string $template_id The id of the Template to edit. (required) + * @param Model\TemplateEditRequest $template_edit_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['templateEdit'] to see the possible values for this operation + * + * @return \GuzzleHttp\Promise\PromiseInterface + * @throws InvalidArgumentException + * @deprecated Prefer to use ::templateEdit. This method will eventually become unavailable + */ + public function templateEditAsyncWithHttpInfo(string $template_id, Model\TemplateEditRequest $template_edit_request, string $contentType = self::contentTypes['templateEdit'][0]) + { + $returnType = '\Dropbox\Sign\Model\TemplateGetResponse'; + $request = $this->templateEditRequest($template_id, $template_edit_request, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); // stream goes to serializer + } else { + $content = (string)$response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders(), + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string)$response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'templateEdit' + * + * @param string $template_id The id of the Template to edit. (required) + * @param Model\TemplateEditRequest $template_edit_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['templateEdit'] to see the possible values for this operation + * + * @return Request + * @throws InvalidArgumentException + * @deprecated Prefer to use ::templateEdit. This method will eventually become unavailable + */ + public function templateEditRequest(string $template_id, Model\TemplateEditRequest $template_edit_request, string $contentType = self::contentTypes['templateEdit'][0]) + { + // verify the required parameter 'template_id' is set + if ($template_id === null || (is_array($template_id) && count($template_id) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $template_id when calling templateEdit' + ); + } + + // verify the required parameter 'template_edit_request' is set + if ($template_edit_request === null || (is_array($template_edit_request) && count($template_edit_request) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $template_edit_request when calling templateEdit' + ); + } + + $resourcePath = '/template/edit/{template_id}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + $formParams = ObjectSerializer::getFormParams( + $template_edit_request + ); + + $multipart = !empty($formParams); + + // path params + if ($template_id !== null) { + $resourcePath = str_replace( + '{template_id}', + ObjectSerializer::toPathValue($template_id), + $resourcePath + ); + } + + $headers = $this->headerSelector->selectHeaders( + $multipart ? ['multipart/form-data'] : ['application/json'], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) === 0) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + // if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($template_edit_request)); + } else { + $httpBody = $template_edit_request; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem, + ]; + } + } + // for HTTP post (form) + if (!empty($body)) { + $multipartContents[] = [ + 'name' => 'body', + 'contents' => $body, + 'headers' => ['Content-Type' => 'application/json'], + ]; + } + + if ($payloadHook = $this->config->getPayloadHook()) { + $payloadHook('multipart', $multipartContents, $template_edit_request); + } + $httpBody = new MultipartStream($multipartContents); + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + // if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername())) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ':'); + } + // this endpoint requires Bearer (JWT) authentication (access token) + if (!empty($this->config->getAccessToken())) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'POST', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + /** * Operation templateFiles * diff --git a/sdks/php/src/Model/TemplateEditResponse.php b/sdks/php/src/Model/TemplateEditRequest.php similarity index 80% rename from sdks/php/src/Model/TemplateEditResponse.php rename to sdks/php/src/Model/TemplateEditRequest.php index 625024594..28578b9bd 100644 --- a/sdks/php/src/Model/TemplateEditResponse.php +++ b/sdks/php/src/Model/TemplateEditRequest.php @@ -1,6 +1,6 @@ */ -class TemplateEditResponse implements ModelInterface, ArrayAccess, JsonSerializable +class TemplateEditRequest implements ModelInterface, ArrayAccess, JsonSerializable { public const DISCRIMINATOR = null; @@ -49,7 +49,7 @@ class TemplateEditResponse implements ModelInterface, ArrayAccess, JsonSerializa * * @var string */ - protected static $openAPIModelName = 'TemplateEditResponse'; + protected static $openAPIModelName = 'TemplateEditRequest'; /** * Array of property to type mappings. Used for (de)serialization @@ -57,7 +57,8 @@ class TemplateEditResponse implements ModelInterface, ArrayAccess, JsonSerializa * @var string[] */ protected static $openAPITypes = [ - 'template_id' => 'string', + 'cc_roles' => 'string[]', + 'allow_form_view' => 'bool', ]; /** @@ -68,7 +69,8 @@ class TemplateEditResponse implements ModelInterface, ArrayAccess, JsonSerializa * @psalm-var array */ protected static $openAPIFormats = [ - 'template_id' => null, + 'cc_roles' => null, + 'allow_form_view' => null, ]; /** @@ -77,7 +79,8 @@ class TemplateEditResponse implements ModelInterface, ArrayAccess, JsonSerializa * @var bool[] */ protected static array $openAPINullables = [ - 'template_id' => false, + 'cc_roles' => false, + 'allow_form_view' => false, ]; /** @@ -158,7 +161,8 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $attributeMap = [ - 'template_id' => 'template_id', + 'cc_roles' => 'cc_roles', + 'allow_form_view' => 'allow_form_view', ]; /** @@ -167,7 +171,8 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $setters = [ - 'template_id' => 'setTemplateId', + 'cc_roles' => 'setCcRoles', + 'allow_form_view' => 'setAllowFormView', ]; /** @@ -176,7 +181,8 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $getters = [ - 'template_id' => 'getTemplateId', + 'cc_roles' => 'getCcRoles', + 'allow_form_view' => 'getAllowFormView', ]; /** @@ -235,13 +241,14 @@ public function getModelName() */ public function __construct(?array $data = null) { - $this->setIfExists('template_id', $data ?? [], null); + $this->setIfExists('cc_roles', $data ?? [], null); + $this->setIfExists('allow_form_view', $data ?? [], null); } /** * @deprecated use ::init() */ - public static function fromArray(array $data): TemplateEditResponse + public static function fromArray(array $data): TemplateEditRequest { return self::init($data); } @@ -249,12 +256,12 @@ public static function fromArray(array $data): TemplateEditResponse /** * Attempt to instantiate and hydrate a new instance of this class */ - public static function init(array $data): TemplateEditResponse + public static function init(array $data): TemplateEditRequest { - /** @var TemplateEditResponse */ + /** @var TemplateEditRequest */ return ObjectSerializer::deserialize( $data, - TemplateEditResponse::class, + TemplateEditRequest::class, ); } @@ -281,12 +288,7 @@ private function setIfExists(string $variableName, array $fields, $defaultValue) */ public function listInvalidProperties() { - $invalidProperties = []; - - if ($this->container['template_id'] === null) { - $invalidProperties[] = "'template_id' can't be null"; - } - return $invalidProperties; + return []; } /** @@ -301,28 +303,55 @@ public function valid() } /** - * Gets template_id + * Gets cc_roles * - * @return string + * @return string[]|null + */ + public function getCcRoles() + { + return $this->container['cc_roles']; + } + + /** + * Sets cc_roles + * + * @param string[]|null $cc_roles The CC roles that must be assigned when using the template to send a signature request + * + * @return self + */ + public function setCcRoles(?array $cc_roles) + { + if (is_null($cc_roles)) { + throw new InvalidArgumentException('non-nullable cc_roles cannot be null'); + } + $this->container['cc_roles'] = $cc_roles; + + return $this; + } + + /** + * Gets allow_form_view + * + * @return bool|null */ - public function getTemplateId() + public function getAllowFormView() { - return $this->container['template_id']; + return $this->container['allow_form_view']; } /** - * Sets template_id + * Sets allow_form_view * - * @param string $template_id the id of the Template + * @param bool|null $allow_form_view allows signers to view the form fields before signing if set to `true` * * @return self */ - public function setTemplateId(string $template_id) + public function setAllowFormView(?bool $allow_form_view) { - if (is_null($template_id)) { - throw new InvalidArgumentException('non-nullable template_id cannot be null'); + if (is_null($allow_form_view)) { + throw new InvalidArgumentException('non-nullable allow_form_view cannot be null'); } - $this->container['template_id'] = $template_id; + $this->container['allow_form_view'] = $allow_form_view; return $this; } diff --git a/sdks/python/README.md b/sdks/python/README.md index 5c2d67154..baf9bd371 100644 --- a/sdks/python/README.md +++ b/sdks/python/README.md @@ -165,6 +165,7 @@ Class | Method | HTTP request | Description ```TemplateApi``` | [```template_create```](docs/TemplateApi.md#template_create) | ```POST /template/create``` | Create Template| ```TemplateApi``` | [```template_create_embedded_draft```](docs/TemplateApi.md#template_create_embedded_draft) | ```POST /template/create_embedded_draft``` | Create Embedded Template Draft| ```TemplateApi``` | [```template_delete```](docs/TemplateApi.md#template_delete) | ```POST /template/delete/{template_id}``` | Delete Template| +```TemplateApi``` | [```template_edit```](docs/TemplateApi.md#template_edit) | ```POST /template/edit/{template_id}``` | Edit Template| ```TemplateApi``` | [```template_files```](docs/TemplateApi.md#template_files) | ```GET /template/files/{template_id}``` | Get Template Files| ```TemplateApi``` | [```template_files_as_data_uri```](docs/TemplateApi.md#template_files_as_data_uri) | ```GET /template/files_as_data_uri/{template_id}``` | Get Template Files as Data Uri| ```TemplateApi``` | [```template_files_as_file_url```](docs/TemplateApi.md#template_files_as_file_url) | ```GET /template/files_as_file_url/{template_id}``` | Get Template Files as File Url| @@ -328,7 +329,7 @@ Class | Method | HTTP request | Description - [TemplateCreateRequest](docs/TemplateCreateRequest.md) - [TemplateCreateResponse](docs/TemplateCreateResponse.md) - [TemplateCreateResponseTemplate](docs/TemplateCreateResponseTemplate.md) - - [TemplateEditResponse](docs/TemplateEditResponse.md) + - [TemplateEditRequest](docs/TemplateEditRequest.md) - [TemplateGetResponse](docs/TemplateGetResponse.md) - [TemplateListResponse](docs/TemplateListResponse.md) - [TemplateRemoveUserRequest](docs/TemplateRemoveUserRequest.md) diff --git a/sdks/python/docs/TemplateApi.md b/sdks/python/docs/TemplateApi.md index 5ff5a44c8..d388b8a5e 100644 --- a/sdks/python/docs/TemplateApi.md +++ b/sdks/python/docs/TemplateApi.md @@ -8,6 +8,7 @@ Method | HTTP request | Description |[```template_create```](TemplateApi.md#template_create) | ```POST /template/create``` | Create Template| |[```template_create_embedded_draft```](TemplateApi.md#template_create_embedded_draft) | ```POST /template/create_embedded_draft``` | Create Embedded Template Draft| |[```template_delete```](TemplateApi.md#template_delete) | ```POST /template/delete/{template_id}``` | Delete Template| +|[```template_edit```](TemplateApi.md#template_edit) | ```POST /template/edit/{template_id}``` | Edit Template| |[```template_files```](TemplateApi.md#template_files) | ```GET /template/files/{template_id}``` | Get Template Files| |[```template_files_as_data_uri```](TemplateApi.md#template_files_as_data_uri) | ```GET /template/files_as_data_uri/{template_id}``` | Get Template Files as Data Uri| |[```template_files_as_file_url```](TemplateApi.md#template_files_as_file_url) | ```GET /template/files_as_file_url/{template_id}``` | Get Template Files as File Url| @@ -418,6 +419,79 @@ void (empty response body) [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +# ```template_edit``` +> ```TemplateGetResponse template_edit(template_id, template_edit_request)``` + +Edit Template + +Edits an existing template. + +### Example + +* Basic Authentication (api_key): +* Bearer (JWT) Authentication (oauth2): + +```python +import json +from datetime import date, datetime +from pprint import pprint + +from dropbox_sign import ApiClient, ApiException, Configuration, api, models + +configuration = Configuration( + username="YOUR_API_KEY", + # access_token="YOUR_ACCESS_TOKEN", +) + +with ApiClient(configuration) as api_client: + template_edit_request = models.TemplateEditRequest( + cc_roles=[ + "Role 1", + "Role 2", + ], + ) + + try: + response = api.TemplateApi(api_client).template_edit( + template_id="f57db65d3f933b5316d398057a36176831451a35", + template_edit_request=template_edit_request, + ) + + pprint(response) + except ApiException as e: + print("Exception when calling TemplateApi#template_edit: %s\n" % e) + +``` +``` + +### Parameters +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| `template_id` | **str** | The id of the Template to edit. | | +| `template_edit_request` | [**TemplateEditRequest**](TemplateEditRequest.md) | | | + +### Return type + +[**TemplateGetResponse**](TemplateGetResponse.md) + +### Authorization + +[api_key](../README.md#api_key), [oauth2](../README.md#oauth2) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | successful operation | * X-RateLimit-Limit - * X-RateLimit-Remaining - * X-Ratelimit-Reset - | +**4XX** | failed_operation | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + # ```template_files``` > ```io.IOBase template_files(template_id)``` diff --git a/sdks/python/docs/TemplateEditResponse.md b/sdks/python/docs/TemplateEditRequest.md similarity index 51% rename from sdks/python/docs/TemplateEditResponse.md rename to sdks/python/docs/TemplateEditRequest.md index 2384cb094..92a8256ef 100644 --- a/sdks/python/docs/TemplateEditResponse.md +++ b/sdks/python/docs/TemplateEditRequest.md @@ -1,11 +1,12 @@ -# TemplateEditResponse +# TemplateEditRequest ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -| `template_id`*_required_ | ```str``` | The id of the Template. | | +| `cc_roles` | ```List[str]``` | The CC roles that must be assigned when using the template to send a signature request | | +| `allow_form_view` | ```bool``` | Allows signers to view the form fields before signing if set to `true`. | | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/sdks/python/dropbox_sign/__init__.py b/sdks/python/dropbox_sign/__init__.py index 82a36a10d..c93c650d1 100644 --- a/sdks/python/dropbox_sign/__init__.py +++ b/sdks/python/dropbox_sign/__init__.py @@ -306,7 +306,7 @@ from dropbox_sign.models.template_create_response_template import ( TemplateCreateResponseTemplate, ) -from dropbox_sign.models.template_edit_response import TemplateEditResponse +from dropbox_sign.models.template_edit_request import TemplateEditRequest from dropbox_sign.models.template_get_response import TemplateGetResponse from dropbox_sign.models.template_list_response import TemplateListResponse from dropbox_sign.models.template_remove_user_request import TemplateRemoveUserRequest diff --git a/sdks/python/dropbox_sign/api/template_api.py b/sdks/python/dropbox_sign/api/template_api.py index 3205675ea..9d6f42a97 100644 --- a/sdks/python/dropbox_sign/api/template_api.py +++ b/sdks/python/dropbox_sign/api/template_api.py @@ -31,6 +31,7 @@ ) from dropbox_sign.models.template_create_request import TemplateCreateRequest from dropbox_sign.models.template_create_response import TemplateCreateResponse +from dropbox_sign.models.template_edit_request import TemplateEditRequest from dropbox_sign.models.template_get_response import TemplateGetResponse from dropbox_sign.models.template_list_response import TemplateListResponse from dropbox_sign.models.template_remove_user_request import TemplateRemoveUserRequest @@ -1163,6 +1164,304 @@ def _template_delete_serialize( _request_auth=_request_auth, ) + @validate_call + def template_edit( + self, + template_id: Annotated[ + StrictStr, Field(description="The id of the Template to edit.") + ], + template_edit_request: TemplateEditRequest, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> TemplateGetResponse: + """Edit Template + + Edits an existing template. + + :param template_id: The id of the Template to edit. (required) + :type template_id: str + :param template_edit_request: (required) + :type template_edit_request: TemplateEditRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._template_edit_serialize( + template_id=template_id, + template_edit_request=template_edit_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "TemplateGetResponse", + "4XX": "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + @validate_call + def template_edit_with_http_info( + self, + template_id: Annotated[ + StrictStr, Field(description="The id of the Template to edit.") + ], + template_edit_request: TemplateEditRequest, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[TemplateGetResponse]: + """Edit Template + + Edits an existing template. + + :param template_id: The id of the Template to edit. (required) + :type template_id: str + :param template_edit_request: (required) + :type template_edit_request: TemplateEditRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._template_edit_serialize( + template_id=template_id, + template_edit_request=template_edit_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "TemplateGetResponse", + "4XX": "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + @validate_call + def template_edit_without_preload_content( + self, + template_id: Annotated[ + StrictStr, Field(description="The id of the Template to edit.") + ], + template_edit_request: TemplateEditRequest, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Edit Template + + Edits an existing template. + + :param template_id: The id of the Template to edit. (required) + :type template_id: str + :param template_edit_request: (required) + :type template_edit_request: TemplateEditRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._template_edit_serialize( + template_id=template_id, + template_edit_request=template_edit_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "TemplateGetResponse", + "4XX": "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + return response_data.response + + def _template_edit_serialize( + self, + template_id, + template_edit_request, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = {} + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + has_files = False + body_param = template_edit_request + excluded_json_fields = set([]) + for param_name, param_type in body_param.openapi_types().items(): + param_value = getattr(body_param, param_name) + if param_value is None: + continue + + if "io.IOBase" in param_type: + has_files = True + _content_type = "multipart/form-data" + excluded_json_fields.add(param_name) + + if isinstance(param_value, list): + for index, item in enumerate(param_value): + _files[f"{param_name}[{index}]"] = item + else: + _files[param_name] = param_value + + if has_files is True: + _form_params = body_param.to_json_form_params(excluded_json_fields) + + # process the path parameters + if template_id is not None: + _path_params["template_id"] = template_id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if template_edit_request is not None and has_files is False: + _body_params = template_edit_request + + # set the HTTP header `Accept` + if "Accept" not in _header_params: + _header_params["Accept"] = self.api_client.select_header_accept( + ["application/json"] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params["Content-Type"] = _content_type + else: + _default_content_type = self.api_client.select_header_content_type( + ["application/json"] + ) + if _default_content_type is not None: + _header_params["Content-Type"] = _default_content_type + + # authentication setting + _auth_settings: List[str] = ["api_key", "oauth2"] + + return self.api_client.param_serialize( + method="POST", + resource_path="/template/edit/{template_id}", + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth, + ) + @validate_call def template_files( self, diff --git a/sdks/python/dropbox_sign/models/__init__.py b/sdks/python/dropbox_sign/models/__init__.py index fd5331ae1..fb933f520 100644 --- a/sdks/python/dropbox_sign/models/__init__.py +++ b/sdks/python/dropbox_sign/models/__init__.py @@ -289,7 +289,7 @@ from dropbox_sign.models.template_create_response_template import ( TemplateCreateResponseTemplate, ) -from dropbox_sign.models.template_edit_response import TemplateEditResponse +from dropbox_sign.models.template_edit_request import TemplateEditRequest from dropbox_sign.models.template_get_response import TemplateGetResponse from dropbox_sign.models.template_list_response import TemplateListResponse from dropbox_sign.models.template_remove_user_request import TemplateRemoveUserRequest diff --git a/sdks/python/dropbox_sign/models/template_edit_response.py b/sdks/python/dropbox_sign/models/template_edit_request.py similarity index 72% rename from sdks/python/dropbox_sign/models/template_edit_response.py rename to sdks/python/dropbox_sign/models/template_edit_request.py index 198813848..3924d00d3 100644 --- a/sdks/python/dropbox_sign/models/template_edit_response.py +++ b/sdks/python/dropbox_sign/models/template_edit_request.py @@ -18,8 +18,8 @@ import re # noqa: F401 import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, List +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr +from typing import Any, ClassVar, Dict, List, Optional from typing import Optional, Set from typing_extensions import Self from typing import Tuple, Union @@ -27,13 +27,20 @@ from pydantic import StrictBool -class TemplateEditResponse(BaseModel): +class TemplateEditRequest(BaseModel): """ - TemplateEditResponse + TemplateEditRequest """ # noqa: E501 - template_id: StrictStr = Field(description="The id of the Template.") - __properties: ClassVar[List[str]] = ["template_id"] + cc_roles: Optional[List[StrictStr]] = Field( + default=None, + description="The CC roles that must be assigned when using the template to send a signature request", + ) + allow_form_view: Optional[StrictBool] = Field( + default=None, + description="Allows signers to view the form fields before signing if set to `true`.", + ) + __properties: ClassVar[List[str]] = ["cc_roles", "allow_form_view"] model_config = ConfigDict( populate_by_name=True, @@ -66,7 +73,7 @@ def to_json_form_params( @classmethod def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of TemplateEditResponse from a JSON string""" + """Create an instance of TemplateEditRequest from a JSON string""" return cls.from_dict(json.loads(json_str)) def to_dict(self, excluded_fields: Set[str] = None) -> Dict[str, Any]: @@ -89,14 +96,19 @@ def to_dict(self, excluded_fields: Set[str] = None) -> Dict[str, Any]: @classmethod def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of TemplateEditResponse from a dict""" + """Create an instance of TemplateEditRequest from a dict""" if obj is None: return None if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({"template_id": obj.get("template_id")}) + _obj = cls.model_validate( + { + "cc_roles": obj.get("cc_roles"), + "allow_form_view": obj.get("allow_form_view"), + } + ) return _obj @classmethod @@ -112,9 +124,12 @@ def init(cls, data: Any) -> Self: @classmethod def openapi_types(cls) -> Dict[str, str]: return { - "template_id": "(str,)", + "cc_roles": "(List[str],)", + "allow_form_view": "(bool,)", } @classmethod def openapi_type_is_array(cls, property_name: str) -> bool: - return property_name in [] + return property_name in [ + "cc_roles", + ] diff --git a/sdks/ruby/README.md b/sdks/ruby/README.md index 2e973be17..21dca6b53 100644 --- a/sdks/ruby/README.md +++ b/sdks/ruby/README.md @@ -169,6 +169,7 @@ All URIs are relative to *https://api.hellosign.com/v3* |*Dropbox::Sign::TemplateApi* | [**template_create**](docs/TemplateApi.md#template_create) | **POST** /template/create | Create Template | |*Dropbox::Sign::TemplateApi* | [**template_create_embedded_draft**](docs/TemplateApi.md#template_create_embedded_draft) | **POST** /template/create_embedded_draft | Create Embedded Template Draft | |*Dropbox::Sign::TemplateApi* | [**template_delete**](docs/TemplateApi.md#template_delete) | **POST** /template/delete/{template_id} | Delete Template | +|*Dropbox::Sign::TemplateApi* | [**template_edit**](docs/TemplateApi.md#template_edit) | **POST** /template/edit/{template_id} | Edit Template | |*Dropbox::Sign::TemplateApi* | [**template_files**](docs/TemplateApi.md#template_files) | **GET** /template/files/{template_id} | Get Template Files | |*Dropbox::Sign::TemplateApi* | [**template_files_as_data_uri**](docs/TemplateApi.md#template_files_as_data_uri) | **GET** /template/files_as_data_uri/{template_id} | Get Template Files as Data Uri | |*Dropbox::Sign::TemplateApi* | [**template_files_as_file_url**](docs/TemplateApi.md#template_files_as_file_url) | **GET** /template/files_as_file_url/{template_id} | Get Template Files as File Url | @@ -332,7 +333,7 @@ All URIs are relative to *https://api.hellosign.com/v3* - [Dropbox::Sign::TemplateCreateRequest](docs/TemplateCreateRequest.md) - [Dropbox::Sign::TemplateCreateResponse](docs/TemplateCreateResponse.md) - [Dropbox::Sign::TemplateCreateResponseTemplate](docs/TemplateCreateResponseTemplate.md) - - [Dropbox::Sign::TemplateEditResponse](docs/TemplateEditResponse.md) + - [Dropbox::Sign::TemplateEditRequest](docs/TemplateEditRequest.md) - [Dropbox::Sign::TemplateGetResponse](docs/TemplateGetResponse.md) - [Dropbox::Sign::TemplateListResponse](docs/TemplateListResponse.md) - [Dropbox::Sign::TemplateRemoveUserRequest](docs/TemplateRemoveUserRequest.md) diff --git a/sdks/ruby/docs/TemplateApi.md b/sdks/ruby/docs/TemplateApi.md index 315ced97c..ac9d8839d 100644 --- a/sdks/ruby/docs/TemplateApi.md +++ b/sdks/ruby/docs/TemplateApi.md @@ -8,6 +8,7 @@ All URIs are relative to *https://api.hellosign.com/v3* | [`template_create`](TemplateApi.md#template_create) | **POST** `/template/create` | Create Template | | [`template_create_embedded_draft`](TemplateApi.md#template_create_embedded_draft) | **POST** `/template/create_embedded_draft` | Create Embedded Template Draft | | [`template_delete`](TemplateApi.md#template_delete) | **POST** `/template/delete/{template_id}` | Delete Template | +| [`template_edit`](TemplateApi.md#template_edit) | **POST** `/template/edit/{template_id}` | Edit Template | | [`template_files`](TemplateApi.md#template_files) | **GET** `/template/files/{template_id}` | Get Template Files | | [`template_files_as_data_uri`](TemplateApi.md#template_files_as_data_uri) | **GET** `/template/files_as_data_uri/{template_id}` | Get Template Files as Data Uri | | [`template_files_as_file_url`](TemplateApi.md#template_files_as_file_url) | **GET** `/template/files_as_file_url/{template_id}` | Get Template Files as File Url | @@ -420,6 +421,83 @@ nil (empty response body) - **Accept**: application/json +## `template_edit` + +> ` template_edit(template_id, template_edit_request)` + +Edit Template + +Edits an existing template. + +### Examples + +```ruby +require "json" +require "dropbox-sign" + +Dropbox::Sign.configure do |config| + config.username = "YOUR_API_KEY" + # config.access_token = "YOUR_ACCESS_TOKEN" +end + +template_edit_request = Dropbox::Sign::TemplateEditRequest.new +template_edit_request.cc_roles = [ + "Role 1", + "Role 2", +] + +begin + response = Dropbox::Sign::TemplateApi.new.template_edit( + "f57db65d3f933b5316d398057a36176831451a35", # template_id + template_edit_request, + ) + + p response +rescue Dropbox::Sign::ApiError => e + puts "Exception when calling TemplateApi#template_edit: #{e}" +end + +``` + +#### Using the `template_edit_with_http_info` variant + +This returns an Array which contains the response data, status code and headers. + +> `, Integer, Hash)> template_edit_with_http_info(template_id, template_edit_request)` + +```ruby +begin + # Edit Template + data, status_code, headers = api_instance.template_edit_with_http_info(template_id, template_edit_request) + p status_code # => 2xx + p headers # => { ... } + p data # => +rescue Dropbox::Sign::ApiError => e + puts "Error when calling TemplateApi->template_edit_with_http_info: #{e}" +end +``` + +### Parameters + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| `template_id` | **String** | The id of the Template to edit. | | +| `template_edit_request` | [**TemplateEditRequest**](TemplateEditRequest.md) | | | + +### Return type + +[**TemplateGetResponse**](TemplateGetResponse.md) + +### Authorization + +[api_key](../README.md#api_key), [oauth2](../README.md#oauth2) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + + ## `template_files` > `File template_files(template_id, opts)` diff --git a/sdks/ruby/docs/TemplateEditRequest.md b/sdks/ruby/docs/TemplateEditRequest.md new file mode 100644 index 000000000..62fddfc98 --- /dev/null +++ b/sdks/ruby/docs/TemplateEditRequest.md @@ -0,0 +1,11 @@ +# Dropbox::Sign::TemplateEditRequest + + + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| `cc_roles` | ```Array``` | The CC roles that must be assigned when using the template to send a signature request | | +| `allow_form_view` | ```Boolean``` | Allows signers to view the form fields before signing if set to `true`. | | + diff --git a/sdks/ruby/docs/TemplateEditResponse.md b/sdks/ruby/docs/TemplateEditResponse.md deleted file mode 100644 index 5b46080d2..000000000 --- a/sdks/ruby/docs/TemplateEditResponse.md +++ /dev/null @@ -1,10 +0,0 @@ -# Dropbox::Sign::TemplateEditResponse - - - -## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | -| `template_id`*_required_ | ```String``` | The id of the Template. | | - diff --git a/sdks/ruby/lib/dropbox-sign.rb b/sdks/ruby/lib/dropbox-sign.rb index 413c293c8..870a7ee4e 100644 --- a/sdks/ruby/lib/dropbox-sign.rb +++ b/sdks/ruby/lib/dropbox-sign.rb @@ -144,7 +144,7 @@ require 'dropbox-sign/models/template_create_request' require 'dropbox-sign/models/template_create_response' require 'dropbox-sign/models/template_create_response_template' -require 'dropbox-sign/models/template_edit_response' +require 'dropbox-sign/models/template_edit_request' require 'dropbox-sign/models/template_get_response' require 'dropbox-sign/models/template_list_response' require 'dropbox-sign/models/template_remove_user_request' diff --git a/sdks/ruby/lib/dropbox-sign/api/template_api.rb b/sdks/ruby/lib/dropbox-sign/api/template_api.rb index 4620ab332..1dc679434 100644 --- a/sdks/ruby/lib/dropbox-sign/api/template_api.rb +++ b/sdks/ruby/lib/dropbox-sign/api/template_api.rb @@ -422,6 +422,121 @@ def template_delete_with_http_info(template_id, opts = {}) return data, status_code, headers end + # Edit Template + # Edits an existing template. + # @param template_id [String] The id of the Template to edit. + # @param template_edit_request [TemplateEditRequest] + # @param [Hash] opts the optional parameters + # @return [TemplateGetResponse] + def template_edit(template_id, template_edit_request, opts = {}) + data, _status_code, _headers = template_edit_with_http_info(template_id, template_edit_request, opts) + data + end + + # Edit Template + # Edits an existing template. + # @param template_id [String] The id of the Template to edit. + # @param template_edit_request [TemplateEditRequest] + # @param [Hash] opts the optional parameters + # @return [Array<(TemplateGetResponse, Integer, Hash)>] TemplateGetResponse data, response status code and response headers + def template_edit_with_http_info(template_id, template_edit_request, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: TemplateApi.template_edit ...' + end + # verify the required parameter 'template_id' is set + if @api_client.config.client_side_validation && template_id.nil? + fail ArgumentError, "Missing the required parameter 'template_id' when calling TemplateApi.template_edit" + end + # verify the required parameter 'template_edit_request' is set + if @api_client.config.client_side_validation && template_edit_request.nil? + fail ArgumentError, "Missing the required parameter 'template_edit_request' when calling TemplateApi.template_edit" + end + # resource path + local_var_path = '/template/edit/{template_id}'.sub('{' + 'template_id' + '}', CGI.escape(template_id.to_s)) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] + # HTTP header 'Content-Type' + content_type = @api_client.select_header_content_type(['application/json']) + if !content_type.nil? + header_params['Content-Type'] = content_type + end + + post_body = {} + form_params = opts[:form_params] || {} + result = @api_client.generate_form_data( + template_edit_request, + Dropbox::Sign::TemplateEditRequest.openapi_types + ) + + # form parameters + if result[:has_file] + form_params = opts[:form_params] || result[:params] + header_params['Content-Type'] = 'multipart/form-data' + else + # http body (model) + post_body = opts[:debug_body] || result[:params] + end + + # return_type + return_type = opts[:debug_return_type] || 'TemplateGetResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || ['api_key', 'oauth2'] + + new_options = opts.merge( + :operation => :"TemplateApi.template_edit", + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + begin + data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) + rescue Dropbox::Sign::ApiError => e + if e.code === 200 + body = @api_client.convert_to_type( + JSON.parse("[#{e.response_body}]", :symbolize_names => true)[0], + "Dropbox::Sign::TemplateGetResponse" + ) + + fail ApiError.new(:code => e.code, + :response_headers => e.response_headers, + :response_body => body), + e.message + end + + range_code = "4XX".split('').first + range_code_left = "#{range_code}00".to_i + range_code_right = "#{range_code}99".to_i + if e.code >= range_code_left && e.code <= range_code_right + body = @api_client.convert_to_type( + JSON.parse("[#{e.response_body}]", :symbolize_names => true)[0], + "Dropbox::Sign::ErrorResponse" + ) + + fail ApiError.new(:code => e.code, + :response_headers => e.response_headers, + :response_body => body), + e.message + end + + end + + if @api_client.config.debugging + @api_client.config.logger.debug "API called: TemplateApi#template_edit\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + # Get Template Files # Obtain a copy of the current documents specified by the `template_id` parameter. Returns a PDF or ZIP file. 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 template_id [String] The id of the template files to retrieve. diff --git a/sdks/ruby/lib/dropbox-sign/models/template_edit_response.rb b/sdks/ruby/lib/dropbox-sign/models/template_edit_request.rb similarity index 85% rename from sdks/ruby/lib/dropbox-sign/models/template_edit_response.rb rename to sdks/ruby/lib/dropbox-sign/models/template_edit_request.rb index 9a4996745..b7ea3ab58 100644 --- a/sdks/ruby/lib/dropbox-sign/models/template_edit_response.rb +++ b/sdks/ruby/lib/dropbox-sign/models/template_edit_request.rb @@ -17,15 +17,20 @@ module Dropbox end module Dropbox::Sign - class TemplateEditResponse - # The id of the Template. - # @return [String] - attr_accessor :template_id + class TemplateEditRequest + # The CC roles that must be assigned when using the template to send a signature request + # @return [Array] + attr_accessor :cc_roles + + # Allows signers to view the form fields before signing if set to `true`. + # @return [Boolean] + attr_accessor :allow_form_view # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { - :'template_id' => :'template_id' + :'cc_roles' => :'cc_roles', + :'allow_form_view' => :'allow_form_view' } end @@ -42,7 +47,8 @@ def self.acceptable_attributes # Attribute type mapping. def self.openapi_types { - :'template_id' => :'String' + :'cc_roles' => :'Array', + :'allow_form_view' => :'Boolean' } end @@ -69,32 +75,38 @@ def self.merged_nullable # Attempt to instantiate and hydrate a new instance of this class # @param [Object] data Data to be converted - # @return [TemplateEditResponse] + # @return [TemplateEditRequest] def self.init(data) ApiClient.default.convert_to_type( data, - "TemplateEditResponse" - ) || TemplateEditResponse.new + "TemplateEditRequest" + ) || TemplateEditRequest.new end # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Dropbox::Sign::TemplateEditResponse` initialize method" + fail ArgumentError, "The input argument (attributes) must be a hash in `Dropbox::Sign::TemplateEditRequest` initialize method" end # check to see if the attribute exists and convert string to symbol for hash key acceptable_attribute_map = self.class.acceptable_attribute_map attributes = attributes.each_with_object({}) { |(k, v), h| if (!self.class.merged_attributes.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Dropbox::Sign::TemplateEditResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + fail ArgumentError, "`#{k}` is not a valid attribute in `Dropbox::Sign::TemplateEditRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect end h[k.to_sym] = v } - if attributes.key?(:'template_id') - self.template_id = attributes[:'template_id'] + if attributes.key?(:'cc_roles') + if (value = attributes[:'cc_roles']).is_a?(Array) + self.cc_roles = value + end + end + + if attributes.key?(:'allow_form_view') + self.allow_form_view = attributes[:'allow_form_view'] end end @@ -102,36 +114,22 @@ def initialize(attributes = {}) # @return Array for valid properties with the reasons def list_invalid_properties invalid_properties = Array.new - if @template_id.nil? - invalid_properties.push('invalid value for "template_id", template_id cannot be nil.') - end - invalid_properties end # Check to see if the all the properties in the model are valid # @return true if the model is valid def valid? - return false if @template_id.nil? true end - # Custom attribute writer method with validation - # @param [Object] template_id Value to be assigned - def template_id=(template_id) - if template_id.nil? - fail ArgumentError, 'template_id cannot be nil' - end - - @template_id = template_id - end - # Checks equality by comparing each attribute. # @param [Object] Object to be compared def ==(o) return true if self.equal?(o) self.class == o.class && - template_id == o.template_id + cc_roles == o.cc_roles && + allow_form_view == o.allow_form_view end # @see the `==` method @@ -143,7 +141,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [template_id].hash + [cc_roles, allow_form_view].hash end # Builds the object from hash diff --git a/translations/en.yaml b/translations/en.yaml index 4099e33e9..fc7b71cd6 100644 --- a/translations/en.yaml +++ b/translations/en.yaml @@ -805,6 +805,12 @@ "TemplateUpdateFiles::TEMPLATE_ID": The ID of the template whose files to update. "TemplateUpdateFiles::TEST_MODE": Whether this is a test, the signature request created from this draft will not be legally binding if set to `true`. Defaults to `false`. +"TemplateEdit::SUMMARY": Edit Template +"TemplateEdit::DESCRIPTION": Edits an existing template. +"TemplateEdit::TEMPLATE_ID": The id of the Template to edit. +"TemplateEdit::CC_ROLES": The CC roles that must be assigned when using the template to send a signature request +"TemplateEdit::ALLOW_FORM_VIEW": Allows signers to view the form fields before signing if set to `true`. + "UnclaimedDraftCreate::SUMMARY": Create Unclaimed Draft "UnclaimedDraftCreate::DESCRIPTION": Creates a new Draft that can be claimed using the claim URL. The first authenticated user to access the URL will claim the Draft and will be shown either the "Sign and send" or the "Request signature" page with the Draft loaded. Subsequent access to the claim URL will result in a 404. "UnclaimedDraftCreate::ALLOW_DECLINE": Allows signers to decline to sign a document if `true`. Defaults to `false`. @@ -1528,6 +1534,8 @@ "TemplateResponse::UPDATED_AT": Time the template was last updated. "TemplateResponse::ALLOW_FORM_VIEW": Allows signers to view the form fields before signing if set to `true`. Defaults to `false`. +"TemplateEditResponseTemplate::DESCRIPTION": Contains information about the template you and your team have edited. + "TemplateListResponse::DESCRIPTION": List of templates that the API caller has access to. "TemplateCreateEmbeddedDraftResponseTemplate::DESCRIPTION": "Template object with parameters: `template_id`, `edit_url`, `expires_at`." @@ -1821,6 +1829,8 @@ "TemplateCreate::SEO::DESCRIPTION": "The RESTful Dropbox Sign API easily allows you to build custom eSign integrations. To find out how to create an template, click here." "TemplateDelete::SEO::TITLE": "Delete Template | API Documentation | Dropbox Sign for Developers" "TemplateDelete::SEO::DESCRIPTION": "The RESTful Dropbox Sign API easily allows you to build custom integrations. To find out how to completely delete a template from the account, click here." +"TemplateEdit::SEO::TITLE": "Edit Template | API Documentation | Dropbox Sign for Developers" +"TemplateEdit::SEO::DESCRIPTION": "The RESTful Dropbox Sign API easily allows you to build custom eSign integrations. To find out how to edit a template, click here." "TemplateFiles::SEO::TITLE": "Get Template Files | API Documentation | Dropbox Sign for Developers" "TemplateFiles::SEO::DESCRIPTION": "The RESTful Dropbox Sign API easily allows you to build custom integrations. To find out how to get a copy of the current specified documents, click here." "TemplateGet::SEO::TITLE": "Get Template | API Documentation | Dropbox Sign for Developers"