diff --git a/openapi-raw.yaml b/openapi-raw.yaml index fa64d0c8b..14ccac22a 100644 --- a/openapi-raw.yaml +++ b/openapi-raw.yaml @@ -7286,7 +7286,9 @@ paths: seo: title: '_t__TemplateUpdate::SEO::TITLE' description: '_t__TemplateUpdate::SEO::DESCRIPTION' - x-hideOn: doc + x-hideOn: + - doc + - sdk '/template/update_files/{template_id}': post: tags: @@ -10430,6 +10432,9 @@ components: - sdk - doc type: object + x-hideOn: + - sdk + - doc TemplateUpdateFilesRequest: properties: client_id: @@ -13387,6 +13392,9 @@ components: summary: 'Default Example' value: $ref: examples/json/TemplateUpdateRequest.json + x-hideOn: + - sdk + - doc TemplateUpdateFilesRequest: summary: 'Default Example' value: diff --git a/openapi-sdk.yaml b/openapi-sdk.yaml index d1055081c..f2497b6e8 100644 --- a/openapi-sdk.yaml +++ b/openapi-sdk.yaml @@ -7250,120 +7250,6 @@ paths: seo: title: 'Remove User from Template | REST API | Dropbox Sign for Developers' description: 'The Dropbox Sign API easily allows you to build custom integrations. To find out how to remove a specified Account''s access to a Template, click here.' - '/template/update/{template_id}': - post: - tags: - - Template - summary: 'Update Template' - description: 'Update template fields. Every field is optional and the endpoint will only change whatever is provided. The fields not included in the request payload will remain unchanged.' - operationId: templateUpdate - parameters: - - - name: template_id - in: path - description: 'The ID of the template to update.' - required: true - schema: - type: string - example: f57db65d3f933b5316d398057a36176831451a35 - requestBody: - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/TemplateUpdateRequest' - examples: - example: - $ref: '#/components/examples/TemplateUpdateRequest' - multipart/form-data: - schema: - $ref: '#/components/schemas/TemplateUpdateRequest' - 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/TemplateUpdateExample.php - - - lang: 'C#' - label: 'C#' - source: - $ref: examples/TemplateUpdateExample.cs - - - lang: TypeScript - label: TypeScript - source: - $ref: examples/TemplateUpdateExample.ts - - - lang: Java - label: Java - source: - $ref: examples/TemplateUpdateExample.java - - - lang: Ruby - label: Ruby - source: - $ref: examples/TemplateUpdateExample.rb - - - lang: Python - label: Python - source: - $ref: examples/TemplateUpdateExample.py - - - lang: cURL - label: cURL - source: - $ref: examples/TemplateUpdateExample.sh - x-meta: - seo: - title: 'Update Template | REST API | Dropbox Sign for Developers' - description: 'The Dropbox Sign API easily allows you to build custom integrations. To find out how to update properties of an existing template, click here.' '/template/update_files/{template_id}': post: tags: @@ -10933,30 +10819,6 @@ components: type: string format: email type: object - TemplateUpdateRequest: - 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 - title: - description: 'The title you want to assign to the SignatureRequest.' - type: string - subject: - description: 'The new default template email subject.' - type: string - maxLength: 200 - message: - description: 'The new default template email message.' - type: string - maxLength: 5000 - form_fields: - description: 'A list of document form fields to update. The endpoint will not create or remove any fields. Every field must be identified by `api_id`, and the only supported change is renaming the field.' - type: array - items: - $ref: '#/components/schemas/SubUpdateFormField' - type: object TemplateUpdateFilesRequest: properties: client_id: @@ -14154,10 +14016,6 @@ components: summary: 'Default Example' value: $ref: examples/json/TemplateRemoveUserRequest.json - TemplateUpdateRequest: - summary: 'Default Example' - value: - $ref: examples/json/TemplateUpdateRequest.json TemplateUpdateFilesRequest: summary: 'Default Example' value: diff --git a/openapi.yaml b/openapi.yaml index eadce2f32..f75975178 100644 --- a/openapi.yaml +++ b/openapi.yaml @@ -10799,30 +10799,6 @@ components: type: string format: email type: object - TemplateUpdateRequest: - 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 - title: - description: 'The title you want to assign to the SignatureRequest.' - type: string - subject: - description: 'The new default template email subject.' - type: string - maxLength: 200 - message: - description: 'The new default template email message.' - type: string - maxLength: 5000 - form_fields: - description: 'A list of document form fields to update. The endpoint will not create or remove any fields. Every field must be identified by `api_id`, and the only supported change is renaming the field.' - type: array - items: - $ref: '#/components/schemas/SubUpdateFormField' - type: object TemplateUpdateFilesRequest: properties: client_id: @@ -14026,10 +14002,6 @@ components: summary: 'Default Example' value: $ref: examples/json/TemplateRemoveUserRequest.json - TemplateUpdateRequest: - summary: 'Default Example' - value: - $ref: examples/json/TemplateUpdateRequest.json TemplateUpdateFilesRequest: summary: 'Default Example' value: diff --git a/sdks/dotnet/README.md b/sdks/dotnet/README.md index c287fe1c8..74ca42eb0 100644 --- a/sdks/dotnet/README.md +++ b/sdks/dotnet/README.md @@ -199,7 +199,6 @@ Class | Method | HTTP request | Description *TemplateApi* | [**TemplateGet**](docs/TemplateApi.md#templateget) | **GET** /template/{template_id} | Get Template *TemplateApi* | [**TemplateList**](docs/TemplateApi.md#templatelist) | **GET** /template/list | List Templates *TemplateApi* | [**TemplateRemoveUser**](docs/TemplateApi.md#templateremoveuser) | **POST** /template/remove_user/{template_id} | Remove User from Template -*TemplateApi* | [**TemplateUpdate**](docs/TemplateApi.md#templateupdate) | **POST** /template/update/{template_id} | Update Template *TemplateApi* | [**TemplateUpdateFiles**](docs/TemplateApi.md#templateupdatefiles) | **POST** /template/update_files/{template_id} | Update Template Files *UnclaimedDraftApi* | [**UnclaimedDraftCreate**](docs/UnclaimedDraftApi.md#unclaimeddraftcreate) | **POST** /unclaimed_draft/create | Create Unclaimed Draft *UnclaimedDraftApi* | [**UnclaimedDraftCreateEmbedded**](docs/UnclaimedDraftApi.md#unclaimeddraftcreateembedded) | **POST** /unclaimed_draft/create_embedded | Create Embedded Unclaimed Draft @@ -396,7 +395,6 @@ Class | Method | HTTP request | Description - [Model.TemplateUpdateFilesRequest](docs/TemplateUpdateFilesRequest.md) - [Model.TemplateUpdateFilesResponse](docs/TemplateUpdateFilesResponse.md) - [Model.TemplateUpdateFilesResponseTemplate](docs/TemplateUpdateFilesResponseTemplate.md) - - [Model.TemplateUpdateRequest](docs/TemplateUpdateRequest.md) - [Model.UnclaimedDraftCreateEmbeddedRequest](docs/UnclaimedDraftCreateEmbeddedRequest.md) - [Model.UnclaimedDraftCreateEmbeddedWithTemplateRequest](docs/UnclaimedDraftCreateEmbeddedWithTemplateRequest.md) - [Model.UnclaimedDraftCreateRequest](docs/UnclaimedDraftCreateRequest.md) diff --git a/sdks/dotnet/docs/TemplateApi.md b/sdks/dotnet/docs/TemplateApi.md index 714d3000f..133b641e6 100644 --- a/sdks/dotnet/docs/TemplateApi.md +++ b/sdks/dotnet/docs/TemplateApi.md @@ -14,7 +14,6 @@ All URIs are relative to *https://api.hellosign.com/v3* | [**TemplateGet**](TemplateApi.md#templateget) | **GET** /template/{template_id} | Get Template | | [**TemplateList**](TemplateApi.md#templatelist) | **GET** /template/list | List Templates | | [**TemplateRemoveUser**](TemplateApi.md#templateremoveuser) | **POST** /template/remove_user/{template_id} | Remove User from Template | -| [**TemplateUpdate**](TemplateApi.md#templateupdate) | **POST** /template/update/{template_id} | Update Template | | [**TemplateUpdateFiles**](TemplateApi.md#templateupdatefiles) | **POST** /template/update_files/{template_id} | Update Template Files | @@ -1136,131 +1135,6 @@ catch (ApiException e) - **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) - - -# **TemplateUpdate** -> TemplateGetResponse TemplateUpdate (string templateId, TemplateUpdateRequest templateUpdateRequest) - -Update Template - -Update template fields. Every field is optional and the endpoint will only change whatever is provided. The fields not included in the request payload will remain unchanged. - -### 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 TemplateUpdateExample -{ - public static void Run() - { - var config = new Configuration(); - config.Username = "YOUR_API_KEY"; - // config.AccessToken = "YOUR_ACCESS_TOKEN"; - - var formFields1 = new SubUpdateFormField( - apiId: "uniqueIdHere_1", - name: "New name 1" - ); - - var formFields2 = new SubUpdateFormField( - apiId: "uniqueIdHere_2", - name: "New name 2" - ); - - var formFields = new List - { - formFields1, - formFields2, - }; - - var templateUpdateRequest = new TemplateUpdateRequest( - title: "Test Title", - subject: "Test Subject", - message: "Test Message", - ccRoles: [ - "CC Role 1", - "CC Role 2", - ], - formFields: formFields - ); - - try - { - var response = new TemplateApi(config).TemplateUpdate( - templateId: "f57db65d3f933b5316d398057a36176831451a35", - templateUpdateRequest: templateUpdateRequest - ); - - Console.WriteLine(response); - } - catch (ApiException e) - { - Console.WriteLine("Exception when calling TemplateApi#TemplateUpdate: " + e.Message); - Console.WriteLine("Status Code: " + e.ErrorCode); - Console.WriteLine(e.StackTrace); - } - } -} - -``` - -#### Using the TemplateUpdateWithHttpInfo variant -This returns an ApiResponse object which contains the response data, status code and headers. - -```csharp -try -{ - // Update Template - ApiResponse response = apiInstance.TemplateUpdateWithHttpInfo(templateId, templateUpdateRequest); - 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.TemplateUpdateWithHttpInfo: " + 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 update. | | -| **templateUpdateRequest** | [**TemplateUpdateRequest**](TemplateUpdateRequest.md) | | | - -### Return type - -[**TemplateGetResponse**](TemplateGetResponse.md) - -### Authorization - -[api_key](../README.md#api_key), [oauth2](../README.md#oauth2) - -### HTTP request headers - - - **Content-Type**: application/json, multipart/form-data - - **Accept**: application/json - - ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| diff --git a/sdks/dotnet/docs/TemplateUpdateRequest.md b/sdks/dotnet/docs/TemplateUpdateRequest.md deleted file mode 100644 index 53c22607d..000000000 --- a/sdks/dotnet/docs/TemplateUpdateRequest.md +++ /dev/null @@ -1,10 +0,0 @@ -# Dropbox.Sign.Model.TemplateUpdateRequest - -## 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] **Title** | **string** | The title you want to assign to the SignatureRequest. | [optional] **Subject** | **string** | The new default template email subject. | [optional] **Message** | **string** | The new default template email message. | [optional] **FormFields** | [**List<SubUpdateFormField>**](SubUpdateFormField.md) | A list of document form fields to update. The endpoint will not create or remove any fields. Every field must be identified by `api_id`, and the only supported change is renaming the field. | [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/src/Dropbox.Sign/Api/TemplateApi.cs b/sdks/dotnet/src/Dropbox.Sign/Api/TemplateApi.cs index 502f52033..80da8262a 100644 --- a/sdks/dotnet/src/Dropbox.Sign/Api/TemplateApi.cs +++ b/sdks/dotnet/src/Dropbox.Sign/Api/TemplateApi.cs @@ -272,31 +272,6 @@ public interface ITemplateApiSync : IApiAccessor /// ApiResponse of TemplateGetResponse ApiResponse TemplateRemoveUserWithHttpInfo(string templateId, TemplateRemoveUserRequest templateRemoveUserRequest, int operationIndex = 0); /// - /// Update Template - /// - /// - /// Update template fields. Every field is optional and the endpoint will only change whatever is provided. The fields not included in the request payload will remain unchanged. - /// - /// Thrown when fails to make API call - /// The ID of the template to update. - /// - /// Index associated with the operation. - /// TemplateGetResponse - TemplateGetResponse TemplateUpdate(string templateId, TemplateUpdateRequest templateUpdateRequest, int operationIndex = 0); - - /// - /// Update Template - /// - /// - /// Update template fields. Every field is optional and the endpoint will only change whatever is provided. The fields not included in the request payload will remain unchanged. - /// - /// Thrown when fails to make API call - /// The ID of the template to update. - /// - /// Index associated with the operation. - /// ApiResponse of TemplateGetResponse - ApiResponse TemplateUpdateWithHttpInfo(string templateId, TemplateUpdateRequest templateUpdateRequest, int operationIndex = 0); - /// /// Update Template Files /// /// @@ -595,33 +570,6 @@ public interface ITemplateApiAsync : IApiAccessor /// Task of ApiResponse (TemplateGetResponse) System.Threading.Tasks.Task> TemplateRemoveUserWithHttpInfoAsync(string templateId, TemplateRemoveUserRequest templateRemoveUserRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); /// - /// Update Template - /// - /// - /// Update template fields. Every field is optional and the endpoint will only change whatever is provided. The fields not included in the request payload will remain unchanged. - /// - /// Thrown when fails to make API call - /// The ID of the template to update. - /// - /// Index associated with the operation. - /// Cancellation Token to cancel the request. - /// Task of TemplateGetResponse - System.Threading.Tasks.Task TemplateUpdateAsync(string templateId, TemplateUpdateRequest templateUpdateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); - - /// - /// Update Template - /// - /// - /// Update template fields. Every field is optional and the endpoint will only change whatever is provided. The fields not included in the request payload will remain unchanged. - /// - /// Thrown when fails to make API call - /// The ID of the template to update. - /// - /// Index associated with the operation. - /// Cancellation Token to cancel the request. - /// Task of ApiResponse (TemplateGetResponse) - System.Threading.Tasks.Task> TemplateUpdateWithHttpInfoAsync(string templateId, TemplateUpdateRequest templateUpdateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); - /// /// Update Template Files /// /// @@ -2604,208 +2552,6 @@ public Dropbox.Sign.Client.ApiResponse TemplateRemoveUserWi return localVarResponse; } - /// - /// Update Template Update template fields. Every field is optional and the endpoint will only change whatever is provided. The fields not included in the request payload will remain unchanged. - /// - /// Thrown when fails to make API call - /// The ID of the template to update. - /// - /// Index associated with the operation. - /// TemplateGetResponse - public TemplateGetResponse TemplateUpdate(string templateId, TemplateUpdateRequest templateUpdateRequest, int operationIndex = 0) - { - Dropbox.Sign.Client.ApiResponse localVarResponse = TemplateUpdateWithHttpInfo(templateId, templateUpdateRequest); - return localVarResponse.Data; - } - - /// - /// Update Template Update template fields. Every field is optional and the endpoint will only change whatever is provided. The fields not included in the request payload will remain unchanged. - /// - /// Thrown when fails to make API call - /// The ID of the template to update. - /// - /// Index associated with the operation. - /// ApiResponse of TemplateGetResponse - public Dropbox.Sign.Client.ApiResponse TemplateUpdateWithHttpInfo(string templateId, TemplateUpdateRequest templateUpdateRequest, 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->TemplateUpdate"); - } - - // verify the required parameter 'templateUpdateRequest' is set - if (templateUpdateRequest == null) - { - throw new Dropbox.Sign.Client.ApiException(400, "Missing required parameter 'templateUpdateRequest' when calling TemplateApi->TemplateUpdate"); - } - - Dropbox.Sign.Client.RequestOptions localVarRequestOptions = new Dropbox.Sign.Client.RequestOptions(); - - var localVarContentType = ""; - var openApiTypes = templateUpdateRequest.GetOpenApiTypes(); - if (ClientUtils.HasFileType(openApiTypes)) - { - ClientUtils.SetFormData(localVarRequestOptions, openApiTypes); - localVarContentType = "multipart/form-data"; - } - else - { - localVarContentType = "application/json"; - localVarRequestOptions.Data = templateUpdateRequest; - } - - // 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.TemplateUpdate"; - 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/update/{template_id}", localVarRequestOptions, this.Configuration); - if (this.ExceptionFactory != null) - { - Exception _exception = this.ExceptionFactory("TemplateUpdate", localVarResponse); - if (_exception != null) - { - throw _exception; - } - } - - return localVarResponse; - } - - /// - /// Update Template Update template fields. Every field is optional and the endpoint will only change whatever is provided. The fields not included in the request payload will remain unchanged. - /// - /// Thrown when fails to make API call - /// The ID of the template to update. - /// - /// Index associated with the operation. - /// Cancellation Token to cancel the request. - /// Task of TemplateGetResponse - public async System.Threading.Tasks.Task TemplateUpdateAsync(string templateId, TemplateUpdateRequest templateUpdateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) - { - Dropbox.Sign.Client.ApiResponse localVarResponse = await TemplateUpdateWithHttpInfoAsync(templateId, templateUpdateRequest, operationIndex, cancellationToken).ConfigureAwait(false); - return localVarResponse.Data; - } - - /// - /// Update Template Update template fields. Every field is optional and the endpoint will only change whatever is provided. The fields not included in the request payload will remain unchanged. - /// - /// Thrown when fails to make API call - /// The ID of the template to update. - /// - /// Index associated with the operation. - /// Cancellation Token to cancel the request. - /// Task of ApiResponse (TemplateGetResponse) - public async System.Threading.Tasks.Task> TemplateUpdateWithHttpInfoAsync(string templateId, TemplateUpdateRequest templateUpdateRequest, 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->TemplateUpdate"); - } - - // verify the required parameter 'templateUpdateRequest' is set - if (templateUpdateRequest == null) - { - throw new Dropbox.Sign.Client.ApiException(400, "Missing required parameter 'templateUpdateRequest' when calling TemplateApi->TemplateUpdate"); - } - - - Dropbox.Sign.Client.RequestOptions localVarRequestOptions = new Dropbox.Sign.Client.RequestOptions(); - - var localVarContentType = ""; - var openApiTypes = templateUpdateRequest.GetOpenApiTypes(); - if (ClientUtils.HasFileType(openApiTypes)) - { - ClientUtils.SetFormData(localVarRequestOptions, openApiTypes); - localVarContentType = "multipart/form-data"; - } - else - { - localVarContentType = "application/json"; - localVarRequestOptions.Data = templateUpdateRequest; - } - - // 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.TemplateUpdate"; - 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/update/{template_id}", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); - - if (this.ExceptionFactory != null) - { - Exception _exception = this.ExceptionFactory("TemplateUpdate", localVarResponse); - if (_exception != null) - { - throw _exception; - } - } - - return localVarResponse; - } - /// /// Update Template Files Overlays a new file with the overlay of an existing template. The new file(s) must: 1. have the same or higher page count 2. the same orientation as the file(s) being replaced. This will not overwrite or in any way affect the existing template. Both the existing template and new template will be available for use after executing this endpoint. Also note that this will decrement your template quota. Overlaying new files is asynchronous and a successful call to this endpoint will return 200 OK response if the request passes initial validation checks. It is recommended that a callback be implemented to listen for the callback event. A `template_created` event will be sent when the files are updated or a `template_error` event will be sent if there was a problem while updating the files. If a callback handler has been configured and the event has not been received within 60 minutes of making the call, check the status of the request in the API dashboard and retry the request if necessary. If the page orientation or page count is different from the original template document, we will notify you with a `template_error` [callback event](https://app.hellosign.com/api/eventsAndCallbacksWalkthrough). /// diff --git a/sdks/dotnet/src/Dropbox.Sign/Model/TemplateUpdateRequest.cs b/sdks/dotnet/src/Dropbox.Sign/Model/TemplateUpdateRequest.cs deleted file mode 100644 index 0577118f3..000000000 --- a/sdks/dotnet/src/Dropbox.Sign/Model/TemplateUpdateRequest.cs +++ /dev/null @@ -1,284 +0,0 @@ -/* - * Dropbox Sign API - * - * Dropbox Sign v3 API - * - * The version of the OpenAPI document: 3.0.0 - * Contact: apisupport@hellosign.com - * Generated by: https://github.com/openapitools/openapi-generator.git - */ - - -using System; -using System.Collections; -using System.Collections.Generic; -using System.Collections.ObjectModel; -using System.Linq; -using System.IO; -using System.Runtime.Serialization; -using System.Text; -using System.Text.RegularExpressions; -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; -using Newtonsoft.Json.Linq; -using System.ComponentModel.DataAnnotations; -using OpenAPIDateConverter = Dropbox.Sign.Client.OpenAPIDateConverter; - -namespace Dropbox.Sign.Model -{ - /// - /// TemplateUpdateRequest - /// - [DataContract(Name = "TemplateUpdateRequest")] - [JsonObject(ItemNullValueHandling = NullValueHandling.Ignore)] - public partial class TemplateUpdateRequest : IEquatable, IValidatableObject - { - /// - /// Initializes a new instance of the class. - /// - [JsonConstructorAttribute] - protected TemplateUpdateRequest() { } - /// - /// Initializes a new instance of the class. - /// - /// The CC roles that must be assigned when using the template to send a signature request.. - /// The title you want to assign to the SignatureRequest.. - /// The new default template email subject.. - /// The new default template email message.. - /// A list of document form fields to update. The endpoint will not create or remove any fields. Every field must be identified by `api_id`, and the only supported change is renaming the field.. - public TemplateUpdateRequest(List ccRoles = default(List), string title = default(string), string subject = default(string), string message = default(string), List formFields = default(List)) - { - - this.CcRoles = ccRoles; - this.Title = title; - this.Subject = subject; - this.Message = message; - this.FormFields = formFields; - } - - /// - /// Attempt to instantiate and hydrate a new instance of this class - /// - /// String of JSON data representing target object - public static TemplateUpdateRequest Init(string jsonData) - { - var obj = JsonConvert.DeserializeObject(jsonData); - - if (obj == null) - { - throw new Exception("Unable to deserialize JSON to instance of TemplateUpdateRequest"); - } - - return obj; - } - - /// - /// 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; } - - /// - /// The title you want to assign to the SignatureRequest. - /// - /// The title you want to assign to the SignatureRequest. - [DataMember(Name = "title", EmitDefaultValue = true)] - public string Title { get; set; } - - /// - /// The new default template email subject. - /// - /// The new default template email subject. - [DataMember(Name = "subject", EmitDefaultValue = true)] - public string Subject { get; set; } - - /// - /// The new default template email message. - /// - /// The new default template email message. - [DataMember(Name = "message", EmitDefaultValue = true)] - public string Message { get; set; } - - /// - /// A list of document form fields to update. The endpoint will not create or remove any fields. Every field must be identified by `api_id`, and the only supported change is renaming the field. - /// - /// A list of document form fields to update. The endpoint will not create or remove any fields. Every field must be identified by `api_id`, and the only supported change is renaming the field. - [DataMember(Name = "form_fields", EmitDefaultValue = true)] - public List FormFields { get; set; } - - /// - /// Returns the string presentation of the object - /// - /// String presentation of the object - public override string ToString() - { - StringBuilder sb = new StringBuilder(); - sb.Append("class TemplateUpdateRequest {\n"); - sb.Append(" CcRoles: ").Append(CcRoles).Append("\n"); - sb.Append(" Title: ").Append(Title).Append("\n"); - sb.Append(" Subject: ").Append(Subject).Append("\n"); - sb.Append(" Message: ").Append(Message).Append("\n"); - sb.Append(" FormFields: ").Append(FormFields).Append("\n"); - sb.Append("}\n"); - return sb.ToString(); - } - - /// - /// Returns the JSON string presentation of the object - /// - /// JSON string presentation of the object - public virtual string ToJson() - { - return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); - } - - /// - /// Returns true if objects are equal - /// - /// Object to be compared - /// Boolean - public override bool Equals(object input) - { - return this.Equals(input as TemplateUpdateRequest); - } - - /// - /// Returns true if TemplateUpdateRequest instances are equal - /// - /// Instance of TemplateUpdateRequest to be compared - /// Boolean - public bool Equals(TemplateUpdateRequest input) - { - if (input == null) - { - return false; - } - return - ( - this.CcRoles == input.CcRoles || - this.CcRoles != null && - input.CcRoles != null && - this.CcRoles.SequenceEqual(input.CcRoles) - ) && - ( - this.Title == input.Title || - (this.Title != null && - this.Title.Equals(input.Title)) - ) && - ( - this.Subject == input.Subject || - (this.Subject != null && - this.Subject.Equals(input.Subject)) - ) && - ( - this.Message == input.Message || - (this.Message != null && - this.Message.Equals(input.Message)) - ) && - ( - this.FormFields == input.FormFields || - this.FormFields != null && - input.FormFields != null && - this.FormFields.SequenceEqual(input.FormFields) - ); - } - - /// - /// Gets the hash code - /// - /// Hash code - public override int GetHashCode() - { - unchecked // Overflow is fine, just wrap - { - int hashCode = 41; - if (this.CcRoles != null) - { - hashCode = (hashCode * 59) + this.CcRoles.GetHashCode(); - } - if (this.Title != null) - { - hashCode = (hashCode * 59) + this.Title.GetHashCode(); - } - if (this.Subject != null) - { - hashCode = (hashCode * 59) + this.Subject.GetHashCode(); - } - if (this.Message != null) - { - hashCode = (hashCode * 59) + this.Message.GetHashCode(); - } - if (this.FormFields != null) - { - hashCode = (hashCode * 59) + this.FormFields.GetHashCode(); - } - return hashCode; - } - } - - /// - /// To validate all properties of the instance - /// - /// Validation context - /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) - { - // Subject (string) maxLength - if (this.Subject != null && this.Subject.Length > 200) - { - yield return new ValidationResult("Invalid value for Subject, length must be less than 200.", new[] { "Subject" }); - } - - // Message (string) maxLength - if (this.Message != null && this.Message.Length > 5000) - { - yield return new ValidationResult("Invalid value for Message, length must be less than 5000.", new[] { "Message" }); - } - - yield break; - } - public List GetOpenApiTypes() - { - var types = new List(); - types.Add(new OpenApiType() - { - Name = "cc_roles", - Property = "CcRoles", - Type = "List", - Value = CcRoles, - }); - types.Add(new OpenApiType() - { - Name = "title", - Property = "Title", - Type = "string", - Value = Title, - }); - types.Add(new OpenApiType() - { - Name = "subject", - Property = "Subject", - Type = "string", - Value = Subject, - }); - types.Add(new OpenApiType() - { - Name = "message", - Property = "Message", - Type = "string", - Value = Message, - }); - types.Add(new OpenApiType() - { - Name = "form_fields", - Property = "FormFields", - Type = "List", - Value = FormFields, - }); - - return types; - } - } - -} diff --git a/sdks/java-v1/README.md b/sdks/java-v1/README.md index a0e36fb0f..bd8decae3 100644 --- a/sdks/java-v1/README.md +++ b/sdks/java-v1/README.md @@ -242,7 +242,6 @@ Class | Method | HTTP request | Description *TemplateApi* | [**templateGet**](docs/TemplateApi.md#templateGet) | **GET** /template/{template_id} | Get Template *TemplateApi* | [**templateList**](docs/TemplateApi.md#templateList) | **GET** /template/list | List Templates *TemplateApi* | [**templateRemoveUser**](docs/TemplateApi.md#templateRemoveUser) | **POST** /template/remove_user/{template_id} | Remove User from Template -*TemplateApi* | [**templateUpdate**](docs/TemplateApi.md#templateUpdate) | **POST** /template/update/{template_id} | Update Template *TemplateApi* | [**templateUpdateFiles**](docs/TemplateApi.md#templateUpdateFiles) | **POST** /template/update_files/{template_id} | Update Template Files *UnclaimedDraftApi* | [**unclaimedDraftCreate**](docs/UnclaimedDraftApi.md#unclaimedDraftCreate) | **POST** /unclaimed_draft/create | Create Unclaimed Draft *UnclaimedDraftApi* | [**unclaimedDraftCreateEmbedded**](docs/UnclaimedDraftApi.md#unclaimedDraftCreateEmbedded) | **POST** /unclaimed_draft/create_embedded | Create Embedded Unclaimed Draft @@ -438,7 +437,6 @@ Class | Method | HTTP request | Description - [TemplateUpdateFilesRequest](docs/TemplateUpdateFilesRequest.md) - [TemplateUpdateFilesResponse](docs/TemplateUpdateFilesResponse.md) - [TemplateUpdateFilesResponseTemplate](docs/TemplateUpdateFilesResponseTemplate.md) - - [TemplateUpdateRequest](docs/TemplateUpdateRequest.md) - [UnclaimedDraftCreateEmbeddedRequest](docs/UnclaimedDraftCreateEmbeddedRequest.md) - [UnclaimedDraftCreateEmbeddedWithTemplateRequest](docs/UnclaimedDraftCreateEmbeddedWithTemplateRequest.md) - [UnclaimedDraftCreateRequest](docs/UnclaimedDraftCreateRequest.md) diff --git a/sdks/java-v1/docs/TemplateApi.md b/sdks/java-v1/docs/TemplateApi.md index 11a51b044..e9233865f 100644 --- a/sdks/java-v1/docs/TemplateApi.md +++ b/sdks/java-v1/docs/TemplateApi.md @@ -14,7 +14,6 @@ All URIs are relative to *https://api.hellosign.com/v3* [**templateGet**](TemplateApi.md#templateGet) | **GET** /template/{template_id} | Get Template [**templateList**](TemplateApi.md#templateList) | **GET** /template/list | List Templates [**templateRemoveUser**](TemplateApi.md#templateRemoveUser) | **POST** /template/remove_user/{template_id} | Remove User from Template -[**templateUpdate**](TemplateApi.md#templateUpdate) | **POST** /template/update/{template_id} | Update Template [**templateUpdateFiles**](TemplateApi.md#templateUpdateFiles) | **POST** /template/update_files/{template_id} | Update Template Files @@ -992,113 +991,6 @@ public class TemplateRemoveUserExample | **4XX** | failed_operation | - | -## templateUpdate - -> TemplateGetResponse templateUpdate(templateId, templateUpdateRequest) - -Update Template - -Update template fields. Every field is optional and the endpoint will only change whatever is provided. The fields not included in the request payload will remain unchanged. - -### 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 TemplateUpdateExample -{ - 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 formFields1 = new SubUpdateFormField(); - formFields1.apiId("uniqueIdHere_1"); - formFields1.name("New name 1"); - - var formFields2 = new SubUpdateFormField(); - formFields2.apiId("uniqueIdHere_2"); - formFields2.name("New name 2"); - - var formFields = new ArrayList(List.of ( - formFields1, - formFields2 - )); - - var templateUpdateRequest = new TemplateUpdateRequest(); - templateUpdateRequest.title("Test Title"); - templateUpdateRequest.subject("Test Subject"); - templateUpdateRequest.message("Test Message"); - templateUpdateRequest.ccRoles(List.of ( - "CC Role 1", - "CC Role 2" - )); - templateUpdateRequest.formFields(formFields); - - try - { - var response = new TemplateApi(config).templateUpdate( - "f57db65d3f933b5316d398057a36176831451a35", // templateId - templateUpdateRequest - ); - - System.out.println(response); - } catch (ApiException e) { - System.err.println("Exception when calling TemplateApi#templateUpdate"); - 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 update. | - **templateUpdateRequest** | [**TemplateUpdateRequest**](TemplateUpdateRequest.md)| | - -### Return type - -[**TemplateGetResponse**](TemplateGetResponse.md) - -### Authorization - -[api_key](../README.md#api_key), [oauth2](../README.md#oauth2) - -### HTTP request headers - -- **Content-Type**: application/json, multipart/form-data -- **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 | - | - - ## templateUpdateFiles > TemplateUpdateFilesResponse templateUpdateFiles(templateId, templateUpdateFilesRequest) diff --git a/sdks/java-v1/docs/TemplateUpdateRequest.md b/sdks/java-v1/docs/TemplateUpdateRequest.md deleted file mode 100644 index f94a7c368..000000000 --- a/sdks/java-v1/docs/TemplateUpdateRequest.md +++ /dev/null @@ -1,18 +0,0 @@ - - -# TemplateUpdateRequest - - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -| `ccRoles` | ```List``` | The CC roles that must be assigned when using the template to send a signature request. | | -| `title` | ```String``` | The title you want to assign to the SignatureRequest. | | -| `subject` | ```String``` | The new default template email subject. | | -| `message` | ```String``` | The new default template email message. | | -| `formFields` | [```List```](SubUpdateFormField.md) | A list of document form fields to update. The endpoint will not create or remove any fields. Every field must be identified by `api_id`, and the only supported change is renaming the field. | | - - - 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 452cf1319..f70c0134b 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 @@ -17,7 +17,6 @@ import com.dropbox.sign.model.TemplateRemoveUserRequest; import com.dropbox.sign.model.TemplateUpdateFilesRequest; import com.dropbox.sign.model.TemplateUpdateFilesResponse; -import com.dropbox.sign.model.TemplateUpdateRequest; import java.io.File; import java.util.ArrayList; import java.util.HashMap; @@ -1020,94 +1019,6 @@ public ApiResponse templateRemoveUserWithHttpInfo( false); } - /** - * Update Template Update template fields. Every field is optional and the endpoint will only - * change whatever is provided. The fields not included in the request payload will remain - * unchanged. - * - * @param templateId The ID of the template to update. (required) - * @param templateUpdateRequest (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 templateUpdate( - String templateId, TemplateUpdateRequest templateUpdateRequest) throws ApiException { - return templateUpdateWithHttpInfo(templateId, templateUpdateRequest).getData(); - } - - /** - * Update Template Update template fields. Every field is optional and the endpoint will only - * change whatever is provided. The fields not included in the request payload will remain - * unchanged. - * - * @param templateId The ID of the template to update. (required) - * @param templateUpdateRequest (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 templateUpdateWithHttpInfo( - String templateId, TemplateUpdateRequest templateUpdateRequest) throws ApiException { - - // Check required parameters - if (templateId == null) { - throw new ApiException( - 400, "Missing the required parameter 'templateId' when calling templateUpdate"); - } - if (templateUpdateRequest == null) { - throw new ApiException( - 400, - "Missing the required parameter 'templateUpdateRequest' when calling" - + " templateUpdate"); - } - - // Path parameters - String localVarPath = - "/template/update/{template_id}" - .replaceAll( - "\\{template_id}", apiClient.escapeString(templateId.toString())); - - String localVarAccept = apiClient.selectHeaderAccept("application/json"); - Map localVarFormParams = new LinkedHashMap<>(); - localVarFormParams = templateUpdateRequest.createFormData(); - boolean isFileTypeFound = !localVarFormParams.isEmpty(); - String localVarContentType = - isFileTypeFound - ? "multipart/form-data" - : apiClient.selectHeaderContentType( - "application/json", "multipart/form-data"); - String[] localVarAuthNames = new String[] {"api_key", "oauth2"}; - GenericType localVarReturnType = - new GenericType() {}; - return apiClient.invokeAPI( - "TemplateApi.templateUpdate", - localVarPath, - "POST", - new ArrayList<>(), - isFileTypeFound ? null : templateUpdateRequest, - new LinkedHashMap<>(), - new LinkedHashMap<>(), - localVarFormParams, - localVarAccept, - localVarContentType, - localVarAuthNames, - localVarReturnType, - false); - } - /** * Update Template Files Overlays a new file with the overlay of an existing template. The new * file(s) must: 1. have the same or higher page count 2. the same orientation as the file(s) diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/model/TemplateUpdateRequest.java b/sdks/java-v1/src/main/java/com/dropbox/sign/model/TemplateUpdateRequest.java deleted file mode 100644 index a0f232f99..000000000 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/model/TemplateUpdateRequest.java +++ /dev/null @@ -1,375 +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.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Objects; - -/** TemplateUpdateRequest */ -@JsonPropertyOrder({ - TemplateUpdateRequest.JSON_PROPERTY_CC_ROLES, - TemplateUpdateRequest.JSON_PROPERTY_TITLE, - TemplateUpdateRequest.JSON_PROPERTY_SUBJECT, - TemplateUpdateRequest.JSON_PROPERTY_MESSAGE, - TemplateUpdateRequest.JSON_PROPERTY_FORM_FIELDS -}) -@javax.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.12.0") -@JsonIgnoreProperties(ignoreUnknown = true) -public class TemplateUpdateRequest { - public static final String JSON_PROPERTY_CC_ROLES = "cc_roles"; - @javax.annotation.Nullable private List ccRoles = null; - - public static final String JSON_PROPERTY_TITLE = "title"; - @javax.annotation.Nullable private String title; - - public static final String JSON_PROPERTY_SUBJECT = "subject"; - @javax.annotation.Nullable private String subject; - - public static final String JSON_PROPERTY_MESSAGE = "message"; - @javax.annotation.Nullable private String message; - - public static final String JSON_PROPERTY_FORM_FIELDS = "form_fields"; - @javax.annotation.Nullable private List formFields = null; - - public TemplateUpdateRequest() {} - - /** - * Attempt to instantiate and hydrate a new instance of this class - * - * @param jsonData String of JSON data representing target object - */ - public static TemplateUpdateRequest init(String jsonData) throws Exception { - return new ObjectMapper().readValue(jsonData, TemplateUpdateRequest.class); - } - - public static TemplateUpdateRequest init(HashMap data) throws Exception { - return new ObjectMapper() - .readValue( - new ObjectMapper().writeValueAsString(data), TemplateUpdateRequest.class); - } - - public TemplateUpdateRequest ccRoles(@javax.annotation.Nullable List ccRoles) { - this.ccRoles = ccRoles; - return this; - } - - public TemplateUpdateRequest 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 TemplateUpdateRequest title(@javax.annotation.Nullable String title) { - this.title = title; - return this; - } - - /** - * The title you want to assign to the SignatureRequest. - * - * @return title - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_TITLE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getTitle() { - return title; - } - - @JsonProperty(JSON_PROPERTY_TITLE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setTitle(@javax.annotation.Nullable String title) { - this.title = title; - } - - public TemplateUpdateRequest subject(@javax.annotation.Nullable String subject) { - this.subject = subject; - return this; - } - - /** - * The new default template email subject. - * - * @return subject - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_SUBJECT) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getSubject() { - return subject; - } - - @JsonProperty(JSON_PROPERTY_SUBJECT) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setSubject(@javax.annotation.Nullable String subject) { - this.subject = subject; - } - - public TemplateUpdateRequest message(@javax.annotation.Nullable String message) { - this.message = message; - return this; - } - - /** - * The new default template email message. - * - * @return message - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_MESSAGE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getMessage() { - return message; - } - - @JsonProperty(JSON_PROPERTY_MESSAGE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setMessage(@javax.annotation.Nullable String message) { - this.message = message; - } - - public TemplateUpdateRequest formFields( - @javax.annotation.Nullable List formFields) { - this.formFields = formFields; - return this; - } - - public TemplateUpdateRequest addFormFieldsItem(SubUpdateFormField formFieldsItem) { - if (this.formFields == null) { - this.formFields = new ArrayList<>(); - } - this.formFields.add(formFieldsItem); - return this; - } - - /** - * A list of document form fields to update. The endpoint will not create or remove any fields. - * Every field must be identified by `api_id`, and the only supported change is - * renaming the field. - * - * @return formFields - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_FORM_FIELDS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public List getFormFields() { - return formFields; - } - - @JsonProperty(JSON_PROPERTY_FORM_FIELDS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setFormFields(@javax.annotation.Nullable List formFields) { - this.formFields = formFields; - } - - /** Return true if this TemplateUpdateRequest object is equal to o. */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - TemplateUpdateRequest templateUpdateRequest = (TemplateUpdateRequest) o; - return Objects.equals(this.ccRoles, templateUpdateRequest.ccRoles) - && Objects.equals(this.title, templateUpdateRequest.title) - && Objects.equals(this.subject, templateUpdateRequest.subject) - && Objects.equals(this.message, templateUpdateRequest.message) - && Objects.equals(this.formFields, templateUpdateRequest.formFields); - } - - @Override - public int hashCode() { - return Objects.hash(ccRoles, title, subject, message, formFields); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class TemplateUpdateRequest {\n"); - sb.append(" ccRoles: ").append(toIndentedString(ccRoles)).append("\n"); - sb.append(" title: ").append(toIndentedString(title)).append("\n"); - sb.append(" subject: ").append(toIndentedString(subject)).append("\n"); - sb.append(" message: ").append(toIndentedString(message)).append("\n"); - sb.append(" formFields: ").append(toIndentedString(formFields)).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 (title != null) { - if (isFileTypeOrListOfFiles(title)) { - fileTypeFound = true; - } - - if (title.getClass().equals(java.io.File.class) - || title.getClass().equals(Integer.class) - || title.getClass().equals(String.class) - || title.getClass().isEnum()) { - map.put("title", title); - } else if (isListOfFile(title)) { - for (int i = 0; i < getListSize(title); i++) { - map.put("title[" + i + "]", getFromList(title, i)); - } - } else { - map.put("title", JSON.getDefault().getMapper().writeValueAsString(title)); - } - } - if (subject != null) { - if (isFileTypeOrListOfFiles(subject)) { - fileTypeFound = true; - } - - if (subject.getClass().equals(java.io.File.class) - || subject.getClass().equals(Integer.class) - || subject.getClass().equals(String.class) - || subject.getClass().isEnum()) { - map.put("subject", subject); - } else if (isListOfFile(subject)) { - for (int i = 0; i < getListSize(subject); i++) { - map.put("subject[" + i + "]", getFromList(subject, i)); - } - } else { - map.put("subject", JSON.getDefault().getMapper().writeValueAsString(subject)); - } - } - if (message != null) { - if (isFileTypeOrListOfFiles(message)) { - fileTypeFound = true; - } - - if (message.getClass().equals(java.io.File.class) - || message.getClass().equals(Integer.class) - || message.getClass().equals(String.class) - || message.getClass().isEnum()) { - map.put("message", message); - } else if (isListOfFile(message)) { - for (int i = 0; i < getListSize(message); i++) { - map.put("message[" + i + "]", getFromList(message, i)); - } - } else { - map.put("message", JSON.getDefault().getMapper().writeValueAsString(message)); - } - } - if (formFields != null) { - if (isFileTypeOrListOfFiles(formFields)) { - fileTypeFound = true; - } - - if (formFields.getClass().equals(java.io.File.class) - || formFields.getClass().equals(Integer.class) - || formFields.getClass().equals(String.class) - || formFields.getClass().isEnum()) { - map.put("form_fields", formFields); - } else if (isListOfFile(formFields)) { - for (int i = 0; i < getListSize(formFields); i++) { - map.put("form_fields[" + i + "]", getFromList(formFields, i)); - } - } else { - map.put( - "form_fields", - JSON.getDefault().getMapper().writeValueAsString(formFields)); - } - } - } 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 50f768ee5..f498e99e7 100644 --- a/sdks/java-v2/README.md +++ b/sdks/java-v2/README.md @@ -218,7 +218,6 @@ Class | Method | HTTP request | Description *TemplateApi* | [**templateGet**](docs/TemplateApi.md#templateGet) | **GET** /template/{template_id} | Get Template *TemplateApi* | [**templateList**](docs/TemplateApi.md#templateList) | **GET** /template/list | List Templates *TemplateApi* | [**templateRemoveUser**](docs/TemplateApi.md#templateRemoveUser) | **POST** /template/remove_user/{template_id} | Remove User from Template -*TemplateApi* | [**templateUpdate**](docs/TemplateApi.md#templateUpdate) | **POST** /template/update/{template_id} | Update Template *TemplateApi* | [**templateUpdateFiles**](docs/TemplateApi.md#templateUpdateFiles) | **POST** /template/update_files/{template_id} | Update Template Files *UnclaimedDraftApi* | [**unclaimedDraftCreate**](docs/UnclaimedDraftApi.md#unclaimedDraftCreate) | **POST** /unclaimed_draft/create | Create Unclaimed Draft *UnclaimedDraftApi* | [**unclaimedDraftCreateEmbedded**](docs/UnclaimedDraftApi.md#unclaimedDraftCreateEmbedded) | **POST** /unclaimed_draft/create_embedded | Create Embedded Unclaimed Draft @@ -414,7 +413,6 @@ Class | Method | HTTP request | Description - [TemplateUpdateFilesRequest](docs/TemplateUpdateFilesRequest.md) - [TemplateUpdateFilesResponse](docs/TemplateUpdateFilesResponse.md) - [TemplateUpdateFilesResponseTemplate](docs/TemplateUpdateFilesResponseTemplate.md) - - [TemplateUpdateRequest](docs/TemplateUpdateRequest.md) - [UnclaimedDraftCreateEmbeddedRequest](docs/UnclaimedDraftCreateEmbeddedRequest.md) - [UnclaimedDraftCreateEmbeddedWithTemplateRequest](docs/UnclaimedDraftCreateEmbeddedWithTemplateRequest.md) - [UnclaimedDraftCreateRequest](docs/UnclaimedDraftCreateRequest.md) diff --git a/sdks/java-v2/docs/TemplateApi.md b/sdks/java-v2/docs/TemplateApi.md index 11a51b044..e9233865f 100644 --- a/sdks/java-v2/docs/TemplateApi.md +++ b/sdks/java-v2/docs/TemplateApi.md @@ -14,7 +14,6 @@ All URIs are relative to *https://api.hellosign.com/v3* [**templateGet**](TemplateApi.md#templateGet) | **GET** /template/{template_id} | Get Template [**templateList**](TemplateApi.md#templateList) | **GET** /template/list | List Templates [**templateRemoveUser**](TemplateApi.md#templateRemoveUser) | **POST** /template/remove_user/{template_id} | Remove User from Template -[**templateUpdate**](TemplateApi.md#templateUpdate) | **POST** /template/update/{template_id} | Update Template [**templateUpdateFiles**](TemplateApi.md#templateUpdateFiles) | **POST** /template/update_files/{template_id} | Update Template Files @@ -992,113 +991,6 @@ public class TemplateRemoveUserExample | **4XX** | failed_operation | - | -## templateUpdate - -> TemplateGetResponse templateUpdate(templateId, templateUpdateRequest) - -Update Template - -Update template fields. Every field is optional and the endpoint will only change whatever is provided. The fields not included in the request payload will remain unchanged. - -### 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 TemplateUpdateExample -{ - 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 formFields1 = new SubUpdateFormField(); - formFields1.apiId("uniqueIdHere_1"); - formFields1.name("New name 1"); - - var formFields2 = new SubUpdateFormField(); - formFields2.apiId("uniqueIdHere_2"); - formFields2.name("New name 2"); - - var formFields = new ArrayList(List.of ( - formFields1, - formFields2 - )); - - var templateUpdateRequest = new TemplateUpdateRequest(); - templateUpdateRequest.title("Test Title"); - templateUpdateRequest.subject("Test Subject"); - templateUpdateRequest.message("Test Message"); - templateUpdateRequest.ccRoles(List.of ( - "CC Role 1", - "CC Role 2" - )); - templateUpdateRequest.formFields(formFields); - - try - { - var response = new TemplateApi(config).templateUpdate( - "f57db65d3f933b5316d398057a36176831451a35", // templateId - templateUpdateRequest - ); - - System.out.println(response); - } catch (ApiException e) { - System.err.println("Exception when calling TemplateApi#templateUpdate"); - 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 update. | - **templateUpdateRequest** | [**TemplateUpdateRequest**](TemplateUpdateRequest.md)| | - -### Return type - -[**TemplateGetResponse**](TemplateGetResponse.md) - -### Authorization - -[api_key](../README.md#api_key), [oauth2](../README.md#oauth2) - -### HTTP request headers - -- **Content-Type**: application/json, multipart/form-data -- **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 | - | - - ## templateUpdateFiles > TemplateUpdateFilesResponse templateUpdateFiles(templateId, templateUpdateFilesRequest) diff --git a/sdks/java-v2/docs/TemplateUpdateRequest.md b/sdks/java-v2/docs/TemplateUpdateRequest.md deleted file mode 100644 index f94a7c368..000000000 --- a/sdks/java-v2/docs/TemplateUpdateRequest.md +++ /dev/null @@ -1,18 +0,0 @@ - - -# TemplateUpdateRequest - - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -| `ccRoles` | ```List``` | The CC roles that must be assigned when using the template to send a signature request. | | -| `title` | ```String``` | The title you want to assign to the SignatureRequest. | | -| `subject` | ```String``` | The new default template email subject. | | -| `message` | ```String``` | The new default template email message. | | -| `formFields` | [```List```](SubUpdateFormField.md) | A list of document form fields to update. The endpoint will not create or remove any fields. Every field must be identified by `api_id`, and the only supported change is renaming the field. | | - - - 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 5b10bf915..f6f6d255b 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 @@ -22,7 +22,6 @@ import com.dropbox.sign.model.TemplateRemoveUserRequest; import com.dropbox.sign.model.TemplateUpdateFilesRequest; import com.dropbox.sign.model.TemplateUpdateFilesResponse; -import com.dropbox.sign.model.TemplateUpdateRequest; import java.util.ArrayList; import java.util.HashMap; @@ -881,78 +880,6 @@ public ApiResponse templateRemoveUserWithHttpInfo(String te false ); } - /** - * Update Template - * Update template fields. Every field is optional and the endpoint will only change whatever is provided. The fields not included in the request payload will remain unchanged. - * @param templateId The ID of the template to update. (required) - * @param templateUpdateRequest (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 templateUpdate(String templateId, TemplateUpdateRequest templateUpdateRequest) throws ApiException { - return templateUpdateWithHttpInfo(templateId, templateUpdateRequest).getData(); - } - - - /** - * Update Template - * Update template fields. Every field is optional and the endpoint will only change whatever is provided. The fields not included in the request payload will remain unchanged. - * @param templateId The ID of the template to update. (required) - * @param templateUpdateRequest (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 templateUpdateWithHttpInfo(String templateId, TemplateUpdateRequest templateUpdateRequest) throws ApiException { - - // Check required parameters - if (templateId == null) { - throw new ApiException(400, "Missing the required parameter 'templateId' when calling templateUpdate"); - } - if (templateUpdateRequest == null) { - throw new ApiException(400, "Missing the required parameter 'templateUpdateRequest' when calling templateUpdate"); - } - - // Path parameters - String localVarPath = "/template/update/{template_id}" - .replaceAll("\\{template_id}", apiClient.escapeString(templateId.toString())); - - String localVarAccept = apiClient.selectHeaderAccept("application/json"); - Map localVarFormParams = new LinkedHashMap<>(); - localVarFormParams = templateUpdateRequest.createFormData(); - boolean isFileTypeFound = !localVarFormParams.isEmpty(); - String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType("application/json", "multipart/form-data"); - String[] localVarAuthNames = new String[] {"api_key", "oauth2"}; - GenericType localVarReturnType = new GenericType() {}; - return apiClient.invokeAPI( - "TemplateApi.templateUpdate", - localVarPath, - "POST", - new ArrayList<>(), - isFileTypeFound ? null : templateUpdateRequest, - new LinkedHashMap<>(), - new LinkedHashMap<>(), - localVarFormParams, - localVarAccept, - localVarContentType, - localVarAuthNames, - localVarReturnType, - false - ); - } /** * Update Template Files * Overlays a new file with the overlay of an existing template. The new file(s) must: 1. have the same or higher page count 2. the same orientation as the file(s) being replaced. This will not overwrite or in any way affect the existing template. Both the existing template and new template will be available for use after executing this endpoint. Also note that this will decrement your template quota. Overlaying new files is asynchronous and a successful call to this endpoint will return 200 OK response if the request passes initial validation checks. It is recommended that a callback be implemented to listen for the callback event. A `template_created` event will be sent when the files are updated or a `template_error` event will be sent if there was a problem while updating the files. If a callback handler has been configured and the event has not been received within 60 minutes of making the call, check the status of the request in the API dashboard and retry the request if necessary. If the page orientation or page count is different from the original template document, we will notify you with a `template_error` [callback event](https://app.hellosign.com/api/eventsAndCallbacksWalkthrough). diff --git a/sdks/java-v2/src/main/java/com/dropbox/sign/model/TemplateUpdateRequest.java b/sdks/java-v2/src/main/java/com/dropbox/sign/model/TemplateUpdateRequest.java deleted file mode 100644 index 7f4050294..000000000 --- a/sdks/java-v2/src/main/java/com/dropbox/sign/model/TemplateUpdateRequest.java +++ /dev/null @@ -1,402 +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.dropbox.sign.model.SubUpdateFormField; -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; -/** - * TemplateUpdateRequest - */ -@JsonPropertyOrder({ - TemplateUpdateRequest.JSON_PROPERTY_CC_ROLES, - TemplateUpdateRequest.JSON_PROPERTY_TITLE, - TemplateUpdateRequest.JSON_PROPERTY_SUBJECT, - TemplateUpdateRequest.JSON_PROPERTY_MESSAGE, - TemplateUpdateRequest.JSON_PROPERTY_FORM_FIELDS -}) -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.12.0") -@JsonIgnoreProperties(ignoreUnknown=true) -public class TemplateUpdateRequest { - public static final String JSON_PROPERTY_CC_ROLES = "cc_roles"; - @jakarta.annotation.Nullable - private List ccRoles = null; - - public static final String JSON_PROPERTY_TITLE = "title"; - @jakarta.annotation.Nullable - private String title; - - public static final String JSON_PROPERTY_SUBJECT = "subject"; - @jakarta.annotation.Nullable - private String subject; - - public static final String JSON_PROPERTY_MESSAGE = "message"; - @jakarta.annotation.Nullable - private String message; - - public static final String JSON_PROPERTY_FORM_FIELDS = "form_fields"; - @jakarta.annotation.Nullable - private List formFields = null; - - public TemplateUpdateRequest() { - } - - /** - * Attempt to instantiate and hydrate a new instance of this class - * @param jsonData String of JSON data representing target object - */ - static public TemplateUpdateRequest init(String jsonData) throws Exception { - return new ObjectMapper().readValue(jsonData, TemplateUpdateRequest.class); - } - - static public TemplateUpdateRequest init(HashMap data) throws Exception { - return new ObjectMapper().readValue( - new ObjectMapper().writeValueAsString(data), - TemplateUpdateRequest.class - ); - } - - public TemplateUpdateRequest ccRoles(@jakarta.annotation.Nullable List ccRoles) { - this.ccRoles = ccRoles; - return this; - } - - public TemplateUpdateRequest 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 TemplateUpdateRequest title(@jakarta.annotation.Nullable String title) { - this.title = title; - return this; - } - - /** - * The title you want to assign to the SignatureRequest. - * @return title - */ - @jakarta.annotation.Nullable - @JsonProperty(JSON_PROPERTY_TITLE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public String getTitle() { - return title; - } - - - @JsonProperty(JSON_PROPERTY_TITLE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setTitle(@jakarta.annotation.Nullable String title) { - this.title = title; - } - - - public TemplateUpdateRequest subject(@jakarta.annotation.Nullable String subject) { - this.subject = subject; - return this; - } - - /** - * The new default template email subject. - * @return subject - */ - @jakarta.annotation.Nullable - @JsonProperty(JSON_PROPERTY_SUBJECT) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public String getSubject() { - return subject; - } - - - @JsonProperty(JSON_PROPERTY_SUBJECT) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setSubject(@jakarta.annotation.Nullable String subject) { - this.subject = subject; - } - - - public TemplateUpdateRequest message(@jakarta.annotation.Nullable String message) { - this.message = message; - return this; - } - - /** - * The new default template email message. - * @return message - */ - @jakarta.annotation.Nullable - @JsonProperty(JSON_PROPERTY_MESSAGE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public String getMessage() { - return message; - } - - - @JsonProperty(JSON_PROPERTY_MESSAGE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setMessage(@jakarta.annotation.Nullable String message) { - this.message = message; - } - - - public TemplateUpdateRequest formFields(@jakarta.annotation.Nullable List formFields) { - this.formFields = formFields; - return this; - } - - public TemplateUpdateRequest addFormFieldsItem(SubUpdateFormField formFieldsItem) { - if (this.formFields == null) { - this.formFields = new ArrayList<>(); - } - this.formFields.add(formFieldsItem); - return this; - } - - /** - * A list of document form fields to update. The endpoint will not create or remove any fields. Every field must be identified by `api_id`, and the only supported change is renaming the field. - * @return formFields - */ - @jakarta.annotation.Nullable - @JsonProperty(JSON_PROPERTY_FORM_FIELDS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public List getFormFields() { - return formFields; - } - - - @JsonProperty(JSON_PROPERTY_FORM_FIELDS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setFormFields(@jakarta.annotation.Nullable List formFields) { - this.formFields = formFields; - } - - - /** - * Return true if this TemplateUpdateRequest object is equal to o. - */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - TemplateUpdateRequest templateUpdateRequest = (TemplateUpdateRequest) o; - return Objects.equals(this.ccRoles, templateUpdateRequest.ccRoles) && - Objects.equals(this.title, templateUpdateRequest.title) && - Objects.equals(this.subject, templateUpdateRequest.subject) && - Objects.equals(this.message, templateUpdateRequest.message) && - Objects.equals(this.formFields, templateUpdateRequest.formFields); - } - - @Override - public int hashCode() { - return Objects.hash(ccRoles, title, subject, message, formFields); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class TemplateUpdateRequest {\n"); - sb.append(" ccRoles: ").append(toIndentedString(ccRoles)).append("\n"); - sb.append(" title: ").append(toIndentedString(title)).append("\n"); - sb.append(" subject: ").append(toIndentedString(subject)).append("\n"); - sb.append(" message: ").append(toIndentedString(message)).append("\n"); - sb.append(" formFields: ").append(toIndentedString(formFields)).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 (title != null) { - if (isFileTypeOrListOfFiles(title)) { - fileTypeFound = true; - } - - if (title.getClass().equals(java.io.File.class) || - title.getClass().equals(Integer.class) || - title.getClass().equals(String.class) || - title.getClass().isEnum()) { - map.put("title", title); - } else if (isListOfFile(title)) { - for(int i = 0; i< getListSize(title); i++) { - map.put("title[" + i + "]", getFromList(title, i)); - } - } - else { - map.put("title", JSON.getDefault().getMapper().writeValueAsString(title)); - } - } - if (subject != null) { - if (isFileTypeOrListOfFiles(subject)) { - fileTypeFound = true; - } - - if (subject.getClass().equals(java.io.File.class) || - subject.getClass().equals(Integer.class) || - subject.getClass().equals(String.class) || - subject.getClass().isEnum()) { - map.put("subject", subject); - } else if (isListOfFile(subject)) { - for(int i = 0; i< getListSize(subject); i++) { - map.put("subject[" + i + "]", getFromList(subject, i)); - } - } - else { - map.put("subject", JSON.getDefault().getMapper().writeValueAsString(subject)); - } - } - if (message != null) { - if (isFileTypeOrListOfFiles(message)) { - fileTypeFound = true; - } - - if (message.getClass().equals(java.io.File.class) || - message.getClass().equals(Integer.class) || - message.getClass().equals(String.class) || - message.getClass().isEnum()) { - map.put("message", message); - } else if (isListOfFile(message)) { - for(int i = 0; i< getListSize(message); i++) { - map.put("message[" + i + "]", getFromList(message, i)); - } - } - else { - map.put("message", JSON.getDefault().getMapper().writeValueAsString(message)); - } - } - if (formFields != null) { - if (isFileTypeOrListOfFiles(formFields)) { - fileTypeFound = true; - } - - if (formFields.getClass().equals(java.io.File.class) || - formFields.getClass().equals(Integer.class) || - formFields.getClass().equals(String.class) || - formFields.getClass().isEnum()) { - map.put("form_fields", formFields); - } else if (isListOfFile(formFields)) { - for(int i = 0; i< getListSize(formFields); i++) { - map.put("form_fields[" + i + "]", getFromList(formFields, i)); - } - } - else { - map.put("form_fields", JSON.getDefault().getMapper().writeValueAsString(formFields)); - } - } - } 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 19d311d6c..7e2b78e3b 100644 --- a/sdks/node/README.md +++ b/sdks/node/README.md @@ -147,7 +147,6 @@ All URIs are relative to *https://api.hellosign.com/v3* | *TemplateApi* | [**templateGet**](./docs/api/TemplateApi.md#templateget) | **GET** /template/{template_id} | Get Template | | *TemplateApi* | [**templateList**](./docs/api/TemplateApi.md#templatelist) | **GET** /template/list | List Templates | | *TemplateApi* | [**templateRemoveUser**](./docs/api/TemplateApi.md#templateremoveuser) | **POST** /template/remove_user/{template_id} | Remove User from Template | -| *TemplateApi* | [**templateUpdate**](./docs/api/TemplateApi.md#templateupdate) | **POST** /template/update/{template_id} | Update Template | | *TemplateApi* | [**templateUpdateFiles**](./docs/api/TemplateApi.md#templateupdatefiles) | **POST** /template/update_files/{template_id} | Update Template Files | | *UnclaimedDraftApi* | [**unclaimedDraftCreate**](./docs/api/UnclaimedDraftApi.md#unclaimeddraftcreate) | **POST** /unclaimed_draft/create | Create Unclaimed Draft | | *UnclaimedDraftApi* | [**unclaimedDraftCreateEmbedded**](./docs/api/UnclaimedDraftApi.md#unclaimeddraftcreateembedded) | **POST** /unclaimed_draft/create_embedded | Create Embedded Unclaimed Draft | @@ -342,7 +341,6 @@ All URIs are relative to *https://api.hellosign.com/v3* - [TemplateUpdateFilesRequest](./docs/model/TemplateUpdateFilesRequest.md) - [TemplateUpdateFilesResponse](./docs/model/TemplateUpdateFilesResponse.md) - [TemplateUpdateFilesResponseTemplate](./docs/model/TemplateUpdateFilesResponseTemplate.md) -- [TemplateUpdateRequest](./docs/model/TemplateUpdateRequest.md) - [UnclaimedDraftCreateEmbeddedRequest](./docs/model/UnclaimedDraftCreateEmbeddedRequest.md) - [UnclaimedDraftCreateEmbeddedWithTemplateRequest](./docs/model/UnclaimedDraftCreateEmbeddedWithTemplateRequest.md) - [UnclaimedDraftCreateRequest](./docs/model/UnclaimedDraftCreateRequest.md) diff --git a/sdks/node/api/templateApi.ts b/sdks/node/api/templateApi.ts index 9b7693a26..676e33e18 100644 --- a/sdks/node/api/templateApi.ts +++ b/sdks/node/api/templateApi.ts @@ -42,7 +42,6 @@ import { TemplateRemoveUserRequest, TemplateUpdateFilesRequest, TemplateUpdateFilesResponse, - TemplateUpdateRequest, VoidAuth, } from "../model"; @@ -1507,165 +1506,6 @@ export class TemplateApi { ); }); } - /** - * Update template fields. Every field is optional and the endpoint will only change whatever is provided. The fields not included in the request payload will remain unchanged. - * @summary Update Template - * @param templateId The ID of the template to update. - * @param templateUpdateRequest - * @param options - */ - public async templateUpdate( - templateId: string, - templateUpdateRequest: TemplateUpdateRequest, - options: optionsI = { headers: {} } - ): Promise> { - templateUpdateRequest = deserializeIfNeeded( - templateUpdateRequest, - "TemplateUpdateRequest" - ); - const localVarPath = - this.basePath + - "/template/update/{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 templateUpdate." - ); - } - - // verify required parameter 'templateUpdateRequest' is not null or undefined - if (templateUpdateRequest === null || templateUpdateRequest === undefined) { - throw new Error( - "Required parameter templateUpdateRequest was null or undefined when calling templateUpdate." - ); - } - - (Object).assign(localVarHeaderParams, options.headers); - - let localVarUseFormData = false; - - const result = generateFormData( - templateUpdateRequest, - TemplateUpdateRequest.attributeTypeMap - ); - localVarUseFormData = result.localVarUseFormData; - - let data = {}; - if (localVarUseFormData) { - const formData = toFormData(result.data); - data = formData; - localVarHeaderParams = { - ...localVarHeaderParams, - ...formData.getHeaders(), - }; - } else { - data = ObjectSerializer.serialize( - templateUpdateRequest, - "TemplateUpdateRequest" - ); - } - - 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); - } - ); - } - ); - }); - } /** * Overlays a new file with the overlay of an existing template. The new file(s) must: 1. have the same or higher page count 2. the same orientation as the file(s) being replaced. This will not overwrite or in any way affect the existing template. Both the existing template and new template will be available for use after executing this endpoint. Also note that this will decrement your template quota. Overlaying new files is asynchronous and a successful call to this endpoint will return 200 OK response if the request passes initial validation checks. It is recommended that a callback be implemented to listen for the callback event. A `template_created` event will be sent when the files are updated or a `template_error` event will be sent if there was a problem while updating the files. If a callback handler has been configured and the event has not been received within 60 minutes of making the call, check the status of the request in the API dashboard and retry the request if necessary. If the page orientation or page count is different from the original template document, we will notify you with a `template_error` [callback event](https://app.hellosign.com/api/eventsAndCallbacksWalkthrough). * @summary Update Template Files diff --git a/sdks/node/dist/api.js b/sdks/node/dist/api.js index 2a0fc8d68..b5e3b1398 100644 --- a/sdks/node/dist/api.js +++ b/sdks/node/dist/api.js @@ -13348,7 +13348,6 @@ __export(api_exports, { TemplateUpdateFilesRequest: () => TemplateUpdateFilesRequest, TemplateUpdateFilesResponse: () => TemplateUpdateFilesResponse, TemplateUpdateFilesResponseTemplate: () => TemplateUpdateFilesResponseTemplate, - TemplateUpdateRequest: () => TemplateUpdateRequest, USER_AGENT: () => USER_AGENT, UnclaimedDraftApi: () => UnclaimedDraftApi, UnclaimedDraftCreateEmbeddedRequest: () => UnclaimedDraftCreateEmbeddedRequest, @@ -25977,49 +25976,6 @@ var TemplateUpdateFilesResponseTemplate = class _TemplateUpdateFilesResponseTemp } }; -// model/templateUpdateRequest.ts -var TemplateUpdateRequest = class _TemplateUpdateRequest { - static { - this.discriminator = void 0; - } - static { - this.attributeTypeMap = [ - { - name: "ccRoles", - baseName: "cc_roles", - type: "Array" - }, - { - name: "title", - baseName: "title", - type: "string" - }, - { - name: "subject", - baseName: "subject", - type: "string" - }, - { - name: "message", - baseName: "message", - type: "string" - }, - { - name: "formFields", - baseName: "form_fields", - type: "Array" - } - ]; - } - static getAttributeTypeMap() { - return _TemplateUpdateRequest.attributeTypeMap; - } - /** Attempt to instantiate and hydrate a new instance of this class */ - static init(data) { - return ObjectSerializer.deserialize(data, "TemplateUpdateRequest"); - } -}; - // model/unclaimedDraftCreateEmbeddedRequest.ts var UnclaimedDraftCreateEmbeddedRequest = class _UnclaimedDraftCreateEmbeddedRequest { constructor() { @@ -27076,7 +27032,6 @@ var typeMap = { TemplateUpdateFilesRequest, TemplateUpdateFilesResponse, TemplateUpdateFilesResponseTemplate, - TemplateUpdateRequest, UnclaimedDraftCreateEmbeddedRequest, UnclaimedDraftCreateEmbeddedWithTemplateRequest, UnclaimedDraftCreateRequest, @@ -35569,137 +35524,6 @@ var TemplateApi = class { ); }); } - /** - * Update template fields. Every field is optional and the endpoint will only change whatever is provided. The fields not included in the request payload will remain unchanged. - * @summary Update Template - * @param templateId The ID of the template to update. - * @param templateUpdateRequest - * @param options - */ - async templateUpdate(templateId, templateUpdateRequest, options = { headers: {} }) { - templateUpdateRequest = deserializeIfNeeded10( - templateUpdateRequest, - "TemplateUpdateRequest" - ); - const localVarPath = this.basePath + "/template/update/{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 templateUpdate." - ); - } - if (templateUpdateRequest === null || templateUpdateRequest === void 0) { - throw new Error( - "Required parameter templateUpdateRequest was null or undefined when calling templateUpdate." - ); - } - Object.assign(localVarHeaderParams, options.headers); - let localVarUseFormData = false; - const result = generateFormData( - templateUpdateRequest, - TemplateUpdateRequest.attributeTypeMap - ); - localVarUseFormData = result.localVarUseFormData; - let data = {}; - if (localVarUseFormData) { - const formData2 = toFormData3(result.data); - data = formData2; - localVarHeaderParams = { - ...localVarHeaderParams, - ...formData2.getHeaders() - }; - } else { - data = ObjectSerializer.serialize( - templateUpdateRequest, - "TemplateUpdateRequest" - ); - } - 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); - } - ); - } - ); - }); - } /** * Overlays a new file with the overlay of an existing template. The new file(s) must: 1. have the same or higher page count 2. the same orientation as the file(s) being replaced. This will not overwrite or in any way affect the existing template. Both the existing template and new template will be available for use after executing this endpoint. Also note that this will decrement your template quota. Overlaying new files is asynchronous and a successful call to this endpoint will return 200 OK response if the request passes initial validation checks. It is recommended that a callback be implemented to listen for the callback event. A `template_created` event will be sent when the files are updated or a `template_error` event will be sent if there was a problem while updating the files. If a callback handler has been configured and the event has not been received within 60 minutes of making the call, check the status of the request in the API dashboard and retry the request if necessary. If the page orientation or page count is different from the original template document, we will notify you with a `template_error` [callback event](https://app.hellosign.com/api/eventsAndCallbacksWalkthrough). * @summary Update Template Files @@ -36746,7 +36570,6 @@ var APIS = [ TemplateUpdateFilesRequest, TemplateUpdateFilesResponse, TemplateUpdateFilesResponseTemplate, - TemplateUpdateRequest, USER_AGENT, UnclaimedDraftApi, UnclaimedDraftCreateEmbeddedRequest, diff --git a/sdks/node/docs/api/TemplateApi.md b/sdks/node/docs/api/TemplateApi.md index 2cb9cb032..a9ce2013a 100644 --- a/sdks/node/docs/api/TemplateApi.md +++ b/sdks/node/docs/api/TemplateApi.md @@ -14,7 +14,6 @@ All URIs are relative to https://api.hellosign.com/v3. | [**templateGet()**](TemplateApi.md#templateGet) | **GET** /template/{template_id} | Get Template | | [**templateList()**](TemplateApi.md#templateList) | **GET** /template/list | List Templates | | [**templateRemoveUser()**](TemplateApi.md#templateRemoveUser) | **POST** /template/remove_user/{template_id} | Remove User from Template | -| [**templateUpdate()**](TemplateApi.md#templateUpdate) | **POST** /template/update/{template_id} | Update Template | | [**templateUpdateFiles()**](TemplateApi.md#templateUpdateFiles) | **POST** /template/update_files/{template_id} | Update Template Files | @@ -726,89 +725,6 @@ apiCaller.templateRemoveUser( [[Back to Model list]](../../README.md#models) [[Back to README]](../../README.md) -## `templateUpdate()` - -```typescript -templateUpdate(templateId: string, templateUpdateRequest: TemplateUpdateRequest): TemplateGetResponse -``` - -Update Template - -Update template fields. Every field is optional and the endpoint will only change whatever is provided. The fields not included in the request payload will remain unchanged. - -### 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 formFields1: models.SubUpdateFormField = { - apiId: "uniqueIdHere_1", - name: "New name 1", -}; - -const formFields2: models.SubUpdateFormField = { - apiId: "uniqueIdHere_2", - name: "New name 2", -}; - -const formFields = [ - formFields1, - formFields2, -]; - -const templateUpdateRequest: models.TemplateUpdateRequest = { - title: "Test Title", - subject: "Test Subject", - message: "Test Message", - ccRoles: [ - "CC Role 1", - "CC Role 2", - ], - formFields: formFields, -}; - -apiCaller.templateUpdate( - "f57db65d3f933b5316d398057a36176831451a35", // templateId - templateUpdateRequest, -).then(response => { - console.log(response.body); -}).catch(error => { - console.log("Exception when calling TemplateApi#templateUpdate:"); - console.log(error.body); -}); - -``` - -### Parameters - -|Name | Type | Description | Notes | -| ------------- | ------------- | ------------- | ------------- | -| **templateId** | **string**| The ID of the template to update. | | -| **templateUpdateRequest** | [**TemplateUpdateRequest**](../model/TemplateUpdateRequest.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`, `multipart/form-data` -- **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) - ## `templateUpdateFiles()` ```typescript diff --git a/sdks/node/docs/model/TemplateUpdateRequest.md b/sdks/node/docs/model/TemplateUpdateRequest.md deleted file mode 100644 index d2f437d03..000000000 --- a/sdks/node/docs/model/TemplateUpdateRequest.md +++ /dev/null @@ -1,15 +0,0 @@ -# # TemplateUpdateRequest - - - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -| `ccRoles` | ```Array``` | The CC roles that must be assigned when using the template to send a signature request. | | -| `title` | ```string``` | The title you want to assign to the SignatureRequest. | | -| `subject` | ```string``` | The new default template email subject. | | -| `message` | ```string``` | The new default template email message. | | -| `formFields` | [```Array```](SubUpdateFormField.md) | A list of document form fields to update. The endpoint will not create or remove any fields. Every field must be identified by `api_id`, and the only supported change is renaming the field. | | - -[[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 7b5badacb..c30e4c127 100644 --- a/sdks/node/model/index.ts +++ b/sdks/node/model/index.ts @@ -198,7 +198,6 @@ import { TemplateResponseSignerRole } from "./templateResponseSignerRole"; import { TemplateUpdateFilesRequest } from "./templateUpdateFilesRequest"; import { TemplateUpdateFilesResponse } from "./templateUpdateFilesResponse"; import { TemplateUpdateFilesResponseTemplate } from "./templateUpdateFilesResponseTemplate"; -import { TemplateUpdateRequest } from "./templateUpdateRequest"; import { UnclaimedDraftCreateEmbeddedRequest } from "./unclaimedDraftCreateEmbeddedRequest"; import { UnclaimedDraftCreateEmbeddedWithTemplateRequest } from "./unclaimedDraftCreateEmbeddedWithTemplateRequest"; import { UnclaimedDraftCreateRequest } from "./unclaimedDraftCreateRequest"; @@ -475,7 +474,6 @@ export let typeMap: { [index: string]: any } = { TemplateUpdateFilesRequest: TemplateUpdateFilesRequest, TemplateUpdateFilesResponse: TemplateUpdateFilesResponse, TemplateUpdateFilesResponseTemplate: TemplateUpdateFilesResponseTemplate, - TemplateUpdateRequest: TemplateUpdateRequest, UnclaimedDraftCreateEmbeddedRequest: UnclaimedDraftCreateEmbeddedRequest, UnclaimedDraftCreateEmbeddedWithTemplateRequest: UnclaimedDraftCreateEmbeddedWithTemplateRequest, @@ -684,7 +682,6 @@ export { TemplateUpdateFilesRequest, TemplateUpdateFilesResponse, TemplateUpdateFilesResponseTemplate, - TemplateUpdateRequest, UnclaimedDraftCreateEmbeddedRequest, UnclaimedDraftCreateEmbeddedWithTemplateRequest, UnclaimedDraftCreateRequest, diff --git a/sdks/node/model/templateUpdateRequest.ts b/sdks/node/model/templateUpdateRequest.ts deleted file mode 100644 index 3bd3bef60..000000000 --- a/sdks/node/model/templateUpdateRequest.ts +++ /dev/null @@ -1,88 +0,0 @@ -/** - * The MIT License (MIT) - * - * Copyright (C) 2023 dropbox.com - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ - -import { AttributeTypeMap, ObjectSerializer } from "./"; -import { SubUpdateFormField } from "./subUpdateFormField"; - -export class TemplateUpdateRequest { - /** - * The CC roles that must be assigned when using the template to send a signature request. - */ - "ccRoles"?: Array; - /** - * The title you want to assign to the SignatureRequest. - */ - "title"?: string; - /** - * The new default template email subject. - */ - "subject"?: string; - /** - * The new default template email message. - */ - "message"?: string; - /** - * A list of document form fields to update. The endpoint will not create or remove any fields. Every field must be identified by `api_id`, and the only supported change is renaming the field. - */ - "formFields"?: Array; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: AttributeTypeMap = [ - { - name: "ccRoles", - baseName: "cc_roles", - type: "Array", - }, - { - name: "title", - baseName: "title", - type: "string", - }, - { - name: "subject", - baseName: "subject", - type: "string", - }, - { - name: "message", - baseName: "message", - type: "string", - }, - { - name: "formFields", - baseName: "form_fields", - type: "Array", - }, - ]; - - static getAttributeTypeMap(): AttributeTypeMap { - return TemplateUpdateRequest.attributeTypeMap; - } - - /** Attempt to instantiate and hydrate a new instance of this class */ - static init(data: any): TemplateUpdateRequest { - return ObjectSerializer.deserialize(data, "TemplateUpdateRequest"); - } -} diff --git a/sdks/node/types/api/templateApi.d.ts b/sdks/node/types/api/templateApi.d.ts index 98a126994..aeaa69a46 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, TemplateUpdateRequest } from "../model"; +import { Authentication, FileResponse, FileResponseDataUri, HttpBasicAuth, HttpBearerAuth, Interceptor, TemplateAddUserRequest, TemplateCreateEmbeddedDraftRequest, TemplateCreateEmbeddedDraftResponse, TemplateCreateRequest, TemplateCreateResponse, TemplateGetResponse, TemplateListResponse, TemplateRemoveUserRequest, TemplateUpdateFilesRequest, TemplateUpdateFilesResponse } from "../model"; import { optionsI, returnTypeI, returnTypeT } from "./"; export declare enum TemplateApiApiKeys { } @@ -34,6 +34,5 @@ export declare class TemplateApi { templateGet(templateId: string, options?: optionsI): Promise>; templateList(accountId?: string, page?: number, pageSize?: number, query?: string, options?: optionsI): Promise>; templateRemoveUser(templateId: string, templateRemoveUserRequest: TemplateRemoveUserRequest, options?: optionsI): Promise>; - templateUpdate(templateId: string, templateUpdateRequest: TemplateUpdateRequest, options?: optionsI): Promise>; templateUpdateFiles(templateId: string, templateUpdateFilesRequest: TemplateUpdateFilesRequest, options?: optionsI): Promise>; } diff --git a/sdks/node/types/model/index.d.ts b/sdks/node/types/model/index.d.ts index e34120091..198242dc3 100644 --- a/sdks/node/types/model/index.d.ts +++ b/sdks/node/types/model/index.d.ts @@ -186,7 +186,6 @@ import { TemplateResponseSignerRole } from "./templateResponseSignerRole"; import { TemplateUpdateFilesRequest } from "./templateUpdateFilesRequest"; import { TemplateUpdateFilesResponse } from "./templateUpdateFilesResponse"; import { TemplateUpdateFilesResponseTemplate } from "./templateUpdateFilesResponseTemplate"; -import { TemplateUpdateRequest } from "./templateUpdateRequest"; import { UnclaimedDraftCreateEmbeddedRequest } from "./unclaimedDraftCreateEmbeddedRequest"; import { UnclaimedDraftCreateEmbeddedWithTemplateRequest } from "./unclaimedDraftCreateEmbeddedWithTemplateRequest"; import { UnclaimedDraftCreateRequest } from "./unclaimedDraftCreateRequest"; @@ -200,4 +199,4 @@ export declare let enumsMap: { export declare let typeMap: { [index: string]: any; }; -export { AccountCreateRequest, AccountCreateResponse, AccountGetResponse, AccountResponse, AccountResponseQuotas, AccountResponseSettings, 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, SubUpdateFormField, SubWhiteLabelingOptions, TeamAddMemberRequest, TeamCreateRequest, TeamGetInfoResponse, TeamGetResponse, TeamInfoResponse, TeamInviteResponse, TeamInvitesResponse, TeamMemberResponse, TeamMembersResponse, TeamParentResponse, TeamRemoveMemberRequest, TeamResponse, TeamSubTeamsResponse, TeamUpdateRequest, TemplateAddUserRequest, TemplateCreateEmbeddedDraftRequest, TemplateCreateEmbeddedDraftResponse, TemplateCreateEmbeddedDraftResponseTemplate, TemplateCreateRequest, TemplateCreateResponse, TemplateCreateResponseTemplate, 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, TemplateUpdateRequest, UnclaimedDraftCreateEmbeddedRequest, UnclaimedDraftCreateEmbeddedWithTemplateRequest, UnclaimedDraftCreateRequest, UnclaimedDraftCreateResponse, UnclaimedDraftEditAndResendRequest, UnclaimedDraftResponse, VoidAuth, WarningResponse, }; +export { AccountCreateRequest, AccountCreateResponse, AccountGetResponse, AccountResponse, AccountResponseQuotas, AccountResponseSettings, 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, SubUpdateFormField, SubWhiteLabelingOptions, TeamAddMemberRequest, TeamCreateRequest, TeamGetInfoResponse, TeamGetResponse, TeamInfoResponse, TeamInviteResponse, TeamInvitesResponse, TeamMemberResponse, TeamMembersResponse, TeamParentResponse, TeamRemoveMemberRequest, TeamResponse, TeamSubTeamsResponse, TeamUpdateRequest, TemplateAddUserRequest, TemplateCreateEmbeddedDraftRequest, TemplateCreateEmbeddedDraftResponse, TemplateCreateEmbeddedDraftResponseTemplate, TemplateCreateRequest, TemplateCreateResponse, TemplateCreateResponseTemplate, 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/templateUpdateRequest.d.ts b/sdks/node/types/model/templateUpdateRequest.d.ts deleted file mode 100644 index 2919a6b64..000000000 --- a/sdks/node/types/model/templateUpdateRequest.d.ts +++ /dev/null @@ -1,13 +0,0 @@ -import { AttributeTypeMap } from "./"; -import { SubUpdateFormField } from "./subUpdateFormField"; -export declare class TemplateUpdateRequest { - "ccRoles"?: Array; - "title"?: string; - "subject"?: string; - "message"?: string; - "formFields"?: Array; - static discriminator: string | undefined; - static attributeTypeMap: AttributeTypeMap; - static getAttributeTypeMap(): AttributeTypeMap; - static init(data: any): TemplateUpdateRequest; -} diff --git a/sdks/php/README.md b/sdks/php/README.md index 30c3cc8f7..3a709a912 100644 --- a/sdks/php/README.md +++ b/sdks/php/README.md @@ -215,7 +215,6 @@ All URIs are relative to *https://api.hellosign.com/v3* | *TemplateApi* | [**templateGet**](docs/Api/TemplateApi.md#templateget) | **GET** /template/{template_id} | Get Template | | *TemplateApi* | [**templateList**](docs/Api/TemplateApi.md#templatelist) | **GET** /template/list | List Templates | | *TemplateApi* | [**templateRemoveUser**](docs/Api/TemplateApi.md#templateremoveuser) | **POST** /template/remove_user/{template_id} | Remove User from Template | -| *TemplateApi* | [**templateUpdate**](docs/Api/TemplateApi.md#templateupdate) | **POST** /template/update/{template_id} | Update Template | | *TemplateApi* | [**templateUpdateFiles**](docs/Api/TemplateApi.md#templateupdatefiles) | **POST** /template/update_files/{template_id} | Update Template Files | | *UnclaimedDraftApi* | [**unclaimedDraftCreate**](docs/Api/UnclaimedDraftApi.md#unclaimeddraftcreate) | **POST** /unclaimed_draft/create | Create Unclaimed Draft | | *UnclaimedDraftApi* | [**unclaimedDraftCreateEmbedded**](docs/Api/UnclaimedDraftApi.md#unclaimeddraftcreateembedded) | **POST** /unclaimed_draft/create_embedded | Create Embedded Unclaimed Draft | @@ -411,7 +410,6 @@ All URIs are relative to *https://api.hellosign.com/v3* - [TemplateUpdateFilesRequest](docs/Model/TemplateUpdateFilesRequest.md) - [TemplateUpdateFilesResponse](docs/Model/TemplateUpdateFilesResponse.md) - [TemplateUpdateFilesResponseTemplate](docs/Model/TemplateUpdateFilesResponseTemplate.md) -- [TemplateUpdateRequest](docs/Model/TemplateUpdateRequest.md) - [UnclaimedDraftCreateEmbeddedRequest](docs/Model/UnclaimedDraftCreateEmbeddedRequest.md) - [UnclaimedDraftCreateEmbeddedWithTemplateRequest](docs/Model/UnclaimedDraftCreateEmbeddedWithTemplateRequest.md) - [UnclaimedDraftCreateRequest](docs/Model/UnclaimedDraftCreateRequest.md) diff --git a/sdks/php/docs/Api/TemplateApi.md b/sdks/php/docs/Api/TemplateApi.md index 5968e16f9..2215c078c 100644 --- a/sdks/php/docs/Api/TemplateApi.md +++ b/sdks/php/docs/Api/TemplateApi.md @@ -14,7 +14,6 @@ All URIs are relative to https://api.hellosign.com/v3. | [**templateGet()**](TemplateApi.md#templateGet) | **GET** /template/{template_id} | Get Template | | [**templateList()**](TemplateApi.md#templateList) | **GET** /template/list | List Templates | | [**templateRemoveUser()**](TemplateApi.md#templateRemoveUser) | **POST** /template/remove_user/{template_id} | Remove User from Template | -| [**templateUpdate()**](TemplateApi.md#templateUpdate) | **POST** /template/update/{template_id} | Update Template | | [**templateUpdateFiles()**](TemplateApi.md#templateUpdateFiles) | **POST** /template/update_files/{template_id} | Update Template Files | @@ -755,91 +754,6 @@ try { [[Back to Model list]](../../README.md#models) [[Back to README]](../../README.md) -## `templateUpdate()` - -```php -templateUpdate($template_id, $template_update_request): \Dropbox\Sign\Model\TemplateGetResponse -``` -Update Template - -Update template fields. Every field is optional and the endpoint will only change whatever is provided. The fields not included in the request payload will remain unchanged. - -### Example - -```php -setUsername("YOUR_API_KEY"); -// $config->setAccessToken("YOUR_ACCESS_TOKEN"); - -$form_fields_1 = (new Dropbox\Sign\Model\SubUpdateFormField()) - ->setApiId("uniqueIdHere_1") - ->setName("New name 1"); - -$form_fields_2 = (new Dropbox\Sign\Model\SubUpdateFormField()) - ->setApiId("uniqueIdHere_2") - ->setName("New name 2"); - -$form_fields = [ - $form_fields_1, - $form_fields_2, -]; - -$template_update_request = (new Dropbox\Sign\Model\TemplateUpdateRequest()) - ->setTitle("Test Title") - ->setSubject("Test Subject") - ->setMessage("Test Message") - ->setCcRoles([ - "CC Role 1", - "CC Role 2", - ]) - ->setFormFields($form_fields); - -try { - $response = (new Dropbox\Sign\Api\TemplateApi(config: $config))->templateUpdate( - template_id: "f57db65d3f933b5316d398057a36176831451a35", - template_update_request: $template_update_request, - ); - - print_r($response); -} catch (Dropbox\Sign\ApiException $e) { - echo "Exception when calling TemplateApi#templateUpdate: {$e->getMessage()}"; -} - -``` - -### Parameters - -|Name | Type | Description | Notes | -| ------------- | ------------- | ------------- | ------------- | -| **template_id** | **string**| The ID of the template to update. | | -| **template_update_request** | [**\Dropbox\Sign\Model\TemplateUpdateRequest**](../Model/TemplateUpdateRequest.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`, `multipart/form-data` -- **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) - ## `templateUpdateFiles()` ```php diff --git a/sdks/php/docs/Model/TemplateUpdateRequest.md b/sdks/php/docs/Model/TemplateUpdateRequest.md deleted file mode 100644 index 2c4e679b3..000000000 --- a/sdks/php/docs/Model/TemplateUpdateRequest.md +++ /dev/null @@ -1,15 +0,0 @@ -# # TemplateUpdateRequest - - - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -| `cc_roles` | ```string[]``` | The CC roles that must be assigned when using the template to send a signature request. | | -| `title` | ```string``` | The title you want to assign to the SignatureRequest. | | -| `subject` | ```string``` | The new default template email subject. | | -| `message` | ```string``` | The new default template email message. | | -| `form_fields` | [```\Dropbox\Sign\Model\SubUpdateFormField[]```](SubUpdateFormField.md) | A list of document form fields to update. The endpoint will not create or remove any fields. Every field must be identified by `api_id`, and the only supported change is renaming the field. | | - -[[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 69a6937d1..2d39bc886 100644 --- a/sdks/php/src/Api/TemplateApi.php +++ b/sdks/php/src/Api/TemplateApi.php @@ -100,10 +100,6 @@ class TemplateApi 'templateRemoveUser' => [ 'application/json', ], - 'templateUpdate' => [ - 'application/json', - 'multipart/form-data', - ], 'templateUpdateFiles' => [ 'application/json', 'multipart/form-data', @@ -3528,366 +3524,6 @@ public function templateRemoveUserRequest(string $template_id, Model\TemplateRem ); } - /** - * Operation templateUpdate - * - * Update Template - * - * @param string $template_id The ID of the template to update. (required) - * @param Model\TemplateUpdateRequest $template_update_request template_update_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 templateUpdate(string $template_id, Model\TemplateUpdateRequest $template_update_request) - { - list($response) = $this->templateUpdateWithHttpInfo($template_id, $template_update_request); - return $response; - } - - /** - * Operation templateUpdateWithHttpInfo - * - * Update Template - * - * @param string $template_id The ID of the template to update. (required) - * @param Model\TemplateUpdateRequest $template_update_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['templateUpdate'] 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 ::templateUpdate. This method will eventually become unavailable - */ - public function templateUpdateWithHttpInfo(string $template_id, Model\TemplateUpdateRequest $template_update_request, string $contentType = self::contentTypes['templateUpdate'][0]) - { - $request = $this->templateUpdateRequest($template_id, $template_update_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 templateUpdateAsync - * - * Update Template - * - * @param string $template_id The ID of the template to update. (required) - * @param Model\TemplateUpdateRequest $template_update_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['templateUpdate'] to see the possible values for this operation - * - * @return \GuzzleHttp\Promise\PromiseInterface - * @throws InvalidArgumentException - * @deprecated Prefer to use ::templateUpdate. This method will eventually become unavailable - */ - public function templateUpdateAsync(string $template_id, Model\TemplateUpdateRequest $template_update_request, string $contentType = self::contentTypes['templateUpdate'][0]) - { - return $this->templateUpdateAsyncWithHttpInfo($template_id, $template_update_request, $contentType) - ->then( - function ($response) { - return $response[0]; - } - ); - } - - /** - * Operation templateUpdateAsyncWithHttpInfo - * - * Update Template - * - * @param string $template_id The ID of the template to update. (required) - * @param Model\TemplateUpdateRequest $template_update_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['templateUpdate'] to see the possible values for this operation - * - * @return \GuzzleHttp\Promise\PromiseInterface - * @throws InvalidArgumentException - * @deprecated Prefer to use ::templateUpdate. This method will eventually become unavailable - */ - public function templateUpdateAsyncWithHttpInfo(string $template_id, Model\TemplateUpdateRequest $template_update_request, string $contentType = self::contentTypes['templateUpdate'][0]) - { - $returnType = '\Dropbox\Sign\Model\TemplateGetResponse'; - $request = $this->templateUpdateRequest($template_id, $template_update_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 'templateUpdate' - * - * @param string $template_id The ID of the template to update. (required) - * @param Model\TemplateUpdateRequest $template_update_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['templateUpdate'] to see the possible values for this operation - * - * @return Request - * @throws InvalidArgumentException - * @deprecated Prefer to use ::templateUpdate. This method will eventually become unavailable - */ - public function templateUpdateRequest(string $template_id, Model\TemplateUpdateRequest $template_update_request, string $contentType = self::contentTypes['templateUpdate'][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 templateUpdate' - ); - } - - // verify the required parameter 'template_update_request' is set - if ($template_update_request === null || (is_array($template_update_request) && count($template_update_request) === 0)) { - throw new InvalidArgumentException( - 'Missing the required parameter $template_update_request when calling templateUpdate' - ); - } - - $resourcePath = '/template/update/{template_id}'; - $formParams = []; - $queryParams = []; - $headerParams = []; - $httpBody = ''; - $multipart = false; - - $formParams = ObjectSerializer::getFormParams( - $template_update_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_update_request)); - } else { - $httpBody = $template_update_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_update_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 templateUpdateFiles * diff --git a/sdks/php/src/Model/TemplateUpdateRequest.php b/sdks/php/src/Model/TemplateUpdateRequest.php deleted file mode 100644 index 9c06c2a56..000000000 --- a/sdks/php/src/Model/TemplateUpdateRequest.php +++ /dev/null @@ -1,565 +0,0 @@ - - */ -class TemplateUpdateRequest implements ModelInterface, ArrayAccess, JsonSerializable -{ - public const DISCRIMINATOR = null; - - /** - * The original name of the model. - * - * @var string - */ - protected static $openAPIModelName = 'TemplateUpdateRequest'; - - /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ - protected static $openAPITypes = [ - 'cc_roles' => 'string[]', - 'title' => 'string', - 'subject' => 'string', - 'message' => 'string', - 'form_fields' => '\Dropbox\Sign\Model\SubUpdateFormField[]', - ]; - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ - protected static $openAPIFormats = [ - 'cc_roles' => null, - 'title' => null, - 'subject' => null, - 'message' => null, - 'form_fields' => null, - ]; - - /** - * Array of nullable properties. Used for (de)serialization - * - * @var bool[] - */ - protected static array $openAPINullables = [ - 'cc_roles' => false, - 'title' => false, - 'subject' => false, - 'message' => false, - 'form_fields' => false, - ]; - - /** - * If a nullable field gets set to null, insert it here - * - * @var bool[] - */ - protected array $openAPINullablesSetToNull = []; - - /** - * Array of property to type mappings. Used for (de)serialization - * - * @return array - */ - public static function openAPITypes() - { - return self::$openAPITypes; - } - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @return array - */ - public static function openAPIFormats() - { - return self::$openAPIFormats; - } - - /** - * Array of nullable properties - */ - protected static function openAPINullables(): array - { - return self::$openAPINullables; - } - - /** - * Array of nullable field names deliberately set to null - * - * @return bool[] - */ - private function getOpenAPINullablesSetToNull(): array - { - return $this->openAPINullablesSetToNull; - } - - /** - * Setter - Array of nullable field names deliberately set to null - * - * @param bool[] $openAPINullablesSetToNull - */ - private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void - { - $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; - } - - /** - * Checks if a property is nullable - */ - public static function isNullable(string $property): bool - { - return self::openAPINullables()[$property] ?? false; - } - - /** - * Checks if a nullable property is set to null. - */ - public function isNullableSetToNull(string $property): bool - { - return in_array($property, $this->getOpenAPINullablesSetToNull(), true); - } - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @var string[] - */ - protected static $attributeMap = [ - 'cc_roles' => 'cc_roles', - 'title' => 'title', - 'subject' => 'subject', - 'message' => 'message', - 'form_fields' => 'form_fields', - ]; - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @var string[] - */ - protected static $setters = [ - 'cc_roles' => 'setCcRoles', - 'title' => 'setTitle', - 'subject' => 'setSubject', - 'message' => 'setMessage', - 'form_fields' => 'setFormFields', - ]; - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @var string[] - */ - protected static $getters = [ - 'cc_roles' => 'getCcRoles', - 'title' => 'getTitle', - 'subject' => 'getSubject', - 'message' => 'getMessage', - 'form_fields' => 'getFormFields', - ]; - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @return array - */ - public static function attributeMap() - { - return self::$attributeMap; - } - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @return array - */ - public static function setters() - { - return self::$setters; - } - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @return array - */ - public static function getters() - { - return self::$getters; - } - - /** - * The original name of the model. - * - * @return string - */ - public function getModelName() - { - return self::$openAPIModelName; - } - - /** - * Associative array for storing property values - * - * @var mixed[] - */ - protected $container = []; - - /** - * Constructor - * - * @param mixed[]|null $data Associated array of property values - * initializing the model - */ - public function __construct(?array $data = null) - { - $this->setIfExists('cc_roles', $data ?? [], null); - $this->setIfExists('title', $data ?? [], null); - $this->setIfExists('subject', $data ?? [], null); - $this->setIfExists('message', $data ?? [], null); - $this->setIfExists('form_fields', $data ?? [], null); - } - - /** - * @deprecated use ::init() - */ - public static function fromArray(array $data): TemplateUpdateRequest - { - return self::init($data); - } - - /** - * Attempt to instantiate and hydrate a new instance of this class - */ - public static function init(array $data): TemplateUpdateRequest - { - /** @var TemplateUpdateRequest */ - return ObjectSerializer::deserialize( - $data, - TemplateUpdateRequest::class, - ); - } - - /** - * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName - * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the - * $this->openAPINullablesSetToNull array - * - * @param string|int|object|array|mixed $defaultValue - */ - private function setIfExists(string $variableName, array $fields, $defaultValue): void - { - if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { - $this->openAPINullablesSetToNull[] = $variableName; - } - - $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; - } - - /** - * Show all the invalid properties with reasons. - * - * @return array invalid properties with reasons - */ - public function listInvalidProperties() - { - $invalidProperties = []; - - if (!is_null($this->container['subject']) && (mb_strlen($this->container['subject']) > 200)) { - $invalidProperties[] = "invalid value for 'subject', the character length must be smaller than or equal to 200."; - } - - if (!is_null($this->container['message']) && (mb_strlen($this->container['message']) > 5000)) { - $invalidProperties[] = "invalid value for 'message', the character length must be smaller than or equal to 5000."; - } - - return $invalidProperties; - } - - /** - * Validate all the properties in the model - * return true if all passed - * - * @return bool True if all properties are valid - */ - public function valid() - { - return count($this->listInvalidProperties()) === 0; - } - - /** - * Gets cc_roles - * - * @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 title - * - * @return string|null - */ - public function getTitle() - { - return $this->container['title']; - } - - /** - * Sets title - * - * @param string|null $title the title you want to assign to the SignatureRequest - * - * @return self - */ - public function setTitle(?string $title) - { - if (is_null($title)) { - throw new InvalidArgumentException('non-nullable title cannot be null'); - } - $this->container['title'] = $title; - - return $this; - } - - /** - * Gets subject - * - * @return string|null - */ - public function getSubject() - { - return $this->container['subject']; - } - - /** - * Sets subject - * - * @param string|null $subject the new default template email subject - * - * @return self - */ - public function setSubject(?string $subject) - { - if (is_null($subject)) { - throw new InvalidArgumentException('non-nullable subject cannot be null'); - } - if (mb_strlen($subject) > 200) { - throw new InvalidArgumentException('invalid length for $subject when calling TemplateUpdateRequest., must be smaller than or equal to 200.'); - } - - $this->container['subject'] = $subject; - - return $this; - } - - /** - * Gets message - * - * @return string|null - */ - public function getMessage() - { - return $this->container['message']; - } - - /** - * Sets message - * - * @param string|null $message the new default template email message - * - * @return self - */ - public function setMessage(?string $message) - { - if (is_null($message)) { - throw new InvalidArgumentException('non-nullable message cannot be null'); - } - if (mb_strlen($message) > 5000) { - throw new InvalidArgumentException('invalid length for $message when calling TemplateUpdateRequest., must be smaller than or equal to 5000.'); - } - - $this->container['message'] = $message; - - return $this; - } - - /** - * Gets form_fields - * - * @return SubUpdateFormField[]|null - */ - public function getFormFields() - { - return $this->container['form_fields']; - } - - /** - * Sets form_fields - * - * @param SubUpdateFormField[]|null $form_fields A list of document form fields to update. The endpoint will not create or remove any fields. Every field must be identified by `api_id`, and the only supported change is renaming the field. - * - * @return self - */ - public function setFormFields(?array $form_fields) - { - if (is_null($form_fields)) { - throw new InvalidArgumentException('non-nullable form_fields cannot be null'); - } - $this->container['form_fields'] = $form_fields; - - return $this; - } - - /** - * Returns true if offset exists. False otherwise. - * - * @param int $offset Offset - */ - #[ReturnTypeWillChange] - public function offsetExists($offset): bool - { - return isset($this->container[$offset]); - } - - /** - * Gets offset. - * - * @param int $offset Offset - * - * @return mixed|null - */ - #[ReturnTypeWillChange] - public function offsetGet($offset) - { - return $this->container[$offset] ?? null; - } - - /** - * Sets value based on offset. - * - * @param int|null $offset Offset - * @param mixed $value Value to be set - */ - #[ReturnTypeWillChange] - public function offsetSet($offset, $value): void - { - if (is_null($offset)) { - $this->container[] = $value; - } else { - $this->container[$offset] = $value; - } - } - - /** - * Unsets offset. - * - * @param int $offset Offset - */ - #[ReturnTypeWillChange] - public function offsetUnset($offset): void - { - unset($this->container[$offset]); - } - - /** - * Serializes the object to a value that can be serialized natively by json_encode(). - * @see https://www.php.net/manual/en/jsonserializable.jsonserialize.php - * - * @return mixed returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource - */ - #[ReturnTypeWillChange] - public function jsonSerialize() - { - return ObjectSerializer::sanitizeForSerialization($this); - } - - /** - * Gets the string presentation of the object - * - * @return string - */ - public function __toString() - { - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_UNESCAPED_SLASHES - ); - } - - /** - * Gets a header-safe presentation of the object - * - * @return string - */ - public function toHeaderValue() - { - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } -} diff --git a/sdks/python/README.md b/sdks/python/README.md index d9a3c0faf..40055084a 100644 --- a/sdks/python/README.md +++ b/sdks/python/README.md @@ -171,7 +171,6 @@ Class | Method | HTTP request | Description ```TemplateApi``` | [```template_get```](docs/TemplateApi.md#template_get) | ```GET /template/{template_id}``` | Get Template| ```TemplateApi``` | [```template_list```](docs/TemplateApi.md#template_list) | ```GET /template/list``` | List Templates| ```TemplateApi``` | [```template_remove_user```](docs/TemplateApi.md#template_remove_user) | ```POST /template/remove_user/{template_id}``` | Remove User from Template| -```TemplateApi``` | [```template_update```](docs/TemplateApi.md#template_update) | ```POST /template/update/{template_id}``` | Update Template| ```TemplateApi``` | [```template_update_files```](docs/TemplateApi.md#template_update_files) | ```POST /template/update_files/{template_id}``` | Update Template Files| |```UnclaimedDraftApi``` | [```unclaimed_draft_create```](docs/UnclaimedDraftApi.md#unclaimed_draft_create) | ```POST /unclaimed_draft/create``` | Create Unclaimed Draft| ```UnclaimedDraftApi``` | [```unclaimed_draft_create_embedded```](docs/UnclaimedDraftApi.md#unclaimed_draft_create_embedded) | ```POST /unclaimed_draft/create_embedded``` | Create Embedded Unclaimed Draft| @@ -367,7 +366,6 @@ Class | Method | HTTP request | Description - [TemplateUpdateFilesRequest](docs/TemplateUpdateFilesRequest.md) - [TemplateUpdateFilesResponse](docs/TemplateUpdateFilesResponse.md) - [TemplateUpdateFilesResponseTemplate](docs/TemplateUpdateFilesResponseTemplate.md) - - [TemplateUpdateRequest](docs/TemplateUpdateRequest.md) - [UnclaimedDraftCreateEmbeddedRequest](docs/UnclaimedDraftCreateEmbeddedRequest.md) - [UnclaimedDraftCreateEmbeddedWithTemplateRequest](docs/UnclaimedDraftCreateEmbeddedWithTemplateRequest.md) - [UnclaimedDraftCreateRequest](docs/UnclaimedDraftCreateRequest.md) diff --git a/sdks/python/docs/TemplateApi.md b/sdks/python/docs/TemplateApi.md index eb5674ad8..23d16d10b 100644 --- a/sdks/python/docs/TemplateApi.md +++ b/sdks/python/docs/TemplateApi.md @@ -14,7 +14,6 @@ Method | HTTP request | Description |[```template_get```](TemplateApi.md#template_get) | ```GET /template/{template_id}``` | Get Template| |[```template_list```](TemplateApi.md#template_list) | ```GET /template/list``` | List Templates| |[```template_remove_user```](TemplateApi.md#template_remove_user) | ```POST /template/remove_user/{template_id}``` | Remove User from Template| -|[```template_update```](TemplateApi.md#template_update) | ```POST /template/update/{template_id}``` | Update Template| |[```template_update_files```](TemplateApi.md#template_update_files) | ```POST /template/update_files/{template_id}``` | Update Template Files| @@ -828,98 +827,6 @@ with ApiClient(configuration) as api_client: [[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_update``` -> ```TemplateGetResponse template_update(template_id, template_update_request)``` - -Update Template - -Update template fields. Every field is optional and the endpoint will only change whatever is provided. The fields not included in the request payload will remain unchanged. - -### 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: - form_fields_1 = models.SubUpdateFormField( - api_id="uniqueIdHere_1", - name="New name 1", - ) - - form_fields_2 = models.SubUpdateFormField( - api_id="uniqueIdHere_2", - name="New name 2", - ) - - form_fields = [ - form_fields_1, - form_fields_2, - ] - - template_update_request = models.TemplateUpdateRequest( - title="Test Title", - subject="Test Subject", - message="Test Message", - cc_roles=[ - "CC Role 1", - "CC Role 2", - ], - form_fields=form_fields, - ) - - try: - response = api.TemplateApi(api_client).template_update( - template_id="f57db65d3f933b5316d398057a36176831451a35", - template_update_request=template_update_request, - ) - - pprint(response) - except ApiException as e: - print("Exception when calling TemplateApi#template_update: %s\n" % e) - -``` -``` - -### Parameters -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | -| `template_id` | **str** | The ID of the template to update. | | -| `template_update_request` | [**TemplateUpdateRequest**](TemplateUpdateRequest.md) | | | - -### Return type - -[**TemplateGetResponse**](TemplateGetResponse.md) - -### Authorization - -[api_key](../README.md#api_key), [oauth2](../README.md#oauth2) - -### HTTP request headers - - - **Content-Type**: application/json, multipart/form-data - - **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_update_files``` > ```TemplateUpdateFilesResponse template_update_files(template_id, template_update_files_request)``` diff --git a/sdks/python/docs/TemplateUpdateRequest.md b/sdks/python/docs/TemplateUpdateRequest.md deleted file mode 100644 index c5c6d6f99..000000000 --- a/sdks/python/docs/TemplateUpdateRequest.md +++ /dev/null @@ -1,16 +0,0 @@ -# TemplateUpdateRequest - - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -| `cc_roles` | ```List[str]``` | The CC roles that must be assigned when using the template to send a signature request. | | -| `title` | ```str``` | The title you want to assign to the SignatureRequest. | | -| `subject` | ```str``` | The new default template email subject. | | -| `message` | ```str``` | The new default template email message. | | -| `form_fields` | [```List[SubUpdateFormField]```](SubUpdateFormField.md) | A list of document form fields to update. The endpoint will not create or remove any fields. Every field must be identified by `api_id`, and the only supported change is renaming the field. | | - -[[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 7331d409c..8d35721ba 100644 --- a/sdks/python/dropbox_sign/__init__.py +++ b/sdks/python/dropbox_sign/__init__.py @@ -397,7 +397,6 @@ from dropbox_sign.models.template_update_files_response_template import ( TemplateUpdateFilesResponseTemplate, ) -from dropbox_sign.models.template_update_request import TemplateUpdateRequest from dropbox_sign.models.unclaimed_draft_create_embedded_request import ( UnclaimedDraftCreateEmbeddedRequest, ) diff --git a/sdks/python/dropbox_sign/api/template_api.py b/sdks/python/dropbox_sign/api/template_api.py index 2140cd502..723488921 100644 --- a/sdks/python/dropbox_sign/api/template_api.py +++ b/sdks/python/dropbox_sign/api/template_api.py @@ -38,7 +38,6 @@ from dropbox_sign.models.template_update_files_response import ( TemplateUpdateFilesResponse, ) -from dropbox_sign.models.template_update_request import TemplateUpdateRequest from dropbox_sign.api_client import ApiClient, RequestSerialized from dropbox_sign.api_response import ApiResponse @@ -2897,304 +2896,6 @@ def _template_remove_user_serialize( _request_auth=_request_auth, ) - @validate_call - def template_update( - self, - template_id: Annotated[ - StrictStr, Field(description="The ID of the template to update.") - ], - template_update_request: TemplateUpdateRequest, - _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: - """Update Template - - Update template fields. Every field is optional and the endpoint will only change whatever is provided. The fields not included in the request payload will remain unchanged. - - :param template_id: The ID of the template to update. (required) - :type template_id: str - :param template_update_request: (required) - :type template_update_request: TemplateUpdateRequest - :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_update_serialize( - template_id=template_id, - template_update_request=template_update_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_update_with_http_info( - self, - template_id: Annotated[ - StrictStr, Field(description="The ID of the template to update.") - ], - template_update_request: TemplateUpdateRequest, - _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]: - """Update Template - - Update template fields. Every field is optional and the endpoint will only change whatever is provided. The fields not included in the request payload will remain unchanged. - - :param template_id: The ID of the template to update. (required) - :type template_id: str - :param template_update_request: (required) - :type template_update_request: TemplateUpdateRequest - :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_update_serialize( - template_id=template_id, - template_update_request=template_update_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_update_without_preload_content( - self, - template_id: Annotated[ - StrictStr, Field(description="The ID of the template to update.") - ], - template_update_request: TemplateUpdateRequest, - _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: - """Update Template - - Update template fields. Every field is optional and the endpoint will only change whatever is provided. The fields not included in the request payload will remain unchanged. - - :param template_id: The ID of the template to update. (required) - :type template_id: str - :param template_update_request: (required) - :type template_update_request: TemplateUpdateRequest - :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_update_serialize( - template_id=template_id, - template_update_request=template_update_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_update_serialize( - self, - template_id, - template_update_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_update_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_update_request is not None and has_files is False: - _body_params = template_update_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", "multipart/form-data"] - ) - 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/update/{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_update_files( self, diff --git a/sdks/python/dropbox_sign/models/__init__.py b/sdks/python/dropbox_sign/models/__init__.py index e7fdb2e48..58571d591 100644 --- a/sdks/python/dropbox_sign/models/__init__.py +++ b/sdks/python/dropbox_sign/models/__init__.py @@ -380,7 +380,6 @@ from dropbox_sign.models.template_update_files_response_template import ( TemplateUpdateFilesResponseTemplate, ) -from dropbox_sign.models.template_update_request import TemplateUpdateRequest from dropbox_sign.models.unclaimed_draft_create_embedded_request import ( UnclaimedDraftCreateEmbeddedRequest, ) diff --git a/sdks/python/dropbox_sign/models/template_update_request.py b/sdks/python/dropbox_sign/models/template_update_request.py deleted file mode 100644 index 792809de0..000000000 --- a/sdks/python/dropbox_sign/models/template_update_request.py +++ /dev/null @@ -1,173 +0,0 @@ -# coding: utf-8 - -""" -Dropbox Sign API - -Dropbox Sign v3 API - -The version of the OpenAPI document: 3.0.0 -Contact: apisupport@hellosign.com -Generated by OpenAPI Generator (https://openapi-generator.tech) - -Do not edit the class manually. -""" # noqa: E501 - -from __future__ import annotations -import pprint -import re # noqa: F401 -import json - -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, List, Optional -from typing_extensions import Annotated -from dropbox_sign.models.sub_update_form_field import SubUpdateFormField -from typing import Optional, Set -from typing_extensions import Self -from typing import Tuple, Union -import io -from pydantic import StrictBool - - -class TemplateUpdateRequest(BaseModel): - """ - TemplateUpdateRequest - """ # noqa: E501 - - 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.", - ) - title: Optional[StrictStr] = Field( - default=None, - description="The title you want to assign to the SignatureRequest.", - ) - subject: Optional[Annotated[str, Field(strict=True, max_length=200)]] = Field( - default=None, description="The new default template email subject." - ) - message: Optional[Annotated[str, Field(strict=True, max_length=5000)]] = Field( - default=None, description="The new default template email message." - ) - form_fields: Optional[List[SubUpdateFormField]] = Field( - default=None, - description="A list of document form fields to update. The endpoint will not create or remove any fields. Every field must be identified by `api_id`, and the only supported change is renaming the field.", - ) - __properties: ClassVar[List[str]] = [ - "cc_roles", - "title", - "subject", - "message", - "form_fields", - ] - - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - arbitrary_types_allowed=True, - ) - - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - def to_json_form_params( - self, excluded_fields: Set[str] = None - ) -> List[Tuple[str, str]]: - data: List[Tuple[str, str]] = [] - - for key, value in self.to_dict(excluded_fields).items(): - if isinstance(value, (int, str, bool)): - data.append((key, value)) - else: - data.append((key, json.dumps(value, ensure_ascii=False))) - - return data - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of TemplateUpdateRequest from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self, excluded_fields: Set[str] = None) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of each item in form_fields (list) - _items = [] - if self.form_fields: - for _item_form_fields in self.form_fields: - if _item_form_fields: - _items.append(_item_form_fields.to_dict()) - _dict["form_fields"] = _items - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of TemplateUpdateRequest from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate( - { - "cc_roles": obj.get("cc_roles"), - "title": obj.get("title"), - "subject": obj.get("subject"), - "message": obj.get("message"), - "form_fields": ( - [ - SubUpdateFormField.from_dict(_item) - for _item in obj["form_fields"] - ] - if obj.get("form_fields") is not None - else None - ), - } - ) - return _obj - - @classmethod - def init(cls, data: Any) -> Self: - """ - Attempt to instantiate and hydrate a new instance of this class - """ - if isinstance(data, str): - data = json.loads(data) - - return cls.from_dict(data) - - @classmethod - def openapi_types(cls) -> Dict[str, str]: - return { - "cc_roles": "(List[str],)", - "title": "(str,)", - "subject": "(str,)", - "message": "(str,)", - "form_fields": "(List[SubUpdateFormField],)", - } - - @classmethod - def openapi_type_is_array(cls, property_name: str) -> bool: - return property_name in [ - "cc_roles", - "form_fields", - ] diff --git a/sdks/ruby/README.md b/sdks/ruby/README.md index e925ed63a..4c46f0bd0 100644 --- a/sdks/ruby/README.md +++ b/sdks/ruby/README.md @@ -175,7 +175,6 @@ All URIs are relative to *https://api.hellosign.com/v3* |*Dropbox::Sign::TemplateApi* | [**template_get**](docs/TemplateApi.md#template_get) | **GET** /template/{template_id} | Get Template | |*Dropbox::Sign::TemplateApi* | [**template_list**](docs/TemplateApi.md#template_list) | **GET** /template/list | List Templates | |*Dropbox::Sign::TemplateApi* | [**template_remove_user**](docs/TemplateApi.md#template_remove_user) | **POST** /template/remove_user/{template_id} | Remove User from Template | -|*Dropbox::Sign::TemplateApi* | [**template_update**](docs/TemplateApi.md#template_update) | **POST** /template/update/{template_id} | Update Template | |*Dropbox::Sign::TemplateApi* | [**template_update_files**](docs/TemplateApi.md#template_update_files) | **POST** /template/update_files/{template_id} | Update Template Files | |*Dropbox::Sign::UnclaimedDraftApi* | [**unclaimed_draft_create**](docs/UnclaimedDraftApi.md#unclaimed_draft_create) | **POST** /unclaimed_draft/create | Create Unclaimed Draft | |*Dropbox::Sign::UnclaimedDraftApi* | [**unclaimed_draft_create_embedded**](docs/UnclaimedDraftApi.md#unclaimed_draft_create_embedded) | **POST** /unclaimed_draft/create_embedded | Create Embedded Unclaimed Draft | @@ -371,7 +370,6 @@ All URIs are relative to *https://api.hellosign.com/v3* - [Dropbox::Sign::TemplateUpdateFilesRequest](docs/TemplateUpdateFilesRequest.md) - [Dropbox::Sign::TemplateUpdateFilesResponse](docs/TemplateUpdateFilesResponse.md) - [Dropbox::Sign::TemplateUpdateFilesResponseTemplate](docs/TemplateUpdateFilesResponseTemplate.md) - - [Dropbox::Sign::TemplateUpdateRequest](docs/TemplateUpdateRequest.md) - [Dropbox::Sign::UnclaimedDraftCreateEmbeddedRequest](docs/UnclaimedDraftCreateEmbeddedRequest.md) - [Dropbox::Sign::UnclaimedDraftCreateEmbeddedWithTemplateRequest](docs/UnclaimedDraftCreateEmbeddedWithTemplateRequest.md) - [Dropbox::Sign::UnclaimedDraftCreateRequest](docs/UnclaimedDraftCreateRequest.md) diff --git a/sdks/ruby/docs/TemplateApi.md b/sdks/ruby/docs/TemplateApi.md index 6bb339197..ffd6ec0ea 100644 --- a/sdks/ruby/docs/TemplateApi.md +++ b/sdks/ruby/docs/TemplateApi.md @@ -14,7 +14,6 @@ All URIs are relative to *https://api.hellosign.com/v3* | [`template_get`](TemplateApi.md#template_get) | **GET** `/template/{template_id}` | Get Template | | [`template_list`](TemplateApi.md#template_list) | **GET** `/template/list` | List Templates | | [`template_remove_user`](TemplateApi.md#template_remove_user) | **POST** `/template/remove_user/{template_id}` | Remove User from Template | -| [`template_update`](TemplateApi.md#template_update) | **POST** `/template/update/{template_id}` | Update Template | | [`template_update_files`](TemplateApi.md#template_update_files) | **POST** `/template/update_files/{template_id}` | Update Template Files | @@ -853,100 +852,6 @@ end - **Accept**: application/json -## `template_update` - -> ` template_update(template_id, template_update_request)` - -Update Template - -Update template fields. Every field is optional and the endpoint will only change whatever is provided. The fields not included in the request payload will remain unchanged. - -### Examples - -```ruby -require "json" -require "dropbox-sign" - -Dropbox::Sign.configure do |config| - config.username = "YOUR_API_KEY" - # config.access_token = "YOUR_ACCESS_TOKEN" -end - -form_fields_1 = Dropbox::Sign::SubUpdateFormField.new -form_fields_1.api_id = "uniqueIdHere_1" -form_fields_1.name = "New name 1" - -form_fields_2 = Dropbox::Sign::SubUpdateFormField.new -form_fields_2.api_id = "uniqueIdHere_2" -form_fields_2.name = "New name 2" - -form_fields = [ - form_fields_1, - form_fields_2, -] - -template_update_request = Dropbox::Sign::TemplateUpdateRequest.new -template_update_request.title = "Test Title" -template_update_request.subject = "Test Subject" -template_update_request.message = "Test Message" -template_update_request.cc_roles = [ - "CC Role 1", - "CC Role 2", -] -template_update_request.form_fields = form_fields - -begin - response = Dropbox::Sign::TemplateApi.new.template_update( - "f57db65d3f933b5316d398057a36176831451a35", # template_id - template_update_request, - ) - - p response -rescue Dropbox::Sign::ApiError => e - puts "Exception when calling TemplateApi#template_update: #{e}" -end - -``` - -#### Using the `template_update_with_http_info` variant - -This returns an Array which contains the response data, status code and headers. - -> `, Integer, Hash)> template_update_with_http_info(template_id, template_update_request)` - -```ruby -begin - # Update Template - data, status_code, headers = api_instance.template_update_with_http_info(template_id, template_update_request) - p status_code # => 2xx - p headers # => { ... } - p data # => -rescue Dropbox::Sign::ApiError => e - puts "Error when calling TemplateApi->template_update_with_http_info: #{e}" -end -``` - -### Parameters - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | -| `template_id` | **String** | The ID of the template to update. | | -| `template_update_request` | [**TemplateUpdateRequest**](TemplateUpdateRequest.md) | | | - -### Return type - -[**TemplateGetResponse**](TemplateGetResponse.md) - -### Authorization - -[api_key](../README.md#api_key), [oauth2](../README.md#oauth2) - -### HTTP request headers - -- **Content-Type**: application/json, multipart/form-data -- **Accept**: application/json - - ## `template_update_files` > ` template_update_files(template_id, template_update_files_request)` diff --git a/sdks/ruby/docs/TemplateUpdateRequest.md b/sdks/ruby/docs/TemplateUpdateRequest.md deleted file mode 100644 index 68e226abd..000000000 --- a/sdks/ruby/docs/TemplateUpdateRequest.md +++ /dev/null @@ -1,14 +0,0 @@ -# Dropbox::Sign::TemplateUpdateRequest - - - -## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | -| `cc_roles` | ```Array``` | The CC roles that must be assigned when using the template to send a signature request. | | -| `title` | ```String``` | The title you want to assign to the SignatureRequest. | | -| `subject` | ```String``` | The new default template email subject. | | -| `message` | ```String``` | The new default template email message. | | -| `form_fields` | [```Array```](SubUpdateFormField.md) | A list of document form fields to update. The endpoint will not create or remove any fields. Every field must be identified by `api_id`, and the only supported change is renaming the field. | | - diff --git a/sdks/ruby/lib/dropbox-sign.rb b/sdks/ruby/lib/dropbox-sign.rb index 729ebf6c1..fb45147a0 100644 --- a/sdks/ruby/lib/dropbox-sign.rb +++ b/sdks/ruby/lib/dropbox-sign.rb @@ -164,7 +164,6 @@ require 'dropbox-sign/models/template_update_files_request' require 'dropbox-sign/models/template_update_files_response' require 'dropbox-sign/models/template_update_files_response_template' -require 'dropbox-sign/models/template_update_request' require 'dropbox-sign/models/unclaimed_draft_create_embedded_request' require 'dropbox-sign/models/unclaimed_draft_create_embedded_with_template_request' require 'dropbox-sign/models/unclaimed_draft_create_request' diff --git a/sdks/ruby/lib/dropbox-sign/api/template_api.rb b/sdks/ruby/lib/dropbox-sign/api/template_api.rb index dcc0a4d5f..c43bf9e06 100644 --- a/sdks/ruby/lib/dropbox-sign/api/template_api.rb +++ b/sdks/ruby/lib/dropbox-sign/api/template_api.rb @@ -1031,121 +1031,6 @@ def template_remove_user_with_http_info(template_id, template_remove_user_reques return data, status_code, headers end - # Update Template - # Update template fields. Every field is optional and the endpoint will only change whatever is provided. The fields not included in the request payload will remain unchanged. - # @param template_id [String] The ID of the template to update. - # @param template_update_request [TemplateUpdateRequest] - # @param [Hash] opts the optional parameters - # @return [TemplateGetResponse] - def template_update(template_id, template_update_request, opts = {}) - data, _status_code, _headers = template_update_with_http_info(template_id, template_update_request, opts) - data - end - - # Update Template - # Update template fields. Every field is optional and the endpoint will only change whatever is provided. The fields not included in the request payload will remain unchanged. - # @param template_id [String] The ID of the template to update. - # @param template_update_request [TemplateUpdateRequest] - # @param [Hash] opts the optional parameters - # @return [Array<(TemplateGetResponse, Integer, Hash)>] TemplateGetResponse data, response status code and response headers - def template_update_with_http_info(template_id, template_update_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: TemplateApi.template_update ...' - 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_update" - end - # verify the required parameter 'template_update_request' is set - if @api_client.config.client_side_validation && template_update_request.nil? - fail ArgumentError, "Missing the required parameter 'template_update_request' when calling TemplateApi.template_update" - end - # resource path - local_var_path = '/template/update/{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', 'multipart/form-data']) - 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_update_request, - Dropbox::Sign::TemplateUpdateRequest.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_update", - :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_update\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - # Update Template Files # Overlays a new file with the overlay of an existing template. The new file(s) must: 1. have the same or higher page count 2. the same orientation as the file(s) being replaced. This will not overwrite or in any way affect the existing template. Both the existing template and new template will be available for use after executing this endpoint. Also note that this will decrement your template quota. Overlaying new files is asynchronous and a successful call to this endpoint will return 200 OK response if the request passes initial validation checks. It is recommended that a callback be implemented to listen for the callback event. A `template_created` event will be sent when the files are updated or a `template_error` event will be sent if there was a problem while updating the files. If a callback handler has been configured and the event has not been received within 60 minutes of making the call, check the status of the request in the API dashboard and retry the request if necessary. If the page orientation or page count is different from the original template document, we will notify you with a `template_error` [callback event](https://app.hellosign.com/api/eventsAndCallbacksWalkthrough). # @param template_id [String] The ID of the template whose files to update. diff --git a/sdks/ruby/lib/dropbox-sign/models/template_update_request.rb b/sdks/ruby/lib/dropbox-sign/models/template_update_request.rb deleted file mode 100644 index 6deaff8a9..000000000 --- a/sdks/ruby/lib/dropbox-sign/models/template_update_request.rb +++ /dev/null @@ -1,330 +0,0 @@ -=begin -#Dropbox Sign API - -#Dropbox Sign v3 API - -The version of the OpenAPI document: 3.0.0 -Contact: apisupport@hellosign.com -Generated by: https://openapi-generator.tech -Generator version: 7.12.0 - -=end - -require 'date' -require 'time' - -module Dropbox -end - -module Dropbox::Sign - class TemplateUpdateRequest - # The CC roles that must be assigned when using the template to send a signature request. - # @return [Array] - attr_accessor :cc_roles - - # The title you want to assign to the SignatureRequest. - # @return [String] - attr_accessor :title - - # The new default template email subject. - # @return [String] - attr_accessor :subject - - # The new default template email message. - # @return [String] - attr_accessor :message - - # A list of document form fields to update. The endpoint will not create or remove any fields. Every field must be identified by `api_id`, and the only supported change is renaming the field. - # @return [Array] - attr_accessor :form_fields - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'cc_roles' => :'cc_roles', - :'title' => :'title', - :'subject' => :'subject', - :'message' => :'message', - :'form_fields' => :'form_fields' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'cc_roles' => :'Array', - :'title' => :'String', - :'subject' => :'String', - :'message' => :'String', - :'form_fields' => :'Array' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Returns attribute map of this model + parent - def self.merged_attributes - self.attribute_map - end - - # Attribute type mapping of this model + parent - def self.merged_types - self.openapi_types - end - - # Returns list of attributes with nullable: true of this model + parent - def self.merged_nullable - self.openapi_nullable - end - - # Attempt to instantiate and hydrate a new instance of this class - # @param [Object] data Data to be converted - # @return [TemplateUpdateRequest] - def self.init(data) - ApiClient.default.convert_to_type( - data, - "TemplateUpdateRequest" - ) || TemplateUpdateRequest.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::TemplateUpdateRequest` 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::TemplateUpdateRequest`. 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?(:'cc_roles') - if (value = attributes[:'cc_roles']).is_a?(Array) - self.cc_roles = value - end - end - - if attributes.key?(:'title') - self.title = attributes[:'title'] - end - - if attributes.key?(:'subject') - self.subject = attributes[:'subject'] - end - - if attributes.key?(:'message') - self.message = attributes[:'message'] - end - - if attributes.key?(:'form_fields') - if (value = attributes[:'form_fields']).is_a?(Array) - self.form_fields = value - end - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if !@subject.nil? && @subject.to_s.length > 200 - invalid_properties.push('invalid value for "subject", the character length must be smaller than or equal to 200.') - end - - if !@message.nil? && @message.to_s.length > 5000 - invalid_properties.push('invalid value for "message", the character length must be smaller than or equal to 5000.') - 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 !@subject.nil? && @subject.to_s.length > 200 - return false if !@message.nil? && @message.to_s.length > 5000 - true - end - - # Custom attribute writer method with validation - # @param [Object] subject Value to be assigned - def subject=(subject) - if subject.to_s.length > 200 - fail ArgumentError, 'invalid value for "subject", the character length must be smaller than or equal to 200.' - end - - @subject = subject - end - - # Custom attribute writer method with validation - # @param [Object] message Value to be assigned - def message=(message) - if message.to_s.length > 5000 - fail ArgumentError, 'invalid value for "message", the character length must be smaller than or equal to 5000.' - end - - @message = message - 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 && - cc_roles == o.cc_roles && - title == o.title && - subject == o.subject && - message == o.message && - form_fields == o.form_fields - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [cc_roles, title, subject, message, form_fields].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attribute_map = self.class.merged_attributes - - self.class.merged_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - klass = Dropbox::Sign.const_get(type) - klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash(include_nil = true) - hash = {} - self.class.merged_attributes.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - next unless include_nil - is_nullable = self.class.merged_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value, include_nil) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value, include_nil = true) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v, include_nil) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v, include_nil) } - end - elsif value.respond_to? :to_hash - value.to_hash(include_nil) - else - value - end - end - end -end