diff --git a/examples/DocumentDetectFieldsExample.cs b/examples/DocumentDetectFieldsExample.cs new file mode 100644 index 000000000..71b27eac3 --- /dev/null +++ b/examples/DocumentDetectFieldsExample.cs @@ -0,0 +1,44 @@ +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 DocumentDetectFieldsExample +{ + public static void Run() + { + var config = new Configuration(); + config.Username = "YOUR_API_KEY"; + // config.AccessToken = "YOUR_ACCESS_TOKEN"; + + var documentFieldDetectionRequest = new DocumentFieldDetectionRequest( + detectionMode: "annotations", + file: new FileStream( + path: "./example_document.pdf", + mode: FileMode.Open + ), + pageRange: "all" + ); + + try + { + var response = new DocumentApi(config).DocumentDetectFields( + documentFieldDetectionRequest: documentFieldDetectionRequest + ); + + Console.WriteLine(response); + } + catch (ApiException e) + { + Console.WriteLine("Exception when calling DocumentApi#DocumentDetectFields: " + e.Message); + Console.WriteLine("Status Code: " + e.ErrorCode); + Console.WriteLine(e.StackTrace); + } + } +} diff --git a/examples/DocumentDetectFieldsExample.java b/examples/DocumentDetectFieldsExample.java new file mode 100644 index 000000000..ab017fddc --- /dev/null +++ b/examples/DocumentDetectFieldsExample.java @@ -0,0 +1,46 @@ +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 DocumentDetectFieldsExample +{ + 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 documentFieldDetectionRequest = new DocumentFieldDetectionRequest(); + documentFieldDetectionRequest.detectionMode("annotations"); + documentFieldDetectionRequest._file(new File("./example_document.pdf")); + documentFieldDetectionRequest.pageRange("all"); + + try + { + var response = new DocumentApi(config).documentDetectFields( + documentFieldDetectionRequest + ); + + System.out.println(response); + } catch (ApiException e) { + System.err.println("Exception when calling DocumentApi#documentDetectFields"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} diff --git a/examples/DocumentDetectFieldsExample.php b/examples/DocumentDetectFieldsExample.php new file mode 100644 index 000000000..301cee10a --- /dev/null +++ b/examples/DocumentDetectFieldsExample.php @@ -0,0 +1,27 @@ +setUsername("YOUR_API_KEY"); +// $config->setAccessToken("YOUR_ACCESS_TOKEN"); + +$document_field_detection_request = (new Dropbox\Sign\Model\DocumentFieldDetectionRequest()) + ->setDetectionMode("annotations") + ->setFile(new SplFileObject("./example_document.pdf")) + ->setPageRange("all"); + +try { + $response = (new Dropbox\Sign\Api\DocumentApi(config: $config))->documentDetectFields( + document_field_detection_request: $document_field_detection_request, + ); + + print_r($response); +} catch (Dropbox\Sign\ApiException $e) { + echo "Exception when calling DocumentApi#documentDetectFields: {$e->getMessage()}"; +} diff --git a/examples/DocumentDetectFieldsExample.py b/examples/DocumentDetectFieldsExample.py new file mode 100644 index 000000000..eca19a246 --- /dev/null +++ b/examples/DocumentDetectFieldsExample.py @@ -0,0 +1,26 @@ +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: + document_field_detection_request = models.DocumentFieldDetectionRequest( + detection_mode="annotations", + file=open("./example_document.pdf", "rb").read(), + page_range="all", + ) + + try: + response = api.DocumentApi(api_client).document_detect_fields( + document_field_detection_request=document_field_detection_request, + ) + + pprint(response) + except ApiException as e: + print("Exception when calling DocumentApi#document_detect_fields: %s\n" % e) diff --git a/examples/DocumentDetectFieldsExample.rb b/examples/DocumentDetectFieldsExample.rb new file mode 100644 index 000000000..e224eb789 --- /dev/null +++ b/examples/DocumentDetectFieldsExample.rb @@ -0,0 +1,22 @@ +require "json" +require "dropbox-sign" + +Dropbox::Sign.configure do |config| + config.username = "YOUR_API_KEY" + # config.access_token = "YOUR_ACCESS_TOKEN" +end + +document_field_detection_request = Dropbox::Sign::DocumentFieldDetectionRequest.new +document_field_detection_request.detection_mode = "annotations" +document_field_detection_request.file = File.new("./example_document.pdf", "r") +document_field_detection_request.page_range = "all" + +begin + response = Dropbox::Sign::DocumentApi.new.document_detect_fields( + document_field_detection_request, + ) + + p response +rescue Dropbox::Sign::ApiError => e + puts "Exception when calling DocumentApi#document_detect_fields: #{e}" +end diff --git a/examples/DocumentDetectFieldsExample.sh b/examples/DocumentDetectFieldsExample.sh new file mode 100644 index 000000000..c9f85464e --- /dev/null +++ b/examples/DocumentDetectFieldsExample.sh @@ -0,0 +1,5 @@ +curl -X POST 'https://api.hellosign.com/v3/document/detect_fields' \ + -u 'YOUR_API_KEY:' \ + -F 'file=@example_document.pdf' \ + -F 'detection_mode=annotations' \ + -F 'page_range=all' diff --git a/examples/DocumentDetectFieldsExample.ts b/examples/DocumentDetectFieldsExample.ts new file mode 100644 index 000000000..65116d93b --- /dev/null +++ b/examples/DocumentDetectFieldsExample.ts @@ -0,0 +1,22 @@ +import * as fs from 'fs'; +import api from "@dropbox/sign" +import models from "@dropbox/sign" + +const apiCaller = new api.DocumentApi(); +apiCaller.username = "YOUR_API_KEY"; +// apiCaller.accessToken = "YOUR_ACCESS_TOKEN"; + +const documentFieldDetectionRequest: models.DocumentFieldDetectionRequest = { + detectionMode: "annotations", + file: fs.createReadStream("./example_document.pdf"), + pageRange: "all", +}; + +apiCaller.documentDetectFields( + documentFieldDetectionRequest, +).then(response => { + console.log(response.body); +}).catch(error => { + console.log("Exception when calling DocumentApi#documentDetectFields:"); + console.log(error.body); +}); diff --git a/openapi-fern.yaml b/openapi-fern.yaml index 304269c37..7f68a6004 100644 --- a/openapi-fern.yaml +++ b/openapi-fern.yaml @@ -3081,6 +3081,280 @@ paths: seo: title: List Bulk Send Jobs | Documentation | Dropbox Sign for Developers description: 'The Dropbox Sign API allows you to build custom integrations. To find out how to return a list of BulkSendJob that you can access, click here.' + /document/detect_fields: + post: + tags: + - Document + summary: Detect Document Fields + description: Detects form fields in a PDF document using either PDF form annotations or Dropbox Sign text tags. + operationId: documentDetectFields + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/DocumentFieldDetectionRequest' + multipart/form-data: + schema: + $ref: '#/components/schemas/DocumentFieldDetectionRequest' + 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/DocumentFieldDetectionResponse' + 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' + 422_example: + $ref: '#/components/examples/Error422Response' + 4XX_example: + $ref: '#/components/examples/Error4XXResponse' + security: + - api_key: [] + - oauth2: + - request_signature + - signature_request_access + x-codeSamples: + - lang: PHP + label: PHP + source: | + setUsername("YOUR_API_KEY"); + // $config->setAccessToken("YOUR_ACCESS_TOKEN"); + + $document_field_detection_request = (new Dropbox\Sign\Model\DocumentFieldDetectionRequest()) + ->setDetectionMode("annotations") + ->setFile(new SplFileObject("./example_document.pdf")) + ->setPageRange("all"); + + try { + $response = (new Dropbox\Sign\Api\DocumentApi(config: $config))->documentDetectFields( + document_field_detection_request: $document_field_detection_request, + ); + + print_r($response); + } catch (Dropbox\Sign\ApiException $e) { + echo "Exception when calling DocumentApi#documentDetectFields: {$e->getMessage()}"; + } + - lang: csharp + label: C# + source: | + 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 DocumentDetectFieldsExample + { + public static void Run() + { + var config = new Configuration(); + config.Username = "YOUR_API_KEY"; + // config.AccessToken = "YOUR_ACCESS_TOKEN"; + + var documentFieldDetectionRequest = new DocumentFieldDetectionRequest( + detectionMode: "annotations", + file: new FileStream( + path: "./example_document.pdf", + mode: FileMode.Open + ), + pageRange: "all" + ); + + try + { + var response = new DocumentApi(config).DocumentDetectFields( + documentFieldDetectionRequest: documentFieldDetectionRequest + ); + + Console.WriteLine(response); + } + catch (ApiException e) + { + Console.WriteLine("Exception when calling DocumentApi#DocumentDetectFields: " + e.Message); + Console.WriteLine("Status Code: " + e.ErrorCode); + Console.WriteLine(e.StackTrace); + } + } + } + - lang: TypeScript + label: TypeScript + source: | + import * as fs from 'fs'; + import api from "@dropbox/sign" + import models from "@dropbox/sign" + + const apiCaller = new api.DocumentApi(); + apiCaller.username = "YOUR_API_KEY"; + // apiCaller.accessToken = "YOUR_ACCESS_TOKEN"; + + const documentFieldDetectionRequest: models.DocumentFieldDetectionRequest = { + detectionMode: "annotations", + file: fs.createReadStream("./example_document.pdf"), + pageRange: "all", + }; + + apiCaller.documentDetectFields( + documentFieldDetectionRequest, + ).then(response => { + console.log(response.body); + }).catch(error => { + console.log("Exception when calling DocumentApi#documentDetectFields:"); + console.log(error.body); + }); + - lang: Java + label: Java + source: | + 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 DocumentDetectFieldsExample + { + 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 documentFieldDetectionRequest = new DocumentFieldDetectionRequest(); + documentFieldDetectionRequest.detectionMode("annotations"); + documentFieldDetectionRequest._file(new File("./example_document.pdf")); + documentFieldDetectionRequest.pageRange("all"); + + try + { + var response = new DocumentApi(config).documentDetectFields( + documentFieldDetectionRequest + ); + + System.out.println(response); + } catch (ApiException e) { + System.err.println("Exception when calling DocumentApi#documentDetectFields"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } + } + - lang: Ruby + label: Ruby + source: | + require "json" + require "dropbox-sign" + + Dropbox::Sign.configure do |config| + config.username = "YOUR_API_KEY" + # config.access_token = "YOUR_ACCESS_TOKEN" + end + + document_field_detection_request = Dropbox::Sign::DocumentFieldDetectionRequest.new + document_field_detection_request.detection_mode = "annotations" + document_field_detection_request.file = File.new("./example_document.pdf", "r") + document_field_detection_request.page_range = "all" + + begin + response = Dropbox::Sign::DocumentApi.new.document_detect_fields( + document_field_detection_request, + ) + + p response + rescue Dropbox::Sign::ApiError => e + puts "Exception when calling DocumentApi#document_detect_fields: #{e}" + end + - lang: Python + label: Python + source: | + 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: + document_field_detection_request = models.DocumentFieldDetectionRequest( + detection_mode="annotations", + file=open("./example_document.pdf", "rb").read(), + page_range="all", + ) + + try: + response = api.DocumentApi(api_client).document_detect_fields( + document_field_detection_request=document_field_detection_request, + ) + + pprint(response) + except ApiException as e: + print("Exception when calling DocumentApi#document_detect_fields: %s\n" % e) + - lang: cURL + label: cURL + source: | + curl -X POST 'https://api.hellosign.com/v3/document/detect_fields' \ + -u 'YOUR_API_KEY:' \ + -F 'file=@example_document.pdf' \ + -F 'detection_mode=annotations' \ + -F 'page_range=all' + x-meta: + seo: + title: Detect Document Fields | API Documentation | Dropbox Sign for Developers + description: Use the Dropbox Sign API to detect form fields in PDF documents from PDF form annotations or Dropbox Sign text tags. /embedded/edit_url/{template_id}: post: tags: @@ -23225,6 +23499,40 @@ components: white_labeling_options: $ref: '#/components/schemas/SubWhiteLabelingOptions' type: object + DocumentFieldDetectionRequest: + required: + - detection_mode + properties: + file: + description: |- + The PDF file to analyze. + + This endpoint requires either `file` or `file_url`, but not both. + type: string + format: binary + file_url: + description: |- + The URL of the PDF file to analyze. + + This endpoint requires either `file` or `file_url`, but not both. + type: string + format: uri + detection_mode: + description: The field detection method to use. Set to `annotations` to detect PDF form annotations or `text_tags` to detect Dropbox Sign text tags. + type: string + oneOf: + - type: string + pattern: ^annotations$ + example: annotations + - type: string + pattern: ^text_tags$ + example: text_tags + page_range: + description: 'The zero-based page indexes to analyze. Accepts `all`, individual pages, inclusive ranges, or comma-separated combinations, such as `0-2,5,7-9`. Defaults to `all`.' + type: string + pattern: ^(?:all|\d+(?:-\d+)?(?:,\d+(?:-\d+)?)*)$ + example: '0-2,5,7-9' + type: object EmbeddedEditUrlRequest: properties: allow_edit_ccs: @@ -23623,6 +23931,10 @@ components: description: The title you want to assign to the SignatureRequest. type: string maxLength: 255 + expires_at: + description: When the signature request will expire. Unsigned signatures will be moved to the expired status, and no longer signable. See [Signature Request Expiration Date](https://developers.hellosign.com/docs/signature-request/expiration/) for details. + type: integer + nullable: true type: object SignatureRequestBulkSendWithTemplateRequest: required: @@ -23712,6 +24024,10 @@ components: description: The title you want to assign to the SignatureRequest. type: string maxLength: 255 + expires_at: + description: When the signature request will expire. Unsigned signatures will be moved to the expired status, and no longer signable. See [Signature Request Expiration Date](https://developers.hellosign.com/docs/signature-request/expiration/) for details. + type: integer + nullable: true type: object SignatureRequestCreateEmbeddedRequest: required: @@ -23952,6 +24268,10 @@ components: **NOTE:** Keep your signer's information safe by ensuring that the _signer on your signature request is the intended party_ before using this feature. type: boolean default: false + expires_at: + description: When the signature request will expire. Unsigned signatures will be moved to the expired status, and no longer signable. See [Signature Request Expiration Date](https://developers.hellosign.com/docs/signature-request/expiration/) for details. + type: integer + nullable: true type: object SignatureRequestEditRequest: properties: @@ -24696,6 +25016,10 @@ components: description: The title you want to assign to the SignatureRequest. type: string maxLength: 255 + expires_at: + description: When the signature request will expire. Unsigned signatures will be moved to the expired status, and no longer signable. See [Signature Request Expiration Date](https://developers.hellosign.com/docs/signature-request/expiration/) for details. + type: integer + nullable: true type: object SignatureRequestUpdateRequest: required: @@ -26790,6 +27114,19 @@ components: $ref: '#/components/schemas/WarningResponse' type: object x-internal-class: true + DocumentFieldDetectionResponse: + required: + - detection_result + properties: + detection_result: + $ref: '#/components/schemas/DocumentFieldDetectionResponseDetectionResult' + warnings: + description: A list of warnings. + type: array + items: + $ref: '#/components/schemas/WarningResponse' + type: object + x-internal-class: true EmbeddedEditUrlResponse: required: - embedded @@ -27209,6 +27546,87 @@ components: type: object additionalProperties: {} x-internal-class: true + DocumentFieldDetectionResponseDetectionResult: + required: + - document_hash + - detection_mode + - page_count + - pages_analyzed + - detected_at + - form_fields_per_document + - form_field_groups + - warnings + - errors + - suggestions + properties: + document_hash: + description: The SHA-256 hash of the analyzed document. + type: string + maxLength: 64 + minLength: 64 + detection_mode: + description: 'The field detection method used to analyze the document: `annotations` or `text_tags`.' + type: string + oneOf: + - type: string + pattern: ^annotations$ + example: annotations + - type: string + pattern: ^text_tags$ + example: text_tags + page_count: + description: The total number of pages in the document. + type: integer + minimum: 0 + pages_analyzed: + description: 'The zero-based page indexes analyzed, represented by the requested `page_range`, or `all` when every page was analyzed.' + type: string + example: all + detected_at: + description: The Unix timestamp when the field detection result was generated. + type: integer + format: int64 + form_fields_per_document: + description: |- + The fields that should appear on the document, expressed as an array of objects. (For more details you can read about it here: [Using Form Fields per Document](/docs/openapi/form-fields-per-document).) + + **NOTE:** Fields like **text**, **dropdown**, **checkbox**, **radio**, and **hyperlink** have additional required and optional parameters. Check out the list of [additional parameters](/api/reference/constants/#form-fields-per-document) for these field types. + + * Text Field use `SubFormFieldsPerDocumentText` + * Dropdown Field use `SubFormFieldsPerDocumentDropdown` + * Hyperlink Field use `SubFormFieldsPerDocumentHyperlink` + * Checkbox Field use `SubFormFieldsPerDocumentCheckbox` + * Radio Field use `SubFormFieldsPerDocumentRadio` + * Signature Field use `SubFormFieldsPerDocumentSignature` + * Date Signed Field use `SubFormFieldsPerDocumentDateSigned` + * Initials Field use `SubFormFieldsPerDocumentInitials` + * Text Merge Field use `SubFormFieldsPerDocumentTextMerge` + * Checkbox Merge Field use `SubFormFieldsPerDocumentCheckboxMerge` + type: array + items: + $ref: '#/components/schemas/SubFormFieldsPerDocumentBase' + form_field_groups: + description: Group information for fields defined in `form_fields_per_document`. String-indexed JSON array with `group_label` and `requirement` keys. `form_fields_per_document` must contain fields referencing a group defined in `form_field_groups`. + type: array + items: + $ref: '#/components/schemas/SubFormFieldGroup' + warnings: + description: Non-fatal issues encountered during field detection. + type: array + items: + $ref: '#/components/schemas/WarningResponse' + errors: + description: Errors encountered during field detection. Successfully detected fields may still be included in the response. + type: array + items: + $ref: '#/components/schemas/ErrorResponseError' + suggestions: + description: Suggestions for improving the field detection results. + type: array + items: + type: string + type: object + x-internal-class: true EmbeddedEditUrlResponseEmbedded: description: An embedded template object. properties: @@ -27257,6 +27675,7 @@ components: - sender - files_url - transmissions + - test_mode properties: fax_id: description: Fax ID @@ -27297,6 +27716,10 @@ components: type: array items: $ref: '#/components/schemas/FaxResponseTransmission' + test_mode: + description: Whether this is a test fax. Test faxes are not delivered to the recipient. Defaults to `false`. + type: boolean + default: false type: object x-internal-class: true FaxLineResponseFaxLine: diff --git a/openapi-raw.yaml b/openapi-raw.yaml index 7fc0b73c2..7295d2c6e 100644 --- a/openapi-raw.yaml +++ b/openapi-raw.yaml @@ -1188,6 +1188,104 @@ paths: seo: title: '_t__BulkSendJobList::SEO::TITLE' description: '_t__BulkSendJobList::SEO::DESCRIPTION' + /document/detect_fields: + post: + tags: + - Document + summary: '_t__DocumentFieldDetection::SUMMARY' + description: '_t__DocumentFieldDetection::DESCRIPTION' + operationId: documentDetectFields + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/DocumentFieldDetectionRequest' + multipart/form-data: + schema: + $ref: '#/components/schemas/DocumentFieldDetectionRequest' + 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/DocumentFieldDetectionResponse' + 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' + 422_example: + $ref: '#/components/examples/Error422Response' + 4XX_example: + $ref: '#/components/examples/Error4XXResponse' + security: + - + api_key: [] + - + oauth2: + - request_signature + - signature_request_access + x-codeSamples: + - + lang: PHP + label: PHP + source: + $ref: examples/DocumentDetectFieldsExample.php + - + lang: 'C#' + label: 'C#' + source: + $ref: examples/DocumentDetectFieldsExample.cs + - + lang: TypeScript + label: TypeScript + source: + $ref: examples/DocumentDetectFieldsExample.ts + - + lang: Java + label: Java + source: + $ref: examples/DocumentDetectFieldsExample.java + - + lang: Ruby + label: Ruby + source: + $ref: examples/DocumentDetectFieldsExample.rb + - + lang: Python + label: Python + source: + $ref: examples/DocumentDetectFieldsExample.py + - + lang: cURL + label: cURL + source: + $ref: examples/DocumentDetectFieldsExample.sh + x-meta: + seo: + title: '_t__DocumentDetectFields::SEO::TITLE' + description: '_t__DocumentDetectFields::SEO::DESCRIPTION' '/embedded/edit_url/{template_id}': post: tags: @@ -7897,6 +7995,16 @@ components: client_secret: description: '_t__AccountCreate::CLIENT_SECRET' type: string + create_type: + description: '_t__AccountCreate::CREATE_TYPE' + type: string + default: default + enum: + - default + - service + x-hideOn: + - sdk + - doc email_address: description: '_t__AccountCreate::EMAIL_ADDRESS' type: string @@ -7981,6 +8089,36 @@ components: white_labeling_options: $ref: '#/components/schemas/SubWhiteLabelingOptions' type: object + DocumentFieldDetectionRequest: + required: + - detection_mode + properties: + file: + description: '_t__DocumentFieldDetection::FILE' + type: string + format: binary + file_url: + description: '_t__DocumentFieldDetection::FILE_URL' + type: string + format: uri + detection_mode: + description: '_t__DocumentFieldDetection::DETECTION_MODE' + type: string + oneOf: + - + type: string + pattern: ^annotations$ + example: annotations + - + type: string + pattern: ^text_tags$ + example: text_tags + page_range: + description: '_t__DocumentFieldDetection::PAGE_RANGE' + type: string + pattern: '^(?:all|\d+(?:-\d+)?(?:,\d+(?:-\d+)?)*)$' + example: '0-2,5,7-9' + type: object EmbeddedEditUrlRequest: properties: allow_edit_ccs: @@ -8344,6 +8482,10 @@ components: description: '_t__SignatureRequestBulkCreateEmbeddedWithTemplate::TITLE' type: string maxLength: 255 + expires_at: + description: '_t__SignatureRequestBulkCreateEmbeddedWithTemplate::EXPIRES_AT' + type: integer + nullable: true type: object SignatureRequestBulkSendWithTemplateRequest: required: @@ -8404,6 +8546,10 @@ components: description: '_t__SignatureRequestBulkSendWithTemplate::TITLE' type: string maxLength: 255 + expires_at: + description: '_t__SignatureRequestBulkSendWithTemplate::EXPIRES_AT' + type: integer + nullable: true type: object SignatureRequestCreateEmbeddedRequest: required: @@ -8597,6 +8743,10 @@ components: description: '_t__SignatureRequestCreateEmbeddedWithTemplate::POPULATE_AUTO_FILL_FIELDS' type: boolean default: false + expires_at: + description: '_t__SignatureRequestCreateEmbeddedWithTemplate::EXPIRES_AT' + type: integer + nullable: true signer_experience: description: '_t__SignatureRequestCreateEmbeddedWithTemplate::SIGNER_EXPERIENCE' allOf: @@ -9232,6 +9382,10 @@ components: description: '_t__SignatureRequestSendWithTemplate::TITLE' type: string maxLength: 255 + expires_at: + description: '_t__SignatureRequestSendWithTemplate::EXPIRES_AT' + type: integer + nullable: true signer_experience: description: '_t__SignatureRequestSendWithTemplate::SIGNER_EXPERIENCE' allOf: @@ -11099,6 +11253,19 @@ components: $ref: '#/components/schemas/WarningResponse' type: object x-internal-class: true + DocumentFieldDetectionResponse: + required: + - detection_result + properties: + detection_result: + $ref: '#/components/schemas/DocumentFieldDetectionResponseDetectionResult' + warnings: + description: '_t__WarningResponse::LIST_DESCRIPTION' + type: array + items: + $ref: '#/components/schemas/WarningResponse' + type: object + x-internal-class: true EmbeddedEditUrlResponse: required: - embedded @@ -11519,6 +11686,75 @@ components: type: object additionalProperties: { } x-internal-class: true + DocumentFieldDetectionResponseDetectionResult: + required: + - document_hash + - detection_mode + - page_count + - pages_analyzed + - detected_at + - form_fields_per_document + - form_field_groups + - warnings + - errors + - suggestions + properties: + document_hash: + description: '_t__DocumentFieldDetectionResponse::DOCUMENT_HASH' + type: string + maxLength: 64 + minLength: 64 + detection_mode: + description: '_t__DocumentFieldDetectionResponse::DETECTION_MODE' + type: string + oneOf: + - + type: string + pattern: ^annotations$ + example: annotations + - + type: string + pattern: ^text_tags$ + example: text_tags + page_count: + description: '_t__DocumentFieldDetectionResponse::PAGE_COUNT' + type: integer + minimum: 0 + pages_analyzed: + description: '_t__DocumentFieldDetectionResponse::PAGES_ANALYZED' + type: string + example: all + detected_at: + description: '_t__DocumentFieldDetectionResponse::DETECTED_AT' + type: integer + format: int64 + form_fields_per_document: + description: '_t__Sub::FormFieldsPerDocument::DESCRIPTION' + type: array + items: + $ref: '#/components/schemas/SubFormFieldsPerDocumentBase' + form_field_groups: + description: '_t__Sub::FormFieldGroup::DESCRIPTION' + type: array + items: + $ref: '#/components/schemas/SubFormFieldGroup' + warnings: + description: '_t__DocumentFieldDetectionResponse::WARNINGS' + type: array + items: + $ref: '#/components/schemas/WarningResponse' + errors: + description: '_t__DocumentFieldDetectionResponse::ERRORS' + type: array + items: + $ref: '#/components/schemas/ErrorResponseError' + suggestions: + description: '_t__DocumentFieldDetectionResponse::SUGGESTIONS' + type: array + items: + type: string + type: object + x-internal-class: true EmbeddedEditUrlResponseEmbedded: description: '_t__EmbeddedEditUrlResponseEmbedded::DESCRIPTION' properties: @@ -11567,6 +11803,7 @@ components: - sender - files_url - transmissions + - test_mode properties: fax_id: description: '_t__FaxResponse::FAX_ID' @@ -11607,6 +11844,10 @@ components: type: array items: $ref: '#/components/schemas/FaxResponseTransmission' + test_mode: + description: '_t__FaxResponse::TEST_MODE' + type: boolean + default: false type: object x-internal-class: true FaxLineResponseFaxLine: diff --git a/openapi-sdk.yaml b/openapi-sdk.yaml index c55482a72..a05971e9f 100644 --- a/openapi-sdk.yaml +++ b/openapi-sdk.yaml @@ -1153,6 +1153,104 @@ paths: seo: title: 'List Bulk Send Jobs | Documentation | Dropbox Sign for Developers' description: 'The Dropbox Sign API allows you to build custom integrations. To find out how to return a list of BulkSendJob that you can access, click here.' + /document/detect_fields: + post: + tags: + - Document + summary: 'Detect Document Fields' + description: 'Detects form fields in a PDF document using either PDF form annotations or Dropbox Sign text tags.' + operationId: documentDetectFields + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/DocumentFieldDetectionRequest' + multipart/form-data: + schema: + $ref: '#/components/schemas/DocumentFieldDetectionRequest' + 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/DocumentFieldDetectionResponse' + '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' + 422_example: + $ref: '#/components/examples/Error422Response' + 4XX_example: + $ref: '#/components/examples/Error4XXResponse' + security: + - + api_key: [] + - + oauth2: + - request_signature + - signature_request_access + x-codeSamples: + - + lang: PHP + label: PHP + source: + $ref: examples/DocumentDetectFieldsExample.php + - + lang: 'C#' + label: 'C#' + source: + $ref: examples/DocumentDetectFieldsExample.cs + - + lang: TypeScript + label: TypeScript + source: + $ref: examples/DocumentDetectFieldsExample.ts + - + lang: Java + label: Java + source: + $ref: examples/DocumentDetectFieldsExample.java + - + lang: Ruby + label: Ruby + source: + $ref: examples/DocumentDetectFieldsExample.rb + - + lang: Python + label: Python + source: + $ref: examples/DocumentDetectFieldsExample.py + - + lang: cURL + label: cURL + source: + $ref: examples/DocumentDetectFieldsExample.sh + x-meta: + seo: + title: 'Detect Document Fields | API Documentation | Dropbox Sign for Developers' + description: 'Use the Dropbox Sign API to detect form fields in PDF documents from PDF form annotations or Dropbox Sign text tags.' '/embedded/edit_url/{template_id}': post: tags: @@ -7927,6 +8025,42 @@ components: white_labeling_options: $ref: '#/components/schemas/SubWhiteLabelingOptions' type: object + DocumentFieldDetectionRequest: + required: + - detection_mode + properties: + file: + description: |- + The PDF file to analyze. + + This endpoint requires either `file` or `file_url`, but not both. + type: string + format: binary + file_url: + description: |- + The URL of the PDF file to analyze. + + This endpoint requires either `file` or `file_url`, but not both. + type: string + format: uri + detection_mode: + description: 'The field detection method to use. Set to `annotations` to detect PDF form annotations or `text_tags` to detect Dropbox Sign text tags.' + type: string + oneOf: + - + type: string + pattern: ^annotations$ + example: annotations + - + type: string + pattern: ^text_tags$ + example: text_tags + page_range: + description: 'The zero-based page indexes to analyze. Accepts `all`, individual pages, inclusive ranges, or comma-separated combinations, such as `0-2,5,7-9`. Defaults to `all`.' + type: string + pattern: '^(?:all|\d+(?:-\d+)?(?:,\d+(?:-\d+)?)*)$' + example: '0-2,5,7-9' + type: object EmbeddedEditUrlRequest: properties: allow_edit_ccs: @@ -8325,6 +8459,10 @@ components: description: 'The title you want to assign to the SignatureRequest.' type: string maxLength: 255 + expires_at: + description: 'When the signature request will expire. Unsigned signatures will be moved to the expired status, and no longer signable. See [Signature Request Expiration Date](https://developers.hellosign.com/docs/signature-request/expiration/) for details.' + type: integer + nullable: true type: object SignatureRequestBulkSendWithTemplateRequest: required: @@ -8414,6 +8552,10 @@ components: description: 'The title you want to assign to the SignatureRequest.' type: string maxLength: 255 + expires_at: + description: 'When the signature request will expire. Unsigned signatures will be moved to the expired status, and no longer signable. See [Signature Request Expiration Date](https://developers.hellosign.com/docs/signature-request/expiration/) for details.' + type: integer + nullable: true type: object SignatureRequestCreateEmbeddedRequest: required: @@ -8654,6 +8796,10 @@ components: **NOTE:** Keep your signer's information safe by ensuring that the _signer on your signature request is the intended party_ before using this feature. type: boolean default: false + expires_at: + description: 'When the signature request will expire. Unsigned signatures will be moved to the expired status, and no longer signable. See [Signature Request Expiration Date](https://developers.hellosign.com/docs/signature-request/expiration/) for details.' + type: integer + nullable: true type: object SignatureRequestEditRequest: properties: @@ -9418,6 +9564,10 @@ components: description: 'The title you want to assign to the SignatureRequest.' type: string maxLength: 255 + expires_at: + description: 'When the signature request will expire. Unsigned signatures will be moved to the expired status, and no longer signable. See [Signature Request Expiration Date](https://developers.hellosign.com/docs/signature-request/expiration/) for details.' + type: integer + nullable: true type: object SignatureRequestUpdateRequest: required: @@ -11522,6 +11672,19 @@ components: $ref: '#/components/schemas/WarningResponse' type: object x-internal-class: true + DocumentFieldDetectionResponse: + required: + - detection_result + properties: + detection_result: + $ref: '#/components/schemas/DocumentFieldDetectionResponseDetectionResult' + warnings: + description: 'A list of warnings.' + type: array + items: + $ref: '#/components/schemas/WarningResponse' + type: object + x-internal-class: true EmbeddedEditUrlResponse: required: - embedded @@ -11942,6 +12105,89 @@ components: type: object additionalProperties: {} x-internal-class: true + DocumentFieldDetectionResponseDetectionResult: + required: + - document_hash + - detection_mode + - page_count + - pages_analyzed + - detected_at + - form_fields_per_document + - form_field_groups + - warnings + - errors + - suggestions + properties: + document_hash: + description: 'The SHA-256 hash of the analyzed document.' + type: string + maxLength: 64 + minLength: 64 + detection_mode: + description: 'The field detection method used to analyze the document: `annotations` or `text_tags`.' + type: string + oneOf: + - + type: string + pattern: ^annotations$ + example: annotations + - + type: string + pattern: ^text_tags$ + example: text_tags + page_count: + description: 'The total number of pages in the document.' + type: integer + minimum: 0 + pages_analyzed: + description: 'The zero-based page indexes analyzed, represented by the requested `page_range`, or `all` when every page was analyzed.' + type: string + example: all + detected_at: + description: 'The Unix timestamp when the field detection result was generated.' + type: integer + format: int64 + form_fields_per_document: + description: |- + The fields that should appear on the document, expressed as an array of objects. (For more details you can read about it here: [Using Form Fields per Document](/docs/openapi/form-fields-per-document).) + + **NOTE:** Fields like **text**, **dropdown**, **checkbox**, **radio**, and **hyperlink** have additional required and optional parameters. Check out the list of [additional parameters](/api/reference/constants/#form-fields-per-document) for these field types. + + * Text Field use `SubFormFieldsPerDocumentText` + * Dropdown Field use `SubFormFieldsPerDocumentDropdown` + * Hyperlink Field use `SubFormFieldsPerDocumentHyperlink` + * Checkbox Field use `SubFormFieldsPerDocumentCheckbox` + * Radio Field use `SubFormFieldsPerDocumentRadio` + * Signature Field use `SubFormFieldsPerDocumentSignature` + * Date Signed Field use `SubFormFieldsPerDocumentDateSigned` + * Initials Field use `SubFormFieldsPerDocumentInitials` + * Text Merge Field use `SubFormFieldsPerDocumentTextMerge` + * Checkbox Merge Field use `SubFormFieldsPerDocumentCheckboxMerge` + type: array + items: + $ref: '#/components/schemas/SubFormFieldsPerDocumentBase' + form_field_groups: + description: 'Group information for fields defined in `form_fields_per_document`. String-indexed JSON array with `group_label` and `requirement` keys. `form_fields_per_document` must contain fields referencing a group defined in `form_field_groups`.' + type: array + items: + $ref: '#/components/schemas/SubFormFieldGroup' + warnings: + description: 'Non-fatal issues encountered during field detection.' + type: array + items: + $ref: '#/components/schemas/WarningResponse' + errors: + description: 'Errors encountered during field detection. Successfully detected fields may still be included in the response.' + type: array + items: + $ref: '#/components/schemas/ErrorResponseError' + suggestions: + description: 'Suggestions for improving the field detection results.' + type: array + items: + type: string + type: object + x-internal-class: true EmbeddedEditUrlResponseEmbedded: description: 'An embedded template object.' properties: @@ -11990,6 +12236,7 @@ components: - sender - files_url - transmissions + - test_mode properties: fax_id: description: 'Fax ID' @@ -12030,6 +12277,10 @@ components: type: array items: $ref: '#/components/schemas/FaxResponseTransmission' + test_mode: + description: 'Whether this is a test fax. Test faxes are not delivered to the recipient. Defaults to `false`.' + type: boolean + default: false type: object x-internal-class: true FaxLineResponseFaxLine: diff --git a/openapi.yaml b/openapi.yaml index a1a34d41d..6be19e5a2 100644 --- a/openapi.yaml +++ b/openapi.yaml @@ -1153,6 +1153,104 @@ paths: seo: title: 'List Bulk Send Jobs | Documentation | Dropbox Sign for Developers' description: 'The Dropbox Sign API allows you to build custom integrations. To find out how to return a list of BulkSendJob that you can access, click here.' + /document/detect_fields: + post: + tags: + - Document + summary: 'Detect Document Fields' + description: 'Detects form fields in a PDF document using either PDF form annotations or Dropbox Sign text tags.' + operationId: documentDetectFields + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/DocumentFieldDetectionRequest' + multipart/form-data: + schema: + $ref: '#/components/schemas/DocumentFieldDetectionRequest' + 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/DocumentFieldDetectionResponse' + '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' + 422_example: + $ref: '#/components/examples/Error422Response' + 4XX_example: + $ref: '#/components/examples/Error4XXResponse' + security: + - + api_key: [] + - + oauth2: + - request_signature + - signature_request_access + x-codeSamples: + - + lang: PHP + label: PHP + source: + $ref: examples/DocumentDetectFieldsExample.php + - + lang: 'C#' + label: 'C#' + source: + $ref: examples/DocumentDetectFieldsExample.cs + - + lang: TypeScript + label: TypeScript + source: + $ref: examples/DocumentDetectFieldsExample.ts + - + lang: Java + label: Java + source: + $ref: examples/DocumentDetectFieldsExample.java + - + lang: Ruby + label: Ruby + source: + $ref: examples/DocumentDetectFieldsExample.rb + - + lang: Python + label: Python + source: + $ref: examples/DocumentDetectFieldsExample.py + - + lang: cURL + label: cURL + source: + $ref: examples/DocumentDetectFieldsExample.sh + x-meta: + seo: + title: 'Detect Document Fields | API Documentation | Dropbox Sign for Developers' + description: 'Use the Dropbox Sign API to detect form fields in PDF documents from PDF form annotations or Dropbox Sign text tags.' '/embedded/edit_url/{template_id}': post: tags: @@ -7927,6 +8025,42 @@ components: white_labeling_options: $ref: '#/components/schemas/SubWhiteLabelingOptions' type: object + DocumentFieldDetectionRequest: + required: + - detection_mode + properties: + file: + description: |- + The PDF file to analyze. + + This endpoint requires either `file` or `file_url`, but not both. + type: string + format: binary + file_url: + description: |- + The URL of the PDF file to analyze. + + This endpoint requires either `file` or `file_url`, but not both. + type: string + format: uri + detection_mode: + description: 'The field detection method to use. Set to `annotations` to detect PDF form annotations or `text_tags` to detect Dropbox Sign text tags.' + type: string + oneOf: + - + type: string + pattern: ^annotations$ + example: annotations + - + type: string + pattern: ^text_tags$ + example: text_tags + page_range: + description: 'The zero-based page indexes to analyze. Accepts `all`, individual pages, inclusive ranges, or comma-separated combinations, such as `0-2,5,7-9`. Defaults to `all`.' + type: string + pattern: '^(?:all|\d+(?:-\d+)?(?:,\d+(?:-\d+)?)*)$' + example: '0-2,5,7-9' + type: object EmbeddedEditUrlRequest: properties: allow_edit_ccs: @@ -8325,6 +8459,10 @@ components: description: 'The title you want to assign to the SignatureRequest.' type: string maxLength: 255 + expires_at: + description: 'When the signature request will expire. Unsigned signatures will be moved to the expired status, and no longer signable. See [Signature Request Expiration Date](https://developers.hellosign.com/docs/signature-request/expiration/) for details.' + type: integer + nullable: true type: object SignatureRequestBulkSendWithTemplateRequest: required: @@ -8414,6 +8552,10 @@ components: description: 'The title you want to assign to the SignatureRequest.' type: string maxLength: 255 + expires_at: + description: 'When the signature request will expire. Unsigned signatures will be moved to the expired status, and no longer signable. See [Signature Request Expiration Date](https://developers.hellosign.com/docs/signature-request/expiration/) for details.' + type: integer + nullable: true type: object SignatureRequestCreateEmbeddedRequest: required: @@ -8654,6 +8796,10 @@ components: **NOTE:** Keep your signer's information safe by ensuring that the _signer on your signature request is the intended party_ before using this feature. type: boolean default: false + expires_at: + description: 'When the signature request will expire. Unsigned signatures will be moved to the expired status, and no longer signable. See [Signature Request Expiration Date](https://developers.hellosign.com/docs/signature-request/expiration/) for details.' + type: integer + nullable: true type: object SignatureRequestEditRequest: properties: @@ -9398,6 +9544,10 @@ components: description: 'The title you want to assign to the SignatureRequest.' type: string maxLength: 255 + expires_at: + description: 'When the signature request will expire. Unsigned signatures will be moved to the expired status, and no longer signable. See [Signature Request Expiration Date](https://developers.hellosign.com/docs/signature-request/expiration/) for details.' + type: integer + nullable: true type: object SignatureRequestUpdateRequest: required: @@ -11502,6 +11652,19 @@ components: $ref: '#/components/schemas/WarningResponse' type: object x-internal-class: true + DocumentFieldDetectionResponse: + required: + - detection_result + properties: + detection_result: + $ref: '#/components/schemas/DocumentFieldDetectionResponseDetectionResult' + warnings: + description: 'A list of warnings.' + type: array + items: + $ref: '#/components/schemas/WarningResponse' + type: object + x-internal-class: true EmbeddedEditUrlResponse: required: - embedded @@ -11922,6 +12085,89 @@ components: type: object additionalProperties: {} x-internal-class: true + DocumentFieldDetectionResponseDetectionResult: + required: + - document_hash + - detection_mode + - page_count + - pages_analyzed + - detected_at + - form_fields_per_document + - form_field_groups + - warnings + - errors + - suggestions + properties: + document_hash: + description: 'The SHA-256 hash of the analyzed document.' + type: string + maxLength: 64 + minLength: 64 + detection_mode: + description: 'The field detection method used to analyze the document: `annotations` or `text_tags`.' + type: string + oneOf: + - + type: string + pattern: ^annotations$ + example: annotations + - + type: string + pattern: ^text_tags$ + example: text_tags + page_count: + description: 'The total number of pages in the document.' + type: integer + minimum: 0 + pages_analyzed: + description: 'The zero-based page indexes analyzed, represented by the requested `page_range`, or `all` when every page was analyzed.' + type: string + example: all + detected_at: + description: 'The Unix timestamp when the field detection result was generated.' + type: integer + format: int64 + form_fields_per_document: + description: |- + The fields that should appear on the document, expressed as an array of objects. (For more details you can read about it here: [Using Form Fields per Document](/docs/openapi/form-fields-per-document).) + + **NOTE:** Fields like **text**, **dropdown**, **checkbox**, **radio**, and **hyperlink** have additional required and optional parameters. Check out the list of [additional parameters](/api/reference/constants/#form-fields-per-document) for these field types. + + * Text Field use `SubFormFieldsPerDocumentText` + * Dropdown Field use `SubFormFieldsPerDocumentDropdown` + * Hyperlink Field use `SubFormFieldsPerDocumentHyperlink` + * Checkbox Field use `SubFormFieldsPerDocumentCheckbox` + * Radio Field use `SubFormFieldsPerDocumentRadio` + * Signature Field use `SubFormFieldsPerDocumentSignature` + * Date Signed Field use `SubFormFieldsPerDocumentDateSigned` + * Initials Field use `SubFormFieldsPerDocumentInitials` + * Text Merge Field use `SubFormFieldsPerDocumentTextMerge` + * Checkbox Merge Field use `SubFormFieldsPerDocumentCheckboxMerge` + type: array + items: + $ref: '#/components/schemas/SubFormFieldsPerDocumentBase' + form_field_groups: + description: 'Group information for fields defined in `form_fields_per_document`. String-indexed JSON array with `group_label` and `requirement` keys. `form_fields_per_document` must contain fields referencing a group defined in `form_field_groups`.' + type: array + items: + $ref: '#/components/schemas/SubFormFieldGroup' + warnings: + description: 'Non-fatal issues encountered during field detection.' + type: array + items: + $ref: '#/components/schemas/WarningResponse' + errors: + description: 'Errors encountered during field detection. Successfully detected fields may still be included in the response.' + type: array + items: + $ref: '#/components/schemas/ErrorResponseError' + suggestions: + description: 'Suggestions for improving the field detection results.' + type: array + items: + type: string + type: object + x-internal-class: true EmbeddedEditUrlResponseEmbedded: description: 'An embedded template object.' properties: @@ -11970,6 +12216,7 @@ components: - sender - files_url - transmissions + - test_mode properties: fax_id: description: 'Fax ID' @@ -12010,6 +12257,10 @@ components: type: array items: $ref: '#/components/schemas/FaxResponseTransmission' + test_mode: + description: 'Whether this is a test fax. Test faxes are not delivered to the recipient. Defaults to `false`.' + type: boolean + default: false type: object x-internal-class: true FaxLineResponseFaxLine: diff --git a/sandbox/dotnet/src/Dropbox.SignSandbox/DocumentDetectFieldsExample.cs b/sandbox/dotnet/src/Dropbox.SignSandbox/DocumentDetectFieldsExample.cs new file mode 100644 index 000000000..71b27eac3 --- /dev/null +++ b/sandbox/dotnet/src/Dropbox.SignSandbox/DocumentDetectFieldsExample.cs @@ -0,0 +1,44 @@ +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 DocumentDetectFieldsExample +{ + public static void Run() + { + var config = new Configuration(); + config.Username = "YOUR_API_KEY"; + // config.AccessToken = "YOUR_ACCESS_TOKEN"; + + var documentFieldDetectionRequest = new DocumentFieldDetectionRequest( + detectionMode: "annotations", + file: new FileStream( + path: "./example_document.pdf", + mode: FileMode.Open + ), + pageRange: "all" + ); + + try + { + var response = new DocumentApi(config).DocumentDetectFields( + documentFieldDetectionRequest: documentFieldDetectionRequest + ); + + Console.WriteLine(response); + } + catch (ApiException e) + { + Console.WriteLine("Exception when calling DocumentApi#DocumentDetectFields: " + e.Message); + Console.WriteLine("Status Code: " + e.ErrorCode); + Console.WriteLine(e.StackTrace); + } + } +} diff --git a/sandbox/java/src/main/java/com/dropbox/sign_sandbox/DocumentDetectFieldsExample.java b/sandbox/java/src/main/java/com/dropbox/sign_sandbox/DocumentDetectFieldsExample.java new file mode 100644 index 000000000..ab017fddc --- /dev/null +++ b/sandbox/java/src/main/java/com/dropbox/sign_sandbox/DocumentDetectFieldsExample.java @@ -0,0 +1,46 @@ +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 DocumentDetectFieldsExample +{ + 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 documentFieldDetectionRequest = new DocumentFieldDetectionRequest(); + documentFieldDetectionRequest.detectionMode("annotations"); + documentFieldDetectionRequest._file(new File("./example_document.pdf")); + documentFieldDetectionRequest.pageRange("all"); + + try + { + var response = new DocumentApi(config).documentDetectFields( + documentFieldDetectionRequest + ); + + System.out.println(response); + } catch (ApiException e) { + System.err.println("Exception when calling DocumentApi#documentDetectFields"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} diff --git a/sandbox/node/src/DocumentDetectFieldsExample.ts b/sandbox/node/src/DocumentDetectFieldsExample.ts new file mode 100644 index 000000000..65116d93b --- /dev/null +++ b/sandbox/node/src/DocumentDetectFieldsExample.ts @@ -0,0 +1,22 @@ +import * as fs from 'fs'; +import api from "@dropbox/sign" +import models from "@dropbox/sign" + +const apiCaller = new api.DocumentApi(); +apiCaller.username = "YOUR_API_KEY"; +// apiCaller.accessToken = "YOUR_ACCESS_TOKEN"; + +const documentFieldDetectionRequest: models.DocumentFieldDetectionRequest = { + detectionMode: "annotations", + file: fs.createReadStream("./example_document.pdf"), + pageRange: "all", +}; + +apiCaller.documentDetectFields( + documentFieldDetectionRequest, +).then(response => { + console.log(response.body); +}).catch(error => { + console.log("Exception when calling DocumentApi#documentDetectFields:"); + console.log(error.body); +}); diff --git a/sandbox/php/src/DocumentDetectFieldsExample.php b/sandbox/php/src/DocumentDetectFieldsExample.php new file mode 100644 index 000000000..301cee10a --- /dev/null +++ b/sandbox/php/src/DocumentDetectFieldsExample.php @@ -0,0 +1,27 @@ +setUsername("YOUR_API_KEY"); +// $config->setAccessToken("YOUR_ACCESS_TOKEN"); + +$document_field_detection_request = (new Dropbox\Sign\Model\DocumentFieldDetectionRequest()) + ->setDetectionMode("annotations") + ->setFile(new SplFileObject("./example_document.pdf")) + ->setPageRange("all"); + +try { + $response = (new Dropbox\Sign\Api\DocumentApi(config: $config))->documentDetectFields( + document_field_detection_request: $document_field_detection_request, + ); + + print_r($response); +} catch (Dropbox\Sign\ApiException $e) { + echo "Exception when calling DocumentApi#documentDetectFields: {$e->getMessage()}"; +} diff --git a/sandbox/python/src/DocumentDetectFieldsExample.py b/sandbox/python/src/DocumentDetectFieldsExample.py new file mode 100644 index 000000000..eca19a246 --- /dev/null +++ b/sandbox/python/src/DocumentDetectFieldsExample.py @@ -0,0 +1,26 @@ +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: + document_field_detection_request = models.DocumentFieldDetectionRequest( + detection_mode="annotations", + file=open("./example_document.pdf", "rb").read(), + page_range="all", + ) + + try: + response = api.DocumentApi(api_client).document_detect_fields( + document_field_detection_request=document_field_detection_request, + ) + + pprint(response) + except ApiException as e: + print("Exception when calling DocumentApi#document_detect_fields: %s\n" % e) diff --git a/sandbox/ruby/src/DocumentDetectFieldsExample.rb b/sandbox/ruby/src/DocumentDetectFieldsExample.rb new file mode 100644 index 000000000..e224eb789 --- /dev/null +++ b/sandbox/ruby/src/DocumentDetectFieldsExample.rb @@ -0,0 +1,22 @@ +require "json" +require "dropbox-sign" + +Dropbox::Sign.configure do |config| + config.username = "YOUR_API_KEY" + # config.access_token = "YOUR_ACCESS_TOKEN" +end + +document_field_detection_request = Dropbox::Sign::DocumentFieldDetectionRequest.new +document_field_detection_request.detection_mode = "annotations" +document_field_detection_request.file = File.new("./example_document.pdf", "r") +document_field_detection_request.page_range = "all" + +begin + response = Dropbox::Sign::DocumentApi.new.document_detect_fields( + document_field_detection_request, + ) + + p response +rescue Dropbox::Sign::ApiError => e + puts "Exception when calling DocumentApi#document_detect_fields: #{e}" +end diff --git a/sdks/dotnet/README.md b/sdks/dotnet/README.md index 414467bc4..ae722c1ef 100644 --- a/sdks/dotnet/README.md +++ b/sdks/dotnet/README.md @@ -142,6 +142,7 @@ Class | Method | HTTP request | Description *ApiAppApi* | [**ApiAppUpdate**](docs/ApiAppApi.md#apiappupdate) | **PUT** /api_app/{client_id} | Update API App *BulkSendJobApi* | [**BulkSendJobGet**](docs/BulkSendJobApi.md#bulksendjobget) | **GET** /bulk_send_job/{bulk_send_job_id} | Get Bulk Send Job *BulkSendJobApi* | [**BulkSendJobList**](docs/BulkSendJobApi.md#bulksendjoblist) | **GET** /bulk_send_job/list | List Bulk Send Jobs +*DocumentApi* | [**DocumentDetectFields**](docs/DocumentApi.md#documentdetectfields) | **POST** /document/detect_fields | Detect Document Fields *EmbeddedApi* | [**EmbeddedEditUrl**](docs/EmbeddedApi.md#embeddedediturl) | **POST** /embedded/edit_url/{template_id} | Get Embedded Template Edit URL *EmbeddedApi* | [**EmbeddedSignUrl**](docs/EmbeddedApi.md#embeddedsignurl) | **GET** /embedded/sign_url/{signature_id} | Get Embedded Sign URL *FaxApi* | [**FaxDelete**](docs/FaxApi.md#faxdelete) | **DELETE** /fax/{fax_id} | Delete Fax @@ -234,6 +235,9 @@ Class | Method | HTTP request | Description - [Model.BulkSendJobListResponse](docs/BulkSendJobListResponse.md) - [Model.BulkSendJobResponse](docs/BulkSendJobResponse.md) - [Model.BulkSendJobSendResponse](docs/BulkSendJobSendResponse.md) + - [Model.DocumentFieldDetectionRequest](docs/DocumentFieldDetectionRequest.md) + - [Model.DocumentFieldDetectionResponse](docs/DocumentFieldDetectionResponse.md) + - [Model.DocumentFieldDetectionResponseDetectionResult](docs/DocumentFieldDetectionResponseDetectionResult.md) - [Model.EmbeddedEditUrlRequest](docs/EmbeddedEditUrlRequest.md) - [Model.EmbeddedEditUrlResponse](docs/EmbeddedEditUrlResponse.md) - [Model.EmbeddedEditUrlResponseEmbedded](docs/EmbeddedEditUrlResponseEmbedded.md) diff --git a/sdks/dotnet/docs/DocumentApi.md b/sdks/dotnet/docs/DocumentApi.md new file mode 100644 index 000000000..6b2fe15dd --- /dev/null +++ b/sdks/dotnet/docs/DocumentApi.md @@ -0,0 +1,113 @@ +# Dropbox.Sign.Api.DocumentApi + +All URIs are relative to *https://api.hellosign.com/v3* + +| Method | HTTP request | Description | +|--------|--------------|-------------| +| [**DocumentDetectFields**](DocumentApi.md#documentdetectfields) | **POST** /document/detect_fields | Detect Document Fields | + + +# **DocumentDetectFields** +> DocumentFieldDetectionResponse DocumentDetectFields (DocumentFieldDetectionRequest documentFieldDetectionRequest) + +Detect Document Fields + +Detects form fields in a PDF document using either PDF form annotations or Dropbox Sign text tags. + +### 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 DocumentDetectFieldsExample +{ + public static void Run() + { + var config = new Configuration(); + config.Username = "YOUR_API_KEY"; + // config.AccessToken = "YOUR_ACCESS_TOKEN"; + + var documentFieldDetectionRequest = new DocumentFieldDetectionRequest( + detectionMode: "annotations", + file: new FileStream( + path: "./example_document.pdf", + mode: FileMode.Open + ), + pageRange: "all" + ); + + try + { + var response = new DocumentApi(config).DocumentDetectFields( + documentFieldDetectionRequest: documentFieldDetectionRequest + ); + + Console.WriteLine(response); + } + catch (ApiException e) + { + Console.WriteLine("Exception when calling DocumentApi#DocumentDetectFields: " + e.Message); + Console.WriteLine("Status Code: " + e.ErrorCode); + Console.WriteLine(e.StackTrace); + } + } +} + +``` + +#### Using the DocumentDetectFieldsWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // Detect Document Fields + ApiResponse response = apiInstance.DocumentDetectFieldsWithHttpInfo(documentFieldDetectionRequest); + 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 DocumentApi.DocumentDetectFieldsWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **documentFieldDetectionRequest** | [**DocumentFieldDetectionRequest**](DocumentFieldDetectionRequest.md) | | | + +### Return type + +[**DocumentFieldDetectionResponse**](DocumentFieldDetectionResponse.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) + diff --git a/sdks/dotnet/docs/DocumentFieldDetectionRequest.md b/sdks/dotnet/docs/DocumentFieldDetectionRequest.md new file mode 100644 index 000000000..0d42cb7d5 --- /dev/null +++ b/sdks/dotnet/docs/DocumentFieldDetectionRequest.md @@ -0,0 +1,10 @@ +# Dropbox.Sign.Model.DocumentFieldDetectionRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**DetectionMode** | **string** | The field detection method to use. Set to `annotations` to detect PDF form annotations or `text_tags` to detect Dropbox Sign text tags. | **File** | **System.IO.Stream** | The PDF file to analyze.

This endpoint requires either `file` or `file_url`, but not both. | [optional] **FileUrl** | **string** | The URL of the PDF file to analyze.

This endpoint requires either `file` or `file_url`, but not both. | [optional] **PageRange** | **string** | The zero-based page indexes to analyze. Accepts `all`, individual pages, inclusive ranges, or comma-separated combinations, such as `0-2,5,7-9`. Defaults to `all`. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/sdks/dotnet/docs/DocumentFieldDetectionResponse.md b/sdks/dotnet/docs/DocumentFieldDetectionResponse.md new file mode 100644 index 000000000..8c440c054 --- /dev/null +++ b/sdks/dotnet/docs/DocumentFieldDetectionResponse.md @@ -0,0 +1,10 @@ +# Dropbox.Sign.Model.DocumentFieldDetectionResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**DetectionResult** | [**DocumentFieldDetectionResponseDetectionResult**](DocumentFieldDetectionResponseDetectionResult.md) | | **Warnings** | [**List<WarningResponse>**](WarningResponse.md) | A list of warnings. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/sdks/dotnet/docs/DocumentFieldDetectionResponseDetectionResult.md b/sdks/dotnet/docs/DocumentFieldDetectionResponseDetectionResult.md new file mode 100644 index 000000000..495a081b0 --- /dev/null +++ b/sdks/dotnet/docs/DocumentFieldDetectionResponseDetectionResult.md @@ -0,0 +1,10 @@ +# Dropbox.Sign.Model.DocumentFieldDetectionResponseDetectionResult + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**DocumentHash** | **string** | The SHA-256 hash of the analyzed document. | **DetectionMode** | **string** | The field detection method used to analyze the document: `annotations` or `text_tags`. | **PageCount** | **int** | The total number of pages in the document. | **PagesAnalyzed** | **string** | The zero-based page indexes analyzed, represented by the requested `page_range`, or `all` when every page was analyzed. | **DetectedAt** | **long** | The Unix timestamp when the field detection result was generated. | **FormFieldsPerDocument** | [**List<SubFormFieldsPerDocumentBase>**](SubFormFieldsPerDocumentBase.md) | The fields that should appear on the document, expressed as an array of objects. (For more details you can read about it here: [Using Form Fields per Document](/docs/openapi/form-fields-per-document).)

**NOTE:** Fields like **text**, **dropdown**, **checkbox**, **radio**, and **hyperlink** have additional required and optional parameters. Check out the list of [additional parameters](/api/reference/constants/#form-fields-per-document) for these field types.

* Text Field use `SubFormFieldsPerDocumentText`
* Dropdown Field use `SubFormFieldsPerDocumentDropdown`
* Hyperlink Field use `SubFormFieldsPerDocumentHyperlink`
* Checkbox Field use `SubFormFieldsPerDocumentCheckbox`
* Radio Field use `SubFormFieldsPerDocumentRadio`
* Signature Field use `SubFormFieldsPerDocumentSignature`
* Date Signed Field use `SubFormFieldsPerDocumentDateSigned`
* Initials Field use `SubFormFieldsPerDocumentInitials`
* Text Merge Field use `SubFormFieldsPerDocumentTextMerge`
* Checkbox Merge Field use `SubFormFieldsPerDocumentCheckboxMerge` | **FormFieldGroups** | [**List<SubFormFieldGroup>**](SubFormFieldGroup.md) | Group information for fields defined in `form_fields_per_document`. String-indexed JSON array with `group_label` and `requirement` keys. `form_fields_per_document` must contain fields referencing a group defined in `form_field_groups`. | **Warnings** | [**List<WarningResponse>**](WarningResponse.md) | Non-fatal issues encountered during field detection. | **Errors** | [**List<ErrorResponseError>**](ErrorResponseError.md) | Errors encountered during field detection. Successfully detected fields may still be included in the response. | **Suggestions** | **List<string>** | Suggestions for improving the field detection results. | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/sdks/dotnet/docs/FaxResponse.md b/sdks/dotnet/docs/FaxResponse.md index 041605710..ebb9b3e41 100644 --- a/sdks/dotnet/docs/FaxResponse.md +++ b/sdks/dotnet/docs/FaxResponse.md @@ -4,7 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**FaxId** | **string** | Fax ID | **Title** | **string** | Fax Title | **OriginalTitle** | **string** | Fax Original Title | **Metadata** | **Dictionary<string, Object>** | Fax Metadata | **CreatedAt** | **int** | Fax Created At Timestamp | **Sender** | **string** | Fax Sender Email | **FilesUrl** | **string** | Fax Files URL | **Transmissions** | [**List<FaxResponseTransmission>**](FaxResponseTransmission.md) | Fax Transmissions List | **Subject** | **string** | Fax Subject | [optional] **Message** | **string** | Fax Message | [optional] **FinalCopyUri** | **string** | The path where the completed document can be downloaded | [optional] +**FaxId** | **string** | Fax ID | **Title** | **string** | Fax Title | **OriginalTitle** | **string** | Fax Original Title | **Metadata** | **Dictionary<string, Object>** | Fax Metadata | **CreatedAt** | **int** | Fax Created At Timestamp | **Sender** | **string** | Fax Sender Email | **FilesUrl** | **string** | Fax Files URL | **Transmissions** | [**List<FaxResponseTransmission>**](FaxResponseTransmission.md) | Fax Transmissions List | **TestMode** | **bool** | Whether this is a test fax. Test faxes are not delivered to the recipient. Defaults to `false`. | [default to false]**Subject** | **string** | Fax Subject | [optional] **Message** | **string** | Fax Message | [optional] **FinalCopyUri** | **string** | The path where the completed document can be downloaded | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/sdks/dotnet/docs/SignatureRequestBulkCreateEmbeddedWithTemplateRequest.md b/sdks/dotnet/docs/SignatureRequestBulkCreateEmbeddedWithTemplateRequest.md index 002d9501a..5d61e0f69 100644 --- a/sdks/dotnet/docs/SignatureRequestBulkCreateEmbeddedWithTemplateRequest.md +++ b/sdks/dotnet/docs/SignatureRequestBulkCreateEmbeddedWithTemplateRequest.md @@ -4,7 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**TemplateIds** | **List<string>** | Use `template_ids` to create a SignatureRequest from one or more templates, in the order in which the template will be used. | **ClientId** | **string** | Client id of the app you're using to create this embedded signature request. Used for security purposes. | **SignerFile** | **System.IO.Stream** | `signer_file` is a CSV file defining values and options for signer fields. Required unless a `signer_list` is used, you may not use both. The CSV can have the following columns:

- `name`: the name of the signer filling the role of RoleName - `email_address`: email address of the signer filling the role of RoleName - `pin`: the 4- to 12-character access code that will secure this signer's signature page (optional) - `sms_phone_number`: An E.164 formatted phone number that will receive a code via SMS to access this signer's signature page. (optional)

By using the feature, you agree you are responsible for obtaining a signer's consent to receive text messages from Dropbox Sign related to this signature request and confirm you have obtained such consent from all signers prior to enabling SMS delivery for this signature request. [Learn more](https://faq.hellosign.com/hc/en-us/articles/15815316468877-Dropbox-Sign-SMS-tools-add-on).

**NOTE:** Not available in test mode and requires a Standard plan or higher. - `*_field`: any column with a _field" suffix will be treated as a custom field (optional)

You may only specify field values here, any other options should be set in the custom_fields request parameter.

Example CSV:

``` name, email_address, pin, company_field George, george@example.com, d79a3td, ABC Corp Mary, mary@example.com, gd9as5b, 123 LLC ``` | [optional] **SignerList** | [**List<SubBulkSignerList>**](SubBulkSignerList.md) | `signer_list` is an array defining values and options for signer fields. Required unless a `signer_file` is used, you may not use both. | [optional] **AllowDecline** | **bool** | Allows signers to decline to sign a document if `true`. Defaults to `false`. | [optional] [default to false]**Ccs** | [**List<SubCC>**](SubCC.md) | Add CC email recipients. Required when a CC role exists for the Template. | [optional] **CustomFields** | [**List<SubCustomField>**](SubCustomField.md) | When used together with merge fields, `custom_fields` allows users to add pre-filled data to their signature requests.

Pre-filled data can be used with "send-once" signature requests by adding merge fields with `form_fields_per_document` or [Text Tags](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) while passing values back with `custom_fields` together in one API call.

For using pre-filled on repeatable signature requests, merge fields are added to templates in the Dropbox Sign UI or by calling [/template/create_embedded_draft](/api/reference/operation/templateCreateEmbeddedDraft) and then passing `custom_fields` on subsequent signature requests referencing that template. | [optional] **Message** | **string** | The custom message in the email that will be sent to the signers. | [optional] **Metadata** | **Dictionary<string, Object>** | Key-value data that should be attached to the signature request. This metadata is included in all API responses and events involving the signature request. For example, use the metadata field to store a signer's order number for look up when receiving events for the signature request.

Each request can include up to 10 metadata keys (or 50 nested metadata keys), with key names up to 40 characters long and values up to 1000 characters long. | [optional] **SigningRedirectUrl** | **string** | The URL you want signers redirected to after they successfully sign. | [optional] **Subject** | **string** | The subject in the email that will be sent to the signers. | [optional] **TestMode** | **bool** | Whether this is a test, the signature request will not be legally binding if set to `true`. Defaults to `false`. | [optional] [default to false]**Title** | **string** | The title you want to assign to the SignatureRequest. | [optional] +**TemplateIds** | **List<string>** | Use `template_ids` to create a SignatureRequest from one or more templates, in the order in which the template will be used. | **ClientId** | **string** | Client id of the app you're using to create this embedded signature request. Used for security purposes. | **SignerFile** | **System.IO.Stream** | `signer_file` is a CSV file defining values and options for signer fields. Required unless a `signer_list` is used, you may not use both. The CSV can have the following columns:

- `name`: the name of the signer filling the role of RoleName - `email_address`: email address of the signer filling the role of RoleName - `pin`: the 4- to 12-character access code that will secure this signer's signature page (optional) - `sms_phone_number`: An E.164 formatted phone number that will receive a code via SMS to access this signer's signature page. (optional)

By using the feature, you agree you are responsible for obtaining a signer's consent to receive text messages from Dropbox Sign related to this signature request and confirm you have obtained such consent from all signers prior to enabling SMS delivery for this signature request. [Learn more](https://faq.hellosign.com/hc/en-us/articles/15815316468877-Dropbox-Sign-SMS-tools-add-on).

**NOTE:** Not available in test mode and requires a Standard plan or higher. - `*_field`: any column with a _field" suffix will be treated as a custom field (optional)

You may only specify field values here, any other options should be set in the custom_fields request parameter.

Example CSV:

``` name, email_address, pin, company_field George, george@example.com, d79a3td, ABC Corp Mary, mary@example.com, gd9as5b, 123 LLC ``` | [optional] **SignerList** | [**List<SubBulkSignerList>**](SubBulkSignerList.md) | `signer_list` is an array defining values and options for signer fields. Required unless a `signer_file` is used, you may not use both. | [optional] **AllowDecline** | **bool** | Allows signers to decline to sign a document if `true`. Defaults to `false`. | [optional] [default to false]**Ccs** | [**List<SubCC>**](SubCC.md) | Add CC email recipients. Required when a CC role exists for the Template. | [optional] **CustomFields** | [**List<SubCustomField>**](SubCustomField.md) | When used together with merge fields, `custom_fields` allows users to add pre-filled data to their signature requests.

Pre-filled data can be used with "send-once" signature requests by adding merge fields with `form_fields_per_document` or [Text Tags](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) while passing values back with `custom_fields` together in one API call.

For using pre-filled on repeatable signature requests, merge fields are added to templates in the Dropbox Sign UI or by calling [/template/create_embedded_draft](/api/reference/operation/templateCreateEmbeddedDraft) and then passing `custom_fields` on subsequent signature requests referencing that template. | [optional] **Message** | **string** | The custom message in the email that will be sent to the signers. | [optional] **Metadata** | **Dictionary<string, Object>** | Key-value data that should be attached to the signature request. This metadata is included in all API responses and events involving the signature request. For example, use the metadata field to store a signer's order number for look up when receiving events for the signature request.

Each request can include up to 10 metadata keys (or 50 nested metadata keys), with key names up to 40 characters long and values up to 1000 characters long. | [optional] **SigningRedirectUrl** | **string** | The URL you want signers redirected to after they successfully sign. | [optional] **Subject** | **string** | The subject in the email that will be sent to the signers. | [optional] **TestMode** | **bool** | Whether this is a test, the signature request will not be legally binding if set to `true`. Defaults to `false`. | [optional] [default to false]**Title** | **string** | The title you want to assign to the SignatureRequest. | [optional] **ExpiresAt** | **int?** | When the signature request will expire. Unsigned signatures will be moved to the expired status, and no longer signable. See [Signature Request Expiration Date](https://developers.hellosign.com/docs/signature-request/expiration/) for details. | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/sdks/dotnet/docs/SignatureRequestBulkSendWithTemplateRequest.md b/sdks/dotnet/docs/SignatureRequestBulkSendWithTemplateRequest.md index 8e108215e..546578d42 100644 --- a/sdks/dotnet/docs/SignatureRequestBulkSendWithTemplateRequest.md +++ b/sdks/dotnet/docs/SignatureRequestBulkSendWithTemplateRequest.md @@ -4,7 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**TemplateIds** | **List<string>** | Use `template_ids` to create a SignatureRequest from one or more templates, in the order in which the template will be used. | **SignerFile** | **System.IO.Stream** | `signer_file` is a CSV file defining values and options for signer fields. Required unless a `signer_list` is used, you may not use both. The CSV can have the following columns:

- `name`: the name of the signer filling the role of RoleName - `email_address`: email address of the signer filling the role of RoleName - `pin`: the 4- to 12-character access code that will secure this signer's signature page (optional) - `sms_phone_number`: An E.164 formatted phone number that will receive a code via SMS to access this signer's signature page. (optional)

By using the feature, you agree you are responsible for obtaining a signer's consent to receive text messages from Dropbox Sign related to this signature request and confirm you have obtained such consent from all signers prior to enabling SMS delivery for this signature request. [Learn more](https://faq.hellosign.com/hc/en-us/articles/15815316468877-Dropbox-Sign-SMS-tools-add-on).

**NOTE:** Not available in test mode and requires a Standard plan or higher. - `*_field`: any column with a _field" suffix will be treated as a custom field (optional)

You may only specify field values here, any other options should be set in the custom_fields request parameter.

Example CSV:

``` name, email_address, pin, company_field George, george@example.com, d79a3td, ABC Corp Mary, mary@example.com, gd9as5b, 123 LLC ``` | [optional] **SignerList** | [**List<SubBulkSignerList>**](SubBulkSignerList.md) | `signer_list` is an array defining values and options for signer fields. Required unless a `signer_file` is used, you may not use both. | [optional] **AllowDecline** | **bool** | Allows signers to decline to sign a document if `true`. Defaults to `false`. | [optional] [default to false]**Ccs** | [**List<SubCC>**](SubCC.md) | Add CC email recipients. Required when a CC role exists for the Template. | [optional] **ClientId** | **string** | The client id of the API App you want to associate with this request. Used to apply the branding and callback url defined for the app. | [optional] **CustomFields** | [**List<SubCustomField>**](SubCustomField.md) | When used together with merge fields, `custom_fields` allows users to add pre-filled data to their signature requests.

Pre-filled data can be used with "send-once" signature requests by adding merge fields with `form_fields_per_document` or [Text Tags](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) while passing values back with `custom_fields` together in one API call.

For using pre-filled on repeatable signature requests, merge fields are added to templates in the Dropbox Sign UI or by calling [/template/create_embedded_draft](/api/reference/operation/templateCreateEmbeddedDraft) and then passing `custom_fields` on subsequent signature requests referencing that template. | [optional] **Message** | **string** | The custom message in the email that will be sent to the signers. | [optional] **Metadata** | **Dictionary<string, Object>** | Key-value data that should be attached to the signature request. This metadata is included in all API responses and events involving the signature request. For example, use the metadata field to store a signer's order number for look up when receiving events for the signature request.

Each request can include up to 10 metadata keys (or 50 nested metadata keys), with key names up to 40 characters long and values up to 1000 characters long. | [optional] **SigningRedirectUrl** | **string** | The URL you want signers redirected to after they successfully sign. | [optional] **Subject** | **string** | The subject in the email that will be sent to the signers. | [optional] **TestMode** | **bool** | Whether this is a test, the signature request will not be legally binding if set to `true`. Defaults to `false`. | [optional] [default to false]**Title** | **string** | The title you want to assign to the SignatureRequest. | [optional] +**TemplateIds** | **List<string>** | Use `template_ids` to create a SignatureRequest from one or more templates, in the order in which the template will be used. | **SignerFile** | **System.IO.Stream** | `signer_file` is a CSV file defining values and options for signer fields. Required unless a `signer_list` is used, you may not use both. The CSV can have the following columns:

- `name`: the name of the signer filling the role of RoleName - `email_address`: email address of the signer filling the role of RoleName - `pin`: the 4- to 12-character access code that will secure this signer's signature page (optional) - `sms_phone_number`: An E.164 formatted phone number that will receive a code via SMS to access this signer's signature page. (optional)

By using the feature, you agree you are responsible for obtaining a signer's consent to receive text messages from Dropbox Sign related to this signature request and confirm you have obtained such consent from all signers prior to enabling SMS delivery for this signature request. [Learn more](https://faq.hellosign.com/hc/en-us/articles/15815316468877-Dropbox-Sign-SMS-tools-add-on).

**NOTE:** Not available in test mode and requires a Standard plan or higher. - `*_field`: any column with a _field" suffix will be treated as a custom field (optional)

You may only specify field values here, any other options should be set in the custom_fields request parameter.

Example CSV:

``` name, email_address, pin, company_field George, george@example.com, d79a3td, ABC Corp Mary, mary@example.com, gd9as5b, 123 LLC ``` | [optional] **SignerList** | [**List<SubBulkSignerList>**](SubBulkSignerList.md) | `signer_list` is an array defining values and options for signer fields. Required unless a `signer_file` is used, you may not use both. | [optional] **AllowDecline** | **bool** | Allows signers to decline to sign a document if `true`. Defaults to `false`. | [optional] [default to false]**Ccs** | [**List<SubCC>**](SubCC.md) | Add CC email recipients. Required when a CC role exists for the Template. | [optional] **ClientId** | **string** | The client id of the API App you want to associate with this request. Used to apply the branding and callback url defined for the app. | [optional] **CustomFields** | [**List<SubCustomField>**](SubCustomField.md) | When used together with merge fields, `custom_fields` allows users to add pre-filled data to their signature requests.

Pre-filled data can be used with "send-once" signature requests by adding merge fields with `form_fields_per_document` or [Text Tags](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) while passing values back with `custom_fields` together in one API call.

For using pre-filled on repeatable signature requests, merge fields are added to templates in the Dropbox Sign UI or by calling [/template/create_embedded_draft](/api/reference/operation/templateCreateEmbeddedDraft) and then passing `custom_fields` on subsequent signature requests referencing that template. | [optional] **Message** | **string** | The custom message in the email that will be sent to the signers. | [optional] **Metadata** | **Dictionary<string, Object>** | Key-value data that should be attached to the signature request. This metadata is included in all API responses and events involving the signature request. For example, use the metadata field to store a signer's order number for look up when receiving events for the signature request.

Each request can include up to 10 metadata keys (or 50 nested metadata keys), with key names up to 40 characters long and values up to 1000 characters long. | [optional] **SigningRedirectUrl** | **string** | The URL you want signers redirected to after they successfully sign. | [optional] **Subject** | **string** | The subject in the email that will be sent to the signers. | [optional] **TestMode** | **bool** | Whether this is a test, the signature request will not be legally binding if set to `true`. Defaults to `false`. | [optional] [default to false]**Title** | **string** | The title you want to assign to the SignatureRequest. | [optional] **ExpiresAt** | **int?** | When the signature request will expire. Unsigned signatures will be moved to the expired status, and no longer signable. See [Signature Request Expiration Date](https://developers.hellosign.com/docs/signature-request/expiration/) for details. | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/sdks/dotnet/docs/SignatureRequestCreateEmbeddedWithTemplateRequest.md b/sdks/dotnet/docs/SignatureRequestCreateEmbeddedWithTemplateRequest.md index 61bab9b3a..9605a8333 100644 --- a/sdks/dotnet/docs/SignatureRequestCreateEmbeddedWithTemplateRequest.md +++ b/sdks/dotnet/docs/SignatureRequestCreateEmbeddedWithTemplateRequest.md @@ -4,7 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**TemplateIds** | **List<string>** | Use `template_ids` to create a SignatureRequest from one or more templates, in the order in which the template will be used. | **ClientId** | **string** | Client id of the app you're using to create this embedded signature request. Used for security purposes. | **Signers** | [**List<SubSignatureRequestTemplateSigner>**](SubSignatureRequestTemplateSigner.md) | Add Signers to your Templated-based Signature Request. | **AllowDecline** | **bool** | Allows signers to decline to sign a document if `true`. Defaults to `false`. | [optional] [default to false]**Ccs** | [**List<SubCC>**](SubCC.md) | Add CC email recipients. Required when a CC role exists for the Template. | [optional] **CustomFields** | [**List<SubCustomField>**](SubCustomField.md) | An array defining values and options for custom fields. Required when a custom field exists in the Template. | [optional] **Files** | **List<System.IO.Stream>** | Use `files[]` to indicate the uploaded file(s) to send for signature.

This endpoint requires either **files** or **file_urls[]**, but not both. | [optional] **FileUrls** | **List<string>** | Use `file_urls[]` to have Dropbox Sign download the file(s) to send for signature.

This endpoint requires either **files** or **file_urls[]**, but not both. | [optional] **Message** | **string** | The custom message in the email that will be sent to the signers. | [optional] **Metadata** | **Dictionary<string, Object>** | Key-value data that should be attached to the signature request. This metadata is included in all API responses and events involving the signature request. For example, use the metadata field to store a signer's order number for look up when receiving events for the signature request.

Each request can include up to 10 metadata keys (or 50 nested metadata keys), with key names up to 40 characters long and values up to 1000 characters long. | [optional] **SigningOptions** | [**SubSigningOptions**](SubSigningOptions.md) | | [optional] **Subject** | **string** | The subject in the email that will be sent to the signers. | [optional] **TestMode** | **bool** | Whether this is a test, the signature request will not be legally binding if set to `true`. Defaults to `false`. | [optional] [default to false]**Title** | **string** | The title you want to assign to the SignatureRequest. | [optional] **PopulateAutoFillFields** | **bool** | Controls whether [auto fill fields](https://faq.hellosign.com/hc/en-us/articles/360051467511-Auto-Fill-Fields) can automatically populate a signer's information during signing.

**NOTE:** Keep your signer's information safe by ensuring that the _signer on your signature request is the intended party_ before using this feature. | [optional] [default to false] +**TemplateIds** | **List<string>** | Use `template_ids` to create a SignatureRequest from one or more templates, in the order in which the template will be used. | **ClientId** | **string** | Client id of the app you're using to create this embedded signature request. Used for security purposes. | **Signers** | [**List<SubSignatureRequestTemplateSigner>**](SubSignatureRequestTemplateSigner.md) | Add Signers to your Templated-based Signature Request. | **AllowDecline** | **bool** | Allows signers to decline to sign a document if `true`. Defaults to `false`. | [optional] [default to false]**Ccs** | [**List<SubCC>**](SubCC.md) | Add CC email recipients. Required when a CC role exists for the Template. | [optional] **CustomFields** | [**List<SubCustomField>**](SubCustomField.md) | An array defining values and options for custom fields. Required when a custom field exists in the Template. | [optional] **Files** | **List<System.IO.Stream>** | Use `files[]` to indicate the uploaded file(s) to send for signature.

This endpoint requires either **files** or **file_urls[]**, but not both. | [optional] **FileUrls** | **List<string>** | Use `file_urls[]` to have Dropbox Sign download the file(s) to send for signature.

This endpoint requires either **files** or **file_urls[]**, but not both. | [optional] **Message** | **string** | The custom message in the email that will be sent to the signers. | [optional] **Metadata** | **Dictionary<string, Object>** | Key-value data that should be attached to the signature request. This metadata is included in all API responses and events involving the signature request. For example, use the metadata field to store a signer's order number for look up when receiving events for the signature request.

Each request can include up to 10 metadata keys (or 50 nested metadata keys), with key names up to 40 characters long and values up to 1000 characters long. | [optional] **SigningOptions** | [**SubSigningOptions**](SubSigningOptions.md) | | [optional] **Subject** | **string** | The subject in the email that will be sent to the signers. | [optional] **TestMode** | **bool** | Whether this is a test, the signature request will not be legally binding if set to `true`. Defaults to `false`. | [optional] [default to false]**Title** | **string** | The title you want to assign to the SignatureRequest. | [optional] **PopulateAutoFillFields** | **bool** | Controls whether [auto fill fields](https://faq.hellosign.com/hc/en-us/articles/360051467511-Auto-Fill-Fields) can automatically populate a signer's information during signing.

**NOTE:** Keep your signer's information safe by ensuring that the _signer on your signature request is the intended party_ before using this feature. | [optional] [default to false]**ExpiresAt** | **int?** | When the signature request will expire. Unsigned signatures will be moved to the expired status, and no longer signable. See [Signature Request Expiration Date](https://developers.hellosign.com/docs/signature-request/expiration/) for details. | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/sdks/dotnet/docs/SignatureRequestSendWithTemplateRequest.md b/sdks/dotnet/docs/SignatureRequestSendWithTemplateRequest.md index 89bbdcc3a..3b5aed968 100644 --- a/sdks/dotnet/docs/SignatureRequestSendWithTemplateRequest.md +++ b/sdks/dotnet/docs/SignatureRequestSendWithTemplateRequest.md @@ -4,7 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**TemplateIds** | **List<string>** | Use `template_ids` to create a SignatureRequest from one or more templates, in the order in which the template will be used. | **Signers** | [**List<SubSignatureRequestTemplateSigner>**](SubSignatureRequestTemplateSigner.md) | Add Signers to your Templated-based Signature Request. | **AllowDecline** | **bool** | Allows signers to decline to sign a document if `true`. Defaults to `false`. | [optional] [default to false]**Ccs** | [**List<SubCC>**](SubCC.md) | Add CC email recipients. Required when a CC role exists for the Template. | [optional] **ClientId** | **string** | Client id of the app to associate with the signature request. Used to apply the branding and callback url defined for the app. | [optional] **CustomFields** | [**List<SubCustomField>**](SubCustomField.md) | An array defining values and options for custom fields. Required when a custom field exists in the Template. | [optional] **Files** | **List<System.IO.Stream>** | Use `files[]` to indicate the uploaded file(s) to send for signature.

This endpoint requires either **files** or **file_urls[]**, but not both. | [optional] **FileUrls** | **List<string>** | Use `file_urls[]` to have Dropbox Sign download the file(s) to send for signature.

This endpoint requires either **files** or **file_urls[]**, but not both. | [optional] **IsQualifiedSignature** | **bool** | Send with a value of `true` if you wish to enable [Qualified Electronic Signatures](https://www.hellosign.com/features/qualified-electronic-signatures) (QES), which requires a face-to-face call to verify the signer's identity.<br>
**NOTE:** QES is only available on the Premium API plan as an add-on purchase. Cannot be used in `test_mode`. Only works on requests with one signer. | [optional] [default to false]**IsEid** | **bool** | Send with a value of `true` if you wish to enable [electronic identification (eID)](https://www.hellosign.com/features/electronic-id), which requires the signer to verify their identity with an eID provider to sign a document.<br>
**NOTE:** You need the eID add-on to use this feature. Please [contact sales](https://sign.dropbox.com/form/contact-sales) for more information. Cannot be used in `test_mode`. Only works on requests with one signer. | [optional] [default to false]**Message** | **string** | The custom message in the email that will be sent to the signers. | [optional] **Metadata** | **Dictionary<string, Object>** | Key-value data that should be attached to the signature request. This metadata is included in all API responses and events involving the signature request. For example, use the metadata field to store a signer's order number for look up when receiving events for the signature request.

Each request can include up to 10 metadata keys (or 50 nested metadata keys), with key names up to 40 characters long and values up to 1000 characters long. | [optional] **SigningOptions** | [**SubSigningOptions**](SubSigningOptions.md) | | [optional] **SigningRedirectUrl** | **string** | The URL you want signers redirected to after they successfully sign. | [optional] **Subject** | **string** | The subject in the email that will be sent to the signers. | [optional] **TestMode** | **bool** | Whether this is a test, the signature request will not be legally binding if set to `true`. Defaults to `false`. | [optional] [default to false]**Title** | **string** | The title you want to assign to the SignatureRequest. | [optional] +**TemplateIds** | **List<string>** | Use `template_ids` to create a SignatureRequest from one or more templates, in the order in which the template will be used. | **Signers** | [**List<SubSignatureRequestTemplateSigner>**](SubSignatureRequestTemplateSigner.md) | Add Signers to your Templated-based Signature Request. | **AllowDecline** | **bool** | Allows signers to decline to sign a document if `true`. Defaults to `false`. | [optional] [default to false]**Ccs** | [**List<SubCC>**](SubCC.md) | Add CC email recipients. Required when a CC role exists for the Template. | [optional] **ClientId** | **string** | Client id of the app to associate with the signature request. Used to apply the branding and callback url defined for the app. | [optional] **CustomFields** | [**List<SubCustomField>**](SubCustomField.md) | An array defining values and options for custom fields. Required when a custom field exists in the Template. | [optional] **Files** | **List<System.IO.Stream>** | Use `files[]` to indicate the uploaded file(s) to send for signature.

This endpoint requires either **files** or **file_urls[]**, but not both. | [optional] **FileUrls** | **List<string>** | Use `file_urls[]` to have Dropbox Sign download the file(s) to send for signature.

This endpoint requires either **files** or **file_urls[]**, but not both. | [optional] **IsQualifiedSignature** | **bool** | Send with a value of `true` if you wish to enable [Qualified Electronic Signatures](https://www.hellosign.com/features/qualified-electronic-signatures) (QES), which requires a face-to-face call to verify the signer's identity.<br>
**NOTE:** QES is only available on the Premium API plan as an add-on purchase. Cannot be used in `test_mode`. Only works on requests with one signer. | [optional] [default to false]**IsEid** | **bool** | Send with a value of `true` if you wish to enable [electronic identification (eID)](https://www.hellosign.com/features/electronic-id), which requires the signer to verify their identity with an eID provider to sign a document.<br>
**NOTE:** You need the eID add-on to use this feature. Please [contact sales](https://sign.dropbox.com/form/contact-sales) for more information. Cannot be used in `test_mode`. Only works on requests with one signer. | [optional] [default to false]**Message** | **string** | The custom message in the email that will be sent to the signers. | [optional] **Metadata** | **Dictionary<string, Object>** | Key-value data that should be attached to the signature request. This metadata is included in all API responses and events involving the signature request. For example, use the metadata field to store a signer's order number for look up when receiving events for the signature request.

Each request can include up to 10 metadata keys (or 50 nested metadata keys), with key names up to 40 characters long and values up to 1000 characters long. | [optional] **SigningOptions** | [**SubSigningOptions**](SubSigningOptions.md) | | [optional] **SigningRedirectUrl** | **string** | The URL you want signers redirected to after they successfully sign. | [optional] **Subject** | **string** | The subject in the email that will be sent to the signers. | [optional] **TestMode** | **bool** | Whether this is a test, the signature request will not be legally binding if set to `true`. Defaults to `false`. | [optional] [default to false]**Title** | **string** | The title you want to assign to the SignatureRequest. | [optional] **ExpiresAt** | **int?** | When the signature request will expire. Unsigned signatures will be moved to the expired status, and no longer signable. See [Signature Request Expiration Date](https://developers.hellosign.com/docs/signature-request/expiration/) for details. | [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/DocumentApi.cs b/sdks/dotnet/src/Dropbox.Sign/Api/DocumentApi.cs new file mode 100644 index 000000000..3bd7a700a --- /dev/null +++ b/sdks/dotnet/src/Dropbox.Sign/Api/DocumentApi.cs @@ -0,0 +1,400 @@ +/* + * 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.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.Net; +using System.Net.Mime; +using Dropbox.Sign.Client; +using Dropbox.Sign.Model; + +namespace Dropbox.Sign.Api +{ + + /// + /// Represents a collection of functions to interact with the API endpoints + /// + public interface IDocumentApiSync : IApiAccessor + { + #region Synchronous Operations + /// + /// Detect Document Fields + /// + /// + /// Detects form fields in a PDF document using either PDF form annotations or Dropbox Sign text tags. + /// + /// https://github.com/hellosign/dropbox-sign-dotnet/blob/main/examples/DocumentDetectFieldsExample.cs + /// Thrown when fails to make API call + /// + /// Index associated with the operation. + /// DocumentFieldDetectionResponse + DocumentFieldDetectionResponse DocumentDetectFields(DocumentFieldDetectionRequest documentFieldDetectionRequest, int operationIndex = 0); + + /// + /// Detect Document Fields + /// + /// + /// Detects form fields in a PDF document using either PDF form annotations or Dropbox Sign text tags. + /// + /// https://github.com/hellosign/dropbox-sign-dotnet/blob/main/examples/DocumentDetectFieldsExample.cs + /// Thrown when fails to make API call + /// + /// Index associated with the operation. + /// ApiResponse of DocumentFieldDetectionResponse + ApiResponse DocumentDetectFieldsWithHttpInfo(DocumentFieldDetectionRequest documentFieldDetectionRequest, int operationIndex = 0); + #endregion Synchronous Operations + } + + /// + /// Represents a collection of functions to interact with the API endpoints + /// + public interface IDocumentApiAsync : IApiAccessor + { + #region Asynchronous Operations + /// + /// Detect Document Fields + /// + /// + /// Detects form fields in a PDF document using either PDF form annotations or Dropbox Sign text tags. + /// + /// https://github.com/hellosign/dropbox-sign-dotnet/blob/main/examples/DocumentDetectFieldsExample.cs + /// Thrown when fails to make API call + /// + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of DocumentFieldDetectionResponse + System.Threading.Tasks.Task DocumentDetectFieldsAsync(DocumentFieldDetectionRequest documentFieldDetectionRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + + /// + /// Detect Document Fields + /// + /// + /// Detects form fields in a PDF document using either PDF form annotations or Dropbox Sign text tags. + /// + /// https://github.com/hellosign/dropbox-sign-dotnet/blob/main/examples/DocumentDetectFieldsExample.cs + /// Thrown when fails to make API call + /// + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (DocumentFieldDetectionResponse) + System.Threading.Tasks.Task> DocumentDetectFieldsWithHttpInfoAsync(DocumentFieldDetectionRequest documentFieldDetectionRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + #endregion Asynchronous Operations + } + + /// + /// Represents a collection of functions to interact with the API endpoints + /// + public interface IDocumentApi : IDocumentApiSync, IDocumentApiAsync + { + + } + + /// + /// Represents a collection of functions to interact with the API endpoints + /// + public partial class DocumentApi : IDocumentApi + { + private Dropbox.Sign.Client.ExceptionFactory _exceptionFactory = (name, response) => null; + + /// + /// Initializes a new instance of the class. + /// + /// + public DocumentApi() : this((string)null) + { + } + + /// + /// Initializes a new instance of the class. + /// + /// + public DocumentApi(string basePath) + { + this.Configuration = Dropbox.Sign.Client.Configuration.MergeConfigurations( + Dropbox.Sign.Client.GlobalConfiguration.Instance, + new Dropbox.Sign.Client.Configuration { BasePath = basePath } + ); + this.Client = new Dropbox.Sign.Client.ApiClient(this.Configuration.BasePath); + this.AsynchronousClient = new Dropbox.Sign.Client.ApiClient(this.Configuration.BasePath); + this.ExceptionFactory = Dropbox.Sign.Client.Configuration.DefaultExceptionFactory; + } + + /// + /// Initializes a new instance of the class + /// using Configuration object + /// + /// An instance of Configuration + /// + public DocumentApi(Dropbox.Sign.Client.Configuration configuration) + { + if (configuration == null) throw new ArgumentNullException("configuration"); + + this.Configuration = Dropbox.Sign.Client.Configuration.MergeConfigurations( + Dropbox.Sign.Client.GlobalConfiguration.Instance, + configuration + ); + this.Client = new Dropbox.Sign.Client.ApiClient(this.Configuration.BasePath); + this.AsynchronousClient = new Dropbox.Sign.Client.ApiClient(this.Configuration.BasePath); + ExceptionFactory = Dropbox.Sign.Client.Configuration.DefaultExceptionFactory; + } + + /// + /// Initializes a new instance of the class + /// using a Configuration object and client instance. + /// + /// The client interface for synchronous API access. + /// The client interface for asynchronous API access. + /// The configuration object. + public DocumentApi(Dropbox.Sign.Client.ISynchronousClient client, Dropbox.Sign.Client.IAsynchronousClient asyncClient, Dropbox.Sign.Client.IReadableConfiguration configuration) + { + if (client == null) throw new ArgumentNullException("client"); + if (asyncClient == null) throw new ArgumentNullException("asyncClient"); + if (configuration == null) throw new ArgumentNullException("configuration"); + + this.Client = client; + this.AsynchronousClient = asyncClient; + this.Configuration = configuration; + this.ExceptionFactory = Dropbox.Sign.Client.Configuration.DefaultExceptionFactory; + } + + /// + /// The client for accessing this underlying API asynchronously. + /// + public Dropbox.Sign.Client.IAsynchronousClient AsynchronousClient { get; set; } + + /// + /// The client for accessing this underlying API synchronously. + /// + public Dropbox.Sign.Client.ISynchronousClient Client { get; set; } + + /// + /// Gets the base path of the API client. + /// + /// The base path + public string GetBasePath() + { + return this.Configuration.BasePath; + } + + /// + /// Gets or sets the configuration object + /// + /// An instance of the Configuration + public Dropbox.Sign.Client.IReadableConfiguration Configuration { get; set; } + + /// + /// Provides a factory method hook for the creation of exceptions. + /// + public Dropbox.Sign.Client.ExceptionFactory ExceptionFactory + { + get + { + if (_exceptionFactory != null && _exceptionFactory.GetInvocationList().Length > 1) + { + throw new InvalidOperationException("Multicast delegate for ExceptionFactory is unsupported."); + } + return _exceptionFactory; + } + set { _exceptionFactory = value; } + } + + /// + /// Detect Document Fields Detects form fields in a PDF document using either PDF form annotations or Dropbox Sign text tags. + /// + /// https://github.com/hellosign/dropbox-sign-dotnet/blob/main/examples/DocumentDetectFieldsExample.cs + /// Thrown when fails to make API call + /// + /// Index associated with the operation. + /// DocumentFieldDetectionResponse + public DocumentFieldDetectionResponse DocumentDetectFields(DocumentFieldDetectionRequest documentFieldDetectionRequest, int operationIndex = 0) + { + Dropbox.Sign.Client.ApiResponse localVarResponse = DocumentDetectFieldsWithHttpInfo(documentFieldDetectionRequest); + return localVarResponse.Data; + } + + /// + /// Detect Document Fields Detects form fields in a PDF document using either PDF form annotations or Dropbox Sign text tags. + /// + /// https://github.com/hellosign/dropbox-sign-dotnet/blob/main/examples/DocumentDetectFieldsExample.cs + /// Thrown when fails to make API call + /// + /// Index associated with the operation. + /// ApiResponse of DocumentFieldDetectionResponse + public Dropbox.Sign.Client.ApiResponse DocumentDetectFieldsWithHttpInfo(DocumentFieldDetectionRequest documentFieldDetectionRequest, int operationIndex = 0) + { + // verify the required parameter 'documentFieldDetectionRequest' is set + if (documentFieldDetectionRequest == null) + { + throw new Dropbox.Sign.Client.ApiException(400, "Missing required parameter 'documentFieldDetectionRequest' when calling DocumentApi->DocumentDetectFields"); + } + + Dropbox.Sign.Client.RequestOptions localVarRequestOptions = new Dropbox.Sign.Client.RequestOptions(); + + var localVarContentType = ""; + var openApiTypes = documentFieldDetectionRequest.GetOpenApiTypes(); + if (ClientUtils.HasFileType(openApiTypes)) + { + ClientUtils.SetFormData(localVarRequestOptions, openApiTypes); + localVarContentType = "multipart/form-data"; + } + else + { + localVarContentType = "application/json"; + localVarRequestOptions.Data = documentFieldDetectionRequest; + } + + // 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.Operation = "DocumentApi.DocumentDetectFields"; + 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("/document/detect_fields", localVarRequestOptions, this.Configuration); + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("DocumentDetectFields", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + + /// + /// Detect Document Fields Detects form fields in a PDF document using either PDF form annotations or Dropbox Sign text tags. + /// + /// https://github.com/hellosign/dropbox-sign-dotnet/blob/main/examples/DocumentDetectFieldsExample.cs + /// Thrown when fails to make API call + /// + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of DocumentFieldDetectionResponse + public async System.Threading.Tasks.Task DocumentDetectFieldsAsync(DocumentFieldDetectionRequest documentFieldDetectionRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + { + Dropbox.Sign.Client.ApiResponse localVarResponse = await DocumentDetectFieldsWithHttpInfoAsync(documentFieldDetectionRequest, operationIndex, cancellationToken).ConfigureAwait(false); + return localVarResponse.Data; + } + + /// + /// Detect Document Fields Detects form fields in a PDF document using either PDF form annotations or Dropbox Sign text tags. + /// + /// https://github.com/hellosign/dropbox-sign-dotnet/blob/main/examples/DocumentDetectFieldsExample.cs + /// Thrown when fails to make API call + /// + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (DocumentFieldDetectionResponse) + public async System.Threading.Tasks.Task> DocumentDetectFieldsWithHttpInfoAsync(DocumentFieldDetectionRequest documentFieldDetectionRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + { + // verify the required parameter 'documentFieldDetectionRequest' is set + if (documentFieldDetectionRequest == null) + { + throw new Dropbox.Sign.Client.ApiException(400, "Missing required parameter 'documentFieldDetectionRequest' when calling DocumentApi->DocumentDetectFields"); + } + + + Dropbox.Sign.Client.RequestOptions localVarRequestOptions = new Dropbox.Sign.Client.RequestOptions(); + + var localVarContentType = ""; + var openApiTypes = documentFieldDetectionRequest.GetOpenApiTypes(); + if (ClientUtils.HasFileType(openApiTypes)) + { + ClientUtils.SetFormData(localVarRequestOptions, openApiTypes); + localVarContentType = "multipart/form-data"; + } + else + { + localVarContentType = "application/json"; + localVarRequestOptions.Data = documentFieldDetectionRequest; + } + + // 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.Operation = "DocumentApi.DocumentDetectFields"; + 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("/document/detect_fields", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("DocumentDetectFields", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + + } +} diff --git a/sdks/dotnet/src/Dropbox.Sign/Model/DocumentFieldDetectionRequest.cs b/sdks/dotnet/src/Dropbox.Sign/Model/DocumentFieldDetectionRequest.cs new file mode 100644 index 000000000..11057c497 --- /dev/null +++ b/sdks/dotnet/src/Dropbox.Sign/Model/DocumentFieldDetectionRequest.cs @@ -0,0 +1,260 @@ +/* + * 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 +{ + /// + /// DocumentFieldDetectionRequest + /// + [DataContract(Name = "DocumentFieldDetectionRequest")] + [JsonObject(ItemNullValueHandling = NullValueHandling.Ignore)] + public partial class DocumentFieldDetectionRequest : IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + [JsonConstructorAttribute] + protected DocumentFieldDetectionRequest() { } + /// + /// Initializes a new instance of the class. + /// + /// The PDF file to analyze. This endpoint requires either `file` or `file_url`, but not both.. + /// The URL of the PDF file to analyze. This endpoint requires either `file` or `file_url`, but not both.. + /// The field detection method to use. Set to `annotations` to detect PDF form annotations or `text_tags` to detect Dropbox Sign text tags. (required). + /// The zero-based page indexes to analyze. Accepts `all`, individual pages, inclusive ranges, or comma-separated combinations, such as `0-2,5,7-9`. Defaults to `all`.. + public DocumentFieldDetectionRequest(System.IO.Stream file = default(System.IO.Stream), string fileUrl = default(string), string detectionMode = default(string), string pageRange = default(string)) + { + + // to ensure "detectionMode" is required (not null) + if (detectionMode == null) + { + throw new ArgumentNullException("detectionMode is a required property for DocumentFieldDetectionRequest and cannot be null"); + } + this.DetectionMode = detectionMode; + this.File = file; + this.FileUrl = fileUrl; + this.PageRange = pageRange; + } + + /// + /// Attempt to instantiate and hydrate a new instance of this class + /// + /// String of JSON data representing target object + public static DocumentFieldDetectionRequest Init(string jsonData) + { + var obj = JsonConvert.DeserializeObject(jsonData); + + if (obj == null) + { + throw new Exception("Unable to deserialize JSON to instance of DocumentFieldDetectionRequest"); + } + + return obj; + } + + /// + /// The field detection method to use. Set to `annotations` to detect PDF form annotations or `text_tags` to detect Dropbox Sign text tags. + /// + /// The field detection method to use. Set to `annotations` to detect PDF form annotations or `text_tags` to detect Dropbox Sign text tags. + [DataMember(Name = "detection_mode", IsRequired = true, EmitDefaultValue = true)] + public string DetectionMode { get; set; } + + /// + /// The PDF file to analyze. This endpoint requires either `file` or `file_url`, but not both. + /// + /// The PDF file to analyze. This endpoint requires either `file` or `file_url`, but not both. + [DataMember(Name = "file", EmitDefaultValue = true)] + public System.IO.Stream File { get; set; } + + /// + /// The URL of the PDF file to analyze. This endpoint requires either `file` or `file_url`, but not both. + /// + /// The URL of the PDF file to analyze. This endpoint requires either `file` or `file_url`, but not both. + [DataMember(Name = "file_url", EmitDefaultValue = true)] + public string FileUrl { get; set; } + + /// + /// The zero-based page indexes to analyze. Accepts `all`, individual pages, inclusive ranges, or comma-separated combinations, such as `0-2,5,7-9`. Defaults to `all`. + /// + /// The zero-based page indexes to analyze. Accepts `all`, individual pages, inclusive ranges, or comma-separated combinations, such as `0-2,5,7-9`. Defaults to `all`. + /// 0-2,5,7-9 + [DataMember(Name = "page_range", EmitDefaultValue = true)] + public string PageRange { 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 DocumentFieldDetectionRequest {\n"); + sb.Append(" DetectionMode: ").Append(DetectionMode).Append("\n"); + sb.Append(" File: ").Append(File).Append("\n"); + sb.Append(" FileUrl: ").Append(FileUrl).Append("\n"); + sb.Append(" PageRange: ").Append(PageRange).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 DocumentFieldDetectionRequest); + } + + /// + /// Returns true if DocumentFieldDetectionRequest instances are equal + /// + /// Instance of DocumentFieldDetectionRequest to be compared + /// Boolean + public bool Equals(DocumentFieldDetectionRequest input) + { + if (input == null) + { + return false; + } + return + ( + this.DetectionMode == input.DetectionMode || + (this.DetectionMode != null && + this.DetectionMode.Equals(input.DetectionMode)) + ) && + ( + this.File == input.File || + (this.File != null && + this.File.Equals(input.File)) + ) && + ( + this.FileUrl == input.FileUrl || + (this.FileUrl != null && + this.FileUrl.Equals(input.FileUrl)) + ) && + ( + this.PageRange == input.PageRange || + (this.PageRange != null && + this.PageRange.Equals(input.PageRange)) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.DetectionMode != null) + { + hashCode = (hashCode * 59) + this.DetectionMode.GetHashCode(); + } + if (this.File != null) + { + hashCode = (hashCode * 59) + this.File.GetHashCode(); + } + if (this.FileUrl != null) + { + hashCode = (hashCode * 59) + this.FileUrl.GetHashCode(); + } + if (this.PageRange != null) + { + hashCode = (hashCode * 59) + this.PageRange.GetHashCode(); + } + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + if (this.PageRange != null) + { + // PageRange (string) pattern + Regex regexPageRange = new Regex(@"^(?:all|\d+(?:-\d+)?(?:,\d+(?:-\d+)?)*)$", RegexOptions.CultureInvariant); + if (!regexPageRange.Match(this.PageRange).Success) + { + yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for PageRange, must match a pattern of " + regexPageRange, new[] { "PageRange" }); + } + } + + yield break; + } + public List GetOpenApiTypes() + { + var types = new List(); + types.Add(new OpenApiType() + { + Name = "detection_mode", + Property = "DetectionMode", + Type = "string", + Value = DetectionMode, + }); + types.Add(new OpenApiType() + { + Name = "file", + Property = "File", + Type = "System.IO.Stream", + Value = File, + }); + types.Add(new OpenApiType() + { + Name = "file_url", + Property = "FileUrl", + Type = "string", + Value = FileUrl, + }); + types.Add(new OpenApiType() + { + Name = "page_range", + Property = "PageRange", + Type = "string", + Value = PageRange, + }); + + return types; + } + } + +} diff --git a/sdks/dotnet/src/Dropbox.Sign/Model/DocumentFieldDetectionResponse.cs b/sdks/dotnet/src/Dropbox.Sign/Model/DocumentFieldDetectionResponse.cs new file mode 100644 index 000000000..db7df3444 --- /dev/null +++ b/sdks/dotnet/src/Dropbox.Sign/Model/DocumentFieldDetectionResponse.cs @@ -0,0 +1,197 @@ +/* + * 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 +{ + /// + /// DocumentFieldDetectionResponse + /// + [DataContract(Name = "DocumentFieldDetectionResponse")] + [JsonObject(ItemNullValueHandling = NullValueHandling.Ignore)] + public partial class DocumentFieldDetectionResponse : IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + [JsonConstructorAttribute] + protected DocumentFieldDetectionResponse() { } + /// + /// Initializes a new instance of the class. + /// + /// detectionResult (required). + /// A list of warnings.. + public DocumentFieldDetectionResponse(DocumentFieldDetectionResponseDetectionResult detectionResult = default(DocumentFieldDetectionResponseDetectionResult), List warnings = default(List)) + { + + // to ensure "detectionResult" is required (not null) + if (detectionResult == null) + { + throw new ArgumentNullException("detectionResult is a required property for DocumentFieldDetectionResponse and cannot be null"); + } + this.DetectionResult = detectionResult; + this.Warnings = warnings; + } + + /// + /// Attempt to instantiate and hydrate a new instance of this class + /// + /// String of JSON data representing target object + public static DocumentFieldDetectionResponse Init(string jsonData) + { + var obj = JsonConvert.DeserializeObject(jsonData); + + if (obj == null) + { + throw new Exception("Unable to deserialize JSON to instance of DocumentFieldDetectionResponse"); + } + + return obj; + } + + /// + /// Gets or Sets DetectionResult + /// + [DataMember(Name = "detection_result", IsRequired = true, EmitDefaultValue = true)] + public DocumentFieldDetectionResponseDetectionResult DetectionResult { get; set; } + + /// + /// A list of warnings. + /// + /// A list of warnings. + [DataMember(Name = "warnings", EmitDefaultValue = true)] + public List Warnings { 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 DocumentFieldDetectionResponse {\n"); + sb.Append(" DetectionResult: ").Append(DetectionResult).Append("\n"); + sb.Append(" Warnings: ").Append(Warnings).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 DocumentFieldDetectionResponse); + } + + /// + /// Returns true if DocumentFieldDetectionResponse instances are equal + /// + /// Instance of DocumentFieldDetectionResponse to be compared + /// Boolean + public bool Equals(DocumentFieldDetectionResponse input) + { + if (input == null) + { + return false; + } + return + ( + this.DetectionResult == input.DetectionResult || + (this.DetectionResult != null && + this.DetectionResult.Equals(input.DetectionResult)) + ) && + ( + this.Warnings == input.Warnings || + this.Warnings != null && + input.Warnings != null && + this.Warnings.SequenceEqual(input.Warnings) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.DetectionResult != null) + { + hashCode = (hashCode * 59) + this.DetectionResult.GetHashCode(); + } + if (this.Warnings != null) + { + hashCode = (hashCode * 59) + this.Warnings.GetHashCode(); + } + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + yield break; + } + public List GetOpenApiTypes() + { + var types = new List(); + types.Add(new OpenApiType() + { + Name = "detection_result", + Property = "DetectionResult", + Type = "DocumentFieldDetectionResponseDetectionResult", + Value = DetectionResult, + }); + types.Add(new OpenApiType() + { + Name = "warnings", + Property = "Warnings", + Type = "List", + Value = Warnings, + }); + + return types; + } + } + +} diff --git a/sdks/dotnet/src/Dropbox.Sign/Model/DocumentFieldDetectionResponseDetectionResult.cs b/sdks/dotnet/src/Dropbox.Sign/Model/DocumentFieldDetectionResponseDetectionResult.cs new file mode 100644 index 000000000..48ce57c00 --- /dev/null +++ b/sdks/dotnet/src/Dropbox.Sign/Model/DocumentFieldDetectionResponseDetectionResult.cs @@ -0,0 +1,456 @@ +/* + * 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 +{ + /// + /// DocumentFieldDetectionResponseDetectionResult + /// + [DataContract(Name = "DocumentFieldDetectionResponseDetectionResult")] + [JsonObject(ItemNullValueHandling = NullValueHandling.Ignore)] + public partial class DocumentFieldDetectionResponseDetectionResult : IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + [JsonConstructorAttribute] + protected DocumentFieldDetectionResponseDetectionResult() { } + /// + /// Initializes a new instance of the class. + /// + /// The SHA-256 hash of the analyzed document. (required). + /// The field detection method used to analyze the document: `annotations` or `text_tags`. (required). + /// The total number of pages in the document. (required). + /// The zero-based page indexes analyzed, represented by the requested `page_range`, or `all` when every page was analyzed. (required). + /// The Unix timestamp when the field detection result was generated. (required). + /// The fields that should appear on the document, expressed as an array of objects. (For more details you can read about it here: [Using Form Fields per Document](/docs/openapi/form-fields-per-document).) **NOTE:** Fields like **text**, **dropdown**, **checkbox**, **radio**, and **hyperlink** have additional required and optional parameters. Check out the list of [additional parameters](/api/reference/constants/#form-fields-per-document) for these field types. * Text Field use `SubFormFieldsPerDocumentText` * Dropdown Field use `SubFormFieldsPerDocumentDropdown` * Hyperlink Field use `SubFormFieldsPerDocumentHyperlink` * Checkbox Field use `SubFormFieldsPerDocumentCheckbox` * Radio Field use `SubFormFieldsPerDocumentRadio` * Signature Field use `SubFormFieldsPerDocumentSignature` * Date Signed Field use `SubFormFieldsPerDocumentDateSigned` * Initials Field use `SubFormFieldsPerDocumentInitials` * Text Merge Field use `SubFormFieldsPerDocumentTextMerge` * Checkbox Merge Field use `SubFormFieldsPerDocumentCheckboxMerge` (required). + /// Group information for fields defined in `form_fields_per_document`. String-indexed JSON array with `group_label` and `requirement` keys. `form_fields_per_document` must contain fields referencing a group defined in `form_field_groups`. (required). + /// Non-fatal issues encountered during field detection. (required). + /// Errors encountered during field detection. Successfully detected fields may still be included in the response. (required). + /// Suggestions for improving the field detection results. (required). + public DocumentFieldDetectionResponseDetectionResult(string documentHash = default(string), string detectionMode = default(string), int pageCount = default(int), string pagesAnalyzed = default(string), long detectedAt = default(long), List formFieldsPerDocument = default(List), List formFieldGroups = default(List), List warnings = default(List), List errors = default(List), List suggestions = default(List)) + { + + // to ensure "documentHash" is required (not null) + if (documentHash == null) + { + throw new ArgumentNullException("documentHash is a required property for DocumentFieldDetectionResponseDetectionResult and cannot be null"); + } + this.DocumentHash = documentHash; + // to ensure "detectionMode" is required (not null) + if (detectionMode == null) + { + throw new ArgumentNullException("detectionMode is a required property for DocumentFieldDetectionResponseDetectionResult and cannot be null"); + } + this.DetectionMode = detectionMode; + this.PageCount = pageCount; + // to ensure "pagesAnalyzed" is required (not null) + if (pagesAnalyzed == null) + { + throw new ArgumentNullException("pagesAnalyzed is a required property for DocumentFieldDetectionResponseDetectionResult and cannot be null"); + } + this.PagesAnalyzed = pagesAnalyzed; + this.DetectedAt = detectedAt; + // to ensure "formFieldsPerDocument" is required (not null) + if (formFieldsPerDocument == null) + { + throw new ArgumentNullException("formFieldsPerDocument is a required property for DocumentFieldDetectionResponseDetectionResult and cannot be null"); + } + this.FormFieldsPerDocument = formFieldsPerDocument; + // to ensure "formFieldGroups" is required (not null) + if (formFieldGroups == null) + { + throw new ArgumentNullException("formFieldGroups is a required property for DocumentFieldDetectionResponseDetectionResult and cannot be null"); + } + this.FormFieldGroups = formFieldGroups; + // to ensure "warnings" is required (not null) + if (warnings == null) + { + throw new ArgumentNullException("warnings is a required property for DocumentFieldDetectionResponseDetectionResult and cannot be null"); + } + this.Warnings = warnings; + // to ensure "errors" is required (not null) + if (errors == null) + { + throw new ArgumentNullException("errors is a required property for DocumentFieldDetectionResponseDetectionResult and cannot be null"); + } + this.Errors = errors; + // to ensure "suggestions" is required (not null) + if (suggestions == null) + { + throw new ArgumentNullException("suggestions is a required property for DocumentFieldDetectionResponseDetectionResult and cannot be null"); + } + this.Suggestions = suggestions; + } + + /// + /// Attempt to instantiate and hydrate a new instance of this class + /// + /// String of JSON data representing target object + public static DocumentFieldDetectionResponseDetectionResult Init(string jsonData) + { + var obj = JsonConvert.DeserializeObject(jsonData); + + if (obj == null) + { + throw new Exception("Unable to deserialize JSON to instance of DocumentFieldDetectionResponseDetectionResult"); + } + + return obj; + } + + /// + /// The SHA-256 hash of the analyzed document. + /// + /// The SHA-256 hash of the analyzed document. + [DataMember(Name = "document_hash", IsRequired = true, EmitDefaultValue = true)] + public string DocumentHash { get; set; } + + /// + /// The field detection method used to analyze the document: `annotations` or `text_tags`. + /// + /// The field detection method used to analyze the document: `annotations` or `text_tags`. + [DataMember(Name = "detection_mode", IsRequired = true, EmitDefaultValue = true)] + public string DetectionMode { get; set; } + + /// + /// The total number of pages in the document. + /// + /// The total number of pages in the document. + [DataMember(Name = "page_count", IsRequired = true, EmitDefaultValue = true)] + public int PageCount { get; set; } + + /// + /// The zero-based page indexes analyzed, represented by the requested `page_range`, or `all` when every page was analyzed. + /// + /// The zero-based page indexes analyzed, represented by the requested `page_range`, or `all` when every page was analyzed. + /// all + [DataMember(Name = "pages_analyzed", IsRequired = true, EmitDefaultValue = true)] + public string PagesAnalyzed { get; set; } + + /// + /// The Unix timestamp when the field detection result was generated. + /// + /// The Unix timestamp when the field detection result was generated. + [DataMember(Name = "detected_at", IsRequired = true, EmitDefaultValue = true)] + public long DetectedAt { get; set; } + + /// + /// The fields that should appear on the document, expressed as an array of objects. (For more details you can read about it here: [Using Form Fields per Document](/docs/openapi/form-fields-per-document).) **NOTE:** Fields like **text**, **dropdown**, **checkbox**, **radio**, and **hyperlink** have additional required and optional parameters. Check out the list of [additional parameters](/api/reference/constants/#form-fields-per-document) for these field types. * Text Field use `SubFormFieldsPerDocumentText` * Dropdown Field use `SubFormFieldsPerDocumentDropdown` * Hyperlink Field use `SubFormFieldsPerDocumentHyperlink` * Checkbox Field use `SubFormFieldsPerDocumentCheckbox` * Radio Field use `SubFormFieldsPerDocumentRadio` * Signature Field use `SubFormFieldsPerDocumentSignature` * Date Signed Field use `SubFormFieldsPerDocumentDateSigned` * Initials Field use `SubFormFieldsPerDocumentInitials` * Text Merge Field use `SubFormFieldsPerDocumentTextMerge` * Checkbox Merge Field use `SubFormFieldsPerDocumentCheckboxMerge` + /// + /// The fields that should appear on the document, expressed as an array of objects. (For more details you can read about it here: [Using Form Fields per Document](/docs/openapi/form-fields-per-document).) **NOTE:** Fields like **text**, **dropdown**, **checkbox**, **radio**, and **hyperlink** have additional required and optional parameters. Check out the list of [additional parameters](/api/reference/constants/#form-fields-per-document) for these field types. * Text Field use `SubFormFieldsPerDocumentText` * Dropdown Field use `SubFormFieldsPerDocumentDropdown` * Hyperlink Field use `SubFormFieldsPerDocumentHyperlink` * Checkbox Field use `SubFormFieldsPerDocumentCheckbox` * Radio Field use `SubFormFieldsPerDocumentRadio` * Signature Field use `SubFormFieldsPerDocumentSignature` * Date Signed Field use `SubFormFieldsPerDocumentDateSigned` * Initials Field use `SubFormFieldsPerDocumentInitials` * Text Merge Field use `SubFormFieldsPerDocumentTextMerge` * Checkbox Merge Field use `SubFormFieldsPerDocumentCheckboxMerge` + [DataMember(Name = "form_fields_per_document", IsRequired = true, EmitDefaultValue = true)] + public List FormFieldsPerDocument { get; set; } + + /// + /// Group information for fields defined in `form_fields_per_document`. String-indexed JSON array with `group_label` and `requirement` keys. `form_fields_per_document` must contain fields referencing a group defined in `form_field_groups`. + /// + /// Group information for fields defined in `form_fields_per_document`. String-indexed JSON array with `group_label` and `requirement` keys. `form_fields_per_document` must contain fields referencing a group defined in `form_field_groups`. + [DataMember(Name = "form_field_groups", IsRequired = true, EmitDefaultValue = true)] + public List FormFieldGroups { get; set; } + + /// + /// Non-fatal issues encountered during field detection. + /// + /// Non-fatal issues encountered during field detection. + [DataMember(Name = "warnings", IsRequired = true, EmitDefaultValue = true)] + public List Warnings { get; set; } + + /// + /// Errors encountered during field detection. Successfully detected fields may still be included in the response. + /// + /// Errors encountered during field detection. Successfully detected fields may still be included in the response. + [DataMember(Name = "errors", IsRequired = true, EmitDefaultValue = true)] + public List Errors { get; set; } + + /// + /// Suggestions for improving the field detection results. + /// + /// Suggestions for improving the field detection results. + [DataMember(Name = "suggestions", IsRequired = true, EmitDefaultValue = true)] + public List Suggestions { 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 DocumentFieldDetectionResponseDetectionResult {\n"); + sb.Append(" DocumentHash: ").Append(DocumentHash).Append("\n"); + sb.Append(" DetectionMode: ").Append(DetectionMode).Append("\n"); + sb.Append(" PageCount: ").Append(PageCount).Append("\n"); + sb.Append(" PagesAnalyzed: ").Append(PagesAnalyzed).Append("\n"); + sb.Append(" DetectedAt: ").Append(DetectedAt).Append("\n"); + sb.Append(" FormFieldsPerDocument: ").Append(FormFieldsPerDocument).Append("\n"); + sb.Append(" FormFieldGroups: ").Append(FormFieldGroups).Append("\n"); + sb.Append(" Warnings: ").Append(Warnings).Append("\n"); + sb.Append(" Errors: ").Append(Errors).Append("\n"); + sb.Append(" Suggestions: ").Append(Suggestions).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 DocumentFieldDetectionResponseDetectionResult); + } + + /// + /// Returns true if DocumentFieldDetectionResponseDetectionResult instances are equal + /// + /// Instance of DocumentFieldDetectionResponseDetectionResult to be compared + /// Boolean + public bool Equals(DocumentFieldDetectionResponseDetectionResult input) + { + if (input == null) + { + return false; + } + return + ( + this.DocumentHash == input.DocumentHash || + (this.DocumentHash != null && + this.DocumentHash.Equals(input.DocumentHash)) + ) && + ( + this.DetectionMode == input.DetectionMode || + (this.DetectionMode != null && + this.DetectionMode.Equals(input.DetectionMode)) + ) && + ( + this.PageCount == input.PageCount || + this.PageCount.Equals(input.PageCount) + ) && + ( + this.PagesAnalyzed == input.PagesAnalyzed || + (this.PagesAnalyzed != null && + this.PagesAnalyzed.Equals(input.PagesAnalyzed)) + ) && + ( + this.DetectedAt == input.DetectedAt || + this.DetectedAt.Equals(input.DetectedAt) + ) && + ( + this.FormFieldsPerDocument == input.FormFieldsPerDocument || + this.FormFieldsPerDocument != null && + input.FormFieldsPerDocument != null && + this.FormFieldsPerDocument.SequenceEqual(input.FormFieldsPerDocument) + ) && + ( + this.FormFieldGroups == input.FormFieldGroups || + this.FormFieldGroups != null && + input.FormFieldGroups != null && + this.FormFieldGroups.SequenceEqual(input.FormFieldGroups) + ) && + ( + this.Warnings == input.Warnings || + this.Warnings != null && + input.Warnings != null && + this.Warnings.SequenceEqual(input.Warnings) + ) && + ( + this.Errors == input.Errors || + this.Errors != null && + input.Errors != null && + this.Errors.SequenceEqual(input.Errors) + ) && + ( + this.Suggestions == input.Suggestions || + this.Suggestions != null && + input.Suggestions != null && + this.Suggestions.SequenceEqual(input.Suggestions) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.DocumentHash != null) + { + hashCode = (hashCode * 59) + this.DocumentHash.GetHashCode(); + } + if (this.DetectionMode != null) + { + hashCode = (hashCode * 59) + this.DetectionMode.GetHashCode(); + } + hashCode = (hashCode * 59) + this.PageCount.GetHashCode(); + if (this.PagesAnalyzed != null) + { + hashCode = (hashCode * 59) + this.PagesAnalyzed.GetHashCode(); + } + hashCode = (hashCode * 59) + this.DetectedAt.GetHashCode(); + if (this.FormFieldsPerDocument != null) + { + hashCode = (hashCode * 59) + this.FormFieldsPerDocument.GetHashCode(); + } + if (this.FormFieldGroups != null) + { + hashCode = (hashCode * 59) + this.FormFieldGroups.GetHashCode(); + } + if (this.Warnings != null) + { + hashCode = (hashCode * 59) + this.Warnings.GetHashCode(); + } + if (this.Errors != null) + { + hashCode = (hashCode * 59) + this.Errors.GetHashCode(); + } + if (this.Suggestions != null) + { + hashCode = (hashCode * 59) + this.Suggestions.GetHashCode(); + } + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + // DocumentHash (string) maxLength + if (this.DocumentHash != null && this.DocumentHash.Length > 64) + { + yield return new ValidationResult("Invalid value for DocumentHash, length must be less than 64.", new[] { "DocumentHash" }); + } + + // DocumentHash (string) minLength + if (this.DocumentHash != null && this.DocumentHash.Length < 64) + { + yield return new ValidationResult("Invalid value for DocumentHash, length must be greater than 64.", new[] { "DocumentHash" }); + } + + // PageCount (int) minimum + if (this.PageCount < (int)0) + { + yield return new ValidationResult("Invalid value for PageCount, must be a value greater than or equal to 0.", new[] { "PageCount" }); + } + + yield break; + } + public List GetOpenApiTypes() + { + var types = new List(); + types.Add(new OpenApiType() + { + Name = "document_hash", + Property = "DocumentHash", + Type = "string", + Value = DocumentHash, + }); + types.Add(new OpenApiType() + { + Name = "detection_mode", + Property = "DetectionMode", + Type = "string", + Value = DetectionMode, + }); + types.Add(new OpenApiType() + { + Name = "page_count", + Property = "PageCount", + Type = "int", + Value = PageCount, + }); + types.Add(new OpenApiType() + { + Name = "pages_analyzed", + Property = "PagesAnalyzed", + Type = "string", + Value = PagesAnalyzed, + }); + types.Add(new OpenApiType() + { + Name = "detected_at", + Property = "DetectedAt", + Type = "long", + Value = DetectedAt, + }); + types.Add(new OpenApiType() + { + Name = "form_fields_per_document", + Property = "FormFieldsPerDocument", + Type = "List", + Value = FormFieldsPerDocument, + }); + types.Add(new OpenApiType() + { + Name = "form_field_groups", + Property = "FormFieldGroups", + Type = "List", + Value = FormFieldGroups, + }); + types.Add(new OpenApiType() + { + Name = "warnings", + Property = "Warnings", + Type = "List", + Value = Warnings, + }); + types.Add(new OpenApiType() + { + Name = "errors", + Property = "Errors", + Type = "List", + Value = Errors, + }); + types.Add(new OpenApiType() + { + Name = "suggestions", + Property = "Suggestions", + Type = "List", + Value = Suggestions, + }); + + return types; + } + } + +} diff --git a/sdks/dotnet/src/Dropbox.Sign/Model/FaxResponse.cs b/sdks/dotnet/src/Dropbox.Sign/Model/FaxResponse.cs index f0aa5e10d..19bf1e6a4 100644 --- a/sdks/dotnet/src/Dropbox.Sign/Model/FaxResponse.cs +++ b/sdks/dotnet/src/Dropbox.Sign/Model/FaxResponse.cs @@ -52,7 +52,8 @@ protected FaxResponse() { } /// Fax Files URL (required). /// The path where the completed document can be downloaded. /// Fax Transmissions List (required). - public FaxResponse(string faxId = default(string), string title = default(string), string originalTitle = default(string), string subject = default(string), string message = default(string), Dictionary metadata = default(Dictionary), int createdAt = default(int), string sender = default(string), string filesUrl = default(string), string finalCopyUri = default(string), List transmissions = default(List)) + /// Whether this is a test fax. Test faxes are not delivered to the recipient. Defaults to `false`. (required) (default to false). + public FaxResponse(string faxId = default(string), string title = default(string), string originalTitle = default(string), string subject = default(string), string message = default(string), Dictionary metadata = default(Dictionary), int createdAt = default(int), string sender = default(string), string filesUrl = default(string), string finalCopyUri = default(string), List transmissions = default(List), bool testMode = false) { // to ensure "faxId" is required (not null) @@ -98,6 +99,7 @@ protected FaxResponse() { } throw new ArgumentNullException("transmissions is a required property for FaxResponse and cannot be null"); } this.Transmissions = transmissions; + this.TestMode = testMode; this.Subject = subject; this.Message = message; this.FinalCopyUri = finalCopyUri; @@ -175,6 +177,13 @@ public static FaxResponse Init(string jsonData) [DataMember(Name = "transmissions", IsRequired = true, EmitDefaultValue = true)] public List Transmissions { get; set; } + /// + /// Whether this is a test fax. Test faxes are not delivered to the recipient. Defaults to `false`. + /// + /// Whether this is a test fax. Test faxes are not delivered to the recipient. Defaults to `false`. + [DataMember(Name = "test_mode", IsRequired = true, EmitDefaultValue = true)] + public bool TestMode { get; set; } + /// /// Fax Subject /// @@ -212,6 +221,7 @@ public override string ToString() sb.Append(" Sender: ").Append(Sender).Append("\n"); sb.Append(" FilesUrl: ").Append(FilesUrl).Append("\n"); sb.Append(" Transmissions: ").Append(Transmissions).Append("\n"); + sb.Append(" TestMode: ").Append(TestMode).Append("\n"); sb.Append(" Subject: ").Append(Subject).Append("\n"); sb.Append(" Message: ").Append(Message).Append("\n"); sb.Append(" FinalCopyUri: ").Append(FinalCopyUri).Append("\n"); @@ -291,6 +301,10 @@ public bool Equals(FaxResponse input) input.Transmissions != null && this.Transmissions.SequenceEqual(input.Transmissions) ) && + ( + this.TestMode == input.TestMode || + this.TestMode.Equals(input.TestMode) + ) && ( this.Subject == input.Subject || (this.Subject != null && @@ -346,6 +360,7 @@ public override int GetHashCode() { hashCode = (hashCode * 59) + this.Transmissions.GetHashCode(); } + hashCode = (hashCode * 59) + this.TestMode.GetHashCode(); if (this.Subject != null) { hashCode = (hashCode * 59) + this.Subject.GetHashCode(); @@ -431,6 +446,13 @@ public List GetOpenApiTypes() Value = Transmissions, }); types.Add(new OpenApiType() + { + Name = "test_mode", + Property = "TestMode", + Type = "bool", + Value = TestMode, + }); + types.Add(new OpenApiType() { Name = "subject", Property = "Subject", diff --git a/sdks/dotnet/src/Dropbox.Sign/Model/SignatureRequestBulkCreateEmbeddedWithTemplateRequest.cs b/sdks/dotnet/src/Dropbox.Sign/Model/SignatureRequestBulkCreateEmbeddedWithTemplateRequest.cs index 86d99ce18..3f56fc76f 100644 --- a/sdks/dotnet/src/Dropbox.Sign/Model/SignatureRequestBulkCreateEmbeddedWithTemplateRequest.cs +++ b/sdks/dotnet/src/Dropbox.Sign/Model/SignatureRequestBulkCreateEmbeddedWithTemplateRequest.cs @@ -54,7 +54,8 @@ protected SignatureRequestBulkCreateEmbeddedWithTemplateRequest() { } /// The subject in the email that will be sent to the signers.. /// Whether this is a test, the signature request will not be legally binding if set to `true`. Defaults to `false`. (default to false). /// The title you want to assign to the SignatureRequest.. - public SignatureRequestBulkCreateEmbeddedWithTemplateRequest(List templateIds = default(List), System.IO.Stream signerFile = default(System.IO.Stream), List signerList = default(List), bool allowDecline = false, List ccs = default(List), string clientId = default(string), List customFields = default(List), string message = default(string), Dictionary metadata = default(Dictionary), string signingRedirectUrl = default(string), string subject = default(string), bool testMode = false, string title = default(string)) + /// When the signature request will expire. Unsigned signatures will be moved to the expired status, and no longer signable. See [Signature Request Expiration Date](https://developers.hellosign.com/docs/signature-request/expiration/) for details.. + public SignatureRequestBulkCreateEmbeddedWithTemplateRequest(List templateIds = default(List), System.IO.Stream signerFile = default(System.IO.Stream), List signerList = default(List), bool allowDecline = false, List ccs = default(List), string clientId = default(string), List customFields = default(List), string message = default(string), Dictionary metadata = default(Dictionary), string signingRedirectUrl = default(string), string subject = default(string), bool testMode = false, string title = default(string), int? expiresAt = default(int?)) { // to ensure "templateIds" is required (not null) @@ -80,6 +81,7 @@ protected SignatureRequestBulkCreateEmbeddedWithTemplateRequest() { } this.Subject = subject; this.TestMode = testMode; this.Title = title; + this.ExpiresAt = expiresAt; } /// @@ -189,6 +191,13 @@ public static SignatureRequestBulkCreateEmbeddedWithTemplateRequest Init(string [DataMember(Name = "title", EmitDefaultValue = true)] public string Title { get; set; } + /// + /// When the signature request will expire. Unsigned signatures will be moved to the expired status, and no longer signable. See [Signature Request Expiration Date](https://developers.hellosign.com/docs/signature-request/expiration/) for details. + /// + /// When the signature request will expire. Unsigned signatures will be moved to the expired status, and no longer signable. See [Signature Request Expiration Date](https://developers.hellosign.com/docs/signature-request/expiration/) for details. + [DataMember(Name = "expires_at", EmitDefaultValue = true)] + public int? ExpiresAt { get; set; } + /// /// Returns the string presentation of the object /// @@ -210,6 +219,7 @@ public override string ToString() sb.Append(" Subject: ").Append(Subject).Append("\n"); sb.Append(" TestMode: ").Append(TestMode).Append("\n"); sb.Append(" Title: ").Append(Title).Append("\n"); + sb.Append(" ExpiresAt: ").Append(ExpiresAt).Append("\n"); sb.Append("}\n"); return sb.ToString(); } @@ -312,6 +322,11 @@ public bool Equals(SignatureRequestBulkCreateEmbeddedWithTemplateRequest input) this.Title == input.Title || (this.Title != null && this.Title.Equals(input.Title)) + ) && + ( + this.ExpiresAt == input.ExpiresAt || + (this.ExpiresAt != null && + this.ExpiresAt.Equals(input.ExpiresAt)) ); } @@ -370,6 +385,10 @@ public override int GetHashCode() { hashCode = (hashCode * 59) + this.Title.GetHashCode(); } + if (this.ExpiresAt != null) + { + hashCode = (hashCode * 59) + this.ExpiresAt.GetHashCode(); + } return hashCode; } } @@ -495,6 +514,13 @@ public List GetOpenApiTypes() Type = "string", Value = Title, }); + types.Add(new OpenApiType() + { + Name = "expires_at", + Property = "ExpiresAt", + Type = "int?", + Value = ExpiresAt, + }); return types; } diff --git a/sdks/dotnet/src/Dropbox.Sign/Model/SignatureRequestBulkSendWithTemplateRequest.cs b/sdks/dotnet/src/Dropbox.Sign/Model/SignatureRequestBulkSendWithTemplateRequest.cs index f18f1280c..e374fb50c 100644 --- a/sdks/dotnet/src/Dropbox.Sign/Model/SignatureRequestBulkSendWithTemplateRequest.cs +++ b/sdks/dotnet/src/Dropbox.Sign/Model/SignatureRequestBulkSendWithTemplateRequest.cs @@ -54,7 +54,8 @@ protected SignatureRequestBulkSendWithTemplateRequest() { } /// The subject in the email that will be sent to the signers.. /// Whether this is a test, the signature request will not be legally binding if set to `true`. Defaults to `false`. (default to false). /// The title you want to assign to the SignatureRequest.. - public SignatureRequestBulkSendWithTemplateRequest(List templateIds = default(List), System.IO.Stream signerFile = default(System.IO.Stream), List signerList = default(List), bool allowDecline = false, List ccs = default(List), string clientId = default(string), List customFields = default(List), string message = default(string), Dictionary metadata = default(Dictionary), string signingRedirectUrl = default(string), string subject = default(string), bool testMode = false, string title = default(string)) + /// When the signature request will expire. Unsigned signatures will be moved to the expired status, and no longer signable. See [Signature Request Expiration Date](https://developers.hellosign.com/docs/signature-request/expiration/) for details.. + public SignatureRequestBulkSendWithTemplateRequest(List templateIds = default(List), System.IO.Stream signerFile = default(System.IO.Stream), List signerList = default(List), bool allowDecline = false, List ccs = default(List), string clientId = default(string), List customFields = default(List), string message = default(string), Dictionary metadata = default(Dictionary), string signingRedirectUrl = default(string), string subject = default(string), bool testMode = false, string title = default(string), int? expiresAt = default(int?)) { // to ensure "templateIds" is required (not null) @@ -75,6 +76,7 @@ protected SignatureRequestBulkSendWithTemplateRequest() { } this.Subject = subject; this.TestMode = testMode; this.Title = title; + this.ExpiresAt = expiresAt; } /// @@ -184,6 +186,13 @@ public static SignatureRequestBulkSendWithTemplateRequest Init(string jsonData) [DataMember(Name = "title", EmitDefaultValue = true)] public string Title { get; set; } + /// + /// When the signature request will expire. Unsigned signatures will be moved to the expired status, and no longer signable. See [Signature Request Expiration Date](https://developers.hellosign.com/docs/signature-request/expiration/) for details. + /// + /// When the signature request will expire. Unsigned signatures will be moved to the expired status, and no longer signable. See [Signature Request Expiration Date](https://developers.hellosign.com/docs/signature-request/expiration/) for details. + [DataMember(Name = "expires_at", EmitDefaultValue = true)] + public int? ExpiresAt { get; set; } + /// /// Returns the string presentation of the object /// @@ -205,6 +214,7 @@ public override string ToString() sb.Append(" Subject: ").Append(Subject).Append("\n"); sb.Append(" TestMode: ").Append(TestMode).Append("\n"); sb.Append(" Title: ").Append(Title).Append("\n"); + sb.Append(" ExpiresAt: ").Append(ExpiresAt).Append("\n"); sb.Append("}\n"); return sb.ToString(); } @@ -307,6 +317,11 @@ public bool Equals(SignatureRequestBulkSendWithTemplateRequest input) this.Title == input.Title || (this.Title != null && this.Title.Equals(input.Title)) + ) && + ( + this.ExpiresAt == input.ExpiresAt || + (this.ExpiresAt != null && + this.ExpiresAt.Equals(input.ExpiresAt)) ); } @@ -365,6 +380,10 @@ public override int GetHashCode() { hashCode = (hashCode * 59) + this.Title.GetHashCode(); } + if (this.ExpiresAt != null) + { + hashCode = (hashCode * 59) + this.ExpiresAt.GetHashCode(); + } return hashCode; } } @@ -490,6 +509,13 @@ public List GetOpenApiTypes() Type = "string", Value = Title, }); + types.Add(new OpenApiType() + { + Name = "expires_at", + Property = "ExpiresAt", + Type = "int?", + Value = ExpiresAt, + }); return types; } diff --git a/sdks/dotnet/src/Dropbox.Sign/Model/SignatureRequestCreateEmbeddedWithTemplateRequest.cs b/sdks/dotnet/src/Dropbox.Sign/Model/SignatureRequestCreateEmbeddedWithTemplateRequest.cs index b0296ffdb..d54f10419 100644 --- a/sdks/dotnet/src/Dropbox.Sign/Model/SignatureRequestCreateEmbeddedWithTemplateRequest.cs +++ b/sdks/dotnet/src/Dropbox.Sign/Model/SignatureRequestCreateEmbeddedWithTemplateRequest.cs @@ -56,7 +56,8 @@ protected SignatureRequestCreateEmbeddedWithTemplateRequest() { } /// Whether this is a test, the signature request will not be legally binding if set to `true`. Defaults to `false`. (default to false). /// The title you want to assign to the SignatureRequest.. /// Controls whether [auto fill fields](https://faq.hellosign.com/hc/en-us/articles/360051467511-Auto-Fill-Fields) can automatically populate a signer's information during signing. **NOTE:** Keep your signer's information safe by ensuring that the _signer on your signature request is the intended party_ before using this feature. (default to false). - public SignatureRequestCreateEmbeddedWithTemplateRequest(List templateIds = default(List), bool allowDecline = false, List ccs = default(List), string clientId = default(string), List customFields = default(List), List files = default(List), List fileUrls = default(List), string message = default(string), Dictionary metadata = default(Dictionary), List signers = default(List), SubSigningOptions signingOptions = default(SubSigningOptions), string subject = default(string), bool testMode = false, string title = default(string), bool populateAutoFillFields = false) + /// When the signature request will expire. Unsigned signatures will be moved to the expired status, and no longer signable. See [Signature Request Expiration Date](https://developers.hellosign.com/docs/signature-request/expiration/) for details.. + public SignatureRequestCreateEmbeddedWithTemplateRequest(List templateIds = default(List), bool allowDecline = false, List ccs = default(List), string clientId = default(string), List customFields = default(List), List files = default(List), List fileUrls = default(List), string message = default(string), Dictionary metadata = default(Dictionary), List signers = default(List), SubSigningOptions signingOptions = default(SubSigningOptions), string subject = default(string), bool testMode = false, string title = default(string), bool populateAutoFillFields = false, int? expiresAt = default(int?)) { // to ensure "templateIds" is required (not null) @@ -89,6 +90,7 @@ protected SignatureRequestCreateEmbeddedWithTemplateRequest() { } this.TestMode = testMode; this.Title = title; this.PopulateAutoFillFields = populateAutoFillFields; + this.ExpiresAt = expiresAt; } /// @@ -211,6 +213,13 @@ public static SignatureRequestCreateEmbeddedWithTemplateRequest Init(string json [DataMember(Name = "populate_auto_fill_fields", EmitDefaultValue = true)] public bool PopulateAutoFillFields { get; set; } + /// + /// When the signature request will expire. Unsigned signatures will be moved to the expired status, and no longer signable. See [Signature Request Expiration Date](https://developers.hellosign.com/docs/signature-request/expiration/) for details. + /// + /// When the signature request will expire. Unsigned signatures will be moved to the expired status, and no longer signable. See [Signature Request Expiration Date](https://developers.hellosign.com/docs/signature-request/expiration/) for details. + [DataMember(Name = "expires_at", EmitDefaultValue = true)] + public int? ExpiresAt { get; set; } + /// /// Returns the string presentation of the object /// @@ -234,6 +243,7 @@ public override string ToString() sb.Append(" TestMode: ").Append(TestMode).Append("\n"); sb.Append(" Title: ").Append(Title).Append("\n"); sb.Append(" PopulateAutoFillFields: ").Append(PopulateAutoFillFields).Append("\n"); + sb.Append(" ExpiresAt: ").Append(ExpiresAt).Append("\n"); sb.Append("}\n"); return sb.ToString(); } @@ -347,6 +357,11 @@ public bool Equals(SignatureRequestCreateEmbeddedWithTemplateRequest input) ( this.PopulateAutoFillFields == input.PopulateAutoFillFields || this.PopulateAutoFillFields.Equals(input.PopulateAutoFillFields) + ) && + ( + this.ExpiresAt == input.ExpiresAt || + (this.ExpiresAt != null && + this.ExpiresAt.Equals(input.ExpiresAt)) ); } @@ -410,6 +425,10 @@ public override int GetHashCode() hashCode = (hashCode * 59) + this.Title.GetHashCode(); } hashCode = (hashCode * 59) + this.PopulateAutoFillFields.GetHashCode(); + if (this.ExpiresAt != null) + { + hashCode = (hashCode * 59) + this.ExpiresAt.GetHashCode(); + } return hashCode; } } @@ -549,6 +568,13 @@ public List GetOpenApiTypes() Type = "bool", Value = PopulateAutoFillFields, }); + types.Add(new OpenApiType() + { + Name = "expires_at", + Property = "ExpiresAt", + Type = "int?", + Value = ExpiresAt, + }); return types; } diff --git a/sdks/dotnet/src/Dropbox.Sign/Model/SignatureRequestSendWithTemplateRequest.cs b/sdks/dotnet/src/Dropbox.Sign/Model/SignatureRequestSendWithTemplateRequest.cs index 681de91fb..bf3c630c8 100644 --- a/sdks/dotnet/src/Dropbox.Sign/Model/SignatureRequestSendWithTemplateRequest.cs +++ b/sdks/dotnet/src/Dropbox.Sign/Model/SignatureRequestSendWithTemplateRequest.cs @@ -58,7 +58,8 @@ protected SignatureRequestSendWithTemplateRequest() { } /// The subject in the email that will be sent to the signers.. /// Whether this is a test, the signature request will not be legally binding if set to `true`. Defaults to `false`. (default to false). /// The title you want to assign to the SignatureRequest.. - public SignatureRequestSendWithTemplateRequest(List templateIds = default(List), bool allowDecline = false, List ccs = default(List), string clientId = default(string), List customFields = default(List), List files = default(List), List fileUrls = default(List), bool isQualifiedSignature = false, bool isEid = false, string message = default(string), Dictionary metadata = default(Dictionary), List signers = default(List), SubSigningOptions signingOptions = default(SubSigningOptions), string signingRedirectUrl = default(string), string subject = default(string), bool testMode = false, string title = default(string)) + /// When the signature request will expire. Unsigned signatures will be moved to the expired status, and no longer signable. See [Signature Request Expiration Date](https://developers.hellosign.com/docs/signature-request/expiration/) for details.. + public SignatureRequestSendWithTemplateRequest(List templateIds = default(List), bool allowDecline = false, List ccs = default(List), string clientId = default(string), List customFields = default(List), List files = default(List), List fileUrls = default(List), bool isQualifiedSignature = false, bool isEid = false, string message = default(string), Dictionary metadata = default(Dictionary), List signers = default(List), SubSigningOptions signingOptions = default(SubSigningOptions), string signingRedirectUrl = default(string), string subject = default(string), bool testMode = false, string title = default(string), int? expiresAt = default(int?)) { // to ensure "templateIds" is required (not null) @@ -88,6 +89,7 @@ protected SignatureRequestSendWithTemplateRequest() { } this.Subject = subject; this.TestMode = testMode; this.Title = title; + this.ExpiresAt = expiresAt; } /// @@ -225,6 +227,13 @@ public static SignatureRequestSendWithTemplateRequest Init(string jsonData) [DataMember(Name = "title", EmitDefaultValue = true)] public string Title { get; set; } + /// + /// When the signature request will expire. Unsigned signatures will be moved to the expired status, and no longer signable. See [Signature Request Expiration Date](https://developers.hellosign.com/docs/signature-request/expiration/) for details. + /// + /// When the signature request will expire. Unsigned signatures will be moved to the expired status, and no longer signable. See [Signature Request Expiration Date](https://developers.hellosign.com/docs/signature-request/expiration/) for details. + [DataMember(Name = "expires_at", EmitDefaultValue = true)] + public int? ExpiresAt { get; set; } + /// /// Returns the string presentation of the object /// @@ -250,6 +259,7 @@ public override string ToString() sb.Append(" Subject: ").Append(Subject).Append("\n"); sb.Append(" TestMode: ").Append(TestMode).Append("\n"); sb.Append(" Title: ").Append(Title).Append("\n"); + sb.Append(" ExpiresAt: ").Append(ExpiresAt).Append("\n"); sb.Append("}\n"); return sb.ToString(); } @@ -372,6 +382,11 @@ public bool Equals(SignatureRequestSendWithTemplateRequest input) this.Title == input.Title || (this.Title != null && this.Title.Equals(input.Title)) + ) && + ( + this.ExpiresAt == input.ExpiresAt || + (this.ExpiresAt != null && + this.ExpiresAt.Equals(input.ExpiresAt)) ); } @@ -440,6 +455,10 @@ public override int GetHashCode() { hashCode = (hashCode * 59) + this.Title.GetHashCode(); } + if (this.ExpiresAt != null) + { + hashCode = (hashCode * 59) + this.ExpiresAt.GetHashCode(); + } return hashCode; } } @@ -593,6 +612,13 @@ public List GetOpenApiTypes() Type = "string", Value = Title, }); + types.Add(new OpenApiType() + { + Name = "expires_at", + Property = "ExpiresAt", + Type = "int?", + Value = ExpiresAt, + }); return types; } diff --git a/sdks/java-v1/README.md b/sdks/java-v1/README.md index 7ea39626e..0b0431cf7 100644 --- a/sdks/java-v1/README.md +++ b/sdks/java-v1/README.md @@ -185,6 +185,7 @@ Class | Method | HTTP request | Description *ApiAppApi* | [**apiAppUpdate**](docs/ApiAppApi.md#apiAppUpdate) | **PUT** /api_app/{client_id} | Update API App *BulkSendJobApi* | [**bulkSendJobGet**](docs/BulkSendJobApi.md#bulkSendJobGet) | **GET** /bulk_send_job/{bulk_send_job_id} | Get Bulk Send Job *BulkSendJobApi* | [**bulkSendJobList**](docs/BulkSendJobApi.md#bulkSendJobList) | **GET** /bulk_send_job/list | List Bulk Send Jobs +*DocumentApi* | [**documentDetectFields**](docs/DocumentApi.md#documentDetectFields) | **POST** /document/detect_fields | Detect Document Fields *EmbeddedApi* | [**embeddedEditUrl**](docs/EmbeddedApi.md#embeddedEditUrl) | **POST** /embedded/edit_url/{template_id} | Get Embedded Template Edit URL *EmbeddedApi* | [**embeddedSignUrl**](docs/EmbeddedApi.md#embeddedSignUrl) | **GET** /embedded/sign_url/{signature_id} | Get Embedded Sign URL *FaxApi* | [**faxDelete**](docs/FaxApi.md#faxDelete) | **DELETE** /fax/{fax_id} | Delete Fax @@ -276,6 +277,9 @@ Class | Method | HTTP request | Description - [BulkSendJobListResponse](docs/BulkSendJobListResponse.md) - [BulkSendJobResponse](docs/BulkSendJobResponse.md) - [BulkSendJobSendResponse](docs/BulkSendJobSendResponse.md) + - [DocumentFieldDetectionRequest](docs/DocumentFieldDetectionRequest.md) + - [DocumentFieldDetectionResponse](docs/DocumentFieldDetectionResponse.md) + - [DocumentFieldDetectionResponseDetectionResult](docs/DocumentFieldDetectionResponseDetectionResult.md) - [EmbeddedEditUrlRequest](docs/EmbeddedEditUrlRequest.md) - [EmbeddedEditUrlResponse](docs/EmbeddedEditUrlResponse.md) - [EmbeddedEditUrlResponseEmbedded](docs/EmbeddedEditUrlResponseEmbedded.md) diff --git a/sdks/java-v1/docs/DocumentApi.md b/sdks/java-v1/docs/DocumentApi.md new file mode 100644 index 000000000..c72d11a30 --- /dev/null +++ b/sdks/java-v1/docs/DocumentApi.md @@ -0,0 +1,96 @@ +# DocumentApi + +All URIs are relative to *https://api.hellosign.com/v3* + +| Method | HTTP request | Description | +|------------- | ------------- | -------------| +[**documentDetectFields**](DocumentApi.md#documentDetectFields) | **POST** /document/detect_fields | Detect Document Fields + + + +## documentDetectFields + +> DocumentFieldDetectionResponse documentDetectFields(documentFieldDetectionRequest) + +Detect Document Fields + +Detects form fields in a PDF document using either PDF form annotations or Dropbox Sign text tags. + +### 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 DocumentDetectFieldsExample +{ + 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 documentFieldDetectionRequest = new DocumentFieldDetectionRequest(); + documentFieldDetectionRequest.detectionMode("annotations"); + documentFieldDetectionRequest._file(new File("./example_document.pdf")); + documentFieldDetectionRequest.pageRange("all"); + + try + { + var response = new DocumentApi(config).documentDetectFields( + documentFieldDetectionRequest + ); + + System.out.println(response); + } catch (ApiException e) { + System.err.println("Exception when calling DocumentApi#documentDetectFields"); + 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 | +|------------- | ------------- | ------------- | -------------| + **documentFieldDetectionRequest** | [**DocumentFieldDetectionRequest**](DocumentFieldDetectionRequest.md)| | + +### Return type + +[**DocumentFieldDetectionResponse**](DocumentFieldDetectionResponse.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 | - | + diff --git a/sdks/java-v1/docs/DocumentFieldDetectionRequest.md b/sdks/java-v1/docs/DocumentFieldDetectionRequest.md new file mode 100644 index 000000000..482d27963 --- /dev/null +++ b/sdks/java-v1/docs/DocumentFieldDetectionRequest.md @@ -0,0 +1,17 @@ + + +# DocumentFieldDetectionRequest + + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +| `detectionMode`*_required_ | [```String```](String.md) | The field detection method to use. Set to `annotations` to detect PDF form annotations or `text_tags` to detect Dropbox Sign text tags. | | +| `_file` | ```File``` | The PDF file to analyze.

This endpoint requires either `file` or `file_url`, but not both. | | +| `fileUrl` | ```URI``` | The URL of the PDF file to analyze.

This endpoint requires either `file` or `file_url`, but not both. | | +| `pageRange` | ```String``` | The zero-based page indexes to analyze. Accepts `all`, individual pages, inclusive ranges, or comma-separated combinations, such as `0-2,5,7-9`. Defaults to `all`. | | + + + diff --git a/sdks/java-v1/docs/DocumentFieldDetectionResponse.md b/sdks/java-v1/docs/DocumentFieldDetectionResponse.md new file mode 100644 index 000000000..2a7329e7c --- /dev/null +++ b/sdks/java-v1/docs/DocumentFieldDetectionResponse.md @@ -0,0 +1,15 @@ + + +# DocumentFieldDetectionResponse + + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +| `detectionResult`*_required_ | [```DocumentFieldDetectionResponseDetectionResult```](DocumentFieldDetectionResponseDetectionResult.md) | | | +| `warnings` | [```List```](WarningResponse.md) | A list of warnings. | | + + + diff --git a/sdks/java-v1/docs/DocumentFieldDetectionResponseDetectionResult.md b/sdks/java-v1/docs/DocumentFieldDetectionResponseDetectionResult.md new file mode 100644 index 000000000..b8f0e04ce --- /dev/null +++ b/sdks/java-v1/docs/DocumentFieldDetectionResponseDetectionResult.md @@ -0,0 +1,23 @@ + + +# DocumentFieldDetectionResponseDetectionResult + + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +| `documentHash`*_required_ | ```String``` | The SHA-256 hash of the analyzed document. | | +| `detectionMode`*_required_ | [```String```](String.md) | The field detection method used to analyze the document: `annotations` or `text_tags`. | | +| `pageCount`*_required_ | ```Integer``` | The total number of pages in the document. | | +| `pagesAnalyzed`*_required_ | ```String``` | The zero-based page indexes analyzed, represented by the requested `page_range`, or `all` when every page was analyzed. | | +| `detectedAt`*_required_ | ```Long``` | The Unix timestamp when the field detection result was generated. | | +| `formFieldsPerDocument`*_required_ | [```List```](SubFormFieldsPerDocumentBase.md) | The fields that should appear on the document, expressed as an array of objects. (For more details you can read about it here: [Using Form Fields per Document](/docs/openapi/form-fields-per-document).)

**NOTE:** Fields like **text**, **dropdown**, **checkbox**, **radio**, and **hyperlink** have additional required and optional parameters. Check out the list of [additional parameters](/api/reference/constants/#form-fields-per-document) for these field types.

* Text Field use `SubFormFieldsPerDocumentText`
* Dropdown Field use `SubFormFieldsPerDocumentDropdown`
* Hyperlink Field use `SubFormFieldsPerDocumentHyperlink`
* Checkbox Field use `SubFormFieldsPerDocumentCheckbox`
* Radio Field use `SubFormFieldsPerDocumentRadio`
* Signature Field use `SubFormFieldsPerDocumentSignature`
* Date Signed Field use `SubFormFieldsPerDocumentDateSigned`
* Initials Field use `SubFormFieldsPerDocumentInitials`
* Text Merge Field use `SubFormFieldsPerDocumentTextMerge`
* Checkbox Merge Field use `SubFormFieldsPerDocumentCheckboxMerge` | | +| `formFieldGroups`*_required_ | [```List```](SubFormFieldGroup.md) | Group information for fields defined in `form_fields_per_document`. String-indexed JSON array with `group_label` and `requirement` keys. `form_fields_per_document` must contain fields referencing a group defined in `form_field_groups`. | | +| `warnings`*_required_ | [```List```](WarningResponse.md) | Non-fatal issues encountered during field detection. | | +| `errors`*_required_ | [```List```](ErrorResponseError.md) | Errors encountered during field detection. Successfully detected fields may still be included in the response. | | +| `suggestions`*_required_ | ```List``` | Suggestions for improving the field detection results. | | + + + diff --git a/sdks/java-v1/docs/FaxResponse.md b/sdks/java-v1/docs/FaxResponse.md index a1c857b48..a5707cfb4 100644 --- a/sdks/java-v1/docs/FaxResponse.md +++ b/sdks/java-v1/docs/FaxResponse.md @@ -16,6 +16,7 @@ | `sender`*_required_ | ```String``` | Fax Sender Email | | | `filesUrl`*_required_ | ```String``` | Fax Files URL | | | `transmissions`*_required_ | [```List```](FaxResponseTransmission.md) | Fax Transmissions List | | +| `testMode`*_required_ | ```Boolean``` | Whether this is a test fax. Test faxes are not delivered to the recipient. Defaults to `false`. | | | `subject` | ```String``` | Fax Subject | | | `message` | ```String``` | Fax Message | | | `finalCopyUri` | ```String``` | The path where the completed document can be downloaded | | diff --git a/sdks/java-v1/docs/SignatureRequestBulkCreateEmbeddedWithTemplateRequest.md b/sdks/java-v1/docs/SignatureRequestBulkCreateEmbeddedWithTemplateRequest.md index 4243ead1c..ef7454fc2 100644 --- a/sdks/java-v1/docs/SignatureRequestBulkCreateEmbeddedWithTemplateRequest.md +++ b/sdks/java-v1/docs/SignatureRequestBulkCreateEmbeddedWithTemplateRequest.md @@ -21,6 +21,7 @@ | `subject` | ```String``` | The subject in the email that will be sent to the signers. | | | `testMode` | ```Boolean``` | Whether this is a test, the signature request will not be legally binding if set to `true`. Defaults to `false`. | | | `title` | ```String``` | The title you want to assign to the SignatureRequest. | | +| `expiresAt` | ```Integer``` | When the signature request will expire. Unsigned signatures will be moved to the expired status, and no longer signable. See [Signature Request Expiration Date](https://developers.hellosign.com/docs/signature-request/expiration/) for details. | | diff --git a/sdks/java-v1/docs/SignatureRequestBulkSendWithTemplateRequest.md b/sdks/java-v1/docs/SignatureRequestBulkSendWithTemplateRequest.md index 1798f6fdc..34a3281c8 100644 --- a/sdks/java-v1/docs/SignatureRequestBulkSendWithTemplateRequest.md +++ b/sdks/java-v1/docs/SignatureRequestBulkSendWithTemplateRequest.md @@ -21,6 +21,7 @@ | `subject` | ```String``` | The subject in the email that will be sent to the signers. | | | `testMode` | ```Boolean``` | Whether this is a test, the signature request will not be legally binding if set to `true`. Defaults to `false`. | | | `title` | ```String``` | The title you want to assign to the SignatureRequest. | | +| `expiresAt` | ```Integer``` | When the signature request will expire. Unsigned signatures will be moved to the expired status, and no longer signable. See [Signature Request Expiration Date](https://developers.hellosign.com/docs/signature-request/expiration/) for details. | | diff --git a/sdks/java-v1/docs/SignatureRequestCreateEmbeddedWithTemplateRequest.md b/sdks/java-v1/docs/SignatureRequestCreateEmbeddedWithTemplateRequest.md index 050a7e631..da8343b6a 100644 --- a/sdks/java-v1/docs/SignatureRequestCreateEmbeddedWithTemplateRequest.md +++ b/sdks/java-v1/docs/SignatureRequestCreateEmbeddedWithTemplateRequest.md @@ -23,6 +23,7 @@ | `testMode` | ```Boolean``` | Whether this is a test, the signature request will not be legally binding if set to `true`. Defaults to `false`. | | | `title` | ```String``` | The title you want to assign to the SignatureRequest. | | | `populateAutoFillFields` | ```Boolean``` | Controls whether [auto fill fields](https://faq.hellosign.com/hc/en-us/articles/360051467511-Auto-Fill-Fields) can automatically populate a signer's information during signing.

**NOTE:** Keep your signer's information safe by ensuring that the _signer on your signature request is the intended party_ before using this feature. | | +| `expiresAt` | ```Integer``` | When the signature request will expire. Unsigned signatures will be moved to the expired status, and no longer signable. See [Signature Request Expiration Date](https://developers.hellosign.com/docs/signature-request/expiration/) for details. | | diff --git a/sdks/java-v1/docs/SignatureRequestSendWithTemplateRequest.md b/sdks/java-v1/docs/SignatureRequestSendWithTemplateRequest.md index 425ccff28..621d66a86 100644 --- a/sdks/java-v1/docs/SignatureRequestSendWithTemplateRequest.md +++ b/sdks/java-v1/docs/SignatureRequestSendWithTemplateRequest.md @@ -25,6 +25,7 @@ | `subject` | ```String``` | The subject in the email that will be sent to the signers. | | | `testMode` | ```Boolean``` | Whether this is a test, the signature request will not be legally binding if set to `true`. Defaults to `false`. | | | `title` | ```String``` | The title you want to assign to the SignatureRequest. | | +| `expiresAt` | ```Integer``` | When the signature request will expire. Unsigned signatures will be moved to the expired status, and no longer signable. See [Signature Request Expiration Date](https://developers.hellosign.com/docs/signature-request/expiration/) for details. | | diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/api/DocumentApi.java b/sdks/java-v1/src/main/java/com/dropbox/sign/api/DocumentApi.java new file mode 100644 index 000000000..ccb577536 --- /dev/null +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/api/DocumentApi.java @@ -0,0 +1,119 @@ +package com.dropbox.sign.api; + +import com.dropbox.sign.ApiClient; +import com.dropbox.sign.ApiException; +import com.dropbox.sign.ApiResponse; +import com.dropbox.sign.Configuration; +import com.dropbox.sign.model.DocumentFieldDetectionRequest; +import com.dropbox.sign.model.DocumentFieldDetectionResponse; +import java.util.ArrayList; +import java.util.LinkedHashMap; +import java.util.Map; +import javax.ws.rs.core.GenericType; + +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class DocumentApi { + private ApiClient apiClient; + + public DocumentApi() { + this(Configuration.getDefaultApiClient()); + } + + public DocumentApi(ApiClient apiClient) { + this.apiClient = apiClient; + } + + /** + * Get the API client + * + * @return API client + */ + public ApiClient getApiClient() { + return apiClient; + } + + /** + * Set the API client + * + * @param apiClient an instance of API client + */ + public void setApiClient(ApiClient apiClient) { + this.apiClient = apiClient; + } + + /** + * Detect Document Fields Detects form fields in a PDF document using either PDF form + * annotations or Dropbox Sign text tags. + * + * @param documentFieldDetectionRequest (required) + * @return DocumentFieldDetectionResponse + * @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 DocumentFieldDetectionResponse documentDetectFields( + DocumentFieldDetectionRequest documentFieldDetectionRequest) throws ApiException { + return documentDetectFieldsWithHttpInfo(documentFieldDetectionRequest).getData(); + } + + /** + * Detect Document Fields Detects form fields in a PDF document using either PDF form + * annotations or Dropbox Sign text tags. + * + * @param documentFieldDetectionRequest (required) + * @return ApiResponse<DocumentFieldDetectionResponse> + * @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 documentDetectFieldsWithHttpInfo( + DocumentFieldDetectionRequest documentFieldDetectionRequest) throws ApiException { + + // Check required parameters + if (documentFieldDetectionRequest == null) { + throw new ApiException( + 400, + "Missing the required parameter 'documentFieldDetectionRequest' when calling" + + " documentDetectFields"); + } + + String localVarAccept = apiClient.selectHeaderAccept("application/json"); + Map localVarFormParams = new LinkedHashMap<>(); + localVarFormParams = documentFieldDetectionRequest.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( + "DocumentApi.documentDetectFields", + "/document/detect_fields", + "POST", + new ArrayList<>(), + isFileTypeFound ? null : documentFieldDetectionRequest, + new LinkedHashMap<>(), + new LinkedHashMap<>(), + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType, + false); + } +} diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/model/DocumentFieldDetectionRequest.java b/sdks/java-v1/src/main/java/com/dropbox/sign/model/DocumentFieldDetectionRequest.java new file mode 100644 index 000000000..a9db580c3 --- /dev/null +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/model/DocumentFieldDetectionRequest.java @@ -0,0 +1,321 @@ +/* + * 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.io.File; +import java.net.URI; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** DocumentFieldDetectionRequest */ +@JsonPropertyOrder({ + DocumentFieldDetectionRequest.JSON_PROPERTY_DETECTION_MODE, + DocumentFieldDetectionRequest.JSON_PROPERTY_FILE, + DocumentFieldDetectionRequest.JSON_PROPERTY_FILE_URL, + DocumentFieldDetectionRequest.JSON_PROPERTY_PAGE_RANGE +}) +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +@JsonIgnoreProperties(ignoreUnknown = true) +public class DocumentFieldDetectionRequest { + public static final String JSON_PROPERTY_DETECTION_MODE = "detection_mode"; + @javax.annotation.Nonnull private String detectionMode; + + public static final String JSON_PROPERTY_FILE = "file"; + @javax.annotation.Nullable private File _file; + + public static final String JSON_PROPERTY_FILE_URL = "file_url"; + @javax.annotation.Nullable private URI fileUrl; + + public static final String JSON_PROPERTY_PAGE_RANGE = "page_range"; + @javax.annotation.Nullable private String pageRange; + + public DocumentFieldDetectionRequest() {} + + /** + * Attempt to instantiate and hydrate a new instance of this class + * + * @param jsonData String of JSON data representing target object + */ + public static DocumentFieldDetectionRequest init(String jsonData) throws Exception { + return new ObjectMapper().readValue(jsonData, DocumentFieldDetectionRequest.class); + } + + public static DocumentFieldDetectionRequest init(HashMap data) throws Exception { + return new ObjectMapper() + .readValue( + new ObjectMapper().writeValueAsString(data), + DocumentFieldDetectionRequest.class); + } + + public DocumentFieldDetectionRequest detectionMode( + @javax.annotation.Nonnull String detectionMode) { + this.detectionMode = detectionMode; + return this; + } + + /** + * The field detection method to use. Set to `annotations` to detect PDF form + * annotations or `text_tags` to detect Dropbox Sign text tags. + * + * @return detectionMode + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_DETECTION_MODE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getDetectionMode() { + return detectionMode; + } + + @JsonProperty(JSON_PROPERTY_DETECTION_MODE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setDetectionMode(@javax.annotation.Nonnull String detectionMode) { + this.detectionMode = detectionMode; + } + + public DocumentFieldDetectionRequest _file(@javax.annotation.Nullable File _file) { + this._file = _file; + return this; + } + + /** + * The PDF file to analyze. This endpoint requires either `file` or + * `file_url`, but not both. + * + * @return _file + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_FILE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public File getFile() { + return _file; + } + + @JsonProperty(JSON_PROPERTY_FILE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setFile(@javax.annotation.Nullable File _file) { + this._file = _file; + } + + public DocumentFieldDetectionRequest fileUrl(@javax.annotation.Nullable URI fileUrl) { + this.fileUrl = fileUrl; + return this; + } + + /** + * The URL of the PDF file to analyze. This endpoint requires either `file` or + * `file_url`, but not both. + * + * @return fileUrl + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_FILE_URL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public URI getFileUrl() { + return fileUrl; + } + + @JsonProperty(JSON_PROPERTY_FILE_URL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setFileUrl(@javax.annotation.Nullable URI fileUrl) { + this.fileUrl = fileUrl; + } + + public DocumentFieldDetectionRequest pageRange(@javax.annotation.Nullable String pageRange) { + this.pageRange = pageRange; + return this; + } + + /** + * The zero-based page indexes to analyze. Accepts `all`, individual pages, inclusive + * ranges, or comma-separated combinations, such as `0-2,5,7-9`. Defaults to + * `all`. + * + * @return pageRange + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_PAGE_RANGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getPageRange() { + return pageRange; + } + + @JsonProperty(JSON_PROPERTY_PAGE_RANGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPageRange(@javax.annotation.Nullable String pageRange) { + this.pageRange = pageRange; + } + + /** Return true if this DocumentFieldDetectionRequest object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DocumentFieldDetectionRequest documentFieldDetectionRequest = + (DocumentFieldDetectionRequest) o; + return Objects.equals(this.detectionMode, documentFieldDetectionRequest.detectionMode) + && Objects.equals(this._file, documentFieldDetectionRequest._file) + && Objects.equals(this.fileUrl, documentFieldDetectionRequest.fileUrl) + && Objects.equals(this.pageRange, documentFieldDetectionRequest.pageRange); + } + + @Override + public int hashCode() { + return Objects.hash(detectionMode, _file, fileUrl, pageRange); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DocumentFieldDetectionRequest {\n"); + sb.append(" detectionMode: ").append(toIndentedString(detectionMode)).append("\n"); + sb.append(" _file: ").append(toIndentedString(_file)).append("\n"); + sb.append(" fileUrl: ").append(toIndentedString(fileUrl)).append("\n"); + sb.append(" pageRange: ").append(toIndentedString(pageRange)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public Map createFormData() throws ApiException { + Map map = new HashMap<>(); + boolean fileTypeFound = false; + try { + if (detectionMode != null) { + if (isFileTypeOrListOfFiles(detectionMode)) { + fileTypeFound = true; + } + + if (detectionMode.getClass().equals(java.io.File.class) + || detectionMode.getClass().equals(Integer.class) + || detectionMode.getClass().equals(String.class) + || detectionMode.getClass().isEnum()) { + map.put("detection_mode", detectionMode); + } else if (isListOfFile(detectionMode)) { + for (int i = 0; i < getListSize(detectionMode); i++) { + map.put("detection_mode[" + i + "]", getFromList(detectionMode, i)); + } + } else { + map.put( + "detection_mode", + JSON.getDefault().getMapper().writeValueAsString(detectionMode)); + } + } + if (_file != null) { + if (isFileTypeOrListOfFiles(_file)) { + fileTypeFound = true; + } + + if (_file.getClass().equals(java.io.File.class) + || _file.getClass().equals(Integer.class) + || _file.getClass().equals(String.class) + || _file.getClass().isEnum()) { + map.put("file", _file); + } else if (isListOfFile(_file)) { + for (int i = 0; i < getListSize(_file); i++) { + map.put("file[" + i + "]", getFromList(_file, i)); + } + } else { + map.put("file", JSON.getDefault().getMapper().writeValueAsString(_file)); + } + } + if (fileUrl != null) { + if (isFileTypeOrListOfFiles(fileUrl)) { + fileTypeFound = true; + } + + if (fileUrl.getClass().equals(java.io.File.class) + || fileUrl.getClass().equals(Integer.class) + || fileUrl.getClass().equals(String.class) + || fileUrl.getClass().isEnum()) { + map.put("file_url", fileUrl); + } else if (isListOfFile(fileUrl)) { + for (int i = 0; i < getListSize(fileUrl); i++) { + map.put("file_url[" + i + "]", getFromList(fileUrl, i)); + } + } else { + map.put("file_url", JSON.getDefault().getMapper().writeValueAsString(fileUrl)); + } + } + if (pageRange != null) { + if (isFileTypeOrListOfFiles(pageRange)) { + fileTypeFound = true; + } + + if (pageRange.getClass().equals(java.io.File.class) + || pageRange.getClass().equals(Integer.class) + || pageRange.getClass().equals(String.class) + || pageRange.getClass().isEnum()) { + map.put("page_range", pageRange); + } else if (isListOfFile(pageRange)) { + for (int i = 0; i < getListSize(pageRange); i++) { + map.put("page_range[" + i + "]", getFromList(pageRange, i)); + } + } else { + map.put( + "page_range", + JSON.getDefault().getMapper().writeValueAsString(pageRange)); + } + } + } catch (Exception e) { + throw new ApiException(e); + } + + return fileTypeFound ? map : new HashMap<>(); + } + + private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { + return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); + } + + private boolean isListOfFile(Object obj) throws Exception { + return obj instanceof java.util.List + && !isListEmpty(obj) + && getFromList(obj, 0) instanceof java.io.File; + } + + private boolean isListEmpty(Object obj) throws Exception { + return (boolean) + Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); + } + + private Object getFromList(Object obj, int index) throws Exception { + return Class.forName(java.util.List.class.getName()) + .getMethod("get", int.class) + .invoke(obj, index); + } + + private int getListSize(Object obj) throws Exception { + return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/model/DocumentFieldDetectionResponse.java b/sdks/java-v1/src/main/java/com/dropbox/sign/model/DocumentFieldDetectionResponse.java new file mode 100644 index 000000000..d877c978d --- /dev/null +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/model/DocumentFieldDetectionResponse.java @@ -0,0 +1,234 @@ +/* + * 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; + +/** DocumentFieldDetectionResponse */ +@JsonPropertyOrder({ + DocumentFieldDetectionResponse.JSON_PROPERTY_DETECTION_RESULT, + DocumentFieldDetectionResponse.JSON_PROPERTY_WARNINGS +}) +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +@JsonIgnoreProperties(ignoreUnknown = true) +public class DocumentFieldDetectionResponse { + public static final String JSON_PROPERTY_DETECTION_RESULT = "detection_result"; + @javax.annotation.Nonnull private DocumentFieldDetectionResponseDetectionResult detectionResult; + + public static final String JSON_PROPERTY_WARNINGS = "warnings"; + @javax.annotation.Nullable private List warnings = null; + + public DocumentFieldDetectionResponse() {} + + /** + * Attempt to instantiate and hydrate a new instance of this class + * + * @param jsonData String of JSON data representing target object + */ + public static DocumentFieldDetectionResponse init(String jsonData) throws Exception { + return new ObjectMapper().readValue(jsonData, DocumentFieldDetectionResponse.class); + } + + public static DocumentFieldDetectionResponse init(HashMap data) throws Exception { + return new ObjectMapper() + .readValue( + new ObjectMapper().writeValueAsString(data), + DocumentFieldDetectionResponse.class); + } + + public DocumentFieldDetectionResponse detectionResult( + @javax.annotation.Nonnull + DocumentFieldDetectionResponseDetectionResult detectionResult) { + this.detectionResult = detectionResult; + return this; + } + + /** + * Get detectionResult + * + * @return detectionResult + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_DETECTION_RESULT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public DocumentFieldDetectionResponseDetectionResult getDetectionResult() { + return detectionResult; + } + + @JsonProperty(JSON_PROPERTY_DETECTION_RESULT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setDetectionResult( + @javax.annotation.Nonnull + DocumentFieldDetectionResponseDetectionResult detectionResult) { + this.detectionResult = detectionResult; + } + + public DocumentFieldDetectionResponse warnings( + @javax.annotation.Nullable List warnings) { + this.warnings = warnings; + return this; + } + + public DocumentFieldDetectionResponse addWarningsItem(WarningResponse warningsItem) { + if (this.warnings == null) { + this.warnings = new ArrayList<>(); + } + this.warnings.add(warningsItem); + return this; + } + + /** + * A list of warnings. + * + * @return warnings + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_WARNINGS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getWarnings() { + return warnings; + } + + @JsonProperty(JSON_PROPERTY_WARNINGS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setWarnings(@javax.annotation.Nullable List warnings) { + this.warnings = warnings; + } + + /** Return true if this DocumentFieldDetectionResponse object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DocumentFieldDetectionResponse documentFieldDetectionResponse = + (DocumentFieldDetectionResponse) o; + return Objects.equals(this.detectionResult, documentFieldDetectionResponse.detectionResult) + && Objects.equals(this.warnings, documentFieldDetectionResponse.warnings); + } + + @Override + public int hashCode() { + return Objects.hash(detectionResult, warnings); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DocumentFieldDetectionResponse {\n"); + sb.append(" detectionResult: ").append(toIndentedString(detectionResult)).append("\n"); + sb.append(" warnings: ").append(toIndentedString(warnings)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public Map createFormData() throws ApiException { + Map map = new HashMap<>(); + boolean fileTypeFound = false; + try { + if (detectionResult != null) { + if (isFileTypeOrListOfFiles(detectionResult)) { + fileTypeFound = true; + } + + if (detectionResult.getClass().equals(java.io.File.class) + || detectionResult.getClass().equals(Integer.class) + || detectionResult.getClass().equals(String.class) + || detectionResult.getClass().isEnum()) { + map.put("detection_result", detectionResult); + } else if (isListOfFile(detectionResult)) { + for (int i = 0; i < getListSize(detectionResult); i++) { + map.put("detection_result[" + i + "]", getFromList(detectionResult, i)); + } + } else { + map.put( + "detection_result", + JSON.getDefault().getMapper().writeValueAsString(detectionResult)); + } + } + if (warnings != null) { + if (isFileTypeOrListOfFiles(warnings)) { + fileTypeFound = true; + } + + if (warnings.getClass().equals(java.io.File.class) + || warnings.getClass().equals(Integer.class) + || warnings.getClass().equals(String.class) + || warnings.getClass().isEnum()) { + map.put("warnings", warnings); + } else if (isListOfFile(warnings)) { + for (int i = 0; i < getListSize(warnings); i++) { + map.put("warnings[" + i + "]", getFromList(warnings, i)); + } + } else { + map.put("warnings", JSON.getDefault().getMapper().writeValueAsString(warnings)); + } + } + } catch (Exception e) { + throw new ApiException(e); + } + + return fileTypeFound ? map : new HashMap<>(); + } + + private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { + return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); + } + + private boolean isListOfFile(Object obj) throws Exception { + return obj instanceof java.util.List + && !isListEmpty(obj) + && getFromList(obj, 0) instanceof java.io.File; + } + + private boolean isListEmpty(Object obj) throws Exception { + return (boolean) + Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); + } + + private Object getFromList(Object obj, int index) throws Exception { + return Class.forName(java.util.List.class.getName()) + .getMethod("get", int.class) + .invoke(obj, index); + } + + private int getListSize(Object obj) throws Exception { + return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/model/DocumentFieldDetectionResponseDetectionResult.java b/sdks/java-v1/src/main/java/com/dropbox/sign/model/DocumentFieldDetectionResponseDetectionResult.java new file mode 100644 index 000000000..37eac201e --- /dev/null +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/model/DocumentFieldDetectionResponseDetectionResult.java @@ -0,0 +1,727 @@ +/* + * 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; + +/** DocumentFieldDetectionResponseDetectionResult */ +@JsonPropertyOrder({ + DocumentFieldDetectionResponseDetectionResult.JSON_PROPERTY_DOCUMENT_HASH, + DocumentFieldDetectionResponseDetectionResult.JSON_PROPERTY_DETECTION_MODE, + DocumentFieldDetectionResponseDetectionResult.JSON_PROPERTY_PAGE_COUNT, + DocumentFieldDetectionResponseDetectionResult.JSON_PROPERTY_PAGES_ANALYZED, + DocumentFieldDetectionResponseDetectionResult.JSON_PROPERTY_DETECTED_AT, + DocumentFieldDetectionResponseDetectionResult.JSON_PROPERTY_FORM_FIELDS_PER_DOCUMENT, + DocumentFieldDetectionResponseDetectionResult.JSON_PROPERTY_FORM_FIELD_GROUPS, + DocumentFieldDetectionResponseDetectionResult.JSON_PROPERTY_WARNINGS, + DocumentFieldDetectionResponseDetectionResult.JSON_PROPERTY_ERRORS, + DocumentFieldDetectionResponseDetectionResult.JSON_PROPERTY_SUGGESTIONS +}) +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +@JsonIgnoreProperties(ignoreUnknown = true) +public class DocumentFieldDetectionResponseDetectionResult { + public static final String JSON_PROPERTY_DOCUMENT_HASH = "document_hash"; + @javax.annotation.Nonnull private String documentHash; + + public static final String JSON_PROPERTY_DETECTION_MODE = "detection_mode"; + @javax.annotation.Nonnull private String detectionMode; + + public static final String JSON_PROPERTY_PAGE_COUNT = "page_count"; + @javax.annotation.Nonnull private Integer pageCount; + + public static final String JSON_PROPERTY_PAGES_ANALYZED = "pages_analyzed"; + @javax.annotation.Nonnull private String pagesAnalyzed; + + public static final String JSON_PROPERTY_DETECTED_AT = "detected_at"; + @javax.annotation.Nonnull private Long detectedAt; + + public static final String JSON_PROPERTY_FORM_FIELDS_PER_DOCUMENT = "form_fields_per_document"; + + @javax.annotation.Nonnull + private List formFieldsPerDocument = new ArrayList<>(); + + public static final String JSON_PROPERTY_FORM_FIELD_GROUPS = "form_field_groups"; + @javax.annotation.Nonnull private List formFieldGroups = new ArrayList<>(); + + public static final String JSON_PROPERTY_WARNINGS = "warnings"; + @javax.annotation.Nonnull private List warnings = new ArrayList<>(); + + public static final String JSON_PROPERTY_ERRORS = "errors"; + @javax.annotation.Nonnull private List errors = new ArrayList<>(); + + public static final String JSON_PROPERTY_SUGGESTIONS = "suggestions"; + @javax.annotation.Nonnull private List suggestions = new ArrayList<>(); + + public DocumentFieldDetectionResponseDetectionResult() {} + + /** + * Attempt to instantiate and hydrate a new instance of this class + * + * @param jsonData String of JSON data representing target object + */ + public static DocumentFieldDetectionResponseDetectionResult init(String jsonData) + throws Exception { + return new ObjectMapper() + .readValue(jsonData, DocumentFieldDetectionResponseDetectionResult.class); + } + + public static DocumentFieldDetectionResponseDetectionResult init(HashMap data) + throws Exception { + return new ObjectMapper() + .readValue( + new ObjectMapper().writeValueAsString(data), + DocumentFieldDetectionResponseDetectionResult.class); + } + + public DocumentFieldDetectionResponseDetectionResult documentHash( + @javax.annotation.Nonnull String documentHash) { + this.documentHash = documentHash; + return this; + } + + /** + * The SHA-256 hash of the analyzed document. + * + * @return documentHash + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_DOCUMENT_HASH) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getDocumentHash() { + return documentHash; + } + + @JsonProperty(JSON_PROPERTY_DOCUMENT_HASH) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setDocumentHash(@javax.annotation.Nonnull String documentHash) { + this.documentHash = documentHash; + } + + public DocumentFieldDetectionResponseDetectionResult detectionMode( + @javax.annotation.Nonnull String detectionMode) { + this.detectionMode = detectionMode; + return this; + } + + /** + * The field detection method used to analyze the document: `annotations` or + * `text_tags`. + * + * @return detectionMode + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_DETECTION_MODE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getDetectionMode() { + return detectionMode; + } + + @JsonProperty(JSON_PROPERTY_DETECTION_MODE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setDetectionMode(@javax.annotation.Nonnull String detectionMode) { + this.detectionMode = detectionMode; + } + + public DocumentFieldDetectionResponseDetectionResult pageCount( + @javax.annotation.Nonnull Integer pageCount) { + this.pageCount = pageCount; + return this; + } + + /** + * The total number of pages in the document. minimum: 0 + * + * @return pageCount + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_PAGE_COUNT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Integer getPageCount() { + return pageCount; + } + + @JsonProperty(JSON_PROPERTY_PAGE_COUNT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setPageCount(@javax.annotation.Nonnull Integer pageCount) { + this.pageCount = pageCount; + } + + public DocumentFieldDetectionResponseDetectionResult pagesAnalyzed( + @javax.annotation.Nonnull String pagesAnalyzed) { + this.pagesAnalyzed = pagesAnalyzed; + return this; + } + + /** + * The zero-based page indexes analyzed, represented by the requested `page_range`, or + * `all` when every page was analyzed. + * + * @return pagesAnalyzed + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_PAGES_ANALYZED) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getPagesAnalyzed() { + return pagesAnalyzed; + } + + @JsonProperty(JSON_PROPERTY_PAGES_ANALYZED) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setPagesAnalyzed(@javax.annotation.Nonnull String pagesAnalyzed) { + this.pagesAnalyzed = pagesAnalyzed; + } + + public DocumentFieldDetectionResponseDetectionResult detectedAt( + @javax.annotation.Nonnull Long detectedAt) { + this.detectedAt = detectedAt; + return this; + } + + /** + * The Unix timestamp when the field detection result was generated. + * + * @return detectedAt + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_DETECTED_AT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Long getDetectedAt() { + return detectedAt; + } + + @JsonProperty(JSON_PROPERTY_DETECTED_AT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setDetectedAt(@javax.annotation.Nonnull Long detectedAt) { + this.detectedAt = detectedAt; + } + + public DocumentFieldDetectionResponseDetectionResult formFieldsPerDocument( + @javax.annotation.Nonnull List formFieldsPerDocument) { + this.formFieldsPerDocument = formFieldsPerDocument; + return this; + } + + public DocumentFieldDetectionResponseDetectionResult addFormFieldsPerDocumentItem( + SubFormFieldsPerDocumentBase formFieldsPerDocumentItem) { + if (this.formFieldsPerDocument == null) { + this.formFieldsPerDocument = new ArrayList<>(); + } + this.formFieldsPerDocument.add(formFieldsPerDocumentItem); + return this; + } + + /** + * The fields that should appear on the document, expressed as an array of objects. (For more + * details you can read about it here: [Using Form Fields per + * Document](/docs/openapi/form-fields-per-document).) **NOTE:** Fields like **text**, + * **dropdown**, **checkbox**, **radio**, and **hyperlink** have additional required and + * optional parameters. Check out the list of [additional + * parameters](/api/reference/constants/#form-fields-per-document) for these field types. * Text + * Field use `SubFormFieldsPerDocumentText` * Dropdown Field use + * `SubFormFieldsPerDocumentDropdown` * Hyperlink Field use + * `SubFormFieldsPerDocumentHyperlink` * Checkbox Field use + * `SubFormFieldsPerDocumentCheckbox` * Radio Field use + * `SubFormFieldsPerDocumentRadio` * Signature Field use + * `SubFormFieldsPerDocumentSignature` * Date Signed Field use + * `SubFormFieldsPerDocumentDateSigned` * Initials Field use + * `SubFormFieldsPerDocumentInitials` * Text Merge Field use + * `SubFormFieldsPerDocumentTextMerge` * Checkbox Merge Field use + * `SubFormFieldsPerDocumentCheckboxMerge` + * + * @return formFieldsPerDocument + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_FORM_FIELDS_PER_DOCUMENT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public List getFormFieldsPerDocument() { + return formFieldsPerDocument; + } + + @JsonProperty(JSON_PROPERTY_FORM_FIELDS_PER_DOCUMENT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setFormFieldsPerDocument( + @javax.annotation.Nonnull List formFieldsPerDocument) { + this.formFieldsPerDocument = formFieldsPerDocument; + } + + public DocumentFieldDetectionResponseDetectionResult formFieldGroups( + @javax.annotation.Nonnull List formFieldGroups) { + this.formFieldGroups = formFieldGroups; + return this; + } + + public DocumentFieldDetectionResponseDetectionResult addFormFieldGroupsItem( + SubFormFieldGroup formFieldGroupsItem) { + if (this.formFieldGroups == null) { + this.formFieldGroups = new ArrayList<>(); + } + this.formFieldGroups.add(formFieldGroupsItem); + return this; + } + + /** + * Group information for fields defined in `form_fields_per_document`. String-indexed + * JSON array with `group_label` and `requirement` keys. + * `form_fields_per_document` must contain fields referencing a group defined in + * `form_field_groups`. + * + * @return formFieldGroups + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_FORM_FIELD_GROUPS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public List getFormFieldGroups() { + return formFieldGroups; + } + + @JsonProperty(JSON_PROPERTY_FORM_FIELD_GROUPS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setFormFieldGroups( + @javax.annotation.Nonnull List formFieldGroups) { + this.formFieldGroups = formFieldGroups; + } + + public DocumentFieldDetectionResponseDetectionResult warnings( + @javax.annotation.Nonnull List warnings) { + this.warnings = warnings; + return this; + } + + public DocumentFieldDetectionResponseDetectionResult addWarningsItem( + WarningResponse warningsItem) { + if (this.warnings == null) { + this.warnings = new ArrayList<>(); + } + this.warnings.add(warningsItem); + return this; + } + + /** + * Non-fatal issues encountered during field detection. + * + * @return warnings + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_WARNINGS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public List getWarnings() { + return warnings; + } + + @JsonProperty(JSON_PROPERTY_WARNINGS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setWarnings(@javax.annotation.Nonnull List warnings) { + this.warnings = warnings; + } + + public DocumentFieldDetectionResponseDetectionResult errors( + @javax.annotation.Nonnull List errors) { + this.errors = errors; + return this; + } + + public DocumentFieldDetectionResponseDetectionResult addErrorsItem( + ErrorResponseError errorsItem) { + if (this.errors == null) { + this.errors = new ArrayList<>(); + } + this.errors.add(errorsItem); + return this; + } + + /** + * Errors encountered during field detection. Successfully detected fields may still be included + * in the response. + * + * @return errors + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_ERRORS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public List getErrors() { + return errors; + } + + @JsonProperty(JSON_PROPERTY_ERRORS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setErrors(@javax.annotation.Nonnull List errors) { + this.errors = errors; + } + + public DocumentFieldDetectionResponseDetectionResult suggestions( + @javax.annotation.Nonnull List suggestions) { + this.suggestions = suggestions; + return this; + } + + public DocumentFieldDetectionResponseDetectionResult addSuggestionsItem( + String suggestionsItem) { + if (this.suggestions == null) { + this.suggestions = new ArrayList<>(); + } + this.suggestions.add(suggestionsItem); + return this; + } + + /** + * Suggestions for improving the field detection results. + * + * @return suggestions + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_SUGGESTIONS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public List getSuggestions() { + return suggestions; + } + + @JsonProperty(JSON_PROPERTY_SUGGESTIONS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setSuggestions(@javax.annotation.Nonnull List suggestions) { + this.suggestions = suggestions; + } + + /** Return true if this DocumentFieldDetectionResponseDetectionResult object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DocumentFieldDetectionResponseDetectionResult + documentFieldDetectionResponseDetectionResult = + (DocumentFieldDetectionResponseDetectionResult) o; + return Objects.equals( + this.documentHash, + documentFieldDetectionResponseDetectionResult.documentHash) + && Objects.equals( + this.detectionMode, + documentFieldDetectionResponseDetectionResult.detectionMode) + && Objects.equals( + this.pageCount, documentFieldDetectionResponseDetectionResult.pageCount) + && Objects.equals( + this.pagesAnalyzed, + documentFieldDetectionResponseDetectionResult.pagesAnalyzed) + && Objects.equals( + this.detectedAt, documentFieldDetectionResponseDetectionResult.detectedAt) + && Objects.equals( + this.formFieldsPerDocument, + documentFieldDetectionResponseDetectionResult.formFieldsPerDocument) + && Objects.equals( + this.formFieldGroups, + documentFieldDetectionResponseDetectionResult.formFieldGroups) + && Objects.equals( + this.warnings, documentFieldDetectionResponseDetectionResult.warnings) + && Objects.equals(this.errors, documentFieldDetectionResponseDetectionResult.errors) + && Objects.equals( + this.suggestions, + documentFieldDetectionResponseDetectionResult.suggestions); + } + + @Override + public int hashCode() { + return Objects.hash( + documentHash, + detectionMode, + pageCount, + pagesAnalyzed, + detectedAt, + formFieldsPerDocument, + formFieldGroups, + warnings, + errors, + suggestions); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DocumentFieldDetectionResponseDetectionResult {\n"); + sb.append(" documentHash: ").append(toIndentedString(documentHash)).append("\n"); + sb.append(" detectionMode: ").append(toIndentedString(detectionMode)).append("\n"); + sb.append(" pageCount: ").append(toIndentedString(pageCount)).append("\n"); + sb.append(" pagesAnalyzed: ").append(toIndentedString(pagesAnalyzed)).append("\n"); + sb.append(" detectedAt: ").append(toIndentedString(detectedAt)).append("\n"); + sb.append(" formFieldsPerDocument: ") + .append(toIndentedString(formFieldsPerDocument)) + .append("\n"); + sb.append(" formFieldGroups: ").append(toIndentedString(formFieldGroups)).append("\n"); + sb.append(" warnings: ").append(toIndentedString(warnings)).append("\n"); + sb.append(" errors: ").append(toIndentedString(errors)).append("\n"); + sb.append(" suggestions: ").append(toIndentedString(suggestions)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public Map createFormData() throws ApiException { + Map map = new HashMap<>(); + boolean fileTypeFound = false; + try { + if (documentHash != null) { + if (isFileTypeOrListOfFiles(documentHash)) { + fileTypeFound = true; + } + + if (documentHash.getClass().equals(java.io.File.class) + || documentHash.getClass().equals(Integer.class) + || documentHash.getClass().equals(String.class) + || documentHash.getClass().isEnum()) { + map.put("document_hash", documentHash); + } else if (isListOfFile(documentHash)) { + for (int i = 0; i < getListSize(documentHash); i++) { + map.put("document_hash[" + i + "]", getFromList(documentHash, i)); + } + } else { + map.put( + "document_hash", + JSON.getDefault().getMapper().writeValueAsString(documentHash)); + } + } + if (detectionMode != null) { + if (isFileTypeOrListOfFiles(detectionMode)) { + fileTypeFound = true; + } + + if (detectionMode.getClass().equals(java.io.File.class) + || detectionMode.getClass().equals(Integer.class) + || detectionMode.getClass().equals(String.class) + || detectionMode.getClass().isEnum()) { + map.put("detection_mode", detectionMode); + } else if (isListOfFile(detectionMode)) { + for (int i = 0; i < getListSize(detectionMode); i++) { + map.put("detection_mode[" + i + "]", getFromList(detectionMode, i)); + } + } else { + map.put( + "detection_mode", + JSON.getDefault().getMapper().writeValueAsString(detectionMode)); + } + } + if (pageCount != null) { + if (isFileTypeOrListOfFiles(pageCount)) { + fileTypeFound = true; + } + + if (pageCount.getClass().equals(java.io.File.class) + || pageCount.getClass().equals(Integer.class) + || pageCount.getClass().equals(String.class) + || pageCount.getClass().isEnum()) { + map.put("page_count", pageCount); + } else if (isListOfFile(pageCount)) { + for (int i = 0; i < getListSize(pageCount); i++) { + map.put("page_count[" + i + "]", getFromList(pageCount, i)); + } + } else { + map.put( + "page_count", + JSON.getDefault().getMapper().writeValueAsString(pageCount)); + } + } + if (pagesAnalyzed != null) { + if (isFileTypeOrListOfFiles(pagesAnalyzed)) { + fileTypeFound = true; + } + + if (pagesAnalyzed.getClass().equals(java.io.File.class) + || pagesAnalyzed.getClass().equals(Integer.class) + || pagesAnalyzed.getClass().equals(String.class) + || pagesAnalyzed.getClass().isEnum()) { + map.put("pages_analyzed", pagesAnalyzed); + } else if (isListOfFile(pagesAnalyzed)) { + for (int i = 0; i < getListSize(pagesAnalyzed); i++) { + map.put("pages_analyzed[" + i + "]", getFromList(pagesAnalyzed, i)); + } + } else { + map.put( + "pages_analyzed", + JSON.getDefault().getMapper().writeValueAsString(pagesAnalyzed)); + } + } + if (detectedAt != null) { + if (isFileTypeOrListOfFiles(detectedAt)) { + fileTypeFound = true; + } + + if (detectedAt.getClass().equals(java.io.File.class) + || detectedAt.getClass().equals(Integer.class) + || detectedAt.getClass().equals(String.class) + || detectedAt.getClass().isEnum()) { + map.put("detected_at", detectedAt); + } else if (isListOfFile(detectedAt)) { + for (int i = 0; i < getListSize(detectedAt); i++) { + map.put("detected_at[" + i + "]", getFromList(detectedAt, i)); + } + } else { + map.put( + "detected_at", + JSON.getDefault().getMapper().writeValueAsString(detectedAt)); + } + } + if (formFieldsPerDocument != null) { + if (isFileTypeOrListOfFiles(formFieldsPerDocument)) { + fileTypeFound = true; + } + + if (formFieldsPerDocument.getClass().equals(java.io.File.class) + || formFieldsPerDocument.getClass().equals(Integer.class) + || formFieldsPerDocument.getClass().equals(String.class) + || formFieldsPerDocument.getClass().isEnum()) { + map.put("form_fields_per_document", formFieldsPerDocument); + } else if (isListOfFile(formFieldsPerDocument)) { + for (int i = 0; i < getListSize(formFieldsPerDocument); i++) { + map.put( + "form_fields_per_document[" + i + "]", + getFromList(formFieldsPerDocument, i)); + } + } else { + map.put( + "form_fields_per_document", + JSON.getDefault() + .getMapper() + .writeValueAsString(formFieldsPerDocument)); + } + } + if (formFieldGroups != null) { + if (isFileTypeOrListOfFiles(formFieldGroups)) { + fileTypeFound = true; + } + + if (formFieldGroups.getClass().equals(java.io.File.class) + || formFieldGroups.getClass().equals(Integer.class) + || formFieldGroups.getClass().equals(String.class) + || formFieldGroups.getClass().isEnum()) { + map.put("form_field_groups", formFieldGroups); + } else if (isListOfFile(formFieldGroups)) { + for (int i = 0; i < getListSize(formFieldGroups); i++) { + map.put("form_field_groups[" + i + "]", getFromList(formFieldGroups, i)); + } + } else { + map.put( + "form_field_groups", + JSON.getDefault().getMapper().writeValueAsString(formFieldGroups)); + } + } + if (warnings != null) { + if (isFileTypeOrListOfFiles(warnings)) { + fileTypeFound = true; + } + + if (warnings.getClass().equals(java.io.File.class) + || warnings.getClass().equals(Integer.class) + || warnings.getClass().equals(String.class) + || warnings.getClass().isEnum()) { + map.put("warnings", warnings); + } else if (isListOfFile(warnings)) { + for (int i = 0; i < getListSize(warnings); i++) { + map.put("warnings[" + i + "]", getFromList(warnings, i)); + } + } else { + map.put("warnings", JSON.getDefault().getMapper().writeValueAsString(warnings)); + } + } + if (errors != null) { + if (isFileTypeOrListOfFiles(errors)) { + fileTypeFound = true; + } + + if (errors.getClass().equals(java.io.File.class) + || errors.getClass().equals(Integer.class) + || errors.getClass().equals(String.class) + || errors.getClass().isEnum()) { + map.put("errors", errors); + } else if (isListOfFile(errors)) { + for (int i = 0; i < getListSize(errors); i++) { + map.put("errors[" + i + "]", getFromList(errors, i)); + } + } else { + map.put("errors", JSON.getDefault().getMapper().writeValueAsString(errors)); + } + } + if (suggestions != null) { + if (isFileTypeOrListOfFiles(suggestions)) { + fileTypeFound = true; + } + + if (suggestions.getClass().equals(java.io.File.class) + || suggestions.getClass().equals(Integer.class) + || suggestions.getClass().equals(String.class) + || suggestions.getClass().isEnum()) { + map.put("suggestions", suggestions); + } else if (isListOfFile(suggestions)) { + for (int i = 0; i < getListSize(suggestions); i++) { + map.put("suggestions[" + i + "]", getFromList(suggestions, i)); + } + } else { + map.put( + "suggestions", + JSON.getDefault().getMapper().writeValueAsString(suggestions)); + } + } + } catch (Exception e) { + throw new ApiException(e); + } + + return fileTypeFound ? map : new HashMap<>(); + } + + private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { + return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); + } + + private boolean isListOfFile(Object obj) throws Exception { + return obj instanceof java.util.List + && !isListEmpty(obj) + && getFromList(obj, 0) instanceof java.io.File; + } + + private boolean isListEmpty(Object obj) throws Exception { + return (boolean) + Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); + } + + private Object getFromList(Object obj, int index) throws Exception { + return Class.forName(java.util.List.class.getName()) + .getMethod("get", int.class) + .invoke(obj, index); + } + + private int getListSize(Object obj) throws Exception { + return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/model/FaxResponse.java b/sdks/java-v1/src/main/java/com/dropbox/sign/model/FaxResponse.java index 7ef24b5cc..b72e26e86 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/model/FaxResponse.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/model/FaxResponse.java @@ -35,6 +35,7 @@ FaxResponse.JSON_PROPERTY_SENDER, FaxResponse.JSON_PROPERTY_FILES_URL, FaxResponse.JSON_PROPERTY_TRANSMISSIONS, + FaxResponse.JSON_PROPERTY_TEST_MODE, FaxResponse.JSON_PROPERTY_SUBJECT, FaxResponse.JSON_PROPERTY_MESSAGE, FaxResponse.JSON_PROPERTY_FINAL_COPY_URI @@ -70,6 +71,9 @@ public class FaxResponse { @javax.annotation.Nonnull private List transmissions = new ArrayList<>(); + public static final String JSON_PROPERTY_TEST_MODE = "test_mode"; + @javax.annotation.Nonnull private Boolean testMode = false; + public static final String JSON_PROPERTY_SUBJECT = "subject"; @javax.annotation.Nullable private String subject; @@ -297,6 +301,30 @@ public void setTransmissions( this.transmissions = transmissions; } + public FaxResponse testMode(@javax.annotation.Nonnull Boolean testMode) { + this.testMode = testMode; + return this; + } + + /** + * Whether this is a test fax. Test faxes are not delivered to the recipient. Defaults to + * `false`. + * + * @return testMode + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_TEST_MODE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Boolean getTestMode() { + return testMode; + } + + @JsonProperty(JSON_PROPERTY_TEST_MODE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setTestMode(@javax.annotation.Nonnull Boolean testMode) { + this.testMode = testMode; + } + public FaxResponse subject(@javax.annotation.Nullable String subject) { this.subject = subject; return this; @@ -381,6 +409,7 @@ public boolean equals(Object o) { && Objects.equals(this.sender, faxResponse.sender) && Objects.equals(this.filesUrl, faxResponse.filesUrl) && Objects.equals(this.transmissions, faxResponse.transmissions) + && Objects.equals(this.testMode, faxResponse.testMode) && Objects.equals(this.subject, faxResponse.subject) && Objects.equals(this.message, faxResponse.message) && Objects.equals(this.finalCopyUri, faxResponse.finalCopyUri); @@ -397,6 +426,7 @@ public int hashCode() { sender, filesUrl, transmissions, + testMode, subject, message, finalCopyUri); @@ -414,6 +444,7 @@ public String toString() { sb.append(" sender: ").append(toIndentedString(sender)).append("\n"); sb.append(" filesUrl: ").append(toIndentedString(filesUrl)).append("\n"); sb.append(" transmissions: ").append(toIndentedString(transmissions)).append("\n"); + sb.append(" testMode: ").append(toIndentedString(testMode)).append("\n"); sb.append(" subject: ").append(toIndentedString(subject)).append("\n"); sb.append(" message: ").append(toIndentedString(message)).append("\n"); sb.append(" finalCopyUri: ").append(toIndentedString(finalCopyUri)).append("\n"); @@ -577,6 +608,26 @@ public Map createFormData() throws ApiException { JSON.getDefault().getMapper().writeValueAsString(transmissions)); } } + if (testMode != null) { + if (isFileTypeOrListOfFiles(testMode)) { + fileTypeFound = true; + } + + if (testMode.getClass().equals(java.io.File.class) + || testMode.getClass().equals(Integer.class) + || testMode.getClass().equals(String.class) + || testMode.getClass().isEnum()) { + map.put("test_mode", testMode); + } else if (isListOfFile(testMode)) { + for (int i = 0; i < getListSize(testMode); i++) { + map.put("test_mode[" + i + "]", getFromList(testMode, i)); + } + } else { + map.put( + "test_mode", + JSON.getDefault().getMapper().writeValueAsString(testMode)); + } + } if (subject != null) { if (isFileTypeOrListOfFiles(subject)) { fileTypeFound = true; diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/model/SignatureRequestBulkCreateEmbeddedWithTemplateRequest.java b/sdks/java-v1/src/main/java/com/dropbox/sign/model/SignatureRequestBulkCreateEmbeddedWithTemplateRequest.java index fda33d504..b83a7c823 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/model/SignatureRequestBulkCreateEmbeddedWithTemplateRequest.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/model/SignatureRequestBulkCreateEmbeddedWithTemplateRequest.java @@ -40,7 +40,8 @@ SignatureRequestBulkCreateEmbeddedWithTemplateRequest.JSON_PROPERTY_SIGNING_REDIRECT_URL, SignatureRequestBulkCreateEmbeddedWithTemplateRequest.JSON_PROPERTY_SUBJECT, SignatureRequestBulkCreateEmbeddedWithTemplateRequest.JSON_PROPERTY_TEST_MODE, - SignatureRequestBulkCreateEmbeddedWithTemplateRequest.JSON_PROPERTY_TITLE + SignatureRequestBulkCreateEmbeddedWithTemplateRequest.JSON_PROPERTY_TITLE, + SignatureRequestBulkCreateEmbeddedWithTemplateRequest.JSON_PROPERTY_EXPIRES_AT }) @javax.annotation.Generated( value = "org.openapitools.codegen.languages.JavaClientCodegen", @@ -86,6 +87,9 @@ public class SignatureRequestBulkCreateEmbeddedWithTemplateRequest { public static final String JSON_PROPERTY_TITLE = "title"; @javax.annotation.Nullable private String title; + public static final String JSON_PROPERTY_EXPIRES_AT = "expires_at"; + @javax.annotation.Nullable private Integer expiresAt; + public SignatureRequestBulkCreateEmbeddedWithTemplateRequest() {} /** @@ -488,6 +492,31 @@ public void setTitle(@javax.annotation.Nullable String title) { this.title = title; } + public SignatureRequestBulkCreateEmbeddedWithTemplateRequest expiresAt( + @javax.annotation.Nullable Integer expiresAt) { + this.expiresAt = expiresAt; + return this; + } + + /** + * When the signature request will expire. Unsigned signatures will be moved to the expired + * status, and no longer signable. See [Signature Request Expiration + * Date](https://developers.hellosign.com/docs/signature-request/expiration/) for details. + * + * @return expiresAt + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_EXPIRES_AT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getExpiresAt() { + return expiresAt; + } + + @JsonProperty(JSON_PROPERTY_EXPIRES_AT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setExpiresAt(@javax.annotation.Nullable Integer expiresAt) { + this.expiresAt = expiresAt; + } + /** * Return true if this SignatureRequestBulkCreateEmbeddedWithTemplateRequest object is equal to * o. @@ -537,7 +566,10 @@ public boolean equals(Object o) { this.testMode, signatureRequestBulkCreateEmbeddedWithTemplateRequest.testMode) && Objects.equals( - this.title, signatureRequestBulkCreateEmbeddedWithTemplateRequest.title); + this.title, signatureRequestBulkCreateEmbeddedWithTemplateRequest.title) + && Objects.equals( + this.expiresAt, + signatureRequestBulkCreateEmbeddedWithTemplateRequest.expiresAt); } @Override @@ -555,7 +587,8 @@ public int hashCode() { signingRedirectUrl, subject, testMode, - title); + title, + expiresAt); } @Override @@ -577,6 +610,7 @@ public String toString() { sb.append(" subject: ").append(toIndentedString(subject)).append("\n"); sb.append(" testMode: ").append(toIndentedString(testMode)).append("\n"); sb.append(" title: ").append(toIndentedString(title)).append("\n"); + sb.append(" expiresAt: ").append(toIndentedString(expiresAt)).append("\n"); sb.append("}"); return sb.toString(); } @@ -837,6 +871,26 @@ public Map createFormData() throws ApiException { map.put("title", JSON.getDefault().getMapper().writeValueAsString(title)); } } + if (expiresAt != null) { + if (isFileTypeOrListOfFiles(expiresAt)) { + fileTypeFound = true; + } + + if (expiresAt.getClass().equals(java.io.File.class) + || expiresAt.getClass().equals(Integer.class) + || expiresAt.getClass().equals(String.class) + || expiresAt.getClass().isEnum()) { + map.put("expires_at", expiresAt); + } else if (isListOfFile(expiresAt)) { + for (int i = 0; i < getListSize(expiresAt); i++) { + map.put("expires_at[" + i + "]", getFromList(expiresAt, i)); + } + } else { + map.put( + "expires_at", + JSON.getDefault().getMapper().writeValueAsString(expiresAt)); + } + } } catch (Exception e) { throw new ApiException(e); } diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/model/SignatureRequestBulkSendWithTemplateRequest.java b/sdks/java-v1/src/main/java/com/dropbox/sign/model/SignatureRequestBulkSendWithTemplateRequest.java index 67ab53ea1..96b3b03fd 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/model/SignatureRequestBulkSendWithTemplateRequest.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/model/SignatureRequestBulkSendWithTemplateRequest.java @@ -40,7 +40,8 @@ SignatureRequestBulkSendWithTemplateRequest.JSON_PROPERTY_SIGNING_REDIRECT_URL, SignatureRequestBulkSendWithTemplateRequest.JSON_PROPERTY_SUBJECT, SignatureRequestBulkSendWithTemplateRequest.JSON_PROPERTY_TEST_MODE, - SignatureRequestBulkSendWithTemplateRequest.JSON_PROPERTY_TITLE + SignatureRequestBulkSendWithTemplateRequest.JSON_PROPERTY_TITLE, + SignatureRequestBulkSendWithTemplateRequest.JSON_PROPERTY_EXPIRES_AT }) @javax.annotation.Generated( value = "org.openapitools.codegen.languages.JavaClientCodegen", @@ -86,6 +87,9 @@ public class SignatureRequestBulkSendWithTemplateRequest { public static final String JSON_PROPERTY_TITLE = "title"; @javax.annotation.Nullable private String title; + public static final String JSON_PROPERTY_EXPIRES_AT = "expires_at"; + @javax.annotation.Nullable private Integer expiresAt; + public SignatureRequestBulkSendWithTemplateRequest() {} /** @@ -485,6 +489,31 @@ public void setTitle(@javax.annotation.Nullable String title) { this.title = title; } + public SignatureRequestBulkSendWithTemplateRequest expiresAt( + @javax.annotation.Nullable Integer expiresAt) { + this.expiresAt = expiresAt; + return this; + } + + /** + * When the signature request will expire. Unsigned signatures will be moved to the expired + * status, and no longer signable. See [Signature Request Expiration + * Date](https://developers.hellosign.com/docs/signature-request/expiration/) for details. + * + * @return expiresAt + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_EXPIRES_AT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getExpiresAt() { + return expiresAt; + } + + @JsonProperty(JSON_PROPERTY_EXPIRES_AT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setExpiresAt(@javax.annotation.Nullable Integer expiresAt) { + this.expiresAt = expiresAt; + } + /** Return true if this SignatureRequestBulkSendWithTemplateRequest object is equal to o. */ @Override public boolean equals(Object o) { @@ -518,7 +547,9 @@ public boolean equals(Object o) { && Objects.equals(this.subject, signatureRequestBulkSendWithTemplateRequest.subject) && Objects.equals( this.testMode, signatureRequestBulkSendWithTemplateRequest.testMode) - && Objects.equals(this.title, signatureRequestBulkSendWithTemplateRequest.title); + && Objects.equals(this.title, signatureRequestBulkSendWithTemplateRequest.title) + && Objects.equals( + this.expiresAt, signatureRequestBulkSendWithTemplateRequest.expiresAt); } @Override @@ -536,7 +567,8 @@ public int hashCode() { signingRedirectUrl, subject, testMode, - title); + title, + expiresAt); } @Override @@ -558,6 +590,7 @@ public String toString() { sb.append(" subject: ").append(toIndentedString(subject)).append("\n"); sb.append(" testMode: ").append(toIndentedString(testMode)).append("\n"); sb.append(" title: ").append(toIndentedString(title)).append("\n"); + sb.append(" expiresAt: ").append(toIndentedString(expiresAt)).append("\n"); sb.append("}"); return sb.toString(); } @@ -818,6 +851,26 @@ public Map createFormData() throws ApiException { map.put("title", JSON.getDefault().getMapper().writeValueAsString(title)); } } + if (expiresAt != null) { + if (isFileTypeOrListOfFiles(expiresAt)) { + fileTypeFound = true; + } + + if (expiresAt.getClass().equals(java.io.File.class) + || expiresAt.getClass().equals(Integer.class) + || expiresAt.getClass().equals(String.class) + || expiresAt.getClass().isEnum()) { + map.put("expires_at", expiresAt); + } else if (isListOfFile(expiresAt)) { + for (int i = 0; i < getListSize(expiresAt); i++) { + map.put("expires_at[" + i + "]", getFromList(expiresAt, i)); + } + } else { + map.put( + "expires_at", + JSON.getDefault().getMapper().writeValueAsString(expiresAt)); + } + } } catch (Exception e) { throw new ApiException(e); } diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/model/SignatureRequestCreateEmbeddedWithTemplateRequest.java b/sdks/java-v1/src/main/java/com/dropbox/sign/model/SignatureRequestCreateEmbeddedWithTemplateRequest.java index a6b8c00ec..c734926f8 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/model/SignatureRequestCreateEmbeddedWithTemplateRequest.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/model/SignatureRequestCreateEmbeddedWithTemplateRequest.java @@ -42,7 +42,8 @@ SignatureRequestCreateEmbeddedWithTemplateRequest.JSON_PROPERTY_SUBJECT, SignatureRequestCreateEmbeddedWithTemplateRequest.JSON_PROPERTY_TEST_MODE, SignatureRequestCreateEmbeddedWithTemplateRequest.JSON_PROPERTY_TITLE, - SignatureRequestCreateEmbeddedWithTemplateRequest.JSON_PROPERTY_POPULATE_AUTO_FILL_FIELDS + SignatureRequestCreateEmbeddedWithTemplateRequest.JSON_PROPERTY_POPULATE_AUTO_FILL_FIELDS, + SignatureRequestCreateEmbeddedWithTemplateRequest.JSON_PROPERTY_EXPIRES_AT }) @javax.annotation.Generated( value = "org.openapitools.codegen.languages.JavaClientCodegen", @@ -97,6 +98,9 @@ public class SignatureRequestCreateEmbeddedWithTemplateRequest { "populate_auto_fill_fields"; @javax.annotation.Nullable private Boolean populateAutoFillFields = false; + public static final String JSON_PROPERTY_EXPIRES_AT = "expires_at"; + @javax.annotation.Nullable private Integer expiresAt; + public SignatureRequestCreateEmbeddedWithTemplateRequest() {} /** @@ -543,6 +547,31 @@ public void setPopulateAutoFillFields( this.populateAutoFillFields = populateAutoFillFields; } + public SignatureRequestCreateEmbeddedWithTemplateRequest expiresAt( + @javax.annotation.Nullable Integer expiresAt) { + this.expiresAt = expiresAt; + return this; + } + + /** + * When the signature request will expire. Unsigned signatures will be moved to the expired + * status, and no longer signable. See [Signature Request Expiration + * Date](https://developers.hellosign.com/docs/signature-request/expiration/) for details. + * + * @return expiresAt + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_EXPIRES_AT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getExpiresAt() { + return expiresAt; + } + + @JsonProperty(JSON_PROPERTY_EXPIRES_AT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setExpiresAt(@javax.annotation.Nullable Integer expiresAt) { + this.expiresAt = expiresAt; + } + /** * Return true if this SignatureRequestCreateEmbeddedWithTemplateRequest object is equal to o. */ @@ -590,7 +619,10 @@ public boolean equals(Object o) { this.title, signatureRequestCreateEmbeddedWithTemplateRequest.title) && Objects.equals( this.populateAutoFillFields, - signatureRequestCreateEmbeddedWithTemplateRequest.populateAutoFillFields); + signatureRequestCreateEmbeddedWithTemplateRequest.populateAutoFillFields) + && Objects.equals( + this.expiresAt, + signatureRequestCreateEmbeddedWithTemplateRequest.expiresAt); } @Override @@ -610,7 +642,8 @@ public int hashCode() { subject, testMode, title, - populateAutoFillFields); + populateAutoFillFields, + expiresAt); } @Override @@ -634,6 +667,7 @@ public String toString() { sb.append(" populateAutoFillFields: ") .append(toIndentedString(populateAutoFillFields)) .append("\n"); + sb.append(" expiresAt: ").append(toIndentedString(expiresAt)).append("\n"); sb.append("}"); return sb.toString(); } @@ -932,6 +966,26 @@ public Map createFormData() throws ApiException { .writeValueAsString(populateAutoFillFields)); } } + if (expiresAt != null) { + if (isFileTypeOrListOfFiles(expiresAt)) { + fileTypeFound = true; + } + + if (expiresAt.getClass().equals(java.io.File.class) + || expiresAt.getClass().equals(Integer.class) + || expiresAt.getClass().equals(String.class) + || expiresAt.getClass().isEnum()) { + map.put("expires_at", expiresAt); + } else if (isListOfFile(expiresAt)) { + for (int i = 0; i < getListSize(expiresAt); i++) { + map.put("expires_at[" + i + "]", getFromList(expiresAt, i)); + } + } else { + map.put( + "expires_at", + JSON.getDefault().getMapper().writeValueAsString(expiresAt)); + } + } } catch (Exception e) { throw new ApiException(e); } diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/model/SignatureRequestSendWithTemplateRequest.java b/sdks/java-v1/src/main/java/com/dropbox/sign/model/SignatureRequestSendWithTemplateRequest.java index 0c0055e43..a09639d03 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/model/SignatureRequestSendWithTemplateRequest.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/model/SignatureRequestSendWithTemplateRequest.java @@ -44,7 +44,8 @@ SignatureRequestSendWithTemplateRequest.JSON_PROPERTY_SIGNING_REDIRECT_URL, SignatureRequestSendWithTemplateRequest.JSON_PROPERTY_SUBJECT, SignatureRequestSendWithTemplateRequest.JSON_PROPERTY_TEST_MODE, - SignatureRequestSendWithTemplateRequest.JSON_PROPERTY_TITLE + SignatureRequestSendWithTemplateRequest.JSON_PROPERTY_TITLE, + SignatureRequestSendWithTemplateRequest.JSON_PROPERTY_EXPIRES_AT }) @javax.annotation.Generated( value = "org.openapitools.codegen.languages.JavaClientCodegen", @@ -104,6 +105,9 @@ public class SignatureRequestSendWithTemplateRequest { public static final String JSON_PROPERTY_TITLE = "title"; @javax.annotation.Nullable private String title; + public static final String JSON_PROPERTY_EXPIRES_AT = "expires_at"; + @javax.annotation.Nullable private Integer expiresAt; + public SignatureRequestSendWithTemplateRequest() {} /** @@ -597,6 +601,31 @@ public void setTitle(@javax.annotation.Nullable String title) { this.title = title; } + public SignatureRequestSendWithTemplateRequest expiresAt( + @javax.annotation.Nullable Integer expiresAt) { + this.expiresAt = expiresAt; + return this; + } + + /** + * When the signature request will expire. Unsigned signatures will be moved to the expired + * status, and no longer signable. See [Signature Request Expiration + * Date](https://developers.hellosign.com/docs/signature-request/expiration/) for details. + * + * @return expiresAt + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_EXPIRES_AT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getExpiresAt() { + return expiresAt; + } + + @JsonProperty(JSON_PROPERTY_EXPIRES_AT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setExpiresAt(@javax.annotation.Nullable Integer expiresAt) { + this.expiresAt = expiresAt; + } + /** Return true if this SignatureRequestSendWithTemplateRequest object is equal to o. */ @Override public boolean equals(Object o) { @@ -631,7 +660,9 @@ public boolean equals(Object o) { signatureRequestSendWithTemplateRequest.signingRedirectUrl) && Objects.equals(this.subject, signatureRequestSendWithTemplateRequest.subject) && Objects.equals(this.testMode, signatureRequestSendWithTemplateRequest.testMode) - && Objects.equals(this.title, signatureRequestSendWithTemplateRequest.title); + && Objects.equals(this.title, signatureRequestSendWithTemplateRequest.title) + && Objects.equals( + this.expiresAt, signatureRequestSendWithTemplateRequest.expiresAt); } @Override @@ -653,7 +684,8 @@ public int hashCode() { signingRedirectUrl, subject, testMode, - title); + title, + expiresAt); } @Override @@ -681,6 +713,7 @@ public String toString() { sb.append(" subject: ").append(toIndentedString(subject)).append("\n"); sb.append(" testMode: ").append(toIndentedString(testMode)).append("\n"); sb.append(" title: ").append(toIndentedString(title)).append("\n"); + sb.append(" expiresAt: ").append(toIndentedString(expiresAt)).append("\n"); sb.append("}"); return sb.toString(); } @@ -1017,6 +1050,26 @@ public Map createFormData() throws ApiException { map.put("title", JSON.getDefault().getMapper().writeValueAsString(title)); } } + if (expiresAt != null) { + if (isFileTypeOrListOfFiles(expiresAt)) { + fileTypeFound = true; + } + + if (expiresAt.getClass().equals(java.io.File.class) + || expiresAt.getClass().equals(Integer.class) + || expiresAt.getClass().equals(String.class) + || expiresAt.getClass().isEnum()) { + map.put("expires_at", expiresAt); + } else if (isListOfFile(expiresAt)) { + for (int i = 0; i < getListSize(expiresAt); i++) { + map.put("expires_at[" + i + "]", getFromList(expiresAt, i)); + } + } else { + map.put( + "expires_at", + JSON.getDefault().getMapper().writeValueAsString(expiresAt)); + } + } } catch (Exception e) { throw new ApiException(e); } diff --git a/sdks/java-v2/README.md b/sdks/java-v2/README.md index 91850482a..80001f0d1 100644 --- a/sdks/java-v2/README.md +++ b/sdks/java-v2/README.md @@ -161,6 +161,7 @@ Class | Method | HTTP request | Description *ApiAppApi* | [**apiAppUpdate**](docs/ApiAppApi.md#apiAppUpdate) | **PUT** /api_app/{client_id} | Update API App *BulkSendJobApi* | [**bulkSendJobGet**](docs/BulkSendJobApi.md#bulkSendJobGet) | **GET** /bulk_send_job/{bulk_send_job_id} | Get Bulk Send Job *BulkSendJobApi* | [**bulkSendJobList**](docs/BulkSendJobApi.md#bulkSendJobList) | **GET** /bulk_send_job/list | List Bulk Send Jobs +*DocumentApi* | [**documentDetectFields**](docs/DocumentApi.md#documentDetectFields) | **POST** /document/detect_fields | Detect Document Fields *EmbeddedApi* | [**embeddedEditUrl**](docs/EmbeddedApi.md#embeddedEditUrl) | **POST** /embedded/edit_url/{template_id} | Get Embedded Template Edit URL *EmbeddedApi* | [**embeddedSignUrl**](docs/EmbeddedApi.md#embeddedSignUrl) | **GET** /embedded/sign_url/{signature_id} | Get Embedded Sign URL *FaxApi* | [**faxDelete**](docs/FaxApi.md#faxDelete) | **DELETE** /fax/{fax_id} | Delete Fax @@ -252,6 +253,9 @@ Class | Method | HTTP request | Description - [BulkSendJobListResponse](docs/BulkSendJobListResponse.md) - [BulkSendJobResponse](docs/BulkSendJobResponse.md) - [BulkSendJobSendResponse](docs/BulkSendJobSendResponse.md) + - [DocumentFieldDetectionRequest](docs/DocumentFieldDetectionRequest.md) + - [DocumentFieldDetectionResponse](docs/DocumentFieldDetectionResponse.md) + - [DocumentFieldDetectionResponseDetectionResult](docs/DocumentFieldDetectionResponseDetectionResult.md) - [EmbeddedEditUrlRequest](docs/EmbeddedEditUrlRequest.md) - [EmbeddedEditUrlResponse](docs/EmbeddedEditUrlResponse.md) - [EmbeddedEditUrlResponseEmbedded](docs/EmbeddedEditUrlResponseEmbedded.md) diff --git a/sdks/java-v2/docs/DocumentApi.md b/sdks/java-v2/docs/DocumentApi.md new file mode 100644 index 000000000..c72d11a30 --- /dev/null +++ b/sdks/java-v2/docs/DocumentApi.md @@ -0,0 +1,96 @@ +# DocumentApi + +All URIs are relative to *https://api.hellosign.com/v3* + +| Method | HTTP request | Description | +|------------- | ------------- | -------------| +[**documentDetectFields**](DocumentApi.md#documentDetectFields) | **POST** /document/detect_fields | Detect Document Fields + + + +## documentDetectFields + +> DocumentFieldDetectionResponse documentDetectFields(documentFieldDetectionRequest) + +Detect Document Fields + +Detects form fields in a PDF document using either PDF form annotations or Dropbox Sign text tags. + +### 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 DocumentDetectFieldsExample +{ + 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 documentFieldDetectionRequest = new DocumentFieldDetectionRequest(); + documentFieldDetectionRequest.detectionMode("annotations"); + documentFieldDetectionRequest._file(new File("./example_document.pdf")); + documentFieldDetectionRequest.pageRange("all"); + + try + { + var response = new DocumentApi(config).documentDetectFields( + documentFieldDetectionRequest + ); + + System.out.println(response); + } catch (ApiException e) { + System.err.println("Exception when calling DocumentApi#documentDetectFields"); + 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 | +|------------- | ------------- | ------------- | -------------| + **documentFieldDetectionRequest** | [**DocumentFieldDetectionRequest**](DocumentFieldDetectionRequest.md)| | + +### Return type + +[**DocumentFieldDetectionResponse**](DocumentFieldDetectionResponse.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 | - | + diff --git a/sdks/java-v2/docs/DocumentFieldDetectionRequest.md b/sdks/java-v2/docs/DocumentFieldDetectionRequest.md new file mode 100644 index 000000000..482d27963 --- /dev/null +++ b/sdks/java-v2/docs/DocumentFieldDetectionRequest.md @@ -0,0 +1,17 @@ + + +# DocumentFieldDetectionRequest + + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +| `detectionMode`*_required_ | [```String```](String.md) | The field detection method to use. Set to `annotations` to detect PDF form annotations or `text_tags` to detect Dropbox Sign text tags. | | +| `_file` | ```File``` | The PDF file to analyze.

This endpoint requires either `file` or `file_url`, but not both. | | +| `fileUrl` | ```URI``` | The URL of the PDF file to analyze.

This endpoint requires either `file` or `file_url`, but not both. | | +| `pageRange` | ```String``` | The zero-based page indexes to analyze. Accepts `all`, individual pages, inclusive ranges, or comma-separated combinations, such as `0-2,5,7-9`. Defaults to `all`. | | + + + diff --git a/sdks/java-v2/docs/DocumentFieldDetectionResponse.md b/sdks/java-v2/docs/DocumentFieldDetectionResponse.md new file mode 100644 index 000000000..2a7329e7c --- /dev/null +++ b/sdks/java-v2/docs/DocumentFieldDetectionResponse.md @@ -0,0 +1,15 @@ + + +# DocumentFieldDetectionResponse + + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +| `detectionResult`*_required_ | [```DocumentFieldDetectionResponseDetectionResult```](DocumentFieldDetectionResponseDetectionResult.md) | | | +| `warnings` | [```List```](WarningResponse.md) | A list of warnings. | | + + + diff --git a/sdks/java-v2/docs/DocumentFieldDetectionResponseDetectionResult.md b/sdks/java-v2/docs/DocumentFieldDetectionResponseDetectionResult.md new file mode 100644 index 000000000..b8f0e04ce --- /dev/null +++ b/sdks/java-v2/docs/DocumentFieldDetectionResponseDetectionResult.md @@ -0,0 +1,23 @@ + + +# DocumentFieldDetectionResponseDetectionResult + + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +| `documentHash`*_required_ | ```String``` | The SHA-256 hash of the analyzed document. | | +| `detectionMode`*_required_ | [```String```](String.md) | The field detection method used to analyze the document: `annotations` or `text_tags`. | | +| `pageCount`*_required_ | ```Integer``` | The total number of pages in the document. | | +| `pagesAnalyzed`*_required_ | ```String``` | The zero-based page indexes analyzed, represented by the requested `page_range`, or `all` when every page was analyzed. | | +| `detectedAt`*_required_ | ```Long``` | The Unix timestamp when the field detection result was generated. | | +| `formFieldsPerDocument`*_required_ | [```List```](SubFormFieldsPerDocumentBase.md) | The fields that should appear on the document, expressed as an array of objects. (For more details you can read about it here: [Using Form Fields per Document](/docs/openapi/form-fields-per-document).)

**NOTE:** Fields like **text**, **dropdown**, **checkbox**, **radio**, and **hyperlink** have additional required and optional parameters. Check out the list of [additional parameters](/api/reference/constants/#form-fields-per-document) for these field types.

* Text Field use `SubFormFieldsPerDocumentText`
* Dropdown Field use `SubFormFieldsPerDocumentDropdown`
* Hyperlink Field use `SubFormFieldsPerDocumentHyperlink`
* Checkbox Field use `SubFormFieldsPerDocumentCheckbox`
* Radio Field use `SubFormFieldsPerDocumentRadio`
* Signature Field use `SubFormFieldsPerDocumentSignature`
* Date Signed Field use `SubFormFieldsPerDocumentDateSigned`
* Initials Field use `SubFormFieldsPerDocumentInitials`
* Text Merge Field use `SubFormFieldsPerDocumentTextMerge`
* Checkbox Merge Field use `SubFormFieldsPerDocumentCheckboxMerge` | | +| `formFieldGroups`*_required_ | [```List```](SubFormFieldGroup.md) | Group information for fields defined in `form_fields_per_document`. String-indexed JSON array with `group_label` and `requirement` keys. `form_fields_per_document` must contain fields referencing a group defined in `form_field_groups`. | | +| `warnings`*_required_ | [```List```](WarningResponse.md) | Non-fatal issues encountered during field detection. | | +| `errors`*_required_ | [```List```](ErrorResponseError.md) | Errors encountered during field detection. Successfully detected fields may still be included in the response. | | +| `suggestions`*_required_ | ```List``` | Suggestions for improving the field detection results. | | + + + diff --git a/sdks/java-v2/docs/FaxResponse.md b/sdks/java-v2/docs/FaxResponse.md index a1c857b48..a5707cfb4 100644 --- a/sdks/java-v2/docs/FaxResponse.md +++ b/sdks/java-v2/docs/FaxResponse.md @@ -16,6 +16,7 @@ | `sender`*_required_ | ```String``` | Fax Sender Email | | | `filesUrl`*_required_ | ```String``` | Fax Files URL | | | `transmissions`*_required_ | [```List```](FaxResponseTransmission.md) | Fax Transmissions List | | +| `testMode`*_required_ | ```Boolean``` | Whether this is a test fax. Test faxes are not delivered to the recipient. Defaults to `false`. | | | `subject` | ```String``` | Fax Subject | | | `message` | ```String``` | Fax Message | | | `finalCopyUri` | ```String``` | The path where the completed document can be downloaded | | diff --git a/sdks/java-v2/docs/SignatureRequestBulkCreateEmbeddedWithTemplateRequest.md b/sdks/java-v2/docs/SignatureRequestBulkCreateEmbeddedWithTemplateRequest.md index 4243ead1c..ef7454fc2 100644 --- a/sdks/java-v2/docs/SignatureRequestBulkCreateEmbeddedWithTemplateRequest.md +++ b/sdks/java-v2/docs/SignatureRequestBulkCreateEmbeddedWithTemplateRequest.md @@ -21,6 +21,7 @@ | `subject` | ```String``` | The subject in the email that will be sent to the signers. | | | `testMode` | ```Boolean``` | Whether this is a test, the signature request will not be legally binding if set to `true`. Defaults to `false`. | | | `title` | ```String``` | The title you want to assign to the SignatureRequest. | | +| `expiresAt` | ```Integer``` | When the signature request will expire. Unsigned signatures will be moved to the expired status, and no longer signable. See [Signature Request Expiration Date](https://developers.hellosign.com/docs/signature-request/expiration/) for details. | | diff --git a/sdks/java-v2/docs/SignatureRequestBulkSendWithTemplateRequest.md b/sdks/java-v2/docs/SignatureRequestBulkSendWithTemplateRequest.md index 1798f6fdc..34a3281c8 100644 --- a/sdks/java-v2/docs/SignatureRequestBulkSendWithTemplateRequest.md +++ b/sdks/java-v2/docs/SignatureRequestBulkSendWithTemplateRequest.md @@ -21,6 +21,7 @@ | `subject` | ```String``` | The subject in the email that will be sent to the signers. | | | `testMode` | ```Boolean``` | Whether this is a test, the signature request will not be legally binding if set to `true`. Defaults to `false`. | | | `title` | ```String``` | The title you want to assign to the SignatureRequest. | | +| `expiresAt` | ```Integer``` | When the signature request will expire. Unsigned signatures will be moved to the expired status, and no longer signable. See [Signature Request Expiration Date](https://developers.hellosign.com/docs/signature-request/expiration/) for details. | | diff --git a/sdks/java-v2/docs/SignatureRequestCreateEmbeddedWithTemplateRequest.md b/sdks/java-v2/docs/SignatureRequestCreateEmbeddedWithTemplateRequest.md index 050a7e631..da8343b6a 100644 --- a/sdks/java-v2/docs/SignatureRequestCreateEmbeddedWithTemplateRequest.md +++ b/sdks/java-v2/docs/SignatureRequestCreateEmbeddedWithTemplateRequest.md @@ -23,6 +23,7 @@ | `testMode` | ```Boolean``` | Whether this is a test, the signature request will not be legally binding if set to `true`. Defaults to `false`. | | | `title` | ```String``` | The title you want to assign to the SignatureRequest. | | | `populateAutoFillFields` | ```Boolean``` | Controls whether [auto fill fields](https://faq.hellosign.com/hc/en-us/articles/360051467511-Auto-Fill-Fields) can automatically populate a signer's information during signing.

**NOTE:** Keep your signer's information safe by ensuring that the _signer on your signature request is the intended party_ before using this feature. | | +| `expiresAt` | ```Integer``` | When the signature request will expire. Unsigned signatures will be moved to the expired status, and no longer signable. See [Signature Request Expiration Date](https://developers.hellosign.com/docs/signature-request/expiration/) for details. | | diff --git a/sdks/java-v2/docs/SignatureRequestSendWithTemplateRequest.md b/sdks/java-v2/docs/SignatureRequestSendWithTemplateRequest.md index 425ccff28..621d66a86 100644 --- a/sdks/java-v2/docs/SignatureRequestSendWithTemplateRequest.md +++ b/sdks/java-v2/docs/SignatureRequestSendWithTemplateRequest.md @@ -25,6 +25,7 @@ | `subject` | ```String``` | The subject in the email that will be sent to the signers. | | | `testMode` | ```Boolean``` | Whether this is a test, the signature request will not be legally binding if set to `true`. Defaults to `false`. | | | `title` | ```String``` | The title you want to assign to the SignatureRequest. | | +| `expiresAt` | ```Integer``` | When the signature request will expire. Unsigned signatures will be moved to the expired status, and no longer signable. See [Signature Request Expiration Date](https://developers.hellosign.com/docs/signature-request/expiration/) for details. | | diff --git a/sdks/java-v2/src/main/java/com/dropbox/sign/api/DocumentApi.java b/sdks/java-v2/src/main/java/com/dropbox/sign/api/DocumentApi.java new file mode 100644 index 000000000..1bf68ca4c --- /dev/null +++ b/sdks/java-v2/src/main/java/com/dropbox/sign/api/DocumentApi.java @@ -0,0 +1,116 @@ +package com.dropbox.sign.api; + +import com.dropbox.sign.ApiException; +import com.dropbox.sign.ApiClient; +import com.dropbox.sign.ApiResponse; +import com.dropbox.sign.Configuration; +import com.dropbox.sign.Pair; + +import jakarta.ws.rs.core.GenericType; + +import com.dropbox.sign.model.DocumentFieldDetectionRequest; +import com.dropbox.sign.model.DocumentFieldDetectionResponse; +import com.dropbox.sign.model.ErrorResponse; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; + +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.12.0") +public class DocumentApi { + private ApiClient apiClient; + + public DocumentApi() { + this(Configuration.getDefaultApiClient()); + } + + public DocumentApi(ApiClient apiClient) { + this.apiClient = apiClient; + } + + /** + * Get the API client + * + * @return API client + */ + public ApiClient getApiClient() { + return apiClient; + } + + /** + * Set the API client + * + * @param apiClient an instance of API client + */ + public void setApiClient(ApiClient apiClient) { + this.apiClient = apiClient; + } + + /** + * Detect Document Fields + * Detects form fields in a PDF document using either PDF form annotations or Dropbox Sign text tags. + * Example: https://github.com/hellosign/dropbox-sign-java/blob/main/examples/DocumentDetectFieldsExample.java + * @param documentFieldDetectionRequest (required) + * @return DocumentFieldDetectionResponse + * @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 DocumentFieldDetectionResponse documentDetectFields(DocumentFieldDetectionRequest documentFieldDetectionRequest) throws ApiException { + return documentDetectFieldsWithHttpInfo(documentFieldDetectionRequest).getData(); + } + + + /** + * Detect Document Fields + * Detects form fields in a PDF document using either PDF form annotations or Dropbox Sign text tags. + * Example: https://github.com/hellosign/dropbox-sign-java/blob/main/examples/DocumentDetectFieldsExample.java + * @param documentFieldDetectionRequest (required) + * @return ApiResponse<DocumentFieldDetectionResponse> + * @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 documentDetectFieldsWithHttpInfo(DocumentFieldDetectionRequest documentFieldDetectionRequest) throws ApiException { + + // Check required parameters + if (documentFieldDetectionRequest == null) { + throw new ApiException(400, "Missing the required parameter 'documentFieldDetectionRequest' when calling documentDetectFields"); + } + + String localVarAccept = apiClient.selectHeaderAccept("application/json"); + Map localVarFormParams = new LinkedHashMap<>(); + localVarFormParams = documentFieldDetectionRequest.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( + "DocumentApi.documentDetectFields", + "/document/detect_fields", + "POST", + new ArrayList<>(), + isFileTypeFound ? null : documentFieldDetectionRequest, + new LinkedHashMap<>(), + new LinkedHashMap<>(), + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType, + false + ); + } +} \ No newline at end of file diff --git a/sdks/java-v2/src/main/java/com/dropbox/sign/model/DocumentFieldDetectionRequest.java b/sdks/java-v2/src/main/java/com/dropbox/sign/model/DocumentFieldDetectionRequest.java new file mode 100644 index 000000000..75d2600b8 --- /dev/null +++ b/sdks/java-v2/src/main/java/com/dropbox/sign/model/DocumentFieldDetectionRequest.java @@ -0,0 +1,334 @@ +/* + * Dropbox Sign API + * Dropbox Sign v3 API + * + * The version of the OpenAPI document: 3.0.0 + * Contact: apisupport@hellosign.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.dropbox.sign.model; + +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.io.File; +import java.net.URI; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.dropbox.sign.JSON; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.databind.ObjectMapper; + + +import com.dropbox.sign.ApiException; +/** + * DocumentFieldDetectionRequest + */ +@JsonPropertyOrder({ + DocumentFieldDetectionRequest.JSON_PROPERTY_DETECTION_MODE, + DocumentFieldDetectionRequest.JSON_PROPERTY_FILE, + DocumentFieldDetectionRequest.JSON_PROPERTY_FILE_URL, + DocumentFieldDetectionRequest.JSON_PROPERTY_PAGE_RANGE +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.12.0") +@JsonIgnoreProperties(ignoreUnknown=true) +public class DocumentFieldDetectionRequest { + public static final String JSON_PROPERTY_DETECTION_MODE = "detection_mode"; + @jakarta.annotation.Nonnull + private String detectionMode; + + public static final String JSON_PROPERTY_FILE = "file"; + @jakarta.annotation.Nullable + private File _file; + + public static final String JSON_PROPERTY_FILE_URL = "file_url"; + @jakarta.annotation.Nullable + private URI fileUrl; + + public static final String JSON_PROPERTY_PAGE_RANGE = "page_range"; + @jakarta.annotation.Nullable + private String pageRange; + + public DocumentFieldDetectionRequest() { + } + + /** + * Attempt to instantiate and hydrate a new instance of this class + * @param jsonData String of JSON data representing target object + */ + static public DocumentFieldDetectionRequest init(String jsonData) throws Exception { + return new ObjectMapper().readValue(jsonData, DocumentFieldDetectionRequest.class); + } + + static public DocumentFieldDetectionRequest init(HashMap data) throws Exception { + return new ObjectMapper().readValue( + new ObjectMapper().writeValueAsString(data), + DocumentFieldDetectionRequest.class + ); + } + + public DocumentFieldDetectionRequest detectionMode(@jakarta.annotation.Nonnull String detectionMode) { + this.detectionMode = detectionMode; + return this; + } + + /** + * The field detection method to use. Set to `annotations` to detect PDF form annotations or `text_tags` to detect Dropbox Sign text tags. + * @return detectionMode + */ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_DETECTION_MODE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getDetectionMode() { + return detectionMode; + } + + + @JsonProperty(JSON_PROPERTY_DETECTION_MODE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setDetectionMode(@jakarta.annotation.Nonnull String detectionMode) { + this.detectionMode = detectionMode; + } + + + public DocumentFieldDetectionRequest _file(@jakarta.annotation.Nullable File _file) { + this._file = _file; + return this; + } + + /** + * The PDF file to analyze. This endpoint requires either `file` or `file_url`, but not both. + * @return _file + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_FILE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public File getFile() { + return _file; + } + + + @JsonProperty(JSON_PROPERTY_FILE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setFile(@jakarta.annotation.Nullable File _file) { + this._file = _file; + } + + + public DocumentFieldDetectionRequest fileUrl(@jakarta.annotation.Nullable URI fileUrl) { + this.fileUrl = fileUrl; + return this; + } + + /** + * The URL of the PDF file to analyze. This endpoint requires either `file` or `file_url`, but not both. + * @return fileUrl + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_FILE_URL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public URI getFileUrl() { + return fileUrl; + } + + + @JsonProperty(JSON_PROPERTY_FILE_URL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setFileUrl(@jakarta.annotation.Nullable URI fileUrl) { + this.fileUrl = fileUrl; + } + + + public DocumentFieldDetectionRequest pageRange(@jakarta.annotation.Nullable String pageRange) { + this.pageRange = pageRange; + return this; + } + + /** + * The zero-based page indexes to analyze. Accepts `all`, individual pages, inclusive ranges, or comma-separated combinations, such as `0-2,5,7-9`. Defaults to `all`. + * @return pageRange + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_PAGE_RANGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getPageRange() { + return pageRange; + } + + + @JsonProperty(JSON_PROPERTY_PAGE_RANGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPageRange(@jakarta.annotation.Nullable String pageRange) { + this.pageRange = pageRange; + } + + + /** + * Return true if this DocumentFieldDetectionRequest object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DocumentFieldDetectionRequest documentFieldDetectionRequest = (DocumentFieldDetectionRequest) o; + return Objects.equals(this.detectionMode, documentFieldDetectionRequest.detectionMode) && + Objects.equals(this._file, documentFieldDetectionRequest._file) && + Objects.equals(this.fileUrl, documentFieldDetectionRequest.fileUrl) && + Objects.equals(this.pageRange, documentFieldDetectionRequest.pageRange); + } + + @Override + public int hashCode() { + return Objects.hash(detectionMode, _file, fileUrl, pageRange); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DocumentFieldDetectionRequest {\n"); + sb.append(" detectionMode: ").append(toIndentedString(detectionMode)).append("\n"); + sb.append(" _file: ").append(toIndentedString(_file)).append("\n"); + sb.append(" fileUrl: ").append(toIndentedString(fileUrl)).append("\n"); + sb.append(" pageRange: ").append(toIndentedString(pageRange)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public Map createFormData() throws ApiException { + Map map = new HashMap<>(); + boolean fileTypeFound = false; + try { + if (detectionMode != null) { + if (isFileTypeOrListOfFiles(detectionMode)) { + fileTypeFound = true; + } + + if (detectionMode.getClass().equals(java.io.File.class) || + detectionMode.getClass().equals(Integer.class) || + detectionMode.getClass().equals(String.class) || + detectionMode.getClass().isEnum()) { + map.put("detection_mode", detectionMode); + } else if (isListOfFile(detectionMode)) { + for(int i = 0; i< getListSize(detectionMode); i++) { + map.put("detection_mode[" + i + "]", getFromList(detectionMode, i)); + } + } + else { + map.put("detection_mode", JSON.getDefault().getMapper().writeValueAsString(detectionMode)); + } + } + if (_file != null) { + if (isFileTypeOrListOfFiles(_file)) { + fileTypeFound = true; + } + + if (_file.getClass().equals(java.io.File.class) || + _file.getClass().equals(Integer.class) || + _file.getClass().equals(String.class) || + _file.getClass().isEnum()) { + map.put("file", _file); + } else if (isListOfFile(_file)) { + for(int i = 0; i< getListSize(_file); i++) { + map.put("file[" + i + "]", getFromList(_file, i)); + } + } + else { + map.put("file", JSON.getDefault().getMapper().writeValueAsString(_file)); + } + } + if (fileUrl != null) { + if (isFileTypeOrListOfFiles(fileUrl)) { + fileTypeFound = true; + } + + if (fileUrl.getClass().equals(java.io.File.class) || + fileUrl.getClass().equals(Integer.class) || + fileUrl.getClass().equals(String.class) || + fileUrl.getClass().isEnum()) { + map.put("file_url", fileUrl); + } else if (isListOfFile(fileUrl)) { + for(int i = 0; i< getListSize(fileUrl); i++) { + map.put("file_url[" + i + "]", getFromList(fileUrl, i)); + } + } + else { + map.put("file_url", JSON.getDefault().getMapper().writeValueAsString(fileUrl)); + } + } + if (pageRange != null) { + if (isFileTypeOrListOfFiles(pageRange)) { + fileTypeFound = true; + } + + if (pageRange.getClass().equals(java.io.File.class) || + pageRange.getClass().equals(Integer.class) || + pageRange.getClass().equals(String.class) || + pageRange.getClass().isEnum()) { + map.put("page_range", pageRange); + } else if (isListOfFile(pageRange)) { + for(int i = 0; i< getListSize(pageRange); i++) { + map.put("page_range[" + i + "]", getFromList(pageRange, i)); + } + } + else { + map.put("page_range", JSON.getDefault().getMapper().writeValueAsString(pageRange)); + } + } + } catch (Exception e) { + throw new ApiException(e); + } + + return fileTypeFound ? map : new HashMap<>(); + } + + private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { + return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); + } + + private boolean isListOfFile(Object obj) throws Exception { + return obj instanceof java.util.List && !isListEmpty(obj) && getFromList(obj, 0) instanceof java.io.File; + } + + private boolean isListEmpty(Object obj) throws Exception { + return (boolean) Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); + } + + private Object getFromList(Object obj, int index) throws Exception { + return Class.forName(java.util.List.class.getName()).getMethod("get", int.class).invoke(obj, index); + } + + private int getListSize(Object obj) throws Exception { + return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/sdks/java-v2/src/main/java/com/dropbox/sign/model/DocumentFieldDetectionResponse.java b/sdks/java-v2/src/main/java/com/dropbox/sign/model/DocumentFieldDetectionResponse.java new file mode 100644 index 000000000..d1cdd7b62 --- /dev/null +++ b/sdks/java-v2/src/main/java/com/dropbox/sign/model/DocumentFieldDetectionResponse.java @@ -0,0 +1,242 @@ +/* + * 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.DocumentFieldDetectionResponseDetectionResult; +import com.dropbox.sign.model.WarningResponse; +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; +/** + * DocumentFieldDetectionResponse + */ +@JsonPropertyOrder({ + DocumentFieldDetectionResponse.JSON_PROPERTY_DETECTION_RESULT, + DocumentFieldDetectionResponse.JSON_PROPERTY_WARNINGS +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.12.0") +@JsonIgnoreProperties(ignoreUnknown=true) +public class DocumentFieldDetectionResponse { + public static final String JSON_PROPERTY_DETECTION_RESULT = "detection_result"; + @jakarta.annotation.Nonnull + private DocumentFieldDetectionResponseDetectionResult detectionResult; + + public static final String JSON_PROPERTY_WARNINGS = "warnings"; + @jakarta.annotation.Nullable + private List warnings = null; + + public DocumentFieldDetectionResponse() { + } + + /** + * Attempt to instantiate and hydrate a new instance of this class + * @param jsonData String of JSON data representing target object + */ + static public DocumentFieldDetectionResponse init(String jsonData) throws Exception { + return new ObjectMapper().readValue(jsonData, DocumentFieldDetectionResponse.class); + } + + static public DocumentFieldDetectionResponse init(HashMap data) throws Exception { + return new ObjectMapper().readValue( + new ObjectMapper().writeValueAsString(data), + DocumentFieldDetectionResponse.class + ); + } + + public DocumentFieldDetectionResponse detectionResult(@jakarta.annotation.Nonnull DocumentFieldDetectionResponseDetectionResult detectionResult) { + this.detectionResult = detectionResult; + return this; + } + + /** + * Get detectionResult + * @return detectionResult + */ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_DETECTION_RESULT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public DocumentFieldDetectionResponseDetectionResult getDetectionResult() { + return detectionResult; + } + + + @JsonProperty(JSON_PROPERTY_DETECTION_RESULT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setDetectionResult(@jakarta.annotation.Nonnull DocumentFieldDetectionResponseDetectionResult detectionResult) { + this.detectionResult = detectionResult; + } + + + public DocumentFieldDetectionResponse warnings(@jakarta.annotation.Nullable List warnings) { + this.warnings = warnings; + return this; + } + + public DocumentFieldDetectionResponse addWarningsItem(WarningResponse warningsItem) { + if (this.warnings == null) { + this.warnings = new ArrayList<>(); + } + this.warnings.add(warningsItem); + return this; + } + + /** + * A list of warnings. + * @return warnings + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_WARNINGS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getWarnings() { + return warnings; + } + + + @JsonProperty(JSON_PROPERTY_WARNINGS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setWarnings(@jakarta.annotation.Nullable List warnings) { + this.warnings = warnings; + } + + + /** + * Return true if this DocumentFieldDetectionResponse object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DocumentFieldDetectionResponse documentFieldDetectionResponse = (DocumentFieldDetectionResponse) o; + return Objects.equals(this.detectionResult, documentFieldDetectionResponse.detectionResult) && + Objects.equals(this.warnings, documentFieldDetectionResponse.warnings); + } + + @Override + public int hashCode() { + return Objects.hash(detectionResult, warnings); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DocumentFieldDetectionResponse {\n"); + sb.append(" detectionResult: ").append(toIndentedString(detectionResult)).append("\n"); + sb.append(" warnings: ").append(toIndentedString(warnings)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public Map createFormData() throws ApiException { + Map map = new HashMap<>(); + boolean fileTypeFound = false; + try { + if (detectionResult != null) { + if (isFileTypeOrListOfFiles(detectionResult)) { + fileTypeFound = true; + } + + if (detectionResult.getClass().equals(java.io.File.class) || + detectionResult.getClass().equals(Integer.class) || + detectionResult.getClass().equals(String.class) || + detectionResult.getClass().isEnum()) { + map.put("detection_result", detectionResult); + } else if (isListOfFile(detectionResult)) { + for(int i = 0; i< getListSize(detectionResult); i++) { + map.put("detection_result[" + i + "]", getFromList(detectionResult, i)); + } + } + else { + map.put("detection_result", JSON.getDefault().getMapper().writeValueAsString(detectionResult)); + } + } + if (warnings != null) { + if (isFileTypeOrListOfFiles(warnings)) { + fileTypeFound = true; + } + + if (warnings.getClass().equals(java.io.File.class) || + warnings.getClass().equals(Integer.class) || + warnings.getClass().equals(String.class) || + warnings.getClass().isEnum()) { + map.put("warnings", warnings); + } else if (isListOfFile(warnings)) { + for(int i = 0; i< getListSize(warnings); i++) { + map.put("warnings[" + i + "]", getFromList(warnings, i)); + } + } + else { + map.put("warnings", JSON.getDefault().getMapper().writeValueAsString(warnings)); + } + } + } catch (Exception e) { + throw new ApiException(e); + } + + return fileTypeFound ? map : new HashMap<>(); + } + + private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { + return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); + } + + private boolean isListOfFile(Object obj) throws Exception { + return obj instanceof java.util.List && !isListEmpty(obj) && getFromList(obj, 0) instanceof java.io.File; + } + + private boolean isListEmpty(Object obj) throws Exception { + return (boolean) Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); + } + + private Object getFromList(Object obj, int index) throws Exception { + return Class.forName(java.util.List.class.getName()).getMethod("get", int.class).invoke(obj, index); + } + + private int getListSize(Object obj) throws Exception { + return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/sdks/java-v2/src/main/java/com/dropbox/sign/model/DocumentFieldDetectionResponseDetectionResult.java b/sdks/java-v2/src/main/java/com/dropbox/sign/model/DocumentFieldDetectionResponseDetectionResult.java new file mode 100644 index 000000000..a5f46f322 --- /dev/null +++ b/sdks/java-v2/src/main/java/com/dropbox/sign/model/DocumentFieldDetectionResponseDetectionResult.java @@ -0,0 +1,685 @@ +/* + * 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.ErrorResponseError; +import com.dropbox.sign.model.SubFormFieldGroup; +import com.dropbox.sign.model.SubFormFieldsPerDocumentBase; +import com.dropbox.sign.model.WarningResponse; +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; +/** + * DocumentFieldDetectionResponseDetectionResult + */ +@JsonPropertyOrder({ + DocumentFieldDetectionResponseDetectionResult.JSON_PROPERTY_DOCUMENT_HASH, + DocumentFieldDetectionResponseDetectionResult.JSON_PROPERTY_DETECTION_MODE, + DocumentFieldDetectionResponseDetectionResult.JSON_PROPERTY_PAGE_COUNT, + DocumentFieldDetectionResponseDetectionResult.JSON_PROPERTY_PAGES_ANALYZED, + DocumentFieldDetectionResponseDetectionResult.JSON_PROPERTY_DETECTED_AT, + DocumentFieldDetectionResponseDetectionResult.JSON_PROPERTY_FORM_FIELDS_PER_DOCUMENT, + DocumentFieldDetectionResponseDetectionResult.JSON_PROPERTY_FORM_FIELD_GROUPS, + DocumentFieldDetectionResponseDetectionResult.JSON_PROPERTY_WARNINGS, + DocumentFieldDetectionResponseDetectionResult.JSON_PROPERTY_ERRORS, + DocumentFieldDetectionResponseDetectionResult.JSON_PROPERTY_SUGGESTIONS +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.12.0") +@JsonIgnoreProperties(ignoreUnknown=true) +public class DocumentFieldDetectionResponseDetectionResult { + public static final String JSON_PROPERTY_DOCUMENT_HASH = "document_hash"; + @jakarta.annotation.Nonnull + private String documentHash; + + public static final String JSON_PROPERTY_DETECTION_MODE = "detection_mode"; + @jakarta.annotation.Nonnull + private String detectionMode; + + public static final String JSON_PROPERTY_PAGE_COUNT = "page_count"; + @jakarta.annotation.Nonnull + private Integer pageCount; + + public static final String JSON_PROPERTY_PAGES_ANALYZED = "pages_analyzed"; + @jakarta.annotation.Nonnull + private String pagesAnalyzed; + + public static final String JSON_PROPERTY_DETECTED_AT = "detected_at"; + @jakarta.annotation.Nonnull + private Long detectedAt; + + public static final String JSON_PROPERTY_FORM_FIELDS_PER_DOCUMENT = "form_fields_per_document"; + @jakarta.annotation.Nonnull + private List formFieldsPerDocument = new ArrayList<>(); + + public static final String JSON_PROPERTY_FORM_FIELD_GROUPS = "form_field_groups"; + @jakarta.annotation.Nonnull + private List formFieldGroups = new ArrayList<>(); + + public static final String JSON_PROPERTY_WARNINGS = "warnings"; + @jakarta.annotation.Nonnull + private List warnings = new ArrayList<>(); + + public static final String JSON_PROPERTY_ERRORS = "errors"; + @jakarta.annotation.Nonnull + private List errors = new ArrayList<>(); + + public static final String JSON_PROPERTY_SUGGESTIONS = "suggestions"; + @jakarta.annotation.Nonnull + private List suggestions = new ArrayList<>(); + + public DocumentFieldDetectionResponseDetectionResult() { + } + + /** + * Attempt to instantiate and hydrate a new instance of this class + * @param jsonData String of JSON data representing target object + */ + static public DocumentFieldDetectionResponseDetectionResult init(String jsonData) throws Exception { + return new ObjectMapper().readValue(jsonData, DocumentFieldDetectionResponseDetectionResult.class); + } + + static public DocumentFieldDetectionResponseDetectionResult init(HashMap data) throws Exception { + return new ObjectMapper().readValue( + new ObjectMapper().writeValueAsString(data), + DocumentFieldDetectionResponseDetectionResult.class + ); + } + + public DocumentFieldDetectionResponseDetectionResult documentHash(@jakarta.annotation.Nonnull String documentHash) { + this.documentHash = documentHash; + return this; + } + + /** + * The SHA-256 hash of the analyzed document. + * @return documentHash + */ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_DOCUMENT_HASH) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getDocumentHash() { + return documentHash; + } + + + @JsonProperty(JSON_PROPERTY_DOCUMENT_HASH) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setDocumentHash(@jakarta.annotation.Nonnull String documentHash) { + this.documentHash = documentHash; + } + + + public DocumentFieldDetectionResponseDetectionResult detectionMode(@jakarta.annotation.Nonnull String detectionMode) { + this.detectionMode = detectionMode; + return this; + } + + /** + * The field detection method used to analyze the document: `annotations` or `text_tags`. + * @return detectionMode + */ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_DETECTION_MODE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getDetectionMode() { + return detectionMode; + } + + + @JsonProperty(JSON_PROPERTY_DETECTION_MODE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setDetectionMode(@jakarta.annotation.Nonnull String detectionMode) { + this.detectionMode = detectionMode; + } + + + public DocumentFieldDetectionResponseDetectionResult pageCount(@jakarta.annotation.Nonnull Integer pageCount) { + this.pageCount = pageCount; + return this; + } + + /** + * The total number of pages in the document. + * minimum: 0 + * @return pageCount + */ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_PAGE_COUNT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public Integer getPageCount() { + return pageCount; + } + + + @JsonProperty(JSON_PROPERTY_PAGE_COUNT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setPageCount(@jakarta.annotation.Nonnull Integer pageCount) { + this.pageCount = pageCount; + } + + + public DocumentFieldDetectionResponseDetectionResult pagesAnalyzed(@jakarta.annotation.Nonnull String pagesAnalyzed) { + this.pagesAnalyzed = pagesAnalyzed; + return this; + } + + /** + * The zero-based page indexes analyzed, represented by the requested `page_range`, or `all` when every page was analyzed. + * @return pagesAnalyzed + */ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_PAGES_ANALYZED) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getPagesAnalyzed() { + return pagesAnalyzed; + } + + + @JsonProperty(JSON_PROPERTY_PAGES_ANALYZED) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setPagesAnalyzed(@jakarta.annotation.Nonnull String pagesAnalyzed) { + this.pagesAnalyzed = pagesAnalyzed; + } + + + public DocumentFieldDetectionResponseDetectionResult detectedAt(@jakarta.annotation.Nonnull Long detectedAt) { + this.detectedAt = detectedAt; + return this; + } + + /** + * The Unix timestamp when the field detection result was generated. + * @return detectedAt + */ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_DETECTED_AT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public Long getDetectedAt() { + return detectedAt; + } + + + @JsonProperty(JSON_PROPERTY_DETECTED_AT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setDetectedAt(@jakarta.annotation.Nonnull Long detectedAt) { + this.detectedAt = detectedAt; + } + + + public DocumentFieldDetectionResponseDetectionResult formFieldsPerDocument(@jakarta.annotation.Nonnull List formFieldsPerDocument) { + this.formFieldsPerDocument = formFieldsPerDocument; + return this; + } + + public DocumentFieldDetectionResponseDetectionResult addFormFieldsPerDocumentItem(SubFormFieldsPerDocumentBase formFieldsPerDocumentItem) { + if (this.formFieldsPerDocument == null) { + this.formFieldsPerDocument = new ArrayList<>(); + } + this.formFieldsPerDocument.add(formFieldsPerDocumentItem); + return this; + } + + /** + * The fields that should appear on the document, expressed as an array of objects. (For more details you can read about it here: [Using Form Fields per Document](/docs/openapi/form-fields-per-document).) **NOTE:** Fields like **text**, **dropdown**, **checkbox**, **radio**, and **hyperlink** have additional required and optional parameters. Check out the list of [additional parameters](/api/reference/constants/#form-fields-per-document) for these field types. * Text Field use `SubFormFieldsPerDocumentText` * Dropdown Field use `SubFormFieldsPerDocumentDropdown` * Hyperlink Field use `SubFormFieldsPerDocumentHyperlink` * Checkbox Field use `SubFormFieldsPerDocumentCheckbox` * Radio Field use `SubFormFieldsPerDocumentRadio` * Signature Field use `SubFormFieldsPerDocumentSignature` * Date Signed Field use `SubFormFieldsPerDocumentDateSigned` * Initials Field use `SubFormFieldsPerDocumentInitials` * Text Merge Field use `SubFormFieldsPerDocumentTextMerge` * Checkbox Merge Field use `SubFormFieldsPerDocumentCheckboxMerge` + * @return formFieldsPerDocument + */ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_FORM_FIELDS_PER_DOCUMENT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public List getFormFieldsPerDocument() { + return formFieldsPerDocument; + } + + + @JsonProperty(JSON_PROPERTY_FORM_FIELDS_PER_DOCUMENT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setFormFieldsPerDocument(@jakarta.annotation.Nonnull List formFieldsPerDocument) { + this.formFieldsPerDocument = formFieldsPerDocument; + } + + + public DocumentFieldDetectionResponseDetectionResult formFieldGroups(@jakarta.annotation.Nonnull List formFieldGroups) { + this.formFieldGroups = formFieldGroups; + return this; + } + + public DocumentFieldDetectionResponseDetectionResult addFormFieldGroupsItem(SubFormFieldGroup formFieldGroupsItem) { + if (this.formFieldGroups == null) { + this.formFieldGroups = new ArrayList<>(); + } + this.formFieldGroups.add(formFieldGroupsItem); + return this; + } + + /** + * Group information for fields defined in `form_fields_per_document`. String-indexed JSON array with `group_label` and `requirement` keys. `form_fields_per_document` must contain fields referencing a group defined in `form_field_groups`. + * @return formFieldGroups + */ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_FORM_FIELD_GROUPS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public List getFormFieldGroups() { + return formFieldGroups; + } + + + @JsonProperty(JSON_PROPERTY_FORM_FIELD_GROUPS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setFormFieldGroups(@jakarta.annotation.Nonnull List formFieldGroups) { + this.formFieldGroups = formFieldGroups; + } + + + public DocumentFieldDetectionResponseDetectionResult warnings(@jakarta.annotation.Nonnull List warnings) { + this.warnings = warnings; + return this; + } + + public DocumentFieldDetectionResponseDetectionResult addWarningsItem(WarningResponse warningsItem) { + if (this.warnings == null) { + this.warnings = new ArrayList<>(); + } + this.warnings.add(warningsItem); + return this; + } + + /** + * Non-fatal issues encountered during field detection. + * @return warnings + */ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_WARNINGS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public List getWarnings() { + return warnings; + } + + + @JsonProperty(JSON_PROPERTY_WARNINGS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setWarnings(@jakarta.annotation.Nonnull List warnings) { + this.warnings = warnings; + } + + + public DocumentFieldDetectionResponseDetectionResult errors(@jakarta.annotation.Nonnull List errors) { + this.errors = errors; + return this; + } + + public DocumentFieldDetectionResponseDetectionResult addErrorsItem(ErrorResponseError errorsItem) { + if (this.errors == null) { + this.errors = new ArrayList<>(); + } + this.errors.add(errorsItem); + return this; + } + + /** + * Errors encountered during field detection. Successfully detected fields may still be included in the response. + * @return errors + */ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_ERRORS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public List getErrors() { + return errors; + } + + + @JsonProperty(JSON_PROPERTY_ERRORS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setErrors(@jakarta.annotation.Nonnull List errors) { + this.errors = errors; + } + + + public DocumentFieldDetectionResponseDetectionResult suggestions(@jakarta.annotation.Nonnull List suggestions) { + this.suggestions = suggestions; + return this; + } + + public DocumentFieldDetectionResponseDetectionResult addSuggestionsItem(String suggestionsItem) { + if (this.suggestions == null) { + this.suggestions = new ArrayList<>(); + } + this.suggestions.add(suggestionsItem); + return this; + } + + /** + * Suggestions for improving the field detection results. + * @return suggestions + */ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_SUGGESTIONS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public List getSuggestions() { + return suggestions; + } + + + @JsonProperty(JSON_PROPERTY_SUGGESTIONS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setSuggestions(@jakarta.annotation.Nonnull List suggestions) { + this.suggestions = suggestions; + } + + + /** + * Return true if this DocumentFieldDetectionResponseDetectionResult object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DocumentFieldDetectionResponseDetectionResult documentFieldDetectionResponseDetectionResult = (DocumentFieldDetectionResponseDetectionResult) o; + return Objects.equals(this.documentHash, documentFieldDetectionResponseDetectionResult.documentHash) && + Objects.equals(this.detectionMode, documentFieldDetectionResponseDetectionResult.detectionMode) && + Objects.equals(this.pageCount, documentFieldDetectionResponseDetectionResult.pageCount) && + Objects.equals(this.pagesAnalyzed, documentFieldDetectionResponseDetectionResult.pagesAnalyzed) && + Objects.equals(this.detectedAt, documentFieldDetectionResponseDetectionResult.detectedAt) && + Objects.equals(this.formFieldsPerDocument, documentFieldDetectionResponseDetectionResult.formFieldsPerDocument) && + Objects.equals(this.formFieldGroups, documentFieldDetectionResponseDetectionResult.formFieldGroups) && + Objects.equals(this.warnings, documentFieldDetectionResponseDetectionResult.warnings) && + Objects.equals(this.errors, documentFieldDetectionResponseDetectionResult.errors) && + Objects.equals(this.suggestions, documentFieldDetectionResponseDetectionResult.suggestions); + } + + @Override + public int hashCode() { + return Objects.hash(documentHash, detectionMode, pageCount, pagesAnalyzed, detectedAt, formFieldsPerDocument, formFieldGroups, warnings, errors, suggestions); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DocumentFieldDetectionResponseDetectionResult {\n"); + sb.append(" documentHash: ").append(toIndentedString(documentHash)).append("\n"); + sb.append(" detectionMode: ").append(toIndentedString(detectionMode)).append("\n"); + sb.append(" pageCount: ").append(toIndentedString(pageCount)).append("\n"); + sb.append(" pagesAnalyzed: ").append(toIndentedString(pagesAnalyzed)).append("\n"); + sb.append(" detectedAt: ").append(toIndentedString(detectedAt)).append("\n"); + sb.append(" formFieldsPerDocument: ").append(toIndentedString(formFieldsPerDocument)).append("\n"); + sb.append(" formFieldGroups: ").append(toIndentedString(formFieldGroups)).append("\n"); + sb.append(" warnings: ").append(toIndentedString(warnings)).append("\n"); + sb.append(" errors: ").append(toIndentedString(errors)).append("\n"); + sb.append(" suggestions: ").append(toIndentedString(suggestions)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public Map createFormData() throws ApiException { + Map map = new HashMap<>(); + boolean fileTypeFound = false; + try { + if (documentHash != null) { + if (isFileTypeOrListOfFiles(documentHash)) { + fileTypeFound = true; + } + + if (documentHash.getClass().equals(java.io.File.class) || + documentHash.getClass().equals(Integer.class) || + documentHash.getClass().equals(String.class) || + documentHash.getClass().isEnum()) { + map.put("document_hash", documentHash); + } else if (isListOfFile(documentHash)) { + for(int i = 0; i< getListSize(documentHash); i++) { + map.put("document_hash[" + i + "]", getFromList(documentHash, i)); + } + } + else { + map.put("document_hash", JSON.getDefault().getMapper().writeValueAsString(documentHash)); + } + } + if (detectionMode != null) { + if (isFileTypeOrListOfFiles(detectionMode)) { + fileTypeFound = true; + } + + if (detectionMode.getClass().equals(java.io.File.class) || + detectionMode.getClass().equals(Integer.class) || + detectionMode.getClass().equals(String.class) || + detectionMode.getClass().isEnum()) { + map.put("detection_mode", detectionMode); + } else if (isListOfFile(detectionMode)) { + for(int i = 0; i< getListSize(detectionMode); i++) { + map.put("detection_mode[" + i + "]", getFromList(detectionMode, i)); + } + } + else { + map.put("detection_mode", JSON.getDefault().getMapper().writeValueAsString(detectionMode)); + } + } + if (pageCount != null) { + if (isFileTypeOrListOfFiles(pageCount)) { + fileTypeFound = true; + } + + if (pageCount.getClass().equals(java.io.File.class) || + pageCount.getClass().equals(Integer.class) || + pageCount.getClass().equals(String.class) || + pageCount.getClass().isEnum()) { + map.put("page_count", pageCount); + } else if (isListOfFile(pageCount)) { + for(int i = 0; i< getListSize(pageCount); i++) { + map.put("page_count[" + i + "]", getFromList(pageCount, i)); + } + } + else { + map.put("page_count", JSON.getDefault().getMapper().writeValueAsString(pageCount)); + } + } + if (pagesAnalyzed != null) { + if (isFileTypeOrListOfFiles(pagesAnalyzed)) { + fileTypeFound = true; + } + + if (pagesAnalyzed.getClass().equals(java.io.File.class) || + pagesAnalyzed.getClass().equals(Integer.class) || + pagesAnalyzed.getClass().equals(String.class) || + pagesAnalyzed.getClass().isEnum()) { + map.put("pages_analyzed", pagesAnalyzed); + } else if (isListOfFile(pagesAnalyzed)) { + for(int i = 0; i< getListSize(pagesAnalyzed); i++) { + map.put("pages_analyzed[" + i + "]", getFromList(pagesAnalyzed, i)); + } + } + else { + map.put("pages_analyzed", JSON.getDefault().getMapper().writeValueAsString(pagesAnalyzed)); + } + } + if (detectedAt != null) { + if (isFileTypeOrListOfFiles(detectedAt)) { + fileTypeFound = true; + } + + if (detectedAt.getClass().equals(java.io.File.class) || + detectedAt.getClass().equals(Integer.class) || + detectedAt.getClass().equals(String.class) || + detectedAt.getClass().isEnum()) { + map.put("detected_at", detectedAt); + } else if (isListOfFile(detectedAt)) { + for(int i = 0; i< getListSize(detectedAt); i++) { + map.put("detected_at[" + i + "]", getFromList(detectedAt, i)); + } + } + else { + map.put("detected_at", JSON.getDefault().getMapper().writeValueAsString(detectedAt)); + } + } + if (formFieldsPerDocument != null) { + if (isFileTypeOrListOfFiles(formFieldsPerDocument)) { + fileTypeFound = true; + } + + if (formFieldsPerDocument.getClass().equals(java.io.File.class) || + formFieldsPerDocument.getClass().equals(Integer.class) || + formFieldsPerDocument.getClass().equals(String.class) || + formFieldsPerDocument.getClass().isEnum()) { + map.put("form_fields_per_document", formFieldsPerDocument); + } else if (isListOfFile(formFieldsPerDocument)) { + for(int i = 0; i< getListSize(formFieldsPerDocument); i++) { + map.put("form_fields_per_document[" + i + "]", getFromList(formFieldsPerDocument, i)); + } + } + else { + map.put("form_fields_per_document", JSON.getDefault().getMapper().writeValueAsString(formFieldsPerDocument)); + } + } + if (formFieldGroups != null) { + if (isFileTypeOrListOfFiles(formFieldGroups)) { + fileTypeFound = true; + } + + if (formFieldGroups.getClass().equals(java.io.File.class) || + formFieldGroups.getClass().equals(Integer.class) || + formFieldGroups.getClass().equals(String.class) || + formFieldGroups.getClass().isEnum()) { + map.put("form_field_groups", formFieldGroups); + } else if (isListOfFile(formFieldGroups)) { + for(int i = 0; i< getListSize(formFieldGroups); i++) { + map.put("form_field_groups[" + i + "]", getFromList(formFieldGroups, i)); + } + } + else { + map.put("form_field_groups", JSON.getDefault().getMapper().writeValueAsString(formFieldGroups)); + } + } + if (warnings != null) { + if (isFileTypeOrListOfFiles(warnings)) { + fileTypeFound = true; + } + + if (warnings.getClass().equals(java.io.File.class) || + warnings.getClass().equals(Integer.class) || + warnings.getClass().equals(String.class) || + warnings.getClass().isEnum()) { + map.put("warnings", warnings); + } else if (isListOfFile(warnings)) { + for(int i = 0; i< getListSize(warnings); i++) { + map.put("warnings[" + i + "]", getFromList(warnings, i)); + } + } + else { + map.put("warnings", JSON.getDefault().getMapper().writeValueAsString(warnings)); + } + } + if (errors != null) { + if (isFileTypeOrListOfFiles(errors)) { + fileTypeFound = true; + } + + if (errors.getClass().equals(java.io.File.class) || + errors.getClass().equals(Integer.class) || + errors.getClass().equals(String.class) || + errors.getClass().isEnum()) { + map.put("errors", errors); + } else if (isListOfFile(errors)) { + for(int i = 0; i< getListSize(errors); i++) { + map.put("errors[" + i + "]", getFromList(errors, i)); + } + } + else { + map.put("errors", JSON.getDefault().getMapper().writeValueAsString(errors)); + } + } + if (suggestions != null) { + if (isFileTypeOrListOfFiles(suggestions)) { + fileTypeFound = true; + } + + if (suggestions.getClass().equals(java.io.File.class) || + suggestions.getClass().equals(Integer.class) || + suggestions.getClass().equals(String.class) || + suggestions.getClass().isEnum()) { + map.put("suggestions", suggestions); + } else if (isListOfFile(suggestions)) { + for(int i = 0; i< getListSize(suggestions); i++) { + map.put("suggestions[" + i + "]", getFromList(suggestions, i)); + } + } + else { + map.put("suggestions", JSON.getDefault().getMapper().writeValueAsString(suggestions)); + } + } + } catch (Exception e) { + throw new ApiException(e); + } + + return fileTypeFound ? map : new HashMap<>(); + } + + private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { + return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); + } + + private boolean isListOfFile(Object obj) throws Exception { + return obj instanceof java.util.List && !isListEmpty(obj) && getFromList(obj, 0) instanceof java.io.File; + } + + private boolean isListEmpty(Object obj) throws Exception { + return (boolean) Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); + } + + private Object getFromList(Object obj, int index) throws Exception { + return Class.forName(java.util.List.class.getName()).getMethod("get", int.class).invoke(obj, index); + } + + private int getListSize(Object obj) throws Exception { + return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/sdks/java-v2/src/main/java/com/dropbox/sign/model/FaxResponse.java b/sdks/java-v2/src/main/java/com/dropbox/sign/model/FaxResponse.java index 156435edc..8b49f5219 100644 --- a/sdks/java-v2/src/main/java/com/dropbox/sign/model/FaxResponse.java +++ b/sdks/java-v2/src/main/java/com/dropbox/sign/model/FaxResponse.java @@ -46,6 +46,7 @@ FaxResponse.JSON_PROPERTY_SENDER, FaxResponse.JSON_PROPERTY_FILES_URL, FaxResponse.JSON_PROPERTY_TRANSMISSIONS, + FaxResponse.JSON_PROPERTY_TEST_MODE, FaxResponse.JSON_PROPERTY_SUBJECT, FaxResponse.JSON_PROPERTY_MESSAGE, FaxResponse.JSON_PROPERTY_FINAL_COPY_URI @@ -85,6 +86,10 @@ public class FaxResponse { @jakarta.annotation.Nonnull private List transmissions = new ArrayList<>(); + public static final String JSON_PROPERTY_TEST_MODE = "test_mode"; + @jakarta.annotation.Nonnull + private Boolean testMode = false; + public static final String JSON_PROPERTY_SUBJECT = "subject"; @jakarta.annotation.Nullable private String subject; @@ -331,6 +336,31 @@ public void setTransmissions(@jakarta.annotation.Nonnull List createFormData() throws ApiException { map.put("transmissions", JSON.getDefault().getMapper().writeValueAsString(transmissions)); } } + if (testMode != null) { + if (isFileTypeOrListOfFiles(testMode)) { + fileTypeFound = true; + } + + if (testMode.getClass().equals(java.io.File.class) || + testMode.getClass().equals(Integer.class) || + testMode.getClass().equals(String.class) || + testMode.getClass().isEnum()) { + map.put("test_mode", testMode); + } else if (isListOfFile(testMode)) { + for(int i = 0; i< getListSize(testMode); i++) { + map.put("test_mode[" + i + "]", getFromList(testMode, i)); + } + } + else { + map.put("test_mode", JSON.getDefault().getMapper().writeValueAsString(testMode)); + } + } if (subject != null) { if (isFileTypeOrListOfFiles(subject)) { fileTypeFound = true; diff --git a/sdks/java-v2/src/main/java/com/dropbox/sign/model/SignatureRequestBulkCreateEmbeddedWithTemplateRequest.java b/sdks/java-v2/src/main/java/com/dropbox/sign/model/SignatureRequestBulkCreateEmbeddedWithTemplateRequest.java index 949ddb44b..6086d7571 100644 --- a/sdks/java-v2/src/main/java/com/dropbox/sign/model/SignatureRequestBulkCreateEmbeddedWithTemplateRequest.java +++ b/sdks/java-v2/src/main/java/com/dropbox/sign/model/SignatureRequestBulkCreateEmbeddedWithTemplateRequest.java @@ -53,7 +53,8 @@ SignatureRequestBulkCreateEmbeddedWithTemplateRequest.JSON_PROPERTY_SIGNING_REDIRECT_URL, SignatureRequestBulkCreateEmbeddedWithTemplateRequest.JSON_PROPERTY_SUBJECT, SignatureRequestBulkCreateEmbeddedWithTemplateRequest.JSON_PROPERTY_TEST_MODE, - SignatureRequestBulkCreateEmbeddedWithTemplateRequest.JSON_PROPERTY_TITLE + SignatureRequestBulkCreateEmbeddedWithTemplateRequest.JSON_PROPERTY_TITLE, + SignatureRequestBulkCreateEmbeddedWithTemplateRequest.JSON_PROPERTY_EXPIRES_AT }) @jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.12.0") @JsonIgnoreProperties(ignoreUnknown=true) @@ -110,6 +111,10 @@ public class SignatureRequestBulkCreateEmbeddedWithTemplateRequest { @jakarta.annotation.Nullable private String title; + public static final String JSON_PROPERTY_EXPIRES_AT = "expires_at"; + @jakarta.annotation.Nullable + private Integer expiresAt; + public SignatureRequestBulkCreateEmbeddedWithTemplateRequest() { } @@ -493,6 +498,31 @@ public void setTitle(@jakarta.annotation.Nullable String title) { } + public SignatureRequestBulkCreateEmbeddedWithTemplateRequest expiresAt(@jakarta.annotation.Nullable Integer expiresAt) { + this.expiresAt = expiresAt; + return this; + } + + /** + * When the signature request will expire. Unsigned signatures will be moved to the expired status, and no longer signable. See [Signature Request Expiration Date](https://developers.hellosign.com/docs/signature-request/expiration/) for details. + * @return expiresAt + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_EXPIRES_AT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Integer getExpiresAt() { + return expiresAt; + } + + + @JsonProperty(JSON_PROPERTY_EXPIRES_AT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setExpiresAt(@jakarta.annotation.Nullable Integer expiresAt) { + this.expiresAt = expiresAt; + } + + /** * Return true if this SignatureRequestBulkCreateEmbeddedWithTemplateRequest object is equal to o. */ @@ -517,12 +547,13 @@ public boolean equals(Object o) { Objects.equals(this.signingRedirectUrl, signatureRequestBulkCreateEmbeddedWithTemplateRequest.signingRedirectUrl) && Objects.equals(this.subject, signatureRequestBulkCreateEmbeddedWithTemplateRequest.subject) && Objects.equals(this.testMode, signatureRequestBulkCreateEmbeddedWithTemplateRequest.testMode) && - Objects.equals(this.title, signatureRequestBulkCreateEmbeddedWithTemplateRequest.title); + Objects.equals(this.title, signatureRequestBulkCreateEmbeddedWithTemplateRequest.title) && + Objects.equals(this.expiresAt, signatureRequestBulkCreateEmbeddedWithTemplateRequest.expiresAt); } @Override public int hashCode() { - return Objects.hash(templateIds, clientId, signerFile, signerList, allowDecline, ccs, customFields, message, metadata, signingRedirectUrl, subject, testMode, title); + return Objects.hash(templateIds, clientId, signerFile, signerList, allowDecline, ccs, customFields, message, metadata, signingRedirectUrl, subject, testMode, title, expiresAt); } @Override @@ -542,6 +573,7 @@ public String toString() { sb.append(" subject: ").append(toIndentedString(subject)).append("\n"); sb.append(" testMode: ").append(toIndentedString(testMode)).append("\n"); sb.append(" title: ").append(toIndentedString(title)).append("\n"); + sb.append(" expiresAt: ").append(toIndentedString(expiresAt)).append("\n"); sb.append("}"); return sb.toString(); } @@ -797,6 +829,25 @@ public Map createFormData() throws ApiException { map.put("title", JSON.getDefault().getMapper().writeValueAsString(title)); } } + if (expiresAt != null) { + if (isFileTypeOrListOfFiles(expiresAt)) { + fileTypeFound = true; + } + + if (expiresAt.getClass().equals(java.io.File.class) || + expiresAt.getClass().equals(Integer.class) || + expiresAt.getClass().equals(String.class) || + expiresAt.getClass().isEnum()) { + map.put("expires_at", expiresAt); + } else if (isListOfFile(expiresAt)) { + for(int i = 0; i< getListSize(expiresAt); i++) { + map.put("expires_at[" + i + "]", getFromList(expiresAt, i)); + } + } + else { + map.put("expires_at", JSON.getDefault().getMapper().writeValueAsString(expiresAt)); + } + } } catch (Exception e) { throw new ApiException(e); } diff --git a/sdks/java-v2/src/main/java/com/dropbox/sign/model/SignatureRequestBulkSendWithTemplateRequest.java b/sdks/java-v2/src/main/java/com/dropbox/sign/model/SignatureRequestBulkSendWithTemplateRequest.java index 1efde34d5..000984aa9 100644 --- a/sdks/java-v2/src/main/java/com/dropbox/sign/model/SignatureRequestBulkSendWithTemplateRequest.java +++ b/sdks/java-v2/src/main/java/com/dropbox/sign/model/SignatureRequestBulkSendWithTemplateRequest.java @@ -53,7 +53,8 @@ SignatureRequestBulkSendWithTemplateRequest.JSON_PROPERTY_SIGNING_REDIRECT_URL, SignatureRequestBulkSendWithTemplateRequest.JSON_PROPERTY_SUBJECT, SignatureRequestBulkSendWithTemplateRequest.JSON_PROPERTY_TEST_MODE, - SignatureRequestBulkSendWithTemplateRequest.JSON_PROPERTY_TITLE + SignatureRequestBulkSendWithTemplateRequest.JSON_PROPERTY_TITLE, + SignatureRequestBulkSendWithTemplateRequest.JSON_PROPERTY_EXPIRES_AT }) @jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.12.0") @JsonIgnoreProperties(ignoreUnknown=true) @@ -110,6 +111,10 @@ public class SignatureRequestBulkSendWithTemplateRequest { @jakarta.annotation.Nullable private String title; + public static final String JSON_PROPERTY_EXPIRES_AT = "expires_at"; + @jakarta.annotation.Nullable + private Integer expiresAt; + public SignatureRequestBulkSendWithTemplateRequest() { } @@ -493,6 +498,31 @@ public void setTitle(@jakarta.annotation.Nullable String title) { } + public SignatureRequestBulkSendWithTemplateRequest expiresAt(@jakarta.annotation.Nullable Integer expiresAt) { + this.expiresAt = expiresAt; + return this; + } + + /** + * When the signature request will expire. Unsigned signatures will be moved to the expired status, and no longer signable. See [Signature Request Expiration Date](https://developers.hellosign.com/docs/signature-request/expiration/) for details. + * @return expiresAt + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_EXPIRES_AT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Integer getExpiresAt() { + return expiresAt; + } + + + @JsonProperty(JSON_PROPERTY_EXPIRES_AT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setExpiresAt(@jakarta.annotation.Nullable Integer expiresAt) { + this.expiresAt = expiresAt; + } + + /** * Return true if this SignatureRequestBulkSendWithTemplateRequest object is equal to o. */ @@ -517,12 +547,13 @@ public boolean equals(Object o) { Objects.equals(this.signingRedirectUrl, signatureRequestBulkSendWithTemplateRequest.signingRedirectUrl) && Objects.equals(this.subject, signatureRequestBulkSendWithTemplateRequest.subject) && Objects.equals(this.testMode, signatureRequestBulkSendWithTemplateRequest.testMode) && - Objects.equals(this.title, signatureRequestBulkSendWithTemplateRequest.title); + Objects.equals(this.title, signatureRequestBulkSendWithTemplateRequest.title) && + Objects.equals(this.expiresAt, signatureRequestBulkSendWithTemplateRequest.expiresAt); } @Override public int hashCode() { - return Objects.hash(templateIds, signerFile, signerList, allowDecline, ccs, clientId, customFields, message, metadata, signingRedirectUrl, subject, testMode, title); + return Objects.hash(templateIds, signerFile, signerList, allowDecline, ccs, clientId, customFields, message, metadata, signingRedirectUrl, subject, testMode, title, expiresAt); } @Override @@ -542,6 +573,7 @@ public String toString() { sb.append(" subject: ").append(toIndentedString(subject)).append("\n"); sb.append(" testMode: ").append(toIndentedString(testMode)).append("\n"); sb.append(" title: ").append(toIndentedString(title)).append("\n"); + sb.append(" expiresAt: ").append(toIndentedString(expiresAt)).append("\n"); sb.append("}"); return sb.toString(); } @@ -797,6 +829,25 @@ public Map createFormData() throws ApiException { map.put("title", JSON.getDefault().getMapper().writeValueAsString(title)); } } + if (expiresAt != null) { + if (isFileTypeOrListOfFiles(expiresAt)) { + fileTypeFound = true; + } + + if (expiresAt.getClass().equals(java.io.File.class) || + expiresAt.getClass().equals(Integer.class) || + expiresAt.getClass().equals(String.class) || + expiresAt.getClass().isEnum()) { + map.put("expires_at", expiresAt); + } else if (isListOfFile(expiresAt)) { + for(int i = 0; i< getListSize(expiresAt); i++) { + map.put("expires_at[" + i + "]", getFromList(expiresAt, i)); + } + } + else { + map.put("expires_at", JSON.getDefault().getMapper().writeValueAsString(expiresAt)); + } + } } catch (Exception e) { throw new ApiException(e); } diff --git a/sdks/java-v2/src/main/java/com/dropbox/sign/model/SignatureRequestCreateEmbeddedWithTemplateRequest.java b/sdks/java-v2/src/main/java/com/dropbox/sign/model/SignatureRequestCreateEmbeddedWithTemplateRequest.java index 6dc29fb8e..f42766ab0 100644 --- a/sdks/java-v2/src/main/java/com/dropbox/sign/model/SignatureRequestCreateEmbeddedWithTemplateRequest.java +++ b/sdks/java-v2/src/main/java/com/dropbox/sign/model/SignatureRequestCreateEmbeddedWithTemplateRequest.java @@ -56,7 +56,8 @@ SignatureRequestCreateEmbeddedWithTemplateRequest.JSON_PROPERTY_SUBJECT, SignatureRequestCreateEmbeddedWithTemplateRequest.JSON_PROPERTY_TEST_MODE, SignatureRequestCreateEmbeddedWithTemplateRequest.JSON_PROPERTY_TITLE, - SignatureRequestCreateEmbeddedWithTemplateRequest.JSON_PROPERTY_POPULATE_AUTO_FILL_FIELDS + SignatureRequestCreateEmbeddedWithTemplateRequest.JSON_PROPERTY_POPULATE_AUTO_FILL_FIELDS, + SignatureRequestCreateEmbeddedWithTemplateRequest.JSON_PROPERTY_EXPIRES_AT }) @jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.12.0") @JsonIgnoreProperties(ignoreUnknown=true) @@ -121,6 +122,10 @@ public class SignatureRequestCreateEmbeddedWithTemplateRequest { @jakarta.annotation.Nullable private Boolean populateAutoFillFields = false; + public static final String JSON_PROPERTY_EXPIRES_AT = "expires_at"; + @jakarta.annotation.Nullable + private Integer expiresAt; + public SignatureRequestCreateEmbeddedWithTemplateRequest() { } @@ -570,6 +575,31 @@ public void setPopulateAutoFillFields(@jakarta.annotation.Nullable Boolean popul } + public SignatureRequestCreateEmbeddedWithTemplateRequest expiresAt(@jakarta.annotation.Nullable Integer expiresAt) { + this.expiresAt = expiresAt; + return this; + } + + /** + * When the signature request will expire. Unsigned signatures will be moved to the expired status, and no longer signable. See [Signature Request Expiration Date](https://developers.hellosign.com/docs/signature-request/expiration/) for details. + * @return expiresAt + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_EXPIRES_AT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Integer getExpiresAt() { + return expiresAt; + } + + + @JsonProperty(JSON_PROPERTY_EXPIRES_AT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setExpiresAt(@jakarta.annotation.Nullable Integer expiresAt) { + this.expiresAt = expiresAt; + } + + /** * Return true if this SignatureRequestCreateEmbeddedWithTemplateRequest object is equal to o. */ @@ -596,12 +626,13 @@ public boolean equals(Object o) { Objects.equals(this.subject, signatureRequestCreateEmbeddedWithTemplateRequest.subject) && Objects.equals(this.testMode, signatureRequestCreateEmbeddedWithTemplateRequest.testMode) && Objects.equals(this.title, signatureRequestCreateEmbeddedWithTemplateRequest.title) && - Objects.equals(this.populateAutoFillFields, signatureRequestCreateEmbeddedWithTemplateRequest.populateAutoFillFields); + Objects.equals(this.populateAutoFillFields, signatureRequestCreateEmbeddedWithTemplateRequest.populateAutoFillFields) && + Objects.equals(this.expiresAt, signatureRequestCreateEmbeddedWithTemplateRequest.expiresAt); } @Override public int hashCode() { - return Objects.hash(templateIds, clientId, signers, allowDecline, ccs, customFields, files, fileUrls, message, metadata, signingOptions, subject, testMode, title, populateAutoFillFields); + return Objects.hash(templateIds, clientId, signers, allowDecline, ccs, customFields, files, fileUrls, message, metadata, signingOptions, subject, testMode, title, populateAutoFillFields, expiresAt); } @Override @@ -623,6 +654,7 @@ public String toString() { sb.append(" testMode: ").append(toIndentedString(testMode)).append("\n"); sb.append(" title: ").append(toIndentedString(title)).append("\n"); sb.append(" populateAutoFillFields: ").append(toIndentedString(populateAutoFillFields)).append("\n"); + sb.append(" expiresAt: ").append(toIndentedString(expiresAt)).append("\n"); sb.append("}"); return sb.toString(); } @@ -916,6 +948,25 @@ public Map createFormData() throws ApiException { map.put("populate_auto_fill_fields", JSON.getDefault().getMapper().writeValueAsString(populateAutoFillFields)); } } + if (expiresAt != null) { + if (isFileTypeOrListOfFiles(expiresAt)) { + fileTypeFound = true; + } + + if (expiresAt.getClass().equals(java.io.File.class) || + expiresAt.getClass().equals(Integer.class) || + expiresAt.getClass().equals(String.class) || + expiresAt.getClass().isEnum()) { + map.put("expires_at", expiresAt); + } else if (isListOfFile(expiresAt)) { + for(int i = 0; i< getListSize(expiresAt); i++) { + map.put("expires_at[" + i + "]", getFromList(expiresAt, i)); + } + } + else { + map.put("expires_at", JSON.getDefault().getMapper().writeValueAsString(expiresAt)); + } + } } catch (Exception e) { throw new ApiException(e); } diff --git a/sdks/java-v2/src/main/java/com/dropbox/sign/model/SignatureRequestSendWithTemplateRequest.java b/sdks/java-v2/src/main/java/com/dropbox/sign/model/SignatureRequestSendWithTemplateRequest.java index f007ed7a9..ea936076a 100644 --- a/sdks/java-v2/src/main/java/com/dropbox/sign/model/SignatureRequestSendWithTemplateRequest.java +++ b/sdks/java-v2/src/main/java/com/dropbox/sign/model/SignatureRequestSendWithTemplateRequest.java @@ -58,7 +58,8 @@ SignatureRequestSendWithTemplateRequest.JSON_PROPERTY_SIGNING_REDIRECT_URL, SignatureRequestSendWithTemplateRequest.JSON_PROPERTY_SUBJECT, SignatureRequestSendWithTemplateRequest.JSON_PROPERTY_TEST_MODE, - SignatureRequestSendWithTemplateRequest.JSON_PROPERTY_TITLE + SignatureRequestSendWithTemplateRequest.JSON_PROPERTY_TITLE, + SignatureRequestSendWithTemplateRequest.JSON_PROPERTY_EXPIRES_AT }) @jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.12.0") @JsonIgnoreProperties(ignoreUnknown=true) @@ -132,6 +133,10 @@ public class SignatureRequestSendWithTemplateRequest { @jakarta.annotation.Nullable private String title; + public static final String JSON_PROPERTY_EXPIRES_AT = "expires_at"; + @jakarta.annotation.Nullable + private Integer expiresAt; + public SignatureRequestSendWithTemplateRequest() { } @@ -635,6 +640,31 @@ public void setTitle(@jakarta.annotation.Nullable String title) { } + public SignatureRequestSendWithTemplateRequest expiresAt(@jakarta.annotation.Nullable Integer expiresAt) { + this.expiresAt = expiresAt; + return this; + } + + /** + * When the signature request will expire. Unsigned signatures will be moved to the expired status, and no longer signable. See [Signature Request Expiration Date](https://developers.hellosign.com/docs/signature-request/expiration/) for details. + * @return expiresAt + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_EXPIRES_AT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Integer getExpiresAt() { + return expiresAt; + } + + + @JsonProperty(JSON_PROPERTY_EXPIRES_AT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setExpiresAt(@jakarta.annotation.Nullable Integer expiresAt) { + this.expiresAt = expiresAt; + } + + /** * Return true if this SignatureRequestSendWithTemplateRequest object is equal to o. */ @@ -663,12 +693,13 @@ public boolean equals(Object o) { Objects.equals(this.signingRedirectUrl, signatureRequestSendWithTemplateRequest.signingRedirectUrl) && Objects.equals(this.subject, signatureRequestSendWithTemplateRequest.subject) && Objects.equals(this.testMode, signatureRequestSendWithTemplateRequest.testMode) && - Objects.equals(this.title, signatureRequestSendWithTemplateRequest.title); + Objects.equals(this.title, signatureRequestSendWithTemplateRequest.title) && + Objects.equals(this.expiresAt, signatureRequestSendWithTemplateRequest.expiresAt); } @Override public int hashCode() { - return Objects.hash(templateIds, signers, allowDecline, ccs, clientId, customFields, files, fileUrls, isQualifiedSignature, isEid, message, metadata, signingOptions, signingRedirectUrl, subject, testMode, title); + return Objects.hash(templateIds, signers, allowDecline, ccs, clientId, customFields, files, fileUrls, isQualifiedSignature, isEid, message, metadata, signingOptions, signingRedirectUrl, subject, testMode, title, expiresAt); } @Override @@ -692,6 +723,7 @@ public String toString() { sb.append(" subject: ").append(toIndentedString(subject)).append("\n"); sb.append(" testMode: ").append(toIndentedString(testMode)).append("\n"); sb.append(" title: ").append(toIndentedString(title)).append("\n"); + sb.append(" expiresAt: ").append(toIndentedString(expiresAt)).append("\n"); sb.append("}"); return sb.toString(); } @@ -1023,6 +1055,25 @@ public Map createFormData() throws ApiException { map.put("title", JSON.getDefault().getMapper().writeValueAsString(title)); } } + if (expiresAt != null) { + if (isFileTypeOrListOfFiles(expiresAt)) { + fileTypeFound = true; + } + + if (expiresAt.getClass().equals(java.io.File.class) || + expiresAt.getClass().equals(Integer.class) || + expiresAt.getClass().equals(String.class) || + expiresAt.getClass().isEnum()) { + map.put("expires_at", expiresAt); + } else if (isListOfFile(expiresAt)) { + for(int i = 0; i< getListSize(expiresAt); i++) { + map.put("expires_at[" + i + "]", getFromList(expiresAt, i)); + } + } + else { + map.put("expires_at", JSON.getDefault().getMapper().writeValueAsString(expiresAt)); + } + } } catch (Exception e) { throw new ApiException(e); } diff --git a/sdks/node/README.md b/sdks/node/README.md index bb45ec624..c66edb433 100644 --- a/sdks/node/README.md +++ b/sdks/node/README.md @@ -90,6 +90,7 @@ All URIs are relative to *https://api.hellosign.com/v3* | *ApiAppApi* | [**apiAppUpdate**](./docs/api/ApiAppApi.md#apiappupdate) | **PUT** /api_app/{client_id} | Update API App | | *BulkSendJobApi* | [**bulkSendJobGet**](./docs/api/BulkSendJobApi.md#bulksendjobget) | **GET** /bulk_send_job/{bulk_send_job_id} | Get Bulk Send Job | | *BulkSendJobApi* | [**bulkSendJobList**](./docs/api/BulkSendJobApi.md#bulksendjoblist) | **GET** /bulk_send_job/list | List Bulk Send Jobs | +| *DocumentApi* | [**documentDetectFields**](./docs/api/DocumentApi.md#documentdetectfields) | **POST** /document/detect_fields | Detect Document Fields | | *EmbeddedApi* | [**embeddedEditUrl**](./docs/api/EmbeddedApi.md#embeddedediturl) | **POST** /embedded/edit_url/{template_id} | Get Embedded Template Edit URL | | *EmbeddedApi* | [**embeddedSignUrl**](./docs/api/EmbeddedApi.md#embeddedsignurl) | **GET** /embedded/sign_url/{signature_id} | Get Embedded Sign URL | | *FaxApi* | [**faxDelete**](./docs/api/FaxApi.md#faxdelete) | **DELETE** /fax/{fax_id} | Delete Fax | @@ -180,6 +181,9 @@ All URIs are relative to *https://api.hellosign.com/v3* - [BulkSendJobListResponse](./docs/model/BulkSendJobListResponse.md) - [BulkSendJobResponse](./docs/model/BulkSendJobResponse.md) - [BulkSendJobSendResponse](./docs/model/BulkSendJobSendResponse.md) +- [DocumentFieldDetectionRequest](./docs/model/DocumentFieldDetectionRequest.md) +- [DocumentFieldDetectionResponse](./docs/model/DocumentFieldDetectionResponse.md) +- [DocumentFieldDetectionResponseDetectionResult](./docs/model/DocumentFieldDetectionResponseDetectionResult.md) - [EmbeddedEditUrlRequest](./docs/model/EmbeddedEditUrlRequest.md) - [EmbeddedEditUrlResponse](./docs/model/EmbeddedEditUrlResponse.md) - [EmbeddedEditUrlResponseEmbedded](./docs/model/EmbeddedEditUrlResponseEmbedded.md) diff --git a/sdks/node/api/documentApi.ts b/sdks/node/api/documentApi.ts new file mode 100644 index 000000000..84e6a4ece --- /dev/null +++ b/sdks/node/api/documentApi.ts @@ -0,0 +1,338 @@ +/** + * 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 axios, { AxiosError, AxiosRequestConfig, AxiosResponse } from "axios"; + +import { + Authentication, + DocumentFieldDetectionRequest, + DocumentFieldDetectionResponse, + HttpBasicAuth, + HttpBearerAuth, + Interceptor, + ObjectSerializer, + VoidAuth, +} from "../model"; + +import { + generateFormData, + HttpError, + optionsI, + queryParamsSerializer, + returnTypeT, + toFormData, + USER_AGENT, +} from "./"; + +let defaultBasePath = "https://api.hellosign.com/v3"; + +// =============================================== +// This file is autogenerated - Please do not edit +// =============================================== + +export enum DocumentApiApiKeys {} + +export class DocumentApi { + protected _basePath = defaultBasePath; + protected _defaultHeaders: any = { "User-Agent": USER_AGENT }; + protected _useQuerystring: boolean = false; + + protected authentications = { + default: new VoidAuth(), + api_key: new HttpBasicAuth(), + oauth2: new HttpBearerAuth(), + }; + + protected interceptors: Interceptor[] = []; + + constructor(basePath?: string) { + if (basePath) { + this.basePath = basePath; + } + } + + set useQuerystring(value: boolean) { + this._useQuerystring = value; + } + + set basePath(basePath: string) { + this._basePath = basePath; + } + + set defaultHeaders(defaultHeaders: any) { + this._defaultHeaders = { ...defaultHeaders, "User-Agent": USER_AGENT }; + } + + get defaultHeaders() { + return this._defaultHeaders; + } + + get basePath() { + return this._basePath; + } + + public setDefaultAuthentication(auth: Authentication) { + this.authentications.default = auth; + } + + public setApiKey(key: string) { + this.authentications.api_key.username = key; + } + + set username(username: string) { + this.authentications.api_key.username = username; + } + + set password(password: string) { + this.authentications.api_key.password = password; + } + + set accessToken(accessToken: string | (() => string)) { + this.authentications.oauth2.accessToken = accessToken; + } + + public addInterceptor(interceptor: Interceptor) { + this.interceptors.push(interceptor); + } + + /** + * Detects form fields in a PDF document using either PDF form annotations or Dropbox Sign text tags. + * @summary Detect Document Fields + * Example: https://github.com/hellosign/dropbox-sign-node/blob/main/examples/DocumentDetectFieldsExample.ts + * @param documentFieldDetectionRequest + * @param options + */ + public async documentDetectFields( + documentFieldDetectionRequest: DocumentFieldDetectionRequest, + options: optionsI = { headers: {} } + ): Promise> { + documentFieldDetectionRequest = deserializeIfNeeded( + documentFieldDetectionRequest, + "DocumentFieldDetectionRequest" + ); + const localVarPath = this.basePath + "/document/detect_fields"; + 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 'documentFieldDetectionRequest' is not null or undefined + if ( + documentFieldDetectionRequest === null || + documentFieldDetectionRequest === undefined + ) { + throw new Error( + "Required parameter documentFieldDetectionRequest was null or undefined when calling documentDetectFields." + ); + } + + (Object).assign(localVarHeaderParams, options.headers); + + let localVarUseFormData = false; + + const result = generateFormData( + documentFieldDetectionRequest, + DocumentFieldDetectionRequest.attributeTypeMap + ); + localVarUseFormData = result.localVarUseFormData; + + let data = {}; + if (localVarUseFormData) { + const formData = toFormData(result.data); + data = formData; + localVarHeaderParams = { + ...localVarHeaderParams, + ...formData.getHeaders(), + }; + } else { + data = ObjectSerializer.serialize( + documentFieldDetectionRequest, + "DocumentFieldDetectionRequest" + ); + } + + 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, + "DocumentFieldDetectionResponse" + ); + }, + (error: AxiosError) => { + if (error.response == null) { + reject(error); + return; + } + + if ( + handleErrorCodeResponse( + reject, + error.response, + 200, + "DocumentFieldDetectionResponse" + ) + ) { + return; + } + + if ( + handleErrorRangeResponse( + reject, + error.response, + "4XX", + "ErrorResponse" + ) + ) { + return; + } + + reject(error); + } + ); + } + ); + }); + } +} + +function deserializeIfNeeded(obj: T, classname: string): T { + if (obj !== null && obj !== undefined && obj.constructor.name !== classname) { + return ObjectSerializer.deserialize(obj, classname); + } + + return obj; +} + +type AxiosResolve = ( + value: returnTypeT | PromiseLike> +) => void; + +type AxiosReject = (reason?: any) => void; + +function handleSuccessfulResponse( + resolve: AxiosResolve, + reject: AxiosReject, + response: AxiosResponse, + returnType?: string +) { + let body = response.data; + + if (response.status && response.status >= 200 && response.status <= 299) { + if (returnType) { + body = ObjectSerializer.deserialize(body, returnType); + } + + resolve({ response: response, body: body }); + } else { + reject(new HttpError(response, body, response.status)); + } +} + +function handleErrorCodeResponse( + reject: AxiosReject, + response: AxiosResponse, + code: number, + returnType: string +): boolean { + if (response.status !== code) { + return false; + } + + const body = ObjectSerializer.deserialize(response.data, returnType); + + reject(new HttpError(response, body, response.status)); + + return true; +} + +function handleErrorRangeResponse( + reject: AxiosReject, + response: AxiosResponse, + code: string, + returnType: string +): boolean { + let rangeCodeLeft = Number(code[0] + "00"); + let rangeCodeRight = Number(code[0] + "99"); + + if (response.status >= rangeCodeLeft && response.status <= rangeCodeRight) { + const body = ObjectSerializer.deserialize(response.data, returnType); + + reject(new HttpError(response, body, response.status)); + + return true; + } + + return false; +} diff --git a/sdks/node/api/index.ts b/sdks/node/api/index.ts index d32b5b1b7..815f7a255 100644 --- a/sdks/node/api/index.ts +++ b/sdks/node/api/index.ts @@ -1,6 +1,7 @@ import { AccountApi } from "./accountApi"; import { ApiAppApi } from "./apiAppApi"; import { BulkSendJobApi } from "./bulkSendJobApi"; +import { DocumentApi } from "./documentApi"; import { EmbeddedApi } from "./embeddedApi"; import { FaxApi } from "./faxApi"; import { FaxLineApi } from "./faxLineApi"; @@ -15,6 +16,7 @@ export { AccountApi, ApiAppApi, BulkSendJobApi, + DocumentApi, EmbeddedApi, FaxApi, FaxLineApi, @@ -41,6 +43,7 @@ export const APIS = [ AccountApi, ApiAppApi, BulkSendJobApi, + DocumentApi, EmbeddedApi, FaxApi, FaxLineApi, diff --git a/sdks/node/bin/node b/sdks/node/bin/node index b837d21ea..6badd28c3 100755 --- a/sdks/node/bin/node +++ b/sdks/node/bin/node @@ -8,5 +8,6 @@ ROOT_DIR="${DIR}/.." docker run --rm \ -v "${ROOT_DIR}:/app" \ -v "dropbox-sign-sdk-npm-cache:/root/.npm" \ + -v "dropbox-sign-sdk-node-modules:/app/node_modules" \ -w /app \ node:18 "$@" diff --git a/sdks/node/dist/api.js b/sdks/node/dist/api.js index b39524b54..2acb8bb12 100644 --- a/sdks/node/dist/api.js +++ b/sdks/node/dist/api.js @@ -13866,6 +13866,10 @@ __export(api_exports, { BulkSendJobListResponse: () => BulkSendJobListResponse, BulkSendJobResponse: () => BulkSendJobResponse, BulkSendJobSendResponse: () => BulkSendJobSendResponse, + DocumentApi: () => DocumentApi, + DocumentFieldDetectionRequest: () => DocumentFieldDetectionRequest, + DocumentFieldDetectionResponse: () => DocumentFieldDetectionResponse, + DocumentFieldDetectionResponseDetectionResult: () => DocumentFieldDetectionResponseDetectionResult, EmbeddedApi: () => EmbeddedApi, EmbeddedEditUrlRequest: () => EmbeddedEditUrlRequest, EmbeddedEditUrlResponse: () => EmbeddedEditUrlResponse, @@ -20772,6 +20776,143 @@ var BulkSendJobSendResponse = class _BulkSendJobSendResponse { } }; +// model/documentFieldDetectionRequest.ts +var DocumentFieldDetectionRequest = class _DocumentFieldDetectionRequest { + static { + this.discriminator = void 0; + } + static { + this.attributeTypeMap = [ + { + name: "detectionMode", + baseName: "detection_mode", + type: "string" + }, + { + name: "file", + baseName: "file", + type: "RequestFile" + }, + { + name: "fileUrl", + baseName: "file_url", + type: "string" + }, + { + name: "pageRange", + baseName: "page_range", + type: "string" + } + ]; + } + static getAttributeTypeMap() { + return _DocumentFieldDetectionRequest.attributeTypeMap; + } + /** Attempt to instantiate and hydrate a new instance of this class */ + static init(data) { + return ObjectSerializer.deserialize(data, "DocumentFieldDetectionRequest"); + } +}; + +// model/documentFieldDetectionResponse.ts +var DocumentFieldDetectionResponse = class _DocumentFieldDetectionResponse { + static { + this.discriminator = void 0; + } + static { + this.attributeTypeMap = [ + { + name: "detectionResult", + baseName: "detection_result", + type: "DocumentFieldDetectionResponseDetectionResult" + }, + { + name: "warnings", + baseName: "warnings", + type: "Array" + } + ]; + } + static getAttributeTypeMap() { + return _DocumentFieldDetectionResponse.attributeTypeMap; + } + /** Attempt to instantiate and hydrate a new instance of this class */ + static init(data) { + return ObjectSerializer.deserialize(data, "DocumentFieldDetectionResponse"); + } +}; + +// model/documentFieldDetectionResponseDetectionResult.ts +var DocumentFieldDetectionResponseDetectionResult = class _DocumentFieldDetectionResponseDetectionResult { + static { + this.discriminator = void 0; + } + static { + this.attributeTypeMap = [ + { + name: "documentHash", + baseName: "document_hash", + type: "string" + }, + { + name: "detectionMode", + baseName: "detection_mode", + type: "string" + }, + { + name: "pageCount", + baseName: "page_count", + type: "number" + }, + { + name: "pagesAnalyzed", + baseName: "pages_analyzed", + type: "string" + }, + { + name: "detectedAt", + baseName: "detected_at", + type: "number" + }, + { + name: "formFieldsPerDocument", + baseName: "form_fields_per_document", + type: "Array" + }, + { + name: "formFieldGroups", + baseName: "form_field_groups", + type: "Array" + }, + { + name: "warnings", + baseName: "warnings", + type: "Array" + }, + { + name: "errors", + baseName: "errors", + type: "Array" + }, + { + name: "suggestions", + baseName: "suggestions", + type: "Array" + } + ]; + } + static getAttributeTypeMap() { + return _DocumentFieldDetectionResponseDetectionResult.attributeTypeMap; + } + /** Attempt to instantiate and hydrate a new instance of this class */ + static init(data) { + return ObjectSerializer.deserialize( + data, + "DocumentFieldDetectionResponseDetectionResult" + ); + } +}; + // model/embeddedEditUrlRequest.ts var EmbeddedEditUrlRequest = class _EmbeddedEditUrlRequest { constructor() { @@ -21628,6 +21769,12 @@ var FaxListResponse = class _FaxListResponse { // model/faxResponse.ts var FaxResponse = class _FaxResponse { + constructor() { + /** + * Whether this is a test fax. Test faxes are not delivered to the recipient. Defaults to `false`. + */ + this["testMode"] = false; + } static { this.discriminator = void 0; } @@ -21673,6 +21820,11 @@ var FaxResponse = class _FaxResponse { baseName: "transmissions", type: "Array" }, + { + name: "testMode", + baseName: "test_mode", + type: "boolean" + }, { name: "subject", baseName: "subject", @@ -22462,6 +22614,11 @@ var SignatureRequestBulkCreateEmbeddedWithTemplateRequest = class _SignatureRequ name: "title", baseName: "title", type: "string" + }, + { + name: "expiresAt", + baseName: "expires_at", + type: "number" } ]; } @@ -22558,6 +22715,11 @@ var SignatureRequestBulkSendWithTemplateRequest = class _SignatureRequestBulkSen name: "title", baseName: "title", type: "string" + }, + { + name: "expiresAt", + baseName: "expires_at", + type: "number" } ]; } @@ -22844,6 +23006,11 @@ var SignatureRequestCreateEmbeddedWithTemplateRequest = class _SignatureRequestC name: "populateAutoFillFields", baseName: "populate_auto_fill_fields", type: "boolean" + }, + { + name: "expiresAt", + baseName: "expires_at", + type: "number" } ]; } @@ -24715,6 +24882,11 @@ var SignatureRequestSendWithTemplateRequest = class _SignatureRequestSendWithTem name: "title", baseName: "title", type: "string" + }, + { + name: "expiresAt", + baseName: "expires_at", + type: "number" } ]; } @@ -29950,6 +30122,9 @@ var typeMap = { BulkSendJobListResponse, BulkSendJobResponse, BulkSendJobSendResponse, + DocumentFieldDetectionRequest, + DocumentFieldDetectionResponse, + DocumentFieldDetectionResponseDetectionResult, EmbeddedEditUrlRequest, EmbeddedEditUrlResponse, EmbeddedEditUrlResponseEmbedded, @@ -31605,9 +31780,9 @@ function handleErrorRangeResponse3(reject, response, code, returnType) { return false; } -// api/embeddedApi.ts +// api/documentApi.ts var defaultBasePath4 = "https://api.hellosign.com/v3"; -var EmbeddedApi = class { +var DocumentApi = class { constructor(basePath) { this._basePath = defaultBasePath4; this._defaultHeaders = { "User-Agent": USER_AGENT }; @@ -31656,22 +31831,18 @@ var EmbeddedApi = class { this.interceptors.push(interceptor); } /** - * Retrieves an embedded object containing a template url that can be opened in an iFrame. Note that only templates created via the embedded template process are available to be edited with this endpoint. - * @summary Get Embedded Template Edit URL - * Example: https://github.com/hellosign/dropbox-sign-node/blob/main/examples/EmbeddedEditUrlExample.ts - * @param templateId The id of the template to edit. - * @param embeddedEditUrlRequest + * Detects form fields in a PDF document using either PDF form annotations or Dropbox Sign text tags. + * @summary Detect Document Fields + * Example: https://github.com/hellosign/dropbox-sign-node/blob/main/examples/DocumentDetectFieldsExample.ts + * @param documentFieldDetectionRequest * @param options */ - async embeddedEditUrl(templateId, embeddedEditUrlRequest, options = { headers: {} }) { - embeddedEditUrlRequest = deserializeIfNeeded3( - embeddedEditUrlRequest, - "EmbeddedEditUrlRequest" - ); - const localVarPath = this.basePath + "/embedded/edit_url/{template_id}".replace( - "{template_id}", - encodeURIComponent(String(templateId)) + async documentDetectFields(documentFieldDetectionRequest, options = { headers: {} }) { + documentFieldDetectionRequest = deserializeIfNeeded3( + documentFieldDetectionRequest, + "DocumentFieldDetectionRequest" ); + const localVarPath = this.basePath + "/document/detect_fields"; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign( {}, @@ -31685,21 +31856,16 @@ var EmbeddedApi = class { } let localVarFormParams = {}; let localVarBodyParams = void 0; - if (templateId === null || templateId === void 0) { - throw new Error( - "Required parameter templateId was null or undefined when calling embeddedEditUrl." - ); - } - if (embeddedEditUrlRequest === null || embeddedEditUrlRequest === void 0) { + if (documentFieldDetectionRequest === null || documentFieldDetectionRequest === void 0) { throw new Error( - "Required parameter embeddedEditUrlRequest was null or undefined when calling embeddedEditUrl." + "Required parameter documentFieldDetectionRequest was null or undefined when calling documentDetectFields." ); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; const result = generateFormData( - embeddedEditUrlRequest, - EmbeddedEditUrlRequest.attributeTypeMap + documentFieldDetectionRequest, + DocumentFieldDetectionRequest.attributeTypeMap ); localVarUseFormData = result.localVarUseFormData; let data = {}; @@ -31712,8 +31878,8 @@ var EmbeddedApi = class { }; } else { data = ObjectSerializer.serialize( - embeddedEditUrlRequest, - "EmbeddedEditUrlRequest" + documentFieldDetectionRequest, + "DocumentFieldDetectionRequest" ); } let localVarRequestOptions = { @@ -31756,7 +31922,7 @@ var EmbeddedApi = class { resolve, reject, response, - "EmbeddedEditUrlResponse" + "DocumentFieldDetectionResponse" ); }, (error) => { @@ -31768,7 +31934,7 @@ var EmbeddedApi = class { reject, error.response, 200, - "EmbeddedEditUrlResponse" + "DocumentFieldDetectionResponse" )) { return; } @@ -31787,57 +31953,174 @@ var EmbeddedApi = class { ); }); } - /** - * Retrieves an embedded object containing a signature url that can be opened in an iFrame. Note that templates created via the embedded template process will only be accessible through the API. - * @summary Get Embedded Sign URL - * Example: https://github.com/hellosign/dropbox-sign-node/blob/main/examples/EmbeddedSignUrlExample.ts - * @param signatureId The id of the signature to get a signature url for. - * @param options - */ - async embeddedSignUrl(signatureId, options = { headers: {} }) { - const localVarPath = this.basePath + "/embedded/sign_url/{signature_id}".replace( - "{signature_id}", - encodeURIComponent(String(signatureId)) - ); - 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 (signatureId === null || signatureId === void 0) { - throw new Error( - "Required parameter signatureId was null or undefined when calling embeddedSignUrl." - ); +}; +function deserializeIfNeeded3(obj, classname) { + if (obj !== null && obj !== void 0 && obj.constructor.name !== classname) { + return ObjectSerializer.deserialize(obj, classname); + } + return obj; +} +function handleSuccessfulResponse4(resolve, reject, response, returnType) { + let body = response.data; + if (response.status && response.status >= 200 && response.status <= 299) { + if (returnType) { + body = ObjectSerializer.deserialize(body, returnType); } - Object.assign(localVarHeaderParams, options.headers); - let localVarUseFormData = false; - let localVarRequestOptions = { - method: "GET", - params: localVarQueryParameters, - headers: localVarHeaderParams, - url: localVarPath, - paramsSerializer: this._useQuerystring ? queryParamsSerializer : void 0, - maxContentLength: Infinity, - maxBodyLength: Infinity, - responseType: "json" + resolve({ response, body }); + } else { + reject(new HttpError(response, body, response.status)); + } +} +function handleErrorCodeResponse4(reject, response, code, returnType) { + if (response.status !== code) { + return false; + } + const body = ObjectSerializer.deserialize(response.data, returnType); + reject(new HttpError(response, body, response.status)); + return true; +} +function handleErrorRangeResponse4(reject, response, code, returnType) { + let rangeCodeLeft = Number(code[0] + "00"); + let rangeCodeRight = Number(code[0] + "99"); + if (response.status >= rangeCodeLeft && response.status <= rangeCodeRight) { + const body = ObjectSerializer.deserialize(response.data, returnType); + reject(new HttpError(response, body, response.status)); + return true; + } + return false; +} + +// api/embeddedApi.ts +var defaultBasePath5 = "https://api.hellosign.com/v3"; +var EmbeddedApi = class { + constructor(basePath) { + this._basePath = defaultBasePath5; + this._defaultHeaders = { "User-Agent": USER_AGENT }; + this._useQuerystring = false; + this.authentications = { + default: new VoidAuth(), + api_key: new HttpBasicAuth(), + oauth2: new HttpBearerAuth() }; - let authenticationPromise = Promise.resolve(); - if (this.authentications.api_key.username) { - authenticationPromise = authenticationPromise.then( - () => this.authentications.api_key.applyToRequest(localVarRequestOptions) - ); + this.interceptors = []; + if (basePath) { + this.basePath = basePath; } - if (this.authentications.oauth2.accessToken) { - authenticationPromise = authenticationPromise.then( - () => this.authentications.oauth2.applyToRequest(localVarRequestOptions) + } + set useQuerystring(value) { + this._useQuerystring = value; + } + set basePath(basePath) { + this._basePath = basePath; + } + set defaultHeaders(defaultHeaders) { + this._defaultHeaders = { ...defaultHeaders, "User-Agent": USER_AGENT }; + } + get defaultHeaders() { + return this._defaultHeaders; + } + get basePath() { + return this._basePath; + } + setDefaultAuthentication(auth) { + this.authentications.default = auth; + } + setApiKey(key) { + this.authentications.api_key.username = key; + } + set username(username) { + this.authentications.api_key.username = username; + } + set password(password) { + this.authentications.api_key.password = password; + } + set accessToken(accessToken) { + this.authentications.oauth2.accessToken = accessToken; + } + addInterceptor(interceptor) { + this.interceptors.push(interceptor); + } + /** + * Retrieves an embedded object containing a template url that can be opened in an iFrame. Note that only templates created via the embedded template process are available to be edited with this endpoint. + * @summary Get Embedded Template Edit URL + * Example: https://github.com/hellosign/dropbox-sign-node/blob/main/examples/EmbeddedEditUrlExample.ts + * @param templateId The id of the template to edit. + * @param embeddedEditUrlRequest + * @param options + */ + async embeddedEditUrl(templateId, embeddedEditUrlRequest, options = { headers: {} }) { + embeddedEditUrlRequest = deserializeIfNeeded4( + embeddedEditUrlRequest, + "EmbeddedEditUrlRequest" + ); + const localVarPath = this.basePath + "/embedded/edit_url/{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 embeddedEditUrl." + ); + } + if (embeddedEditUrlRequest === null || embeddedEditUrlRequest === void 0) { + throw new Error( + "Required parameter embeddedEditUrlRequest was null or undefined when calling embeddedEditUrl." + ); + } + Object.assign(localVarHeaderParams, options.headers); + let localVarUseFormData = false; + const result = generateFormData( + embeddedEditUrlRequest, + EmbeddedEditUrlRequest.attributeTypeMap + ); + localVarUseFormData = result.localVarUseFormData; + let data = {}; + if (localVarUseFormData) { + const formData2 = toFormData3(result.data); + data = formData2; + localVarHeaderParams = { + ...localVarHeaderParams, + ...formData2.getHeaders() + }; + } else { + data = ObjectSerializer.serialize( + embeddedEditUrlRequest, + "EmbeddedEditUrlRequest" + ); + } + 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( @@ -31854,7 +32137,109 @@ var EmbeddedApi = class { (resolve, reject) => { axios_default.request(localVarRequestOptions).then( (response) => { - handleSuccessfulResponse4( + handleSuccessfulResponse5( + resolve, + reject, + response, + "EmbeddedEditUrlResponse" + ); + }, + (error) => { + if (error.response == null) { + reject(error); + return; + } + if (handleErrorCodeResponse5( + reject, + error.response, + 200, + "EmbeddedEditUrlResponse" + )) { + return; + } + if (handleErrorRangeResponse5( + reject, + error.response, + "4XX", + "ErrorResponse" + )) { + return; + } + reject(error); + } + ); + } + ); + }); + } + /** + * Retrieves an embedded object containing a signature url that can be opened in an iFrame. Note that templates created via the embedded template process will only be accessible through the API. + * @summary Get Embedded Sign URL + * Example: https://github.com/hellosign/dropbox-sign-node/blob/main/examples/EmbeddedSignUrlExample.ts + * @param signatureId The id of the signature to get a signature url for. + * @param options + */ + async embeddedSignUrl(signatureId, options = { headers: {} }) { + const localVarPath = this.basePath + "/embedded/sign_url/{signature_id}".replace( + "{signature_id}", + encodeURIComponent(String(signatureId)) + ); + 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 (signatureId === null || signatureId === void 0) { + throw new Error( + "Required parameter signatureId was null or undefined when calling embeddedSignUrl." + ); + } + Object.assign(localVarHeaderParams, options.headers); + let localVarUseFormData = false; + let localVarRequestOptions = { + method: "GET", + params: localVarQueryParameters, + headers: localVarHeaderParams, + url: localVarPath, + paramsSerializer: this._useQuerystring ? queryParamsSerializer : void 0, + maxContentLength: Infinity, + maxBodyLength: Infinity, + responseType: "json" + }; + 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) => { + handleSuccessfulResponse5( resolve, reject, response, @@ -31866,7 +32251,7 @@ var EmbeddedApi = class { reject(error); return; } - if (handleErrorCodeResponse4( + if (handleErrorCodeResponse5( reject, error.response, 200, @@ -31874,7 +32259,7 @@ var EmbeddedApi = class { )) { return; } - if (handleErrorRangeResponse4( + if (handleErrorRangeResponse5( reject, error.response, "4XX", @@ -31890,13 +32275,13 @@ var EmbeddedApi = class { }); } }; -function deserializeIfNeeded3(obj, classname) { +function deserializeIfNeeded4(obj, classname) { if (obj !== null && obj !== void 0 && obj.constructor.name !== classname) { return ObjectSerializer.deserialize(obj, classname); } return obj; } -function handleSuccessfulResponse4(resolve, reject, response, returnType) { +function handleSuccessfulResponse5(resolve, reject, response, returnType) { let body = response.data; if (response.status && response.status >= 200 && response.status <= 299) { if (returnType) { @@ -31907,7 +32292,7 @@ function handleSuccessfulResponse4(resolve, reject, response, returnType) { reject(new HttpError(response, body, response.status)); } } -function handleErrorCodeResponse4(reject, response, code, returnType) { +function handleErrorCodeResponse5(reject, response, code, returnType) { if (response.status !== code) { return false; } @@ -31915,7 +32300,7 @@ function handleErrorCodeResponse4(reject, response, code, returnType) { reject(new HttpError(response, body, response.status)); return true; } -function handleErrorRangeResponse4(reject, response, code, returnType) { +function handleErrorRangeResponse5(reject, response, code, returnType) { let rangeCodeLeft = Number(code[0] + "00"); let rangeCodeRight = Number(code[0] + "99"); if (response.status >= rangeCodeLeft && response.status <= rangeCodeRight) { @@ -31927,10 +32312,10 @@ function handleErrorRangeResponse4(reject, response, code, returnType) { } // api/faxApi.ts -var defaultBasePath5 = "https://api.hellosign.com/v3"; +var defaultBasePath6 = "https://api.hellosign.com/v3"; var FaxApi = class { constructor(basePath) { - this._basePath = defaultBasePath5; + this._basePath = defaultBasePath6; this._defaultHeaders = { "User-Agent": USER_AGENT }; this._useQuerystring = false; this.authentications = { @@ -32037,14 +32422,14 @@ var FaxApi = class { return new Promise((resolve, reject) => { axios_default.request(localVarRequestOptions).then( (response) => { - handleSuccessfulResponse5(resolve, reject, response); + handleSuccessfulResponse6(resolve, reject, response); }, (error) => { if (error.response == null) { reject(error); return; } - if (handleErrorRangeResponse5( + if (handleErrorRangeResponse6( reject, error.response, "4XX", @@ -32119,7 +32504,7 @@ var FaxApi = class { return new Promise((resolve, reject) => { axios_default.request(localVarRequestOptions).then( (response) => { - handleSuccessfulResponse5( + handleSuccessfulResponse6( resolve, reject, response, @@ -32131,7 +32516,7 @@ var FaxApi = class { reject(error); return; } - if (handleErrorCodeResponse5( + if (handleErrorCodeResponse6( reject, error.response, 200, @@ -32139,7 +32524,7 @@ var FaxApi = class { )) { return; } - if (handleErrorRangeResponse5( + if (handleErrorRangeResponse6( reject, error.response, "4XX", @@ -32214,7 +32599,7 @@ var FaxApi = class { return new Promise((resolve, reject) => { axios_default.request(localVarRequestOptions).then( (response) => { - handleSuccessfulResponse5( + handleSuccessfulResponse6( resolve, reject, response, @@ -32226,7 +32611,7 @@ var FaxApi = class { reject(error); return; } - if (handleErrorCodeResponse5( + if (handleErrorCodeResponse6( reject, error.response, 200, @@ -32234,7 +32619,7 @@ var FaxApi = class { )) { return; } - if (handleErrorRangeResponse5( + if (handleErrorRangeResponse6( reject, error.response, "4XX", @@ -32314,7 +32699,7 @@ var FaxApi = class { return new Promise((resolve, reject) => { axios_default.request(localVarRequestOptions).then( (response) => { - handleSuccessfulResponse5( + handleSuccessfulResponse6( resolve, reject, response, @@ -32326,7 +32711,7 @@ var FaxApi = class { reject(error); return; } - if (handleErrorCodeResponse5( + if (handleErrorCodeResponse6( reject, error.response, 200, @@ -32334,7 +32719,7 @@ var FaxApi = class { )) { return; } - if (handleErrorRangeResponse5( + if (handleErrorRangeResponse6( reject, error.response, "4XX", @@ -32356,7 +32741,7 @@ var FaxApi = class { * @param options */ async faxSend(faxSendRequest, options = { headers: {} }) { - faxSendRequest = deserializeIfNeeded4(faxSendRequest, "FaxSendRequest"); + faxSendRequest = deserializeIfNeeded5(faxSendRequest, "FaxSendRequest"); const localVarPath = this.basePath + "/fax/send"; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign( @@ -32424,7 +32809,7 @@ var FaxApi = class { return new Promise((resolve, reject) => { axios_default.request(localVarRequestOptions).then( (response) => { - handleSuccessfulResponse5( + handleSuccessfulResponse6( resolve, reject, response, @@ -32436,7 +32821,7 @@ var FaxApi = class { reject(error); return; } - if (handleErrorCodeResponse5( + if (handleErrorCodeResponse6( reject, error.response, 200, @@ -32444,7 +32829,7 @@ var FaxApi = class { )) { return; } - if (handleErrorRangeResponse5( + if (handleErrorRangeResponse6( reject, error.response, "4XX", @@ -32459,13 +32844,13 @@ var FaxApi = class { }); } }; -function deserializeIfNeeded4(obj, classname) { +function deserializeIfNeeded5(obj, classname) { if (obj !== null && obj !== void 0 && obj.constructor.name !== classname) { return ObjectSerializer.deserialize(obj, classname); } return obj; } -function handleSuccessfulResponse5(resolve, reject, response, returnType) { +function handleSuccessfulResponse6(resolve, reject, response, returnType) { let body = response.data; if (response.status && response.status >= 200 && response.status <= 299) { if (returnType) { @@ -32476,7 +32861,7 @@ function handleSuccessfulResponse5(resolve, reject, response, returnType) { reject(new HttpError(response, body, response.status)); } } -function handleErrorCodeResponse5(reject, response, code, returnType) { +function handleErrorCodeResponse6(reject, response, code, returnType) { if (response.status !== code) { return false; } @@ -32484,7 +32869,7 @@ function handleErrorCodeResponse5(reject, response, code, returnType) { reject(new HttpError(response, body, response.status)); return true; } -function handleErrorRangeResponse5(reject, response, code, returnType) { +function handleErrorRangeResponse6(reject, response, code, returnType) { let rangeCodeLeft = Number(code[0] + "00"); let rangeCodeRight = Number(code[0] + "99"); if (response.status >= rangeCodeLeft && response.status <= rangeCodeRight) { @@ -32496,10 +32881,10 @@ function handleErrorRangeResponse5(reject, response, code, returnType) { } // api/faxLineApi.ts -var defaultBasePath6 = "https://api.hellosign.com/v3"; +var defaultBasePath7 = "https://api.hellosign.com/v3"; var FaxLineApi = class { constructor(basePath) { - this._basePath = defaultBasePath6; + this._basePath = defaultBasePath7; this._defaultHeaders = { "User-Agent": USER_AGENT }; this._useQuerystring = false; this.authentications = { @@ -32553,7 +32938,7 @@ var FaxLineApi = class { * @param options */ async faxLineAddUser(faxLineAddUserRequest, options = { headers: {} }) { - faxLineAddUserRequest = deserializeIfNeeded5( + faxLineAddUserRequest = deserializeIfNeeded6( faxLineAddUserRequest, "FaxLineAddUserRequest" ); @@ -32627,7 +33012,7 @@ var FaxLineApi = class { return new Promise((resolve, reject) => { axios_default.request(localVarRequestOptions).then( (response) => { - handleSuccessfulResponse6( + handleSuccessfulResponse7( resolve, reject, response, @@ -32639,7 +33024,7 @@ var FaxLineApi = class { reject(error); return; } - if (handleErrorCodeResponse6( + if (handleErrorCodeResponse7( reject, error.response, 200, @@ -32647,7 +33032,7 @@ var FaxLineApi = class { )) { return; } - if (handleErrorRangeResponse6( + if (handleErrorRangeResponse7( reject, error.response, "4XX", @@ -32747,7 +33132,7 @@ var FaxLineApi = class { (resolve, reject) => { axios_default.request(localVarRequestOptions).then( (response) => { - handleSuccessfulResponse6( + handleSuccessfulResponse7( resolve, reject, response, @@ -32759,7 +33144,7 @@ var FaxLineApi = class { reject(error); return; } - if (handleErrorCodeResponse6( + if (handleErrorCodeResponse7( reject, error.response, 200, @@ -32767,7 +33152,7 @@ var FaxLineApi = class { )) { return; } - if (handleErrorRangeResponse6( + if (handleErrorRangeResponse7( reject, error.response, "4XX", @@ -32790,7 +33175,7 @@ var FaxLineApi = class { * @param options */ async faxLineCreate(faxLineCreateRequest, options = { headers: {} }) { - faxLineCreateRequest = deserializeIfNeeded5( + faxLineCreateRequest = deserializeIfNeeded6( faxLineCreateRequest, "FaxLineCreateRequest" ); @@ -32864,7 +33249,7 @@ var FaxLineApi = class { return new Promise((resolve, reject) => { axios_default.request(localVarRequestOptions).then( (response) => { - handleSuccessfulResponse6( + handleSuccessfulResponse7( resolve, reject, response, @@ -32876,7 +33261,7 @@ var FaxLineApi = class { reject(error); return; } - if (handleErrorCodeResponse6( + if (handleErrorCodeResponse7( reject, error.response, 200, @@ -32884,7 +33269,7 @@ var FaxLineApi = class { )) { return; } - if (handleErrorRangeResponse6( + if (handleErrorRangeResponse7( reject, error.response, "4XX", @@ -32906,7 +33291,7 @@ var FaxLineApi = class { * @param options */ async faxLineDelete(faxLineDeleteRequest, options = { headers: {} }) { - faxLineDeleteRequest = deserializeIfNeeded5( + faxLineDeleteRequest = deserializeIfNeeded6( faxLineDeleteRequest, "FaxLineDeleteRequest" ); @@ -32980,14 +33365,14 @@ var FaxLineApi = class { return new Promise((resolve, reject) => { axios_default.request(localVarRequestOptions).then( (response) => { - handleSuccessfulResponse6(resolve, reject, response); + handleSuccessfulResponse7(resolve, reject, response); }, (error) => { if (error.response == null) { reject(error); return; } - if (handleErrorRangeResponse6( + if (handleErrorRangeResponse7( reject, error.response, "4XX", @@ -33065,7 +33450,7 @@ var FaxLineApi = class { return new Promise((resolve, reject) => { axios_default.request(localVarRequestOptions).then( (response) => { - handleSuccessfulResponse6( + handleSuccessfulResponse7( resolve, reject, response, @@ -33077,7 +33462,7 @@ var FaxLineApi = class { reject(error); return; } - if (handleErrorCodeResponse6( + if (handleErrorCodeResponse7( reject, error.response, 200, @@ -33085,7 +33470,7 @@ var FaxLineApi = class { )) { return; } - if (handleErrorRangeResponse6( + if (handleErrorRangeResponse7( reject, error.response, "4XX", @@ -33180,7 +33565,7 @@ var FaxLineApi = class { (resolve, reject) => { axios_default.request(localVarRequestOptions).then( (response) => { - handleSuccessfulResponse6( + handleSuccessfulResponse7( resolve, reject, response, @@ -33192,7 +33577,7 @@ var FaxLineApi = class { reject(error); return; } - if (handleErrorCodeResponse6( + if (handleErrorCodeResponse7( reject, error.response, 200, @@ -33200,7 +33585,7 @@ var FaxLineApi = class { )) { return; } - if (handleErrorRangeResponse6( + if (handleErrorRangeResponse7( reject, error.response, "4XX", @@ -33223,7 +33608,7 @@ var FaxLineApi = class { * @param options */ async faxLineRemoveUser(faxLineRemoveUserRequest, options = { headers: {} }) { - faxLineRemoveUserRequest = deserializeIfNeeded5( + faxLineRemoveUserRequest = deserializeIfNeeded6( faxLineRemoveUserRequest, "FaxLineRemoveUserRequest" ); @@ -33297,7 +33682,7 @@ var FaxLineApi = class { return new Promise((resolve, reject) => { axios_default.request(localVarRequestOptions).then( (response) => { - handleSuccessfulResponse6( + handleSuccessfulResponse7( resolve, reject, response, @@ -33309,7 +33694,7 @@ var FaxLineApi = class { reject(error); return; } - if (handleErrorCodeResponse6( + if (handleErrorCodeResponse7( reject, error.response, 200, @@ -33317,7 +33702,7 @@ var FaxLineApi = class { )) { return; } - if (handleErrorRangeResponse6( + if (handleErrorRangeResponse7( reject, error.response, "4XX", @@ -33332,13 +33717,13 @@ var FaxLineApi = class { }); } }; -function deserializeIfNeeded5(obj, classname) { +function deserializeIfNeeded6(obj, classname) { if (obj !== null && obj !== void 0 && obj.constructor.name !== classname) { return ObjectSerializer.deserialize(obj, classname); } return obj; } -function handleSuccessfulResponse6(resolve, reject, response, returnType) { +function handleSuccessfulResponse7(resolve, reject, response, returnType) { let body = response.data; if (response.status && response.status >= 200 && response.status <= 299) { if (returnType) { @@ -33349,7 +33734,7 @@ function handleSuccessfulResponse6(resolve, reject, response, returnType) { reject(new HttpError(response, body, response.status)); } } -function handleErrorCodeResponse6(reject, response, code, returnType) { +function handleErrorCodeResponse7(reject, response, code, returnType) { if (response.status !== code) { return false; } @@ -33357,7 +33742,7 @@ function handleErrorCodeResponse6(reject, response, code, returnType) { reject(new HttpError(response, body, response.status)); return true; } -function handleErrorRangeResponse6(reject, response, code, returnType) { +function handleErrorRangeResponse7(reject, response, code, returnType) { let rangeCodeLeft = Number(code[0] + "00"); let rangeCodeRight = Number(code[0] + "99"); if (response.status >= rangeCodeLeft && response.status <= rangeCodeRight) { @@ -33369,10 +33754,10 @@ function handleErrorRangeResponse6(reject, response, code, returnType) { } // api/oAuthApi.ts -var defaultBasePath7 = "https://app.hellosign.com"; +var defaultBasePath8 = "https://app.hellosign.com"; var OAuthApi = class { constructor(basePath) { - this._basePath = defaultBasePath7; + this._basePath = defaultBasePath8; this._defaultHeaders = { "User-Agent": USER_AGENT }; this._useQuerystring = false; this.authentications = { @@ -33426,7 +33811,7 @@ var OAuthApi = class { * @param options */ async oauthTokenGenerate(oAuthTokenGenerateRequest, options = { headers: {} }) { - oAuthTokenGenerateRequest = deserializeIfNeeded6( + oAuthTokenGenerateRequest = deserializeIfNeeded7( oAuthTokenGenerateRequest, "OAuthTokenGenerateRequest" ); @@ -33495,7 +33880,7 @@ var OAuthApi = class { return new Promise((resolve, reject) => { axios_default.request(localVarRequestOptions).then( (response) => { - handleSuccessfulResponse7( + handleSuccessfulResponse8( resolve, reject, response, @@ -33507,7 +33892,7 @@ var OAuthApi = class { reject(error); return; } - if (handleErrorCodeResponse7( + if (handleErrorCodeResponse8( reject, error.response, 200, @@ -33515,7 +33900,7 @@ var OAuthApi = class { )) { return; } - if (handleErrorRangeResponse7( + if (handleErrorRangeResponse8( reject, error.response, "4XX", @@ -33537,7 +33922,7 @@ var OAuthApi = class { * @param options */ async oauthTokenRefresh(oAuthTokenRefreshRequest, options = { headers: {} }) { - oAuthTokenRefreshRequest = deserializeIfNeeded6( + oAuthTokenRefreshRequest = deserializeIfNeeded7( oAuthTokenRefreshRequest, "OAuthTokenRefreshRequest" ); @@ -33606,7 +33991,7 @@ var OAuthApi = class { return new Promise((resolve, reject) => { axios_default.request(localVarRequestOptions).then( (response) => { - handleSuccessfulResponse7( + handleSuccessfulResponse8( resolve, reject, response, @@ -33618,7 +34003,7 @@ var OAuthApi = class { reject(error); return; } - if (handleErrorCodeResponse7( + if (handleErrorCodeResponse8( reject, error.response, 200, @@ -33626,7 +34011,7 @@ var OAuthApi = class { )) { return; } - if (handleErrorRangeResponse7( + if (handleErrorRangeResponse8( reject, error.response, "4XX", @@ -33641,13 +34026,13 @@ var OAuthApi = class { }); } }; -function deserializeIfNeeded6(obj, classname) { +function deserializeIfNeeded7(obj, classname) { if (obj !== null && obj !== void 0 && obj.constructor.name !== classname) { return ObjectSerializer.deserialize(obj, classname); } return obj; } -function handleSuccessfulResponse7(resolve, reject, response, returnType) { +function handleSuccessfulResponse8(resolve, reject, response, returnType) { let body = response.data; if (response.status && response.status >= 200 && response.status <= 299) { if (returnType) { @@ -33658,7 +34043,7 @@ function handleSuccessfulResponse7(resolve, reject, response, returnType) { reject(new HttpError(response, body, response.status)); } } -function handleErrorCodeResponse7(reject, response, code, returnType) { +function handleErrorCodeResponse8(reject, response, code, returnType) { if (response.status !== code) { return false; } @@ -33666,7 +34051,7 @@ function handleErrorCodeResponse7(reject, response, code, returnType) { reject(new HttpError(response, body, response.status)); return true; } -function handleErrorRangeResponse7(reject, response, code, returnType) { +function handleErrorRangeResponse8(reject, response, code, returnType) { let rangeCodeLeft = Number(code[0] + "00"); let rangeCodeRight = Number(code[0] + "99"); if (response.status >= rangeCodeLeft && response.status <= rangeCodeRight) { @@ -33678,10 +34063,10 @@ function handleErrorRangeResponse7(reject, response, code, returnType) { } // api/reportApi.ts -var defaultBasePath8 = "https://api.hellosign.com/v3"; +var defaultBasePath9 = "https://api.hellosign.com/v3"; var ReportApi = class { constructor(basePath) { - this._basePath = defaultBasePath8; + this._basePath = defaultBasePath9; this._defaultHeaders = { "User-Agent": USER_AGENT }; this._useQuerystring = false; this.authentications = { @@ -33735,7 +34120,7 @@ var ReportApi = class { * @param options */ async reportCreate(reportCreateRequest, options = { headers: {} }) { - reportCreateRequest = deserializeIfNeeded7( + reportCreateRequest = deserializeIfNeeded8( reportCreateRequest, "ReportCreateRequest" ); @@ -33810,7 +34195,7 @@ var ReportApi = class { (resolve, reject) => { axios_default.request(localVarRequestOptions).then( (response) => { - handleSuccessfulResponse8( + handleSuccessfulResponse9( resolve, reject, response, @@ -33822,7 +34207,7 @@ var ReportApi = class { reject(error); return; } - if (handleErrorCodeResponse8( + if (handleErrorCodeResponse9( reject, error.response, 200, @@ -33830,7 +34215,7 @@ var ReportApi = class { )) { return; } - if (handleErrorRangeResponse8( + if (handleErrorRangeResponse9( reject, error.response, "4XX", @@ -33846,13 +34231,13 @@ var ReportApi = class { }); } }; -function deserializeIfNeeded7(obj, classname) { +function deserializeIfNeeded8(obj, classname) { if (obj !== null && obj !== void 0 && obj.constructor.name !== classname) { return ObjectSerializer.deserialize(obj, classname); } return obj; } -function handleSuccessfulResponse8(resolve, reject, response, returnType) { +function handleSuccessfulResponse9(resolve, reject, response, returnType) { let body = response.data; if (response.status && response.status >= 200 && response.status <= 299) { if (returnType) { @@ -33863,7 +34248,7 @@ function handleSuccessfulResponse8(resolve, reject, response, returnType) { reject(new HttpError(response, body, response.status)); } } -function handleErrorCodeResponse8(reject, response, code, returnType) { +function handleErrorCodeResponse9(reject, response, code, returnType) { if (response.status !== code) { return false; } @@ -33871,7 +34256,7 @@ function handleErrorCodeResponse8(reject, response, code, returnType) { reject(new HttpError(response, body, response.status)); return true; } -function handleErrorRangeResponse8(reject, response, code, returnType) { +function handleErrorRangeResponse9(reject, response, code, returnType) { let rangeCodeLeft = Number(code[0] + "00"); let rangeCodeRight = Number(code[0] + "99"); if (response.status >= rangeCodeLeft && response.status <= rangeCodeRight) { @@ -33883,10 +34268,10 @@ function handleErrorRangeResponse8(reject, response, code, returnType) { } // api/signatureRequestApi.ts -var defaultBasePath9 = "https://api.hellosign.com/v3"; +var defaultBasePath10 = "https://api.hellosign.com/v3"; var SignatureRequestApi = class { constructor(basePath) { - this._basePath = defaultBasePath9; + this._basePath = defaultBasePath10; this._defaultHeaders = { "User-Agent": USER_AGENT }; this._useQuerystring = false; this.authentications = { @@ -33940,7 +34325,7 @@ var SignatureRequestApi = class { * @param options */ async signatureRequestBulkCreateEmbeddedWithTemplate(signatureRequestBulkCreateEmbeddedWithTemplateRequest, options = { headers: {} }) { - signatureRequestBulkCreateEmbeddedWithTemplateRequest = deserializeIfNeeded8( + signatureRequestBulkCreateEmbeddedWithTemplateRequest = deserializeIfNeeded9( signatureRequestBulkCreateEmbeddedWithTemplateRequest, "SignatureRequestBulkCreateEmbeddedWithTemplateRequest" ); @@ -34015,7 +34400,7 @@ var SignatureRequestApi = class { (resolve, reject) => { axios_default.request(localVarRequestOptions).then( (response) => { - handleSuccessfulResponse9( + handleSuccessfulResponse10( resolve, reject, response, @@ -34027,7 +34412,7 @@ var SignatureRequestApi = class { reject(error); return; } - if (handleErrorCodeResponse9( + if (handleErrorCodeResponse10( reject, error.response, 200, @@ -34035,7 +34420,7 @@ var SignatureRequestApi = class { )) { return; } - if (handleErrorRangeResponse9( + if (handleErrorRangeResponse10( reject, error.response, "4XX", @@ -34058,7 +34443,7 @@ var SignatureRequestApi = class { * @param options */ async signatureRequestBulkSendWithTemplate(signatureRequestBulkSendWithTemplateRequest, options = { headers: {} }) { - signatureRequestBulkSendWithTemplateRequest = deserializeIfNeeded8( + signatureRequestBulkSendWithTemplateRequest = deserializeIfNeeded9( signatureRequestBulkSendWithTemplateRequest, "SignatureRequestBulkSendWithTemplateRequest" ); @@ -34138,7 +34523,7 @@ var SignatureRequestApi = class { (resolve, reject) => { axios_default.request(localVarRequestOptions).then( (response) => { - handleSuccessfulResponse9( + handleSuccessfulResponse10( resolve, reject, response, @@ -34150,7 +34535,7 @@ var SignatureRequestApi = class { reject(error); return; } - if (handleErrorCodeResponse9( + if (handleErrorCodeResponse10( reject, error.response, 200, @@ -34158,7 +34543,7 @@ var SignatureRequestApi = class { )) { return; } - if (handleErrorRangeResponse9( + if (handleErrorRangeResponse10( reject, error.response, "4XX", @@ -34239,14 +34624,14 @@ var SignatureRequestApi = class { return new Promise((resolve, reject) => { axios_default.request(localVarRequestOptions).then( (response) => { - handleSuccessfulResponse9(resolve, reject, response); + handleSuccessfulResponse10(resolve, reject, response); }, (error) => { if (error.response == null) { reject(error); return; } - if (handleErrorRangeResponse9( + if (handleErrorRangeResponse10( reject, error.response, "4XX", @@ -34268,7 +34653,7 @@ var SignatureRequestApi = class { * @param options */ async signatureRequestCreateEmbedded(signatureRequestCreateEmbeddedRequest, options = { headers: {} }) { - signatureRequestCreateEmbeddedRequest = deserializeIfNeeded8( + signatureRequestCreateEmbeddedRequest = deserializeIfNeeded9( signatureRequestCreateEmbeddedRequest, "SignatureRequestCreateEmbeddedRequest" ); @@ -34348,7 +34733,7 @@ var SignatureRequestApi = class { (resolve, reject) => { axios_default.request(localVarRequestOptions).then( (response) => { - handleSuccessfulResponse9( + handleSuccessfulResponse10( resolve, reject, response, @@ -34360,7 +34745,7 @@ var SignatureRequestApi = class { reject(error); return; } - if (handleErrorCodeResponse9( + if (handleErrorCodeResponse10( reject, error.response, 200, @@ -34368,7 +34753,7 @@ var SignatureRequestApi = class { )) { return; } - if (handleErrorRangeResponse9( + if (handleErrorRangeResponse10( reject, error.response, "4XX", @@ -34391,7 +34776,7 @@ var SignatureRequestApi = class { * @param options */ async signatureRequestCreateEmbeddedWithTemplate(signatureRequestCreateEmbeddedWithTemplateRequest, options = { headers: {} }) { - signatureRequestCreateEmbeddedWithTemplateRequest = deserializeIfNeeded8( + signatureRequestCreateEmbeddedWithTemplateRequest = deserializeIfNeeded9( signatureRequestCreateEmbeddedWithTemplateRequest, "SignatureRequestCreateEmbeddedWithTemplateRequest" ); @@ -34471,7 +34856,7 @@ var SignatureRequestApi = class { (resolve, reject) => { axios_default.request(localVarRequestOptions).then( (response) => { - handleSuccessfulResponse9( + handleSuccessfulResponse10( resolve, reject, response, @@ -34483,7 +34868,7 @@ var SignatureRequestApi = class { reject(error); return; } - if (handleErrorCodeResponse9( + if (handleErrorCodeResponse10( reject, error.response, 200, @@ -34491,7 +34876,7 @@ var SignatureRequestApi = class { )) { return; } - if (handleErrorRangeResponse9( + if (handleErrorRangeResponse10( reject, error.response, "4XX", @@ -34515,7 +34900,7 @@ var SignatureRequestApi = class { * @param options */ async signatureRequestEdit(signatureRequestId, signatureRequestEditRequest, options = { headers: {} }) { - signatureRequestEditRequest = deserializeIfNeeded8( + signatureRequestEditRequest = deserializeIfNeeded9( signatureRequestEditRequest, "SignatureRequestEditRequest" ); @@ -34603,7 +34988,7 @@ var SignatureRequestApi = class { (resolve, reject) => { axios_default.request(localVarRequestOptions).then( (response) => { - handleSuccessfulResponse9( + handleSuccessfulResponse10( resolve, reject, response, @@ -34615,7 +35000,7 @@ var SignatureRequestApi = class { reject(error); return; } - if (handleErrorCodeResponse9( + if (handleErrorCodeResponse10( reject, error.response, 200, @@ -34623,7 +35008,7 @@ var SignatureRequestApi = class { )) { return; } - if (handleErrorRangeResponse9( + if (handleErrorRangeResponse10( reject, error.response, "4XX", @@ -34647,7 +35032,7 @@ var SignatureRequestApi = class { * @param options */ async signatureRequestEditEmbedded(signatureRequestId, signatureRequestEditEmbeddedRequest, options = { headers: {} }) { - signatureRequestEditEmbeddedRequest = deserializeIfNeeded8( + signatureRequestEditEmbeddedRequest = deserializeIfNeeded9( signatureRequestEditEmbeddedRequest, "SignatureRequestEditEmbeddedRequest" ); @@ -34735,7 +35120,7 @@ var SignatureRequestApi = class { (resolve, reject) => { axios_default.request(localVarRequestOptions).then( (response) => { - handleSuccessfulResponse9( + handleSuccessfulResponse10( resolve, reject, response, @@ -34747,7 +35132,7 @@ var SignatureRequestApi = class { reject(error); return; } - if (handleErrorCodeResponse9( + if (handleErrorCodeResponse10( reject, error.response, 200, @@ -34755,7 +35140,7 @@ var SignatureRequestApi = class { )) { return; } - if (handleErrorRangeResponse9( + if (handleErrorRangeResponse10( reject, error.response, "4XX", @@ -34779,7 +35164,7 @@ var SignatureRequestApi = class { * @param options */ async signatureRequestEditEmbeddedWithTemplate(signatureRequestId, signatureRequestEditEmbeddedWithTemplateRequest, options = { headers: {} }) { - signatureRequestEditEmbeddedWithTemplateRequest = deserializeIfNeeded8( + signatureRequestEditEmbeddedWithTemplateRequest = deserializeIfNeeded9( signatureRequestEditEmbeddedWithTemplateRequest, "SignatureRequestEditEmbeddedWithTemplateRequest" ); @@ -34867,7 +35252,7 @@ var SignatureRequestApi = class { (resolve, reject) => { axios_default.request(localVarRequestOptions).then( (response) => { - handleSuccessfulResponse9( + handleSuccessfulResponse10( resolve, reject, response, @@ -34879,7 +35264,7 @@ var SignatureRequestApi = class { reject(error); return; } - if (handleErrorCodeResponse9( + if (handleErrorCodeResponse10( reject, error.response, 200, @@ -34887,7 +35272,7 @@ var SignatureRequestApi = class { )) { return; } - if (handleErrorRangeResponse9( + if (handleErrorRangeResponse10( reject, error.response, "4XX", @@ -34911,7 +35296,7 @@ var SignatureRequestApi = class { * @param options */ async signatureRequestEditWithTemplate(signatureRequestId, signatureRequestEditWithTemplateRequest, options = { headers: {} }) { - signatureRequestEditWithTemplateRequest = deserializeIfNeeded8( + signatureRequestEditWithTemplateRequest = deserializeIfNeeded9( signatureRequestEditWithTemplateRequest, "SignatureRequestEditWithTemplateRequest" ); @@ -34999,7 +35384,7 @@ var SignatureRequestApi = class { (resolve, reject) => { axios_default.request(localVarRequestOptions).then( (response) => { - handleSuccessfulResponse9( + handleSuccessfulResponse10( resolve, reject, response, @@ -35011,7 +35396,7 @@ var SignatureRequestApi = class { reject(error); return; } - if (handleErrorCodeResponse9( + if (handleErrorCodeResponse10( reject, error.response, 200, @@ -35019,7 +35404,7 @@ var SignatureRequestApi = class { )) { return; } - if (handleErrorRangeResponse9( + if (handleErrorRangeResponse10( reject, error.response, "4XX", @@ -35107,7 +35492,7 @@ var SignatureRequestApi = class { return new Promise((resolve, reject) => { axios_default.request(localVarRequestOptions).then( (response) => { - handleSuccessfulResponse9( + handleSuccessfulResponse10( resolve, reject, response, @@ -35119,7 +35504,7 @@ var SignatureRequestApi = class { reject(error); return; } - if (handleErrorCodeResponse9( + if (handleErrorCodeResponse10( reject, error.response, 200, @@ -35127,7 +35512,7 @@ var SignatureRequestApi = class { )) { return; } - if (handleErrorRangeResponse9( + if (handleErrorRangeResponse10( reject, error.response, "4XX", @@ -35208,7 +35593,7 @@ var SignatureRequestApi = class { (resolve, reject) => { axios_default.request(localVarRequestOptions).then( (response) => { - handleSuccessfulResponse9( + handleSuccessfulResponse10( resolve, reject, response, @@ -35220,7 +35605,7 @@ var SignatureRequestApi = class { reject(error); return; } - if (handleErrorCodeResponse9( + if (handleErrorCodeResponse10( reject, error.response, 200, @@ -35228,7 +35613,7 @@ var SignatureRequestApi = class { )) { return; } - if (handleErrorRangeResponse9( + if (handleErrorRangeResponse10( reject, error.response, "4XX", @@ -35316,7 +35701,7 @@ var SignatureRequestApi = class { return new Promise((resolve, reject) => { axios_default.request(localVarRequestOptions).then( (response) => { - handleSuccessfulResponse9( + handleSuccessfulResponse10( resolve, reject, response, @@ -35328,7 +35713,7 @@ var SignatureRequestApi = class { reject(error); return; } - if (handleErrorCodeResponse9( + if (handleErrorCodeResponse10( reject, error.response, 200, @@ -35336,7 +35721,7 @@ var SignatureRequestApi = class { )) { return; } - if (handleErrorRangeResponse9( + if (handleErrorRangeResponse10( reject, error.response, "4XX", @@ -35417,7 +35802,7 @@ var SignatureRequestApi = class { (resolve, reject) => { axios_default.request(localVarRequestOptions).then( (response) => { - handleSuccessfulResponse9( + handleSuccessfulResponse10( resolve, reject, response, @@ -35429,7 +35814,7 @@ var SignatureRequestApi = class { reject(error); return; } - if (handleErrorCodeResponse9( + if (handleErrorCodeResponse10( reject, error.response, 200, @@ -35437,7 +35822,7 @@ var SignatureRequestApi = class { )) { return; } - if (handleErrorRangeResponse9( + if (handleErrorRangeResponse10( reject, error.response, "4XX", @@ -35538,7 +35923,7 @@ var SignatureRequestApi = class { (resolve, reject) => { axios_default.request(localVarRequestOptions).then( (response) => { - handleSuccessfulResponse9( + handleSuccessfulResponse10( resolve, reject, response, @@ -35550,7 +35935,7 @@ var SignatureRequestApi = class { reject(error); return; } - if (handleErrorCodeResponse9( + if (handleErrorCodeResponse10( reject, error.response, 200, @@ -35558,7 +35943,7 @@ var SignatureRequestApi = class { )) { return; } - if (handleErrorRangeResponse9( + if (handleErrorRangeResponse10( reject, error.response, "4XX", @@ -35640,7 +36025,7 @@ var SignatureRequestApi = class { (resolve, reject) => { axios_default.request(localVarRequestOptions).then( (response) => { - handleSuccessfulResponse9( + handleSuccessfulResponse10( resolve, reject, response, @@ -35652,7 +36037,7 @@ var SignatureRequestApi = class { reject(error); return; } - if (handleErrorCodeResponse9( + if (handleErrorCodeResponse10( reject, error.response, 200, @@ -35660,7 +36045,7 @@ var SignatureRequestApi = class { )) { return; } - if (handleErrorRangeResponse9( + if (handleErrorRangeResponse10( reject, error.response, "4XX", @@ -35684,7 +36069,7 @@ var SignatureRequestApi = class { * @param options */ async signatureRequestRemind(signatureRequestId, signatureRequestRemindRequest, options = { headers: {} }) { - signatureRequestRemindRequest = deserializeIfNeeded8( + signatureRequestRemindRequest = deserializeIfNeeded9( signatureRequestRemindRequest, "SignatureRequestRemindRequest" ); @@ -35772,7 +36157,7 @@ var SignatureRequestApi = class { (resolve, reject) => { axios_default.request(localVarRequestOptions).then( (response) => { - handleSuccessfulResponse9( + handleSuccessfulResponse10( resolve, reject, response, @@ -35784,7 +36169,7 @@ var SignatureRequestApi = class { reject(error); return; } - if (handleErrorCodeResponse9( + if (handleErrorCodeResponse10( reject, error.response, 200, @@ -35792,7 +36177,7 @@ var SignatureRequestApi = class { )) { return; } - if (handleErrorRangeResponse9( + if (handleErrorRangeResponse10( reject, error.response, "4XX", @@ -35868,14 +36253,14 @@ var SignatureRequestApi = class { return new Promise((resolve, reject) => { axios_default.request(localVarRequestOptions).then( (response) => { - handleSuccessfulResponse9(resolve, reject, response); + handleSuccessfulResponse10(resolve, reject, response); }, (error) => { if (error.response == null) { reject(error); return; } - if (handleErrorRangeResponse9( + if (handleErrorRangeResponse10( reject, error.response, "4XX", @@ -35897,7 +36282,7 @@ var SignatureRequestApi = class { * @param options */ async signatureRequestSend(signatureRequestSendRequest, options = { headers: {} }) { - signatureRequestSendRequest = deserializeIfNeeded8( + signatureRequestSendRequest = deserializeIfNeeded9( signatureRequestSendRequest, "SignatureRequestSendRequest" ); @@ -35977,7 +36362,7 @@ var SignatureRequestApi = class { (resolve, reject) => { axios_default.request(localVarRequestOptions).then( (response) => { - handleSuccessfulResponse9( + handleSuccessfulResponse10( resolve, reject, response, @@ -35989,7 +36374,7 @@ var SignatureRequestApi = class { reject(error); return; } - if (handleErrorCodeResponse9( + if (handleErrorCodeResponse10( reject, error.response, 200, @@ -35997,7 +36382,7 @@ var SignatureRequestApi = class { )) { return; } - if (handleErrorRangeResponse9( + if (handleErrorRangeResponse10( reject, error.response, "4XX", @@ -36020,7 +36405,7 @@ var SignatureRequestApi = class { * @param options */ async signatureRequestSendWithTemplate(signatureRequestSendWithTemplateRequest, options = { headers: {} }) { - signatureRequestSendWithTemplateRequest = deserializeIfNeeded8( + signatureRequestSendWithTemplateRequest = deserializeIfNeeded9( signatureRequestSendWithTemplateRequest, "SignatureRequestSendWithTemplateRequest" ); @@ -36100,7 +36485,7 @@ var SignatureRequestApi = class { (resolve, reject) => { axios_default.request(localVarRequestOptions).then( (response) => { - handleSuccessfulResponse9( + handleSuccessfulResponse10( resolve, reject, response, @@ -36112,7 +36497,7 @@ var SignatureRequestApi = class { reject(error); return; } - if (handleErrorCodeResponse9( + if (handleErrorCodeResponse10( reject, error.response, 200, @@ -36120,7 +36505,7 @@ var SignatureRequestApi = class { )) { return; } - if (handleErrorRangeResponse9( + if (handleErrorRangeResponse10( reject, error.response, "4XX", @@ -36144,7 +36529,7 @@ var SignatureRequestApi = class { * @param options */ async signatureRequestUpdate(signatureRequestId, signatureRequestUpdateRequest, options = { headers: {} }) { - signatureRequestUpdateRequest = deserializeIfNeeded8( + signatureRequestUpdateRequest = deserializeIfNeeded9( signatureRequestUpdateRequest, "SignatureRequestUpdateRequest" ); @@ -36232,7 +36617,7 @@ var SignatureRequestApi = class { (resolve, reject) => { axios_default.request(localVarRequestOptions).then( (response) => { - handleSuccessfulResponse9( + handleSuccessfulResponse10( resolve, reject, response, @@ -36244,7 +36629,7 @@ var SignatureRequestApi = class { reject(error); return; } - if (handleErrorCodeResponse9( + if (handleErrorCodeResponse10( reject, error.response, 200, @@ -36252,7 +36637,7 @@ var SignatureRequestApi = class { )) { return; } - if (handleErrorRangeResponse9( + if (handleErrorRangeResponse10( reject, error.response, "4XX", @@ -36268,13 +36653,13 @@ var SignatureRequestApi = class { }); } }; -function deserializeIfNeeded8(obj, classname) { +function deserializeIfNeeded9(obj, classname) { if (obj !== null && obj !== void 0 && obj.constructor.name !== classname) { return ObjectSerializer.deserialize(obj, classname); } return obj; } -function handleSuccessfulResponse9(resolve, reject, response, returnType) { +function handleSuccessfulResponse10(resolve, reject, response, returnType) { let body = response.data; if (response.status && response.status >= 200 && response.status <= 299) { if (returnType) { @@ -36285,7 +36670,7 @@ function handleSuccessfulResponse9(resolve, reject, response, returnType) { reject(new HttpError(response, body, response.status)); } } -function handleErrorCodeResponse9(reject, response, code, returnType) { +function handleErrorCodeResponse10(reject, response, code, returnType) { if (response.status !== code) { return false; } @@ -36293,7 +36678,7 @@ function handleErrorCodeResponse9(reject, response, code, returnType) { reject(new HttpError(response, body, response.status)); return true; } -function handleErrorRangeResponse9(reject, response, code, returnType) { +function handleErrorRangeResponse10(reject, response, code, returnType) { let rangeCodeLeft = Number(code[0] + "00"); let rangeCodeRight = Number(code[0] + "99"); if (response.status >= rangeCodeLeft && response.status <= rangeCodeRight) { @@ -36305,10 +36690,10 @@ function handleErrorRangeResponse9(reject, response, code, returnType) { } // api/teamApi.ts -var defaultBasePath10 = "https://api.hellosign.com/v3"; +var defaultBasePath11 = "https://api.hellosign.com/v3"; var TeamApi = class { constructor(basePath) { - this._basePath = defaultBasePath10; + this._basePath = defaultBasePath11; this._defaultHeaders = { "User-Agent": USER_AGENT }; this._useQuerystring = false; this.authentications = { @@ -36363,7 +36748,7 @@ var TeamApi = class { * @param options */ async teamAddMember(teamAddMemberRequest, teamId, options = { headers: {} }) { - teamAddMemberRequest = deserializeIfNeeded9( + teamAddMemberRequest = deserializeIfNeeded10( teamAddMemberRequest, "TeamAddMemberRequest" ); @@ -36448,7 +36833,7 @@ var TeamApi = class { return new Promise((resolve, reject) => { axios_default.request(localVarRequestOptions).then( (response) => { - handleSuccessfulResponse10( + handleSuccessfulResponse11( resolve, reject, response, @@ -36460,7 +36845,7 @@ var TeamApi = class { reject(error); return; } - if (handleErrorCodeResponse10( + if (handleErrorCodeResponse11( reject, error.response, 200, @@ -36468,7 +36853,7 @@ var TeamApi = class { )) { return; } - if (handleErrorRangeResponse10( + if (handleErrorRangeResponse11( reject, error.response, "4XX", @@ -36490,7 +36875,7 @@ var TeamApi = class { * @param options */ async teamCreate(teamCreateRequest, options = { headers: {} }) { - teamCreateRequest = deserializeIfNeeded9( + teamCreateRequest = deserializeIfNeeded10( teamCreateRequest, "TeamCreateRequest" ); @@ -36566,7 +36951,7 @@ var TeamApi = class { return new Promise((resolve, reject) => { axios_default.request(localVarRequestOptions).then( (response) => { - handleSuccessfulResponse10( + handleSuccessfulResponse11( resolve, reject, response, @@ -36578,7 +36963,7 @@ var TeamApi = class { reject(error); return; } - if (handleErrorCodeResponse10( + if (handleErrorCodeResponse11( reject, error.response, 200, @@ -36586,7 +36971,7 @@ var TeamApi = class { )) { return; } - if (handleErrorRangeResponse10( + if (handleErrorRangeResponse11( reject, error.response, "4XX", @@ -36657,14 +37042,14 @@ var TeamApi = class { return new Promise((resolve, reject) => { axios_default.request(localVarRequestOptions).then( (response) => { - handleSuccessfulResponse10(resolve, reject, response); + handleSuccessfulResponse11(resolve, reject, response); }, (error) => { if (error.response == null) { reject(error); return; } - if (handleErrorRangeResponse10( + if (handleErrorRangeResponse11( reject, error.response, "4XX", @@ -36735,7 +37120,7 @@ var TeamApi = class { return new Promise((resolve, reject) => { axios_default.request(localVarRequestOptions).then( (response) => { - handleSuccessfulResponse10( + handleSuccessfulResponse11( resolve, reject, response, @@ -36747,7 +37132,7 @@ var TeamApi = class { reject(error); return; } - if (handleErrorCodeResponse10( + if (handleErrorCodeResponse11( reject, error.response, 200, @@ -36755,7 +37140,7 @@ var TeamApi = class { )) { return; } - if (handleErrorRangeResponse10( + if (handleErrorRangeResponse11( reject, error.response, "4XX", @@ -36834,7 +37219,7 @@ var TeamApi = class { (resolve, reject) => { axios_default.request(localVarRequestOptions).then( (response) => { - handleSuccessfulResponse10( + handleSuccessfulResponse11( resolve, reject, response, @@ -36846,7 +37231,7 @@ var TeamApi = class { reject(error); return; } - if (handleErrorCodeResponse10( + if (handleErrorCodeResponse11( reject, error.response, 200, @@ -36854,7 +37239,7 @@ var TeamApi = class { )) { return; } - if (handleErrorRangeResponse10( + if (handleErrorRangeResponse11( reject, error.response, "4XX", @@ -36934,7 +37319,7 @@ var TeamApi = class { (resolve, reject) => { axios_default.request(localVarRequestOptions).then( (response) => { - handleSuccessfulResponse10( + handleSuccessfulResponse11( resolve, reject, response, @@ -36946,7 +37331,7 @@ var TeamApi = class { reject(error); return; } - if (handleErrorCodeResponse10( + if (handleErrorCodeResponse11( reject, error.response, 200, @@ -36954,7 +37339,7 @@ var TeamApi = class { )) { return; } - if (handleErrorRangeResponse10( + if (handleErrorRangeResponse11( reject, error.response, "4XX", @@ -37050,7 +37435,7 @@ var TeamApi = class { (resolve, reject) => { axios_default.request(localVarRequestOptions).then( (response) => { - handleSuccessfulResponse10( + handleSuccessfulResponse11( resolve, reject, response, @@ -37062,7 +37447,7 @@ var TeamApi = class { reject(error); return; } - if (handleErrorCodeResponse10( + if (handleErrorCodeResponse11( reject, error.response, 200, @@ -37070,7 +37455,7 @@ var TeamApi = class { )) { return; } - if (handleErrorRangeResponse10( + if (handleErrorRangeResponse11( reject, error.response, "4XX", @@ -37093,7 +37478,7 @@ var TeamApi = class { * @param options */ async teamRemoveMember(teamRemoveMemberRequest, options = { headers: {} }) { - teamRemoveMemberRequest = deserializeIfNeeded9( + teamRemoveMemberRequest = deserializeIfNeeded10( teamRemoveMemberRequest, "TeamRemoveMemberRequest" ); @@ -37172,7 +37557,7 @@ var TeamApi = class { return new Promise((resolve, reject) => { axios_default.request(localVarRequestOptions).then( (response) => { - handleSuccessfulResponse10( + handleSuccessfulResponse11( resolve, reject, response, @@ -37184,7 +37569,7 @@ var TeamApi = class { reject(error); return; } - if (handleErrorCodeResponse10( + if (handleErrorCodeResponse11( reject, error.response, 201, @@ -37192,7 +37577,7 @@ var TeamApi = class { )) { return; } - if (handleErrorRangeResponse10( + if (handleErrorRangeResponse11( reject, error.response, "4XX", @@ -37287,7 +37672,7 @@ var TeamApi = class { (resolve, reject) => { axios_default.request(localVarRequestOptions).then( (response) => { - handleSuccessfulResponse10( + handleSuccessfulResponse11( resolve, reject, response, @@ -37299,7 +37684,7 @@ var TeamApi = class { reject(error); return; } - if (handleErrorCodeResponse10( + if (handleErrorCodeResponse11( reject, error.response, 200, @@ -37307,7 +37692,7 @@ var TeamApi = class { )) { return; } - if (handleErrorRangeResponse10( + if (handleErrorRangeResponse11( reject, error.response, "4XX", @@ -37330,7 +37715,7 @@ var TeamApi = class { * @param options */ async teamUpdate(teamUpdateRequest, options = { headers: {} }) { - teamUpdateRequest = deserializeIfNeeded9( + teamUpdateRequest = deserializeIfNeeded10( teamUpdateRequest, "TeamUpdateRequest" ); @@ -37406,7 +37791,7 @@ var TeamApi = class { return new Promise((resolve, reject) => { axios_default.request(localVarRequestOptions).then( (response) => { - handleSuccessfulResponse10( + handleSuccessfulResponse11( resolve, reject, response, @@ -37418,7 +37803,7 @@ var TeamApi = class { reject(error); return; } - if (handleErrorCodeResponse10( + if (handleErrorCodeResponse11( reject, error.response, 200, @@ -37426,7 +37811,7 @@ var TeamApi = class { )) { return; } - if (handleErrorRangeResponse10( + if (handleErrorRangeResponse11( reject, error.response, "4XX", @@ -37441,13 +37826,13 @@ var TeamApi = class { }); } }; -function deserializeIfNeeded9(obj, classname) { +function deserializeIfNeeded10(obj, classname) { if (obj !== null && obj !== void 0 && obj.constructor.name !== classname) { return ObjectSerializer.deserialize(obj, classname); } return obj; } -function handleSuccessfulResponse10(resolve, reject, response, returnType) { +function handleSuccessfulResponse11(resolve, reject, response, returnType) { let body = response.data; if (response.status && response.status >= 200 && response.status <= 299) { if (returnType) { @@ -37458,7 +37843,7 @@ function handleSuccessfulResponse10(resolve, reject, response, returnType) { reject(new HttpError(response, body, response.status)); } } -function handleErrorCodeResponse10(reject, response, code, returnType) { +function handleErrorCodeResponse11(reject, response, code, returnType) { if (response.status !== code) { return false; } @@ -37466,7 +37851,7 @@ function handleErrorCodeResponse10(reject, response, code, returnType) { reject(new HttpError(response, body, response.status)); return true; } -function handleErrorRangeResponse10(reject, response, code, returnType) { +function handleErrorRangeResponse11(reject, response, code, returnType) { let rangeCodeLeft = Number(code[0] + "00"); let rangeCodeRight = Number(code[0] + "99"); if (response.status >= rangeCodeLeft && response.status <= rangeCodeRight) { @@ -37478,10 +37863,10 @@ function handleErrorRangeResponse10(reject, response, code, returnType) { } // api/templateApi.ts -var defaultBasePath11 = "https://api.hellosign.com/v3"; +var defaultBasePath12 = "https://api.hellosign.com/v3"; var TemplateApi = class { constructor(basePath) { - this._basePath = defaultBasePath11; + this._basePath = defaultBasePath12; this._defaultHeaders = { "User-Agent": USER_AGENT }; this._useQuerystring = false; this.authentications = { @@ -37536,7 +37921,7 @@ var TemplateApi = class { * @param options */ async templateAddUser(templateId, templateAddUserRequest, options = { headers: {} }) { - templateAddUserRequest = deserializeIfNeeded10( + templateAddUserRequest = deserializeIfNeeded11( templateAddUserRequest, "TemplateAddUserRequest" ); @@ -37624,7 +38009,7 @@ var TemplateApi = class { (resolve, reject) => { axios_default.request(localVarRequestOptions).then( (response) => { - handleSuccessfulResponse11( + handleSuccessfulResponse12( resolve, reject, response, @@ -37636,7 +38021,7 @@ var TemplateApi = class { reject(error); return; } - if (handleErrorCodeResponse11( + if (handleErrorCodeResponse12( reject, error.response, 200, @@ -37644,7 +38029,7 @@ var TemplateApi = class { )) { return; } - if (handleErrorRangeResponse11( + if (handleErrorRangeResponse12( reject, error.response, "4XX", @@ -37667,7 +38052,7 @@ var TemplateApi = class { * @param options */ async templateCreate(templateCreateRequest, options = { headers: {} }) { - templateCreateRequest = deserializeIfNeeded10( + templateCreateRequest = deserializeIfNeeded11( templateCreateRequest, "TemplateCreateRequest" ); @@ -37747,7 +38132,7 @@ var TemplateApi = class { (resolve, reject) => { axios_default.request(localVarRequestOptions).then( (response) => { - handleSuccessfulResponse11( + handleSuccessfulResponse12( resolve, reject, response, @@ -37759,7 +38144,7 @@ var TemplateApi = class { reject(error); return; } - if (handleErrorCodeResponse11( + if (handleErrorCodeResponse12( reject, error.response, 200, @@ -37767,7 +38152,7 @@ var TemplateApi = class { )) { return; } - if (handleErrorRangeResponse11( + if (handleErrorRangeResponse12( reject, error.response, "4XX", @@ -37790,7 +38175,7 @@ var TemplateApi = class { * @param options */ async templateCreateEmbeddedDraft(templateCreateEmbeddedDraftRequest, options = { headers: {} }) { - templateCreateEmbeddedDraftRequest = deserializeIfNeeded10( + templateCreateEmbeddedDraftRequest = deserializeIfNeeded11( templateCreateEmbeddedDraftRequest, "TemplateCreateEmbeddedDraftRequest" ); @@ -37870,7 +38255,7 @@ var TemplateApi = class { (resolve, reject) => { axios_default.request(localVarRequestOptions).then( (response) => { - handleSuccessfulResponse11( + handleSuccessfulResponse12( resolve, reject, response, @@ -37882,7 +38267,7 @@ var TemplateApi = class { reject(error); return; } - if (handleErrorCodeResponse11( + if (handleErrorCodeResponse12( reject, error.response, 200, @@ -37890,7 +38275,7 @@ var TemplateApi = class { )) { return; } - if (handleErrorRangeResponse11( + if (handleErrorRangeResponse12( reject, error.response, "4XX", @@ -37971,14 +38356,14 @@ var TemplateApi = class { return new Promise((resolve, reject) => { axios_default.request(localVarRequestOptions).then( (response) => { - handleSuccessfulResponse11(resolve, reject, response); + handleSuccessfulResponse12(resolve, reject, response); }, (error) => { if (error.response == null) { reject(error); return; } - if (handleErrorRangeResponse11( + if (handleErrorRangeResponse12( reject, error.response, "4XX", @@ -38065,7 +38450,7 @@ var TemplateApi = class { return new Promise((resolve, reject) => { axios_default.request(localVarRequestOptions).then( (response) => { - handleSuccessfulResponse11( + handleSuccessfulResponse12( resolve, reject, response, @@ -38077,7 +38462,7 @@ var TemplateApi = class { reject(error); return; } - if (handleErrorCodeResponse11( + if (handleErrorCodeResponse12( reject, error.response, 200, @@ -38085,7 +38470,7 @@ var TemplateApi = class { )) { return; } - if (handleErrorRangeResponse11( + if (handleErrorRangeResponse12( reject, error.response, "4XX", @@ -38166,7 +38551,7 @@ var TemplateApi = class { (resolve, reject) => { axios_default.request(localVarRequestOptions).then( (response) => { - handleSuccessfulResponse11( + handleSuccessfulResponse12( resolve, reject, response, @@ -38178,7 +38563,7 @@ var TemplateApi = class { reject(error); return; } - if (handleErrorCodeResponse11( + if (handleErrorCodeResponse12( reject, error.response, 200, @@ -38186,7 +38571,7 @@ var TemplateApi = class { )) { return; } - if (handleErrorRangeResponse11( + if (handleErrorRangeResponse12( reject, error.response, "4XX", @@ -38274,7 +38659,7 @@ var TemplateApi = class { return new Promise((resolve, reject) => { axios_default.request(localVarRequestOptions).then( (response) => { - handleSuccessfulResponse11( + handleSuccessfulResponse12( resolve, reject, response, @@ -38286,7 +38671,7 @@ var TemplateApi = class { reject(error); return; } - if (handleErrorCodeResponse11( + if (handleErrorCodeResponse12( reject, error.response, 200, @@ -38294,7 +38679,7 @@ var TemplateApi = class { )) { return; } - if (handleErrorRangeResponse11( + if (handleErrorRangeResponse12( reject, error.response, "4XX", @@ -38375,7 +38760,7 @@ var TemplateApi = class { (resolve, reject) => { axios_default.request(localVarRequestOptions).then( (response) => { - handleSuccessfulResponse11( + handleSuccessfulResponse12( resolve, reject, response, @@ -38387,7 +38772,7 @@ var TemplateApi = class { reject(error); return; } - if (handleErrorCodeResponse11( + if (handleErrorCodeResponse12( reject, error.response, 200, @@ -38395,7 +38780,7 @@ var TemplateApi = class { )) { return; } - if (handleErrorRangeResponse11( + if (handleErrorRangeResponse12( reject, error.response, "4XX", @@ -38496,7 +38881,7 @@ var TemplateApi = class { (resolve, reject) => { axios_default.request(localVarRequestOptions).then( (response) => { - handleSuccessfulResponse11( + handleSuccessfulResponse12( resolve, reject, response, @@ -38508,7 +38893,7 @@ var TemplateApi = class { reject(error); return; } - if (handleErrorCodeResponse11( + if (handleErrorCodeResponse12( reject, error.response, 200, @@ -38516,7 +38901,7 @@ var TemplateApi = class { )) { return; } - if (handleErrorRangeResponse11( + if (handleErrorRangeResponse12( reject, error.response, "4XX", @@ -38540,7 +38925,7 @@ var TemplateApi = class { * @param options */ async templateRemoveUser(templateId, templateRemoveUserRequest, options = { headers: {} }) { - templateRemoveUserRequest = deserializeIfNeeded10( + templateRemoveUserRequest = deserializeIfNeeded11( templateRemoveUserRequest, "TemplateRemoveUserRequest" ); @@ -38628,7 +39013,7 @@ var TemplateApi = class { (resolve, reject) => { axios_default.request(localVarRequestOptions).then( (response) => { - handleSuccessfulResponse11( + handleSuccessfulResponse12( resolve, reject, response, @@ -38640,7 +39025,7 @@ var TemplateApi = class { reject(error); return; } - if (handleErrorCodeResponse11( + if (handleErrorCodeResponse12( reject, error.response, 200, @@ -38648,7 +39033,7 @@ var TemplateApi = class { )) { return; } - if (handleErrorRangeResponse11( + if (handleErrorRangeResponse12( reject, error.response, "4XX", @@ -38672,7 +39057,7 @@ var TemplateApi = class { * @param options */ async templateUpdateFiles(templateId, templateUpdateFilesRequest, options = { headers: {} }) { - templateUpdateFilesRequest = deserializeIfNeeded10( + templateUpdateFilesRequest = deserializeIfNeeded11( templateUpdateFilesRequest, "TemplateUpdateFilesRequest" ); @@ -38760,7 +39145,7 @@ var TemplateApi = class { (resolve, reject) => { axios_default.request(localVarRequestOptions).then( (response) => { - handleSuccessfulResponse11( + handleSuccessfulResponse12( resolve, reject, response, @@ -38772,7 +39157,7 @@ var TemplateApi = class { reject(error); return; } - if (handleErrorCodeResponse11( + if (handleErrorCodeResponse12( reject, error.response, 200, @@ -38780,7 +39165,7 @@ var TemplateApi = class { )) { return; } - if (handleErrorRangeResponse11( + if (handleErrorRangeResponse12( reject, error.response, "4XX", @@ -38796,13 +39181,13 @@ var TemplateApi = class { }); } }; -function deserializeIfNeeded10(obj, classname) { +function deserializeIfNeeded11(obj, classname) { if (obj !== null && obj !== void 0 && obj.constructor.name !== classname) { return ObjectSerializer.deserialize(obj, classname); } return obj; } -function handleSuccessfulResponse11(resolve, reject, response, returnType) { +function handleSuccessfulResponse12(resolve, reject, response, returnType) { let body = response.data; if (response.status && response.status >= 200 && response.status <= 299) { if (returnType) { @@ -38813,7 +39198,7 @@ function handleSuccessfulResponse11(resolve, reject, response, returnType) { reject(new HttpError(response, body, response.status)); } } -function handleErrorCodeResponse11(reject, response, code, returnType) { +function handleErrorCodeResponse12(reject, response, code, returnType) { if (response.status !== code) { return false; } @@ -38821,7 +39206,7 @@ function handleErrorCodeResponse11(reject, response, code, returnType) { reject(new HttpError(response, body, response.status)); return true; } -function handleErrorRangeResponse11(reject, response, code, returnType) { +function handleErrorRangeResponse12(reject, response, code, returnType) { let rangeCodeLeft = Number(code[0] + "00"); let rangeCodeRight = Number(code[0] + "99"); if (response.status >= rangeCodeLeft && response.status <= rangeCodeRight) { @@ -38833,10 +39218,10 @@ function handleErrorRangeResponse11(reject, response, code, returnType) { } // api/unclaimedDraftApi.ts -var defaultBasePath12 = "https://api.hellosign.com/v3"; +var defaultBasePath13 = "https://api.hellosign.com/v3"; var UnclaimedDraftApi = class { constructor(basePath) { - this._basePath = defaultBasePath12; + this._basePath = defaultBasePath13; this._defaultHeaders = { "User-Agent": USER_AGENT }; this._useQuerystring = false; this.authentications = { @@ -38890,7 +39275,7 @@ var UnclaimedDraftApi = class { * @param options */ async unclaimedDraftCreate(unclaimedDraftCreateRequest, options = { headers: {} }) { - unclaimedDraftCreateRequest = deserializeIfNeeded11( + unclaimedDraftCreateRequest = deserializeIfNeeded12( unclaimedDraftCreateRequest, "UnclaimedDraftCreateRequest" ); @@ -38970,7 +39355,7 @@ var UnclaimedDraftApi = class { (resolve, reject) => { axios_default.request(localVarRequestOptions).then( (response) => { - handleSuccessfulResponse12( + handleSuccessfulResponse13( resolve, reject, response, @@ -38982,7 +39367,7 @@ var UnclaimedDraftApi = class { reject(error); return; } - if (handleErrorCodeResponse12( + if (handleErrorCodeResponse13( reject, error.response, 200, @@ -38990,7 +39375,7 @@ var UnclaimedDraftApi = class { )) { return; } - if (handleErrorRangeResponse12( + if (handleErrorRangeResponse13( reject, error.response, "4XX", @@ -39013,7 +39398,7 @@ var UnclaimedDraftApi = class { * @param options */ async unclaimedDraftCreateEmbedded(unclaimedDraftCreateEmbeddedRequest, options = { headers: {} }) { - unclaimedDraftCreateEmbeddedRequest = deserializeIfNeeded11( + unclaimedDraftCreateEmbeddedRequest = deserializeIfNeeded12( unclaimedDraftCreateEmbeddedRequest, "UnclaimedDraftCreateEmbeddedRequest" ); @@ -39093,7 +39478,7 @@ var UnclaimedDraftApi = class { (resolve, reject) => { axios_default.request(localVarRequestOptions).then( (response) => { - handleSuccessfulResponse12( + handleSuccessfulResponse13( resolve, reject, response, @@ -39105,7 +39490,7 @@ var UnclaimedDraftApi = class { reject(error); return; } - if (handleErrorCodeResponse12( + if (handleErrorCodeResponse13( reject, error.response, 200, @@ -39113,7 +39498,7 @@ var UnclaimedDraftApi = class { )) { return; } - if (handleErrorRangeResponse12( + if (handleErrorRangeResponse13( reject, error.response, "4XX", @@ -39136,7 +39521,7 @@ var UnclaimedDraftApi = class { * @param options */ async unclaimedDraftCreateEmbeddedWithTemplate(unclaimedDraftCreateEmbeddedWithTemplateRequest, options = { headers: {} }) { - unclaimedDraftCreateEmbeddedWithTemplateRequest = deserializeIfNeeded11( + unclaimedDraftCreateEmbeddedWithTemplateRequest = deserializeIfNeeded12( unclaimedDraftCreateEmbeddedWithTemplateRequest, "UnclaimedDraftCreateEmbeddedWithTemplateRequest" ); @@ -39216,7 +39601,7 @@ var UnclaimedDraftApi = class { (resolve, reject) => { axios_default.request(localVarRequestOptions).then( (response) => { - handleSuccessfulResponse12( + handleSuccessfulResponse13( resolve, reject, response, @@ -39228,7 +39613,7 @@ var UnclaimedDraftApi = class { reject(error); return; } - if (handleErrorCodeResponse12( + if (handleErrorCodeResponse13( reject, error.response, 200, @@ -39236,7 +39621,7 @@ var UnclaimedDraftApi = class { )) { return; } - if (handleErrorRangeResponse12( + if (handleErrorRangeResponse13( reject, error.response, "4XX", @@ -39260,7 +39645,7 @@ var UnclaimedDraftApi = class { * @param options */ async unclaimedDraftEditAndResend(signatureRequestId, unclaimedDraftEditAndResendRequest, options = { headers: {} }) { - unclaimedDraftEditAndResendRequest = deserializeIfNeeded11( + unclaimedDraftEditAndResendRequest = deserializeIfNeeded12( unclaimedDraftEditAndResendRequest, "UnclaimedDraftEditAndResendRequest" ); @@ -39348,7 +39733,7 @@ var UnclaimedDraftApi = class { (resolve, reject) => { axios_default.request(localVarRequestOptions).then( (response) => { - handleSuccessfulResponse12( + handleSuccessfulResponse13( resolve, reject, response, @@ -39360,7 +39745,7 @@ var UnclaimedDraftApi = class { reject(error); return; } - if (handleErrorCodeResponse12( + if (handleErrorCodeResponse13( reject, error.response, 200, @@ -39368,7 +39753,7 @@ var UnclaimedDraftApi = class { )) { return; } - if (handleErrorRangeResponse12( + if (handleErrorRangeResponse13( reject, error.response, "4XX", @@ -39384,13 +39769,13 @@ var UnclaimedDraftApi = class { }); } }; -function deserializeIfNeeded11(obj, classname) { +function deserializeIfNeeded12(obj, classname) { if (obj !== null && obj !== void 0 && obj.constructor.name !== classname) { return ObjectSerializer.deserialize(obj, classname); } return obj; } -function handleSuccessfulResponse12(resolve, reject, response, returnType) { +function handleSuccessfulResponse13(resolve, reject, response, returnType) { let body = response.data; if (response.status && response.status >= 200 && response.status <= 299) { if (returnType) { @@ -39401,7 +39786,7 @@ function handleSuccessfulResponse12(resolve, reject, response, returnType) { reject(new HttpError(response, body, response.status)); } } -function handleErrorCodeResponse12(reject, response, code, returnType) { +function handleErrorCodeResponse13(reject, response, code, returnType) { if (response.status !== code) { return false; } @@ -39409,7 +39794,7 @@ function handleErrorCodeResponse12(reject, response, code, returnType) { reject(new HttpError(response, body, response.status)); return true; } -function handleErrorRangeResponse12(reject, response, code, returnType) { +function handleErrorRangeResponse13(reject, response, code, returnType) { let rangeCodeLeft = Number(code[0] + "00"); let rangeCodeRight = Number(code[0] + "99"); if (response.status >= rangeCodeLeft && response.status <= rangeCodeRight) { @@ -39497,6 +39882,7 @@ var APIS = [ AccountApi, ApiAppApi, BulkSendJobApi, + DocumentApi, EmbeddedApi, FaxApi, FaxLineApi, @@ -39539,6 +39925,10 @@ var APIS = [ BulkSendJobListResponse, BulkSendJobResponse, BulkSendJobSendResponse, + DocumentApi, + DocumentFieldDetectionRequest, + DocumentFieldDetectionResponse, + DocumentFieldDetectionResponseDetectionResult, EmbeddedApi, EmbeddedEditUrlRequest, EmbeddedEditUrlResponse, diff --git a/sdks/node/docs/api/DocumentApi.md b/sdks/node/docs/api/DocumentApi.md new file mode 100644 index 000000000..75152c6a3 --- /dev/null +++ b/sdks/node/docs/api/DocumentApi.md @@ -0,0 +1,69 @@ +# DocumentApi + +All URIs are relative to https://api.hellosign.com/v3. + +| Method | HTTP request | Description | +| ------------- | ------------- | ------------- | +| [**documentDetectFields()**](DocumentApi.md#documentDetectFields) | **POST** /document/detect_fields | Detect Document Fields | + + +## `documentDetectFields()` + +```typescript +documentDetectFields(documentFieldDetectionRequest: DocumentFieldDetectionRequest): DocumentFieldDetectionResponse +``` + +Detect Document Fields + +Detects form fields in a PDF document using either PDF form annotations or Dropbox Sign text tags. + +### TypeScript Example + +```typescript +import * as fs from 'fs'; +import api from "@dropbox/sign" +import models from "@dropbox/sign" + +const apiCaller = new api.DocumentApi(); +apiCaller.username = "YOUR_API_KEY"; +// apiCaller.accessToken = "YOUR_ACCESS_TOKEN"; + +const documentFieldDetectionRequest: models.DocumentFieldDetectionRequest = { + detectionMode: "annotations", + file: fs.createReadStream("./example_document.pdf"), + pageRange: "all", +}; + +apiCaller.documentDetectFields( + documentFieldDetectionRequest, +).then(response => { + console.log(response.body); +}).catch(error => { + console.log("Exception when calling DocumentApi#documentDetectFields:"); + console.log(error.body); +}); + +``` + +### Parameters + +|Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **documentFieldDetectionRequest** | [**DocumentFieldDetectionRequest**](../model/DocumentFieldDetectionRequest.md)| | | + +### Return type + +[**DocumentFieldDetectionResponse**](../model/DocumentFieldDetectionResponse.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) diff --git a/sdks/node/docs/model/DocumentFieldDetectionRequest.md b/sdks/node/docs/model/DocumentFieldDetectionRequest.md new file mode 100644 index 000000000..9460db65c --- /dev/null +++ b/sdks/node/docs/model/DocumentFieldDetectionRequest.md @@ -0,0 +1,14 @@ +# # DocumentFieldDetectionRequest + + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +| `detectionMode`*_required_ | [```DocumentFieldDetectionRequestDetectionMode```](DocumentFieldDetectionRequestDetectionMode.md) | | | +| `file` | ```RequestFile``` | The PDF file to analyze.

This endpoint requires either `file` or `file_url`, but not both. | | +| `fileUrl` | ```string``` | The URL of the PDF file to analyze.

This endpoint requires either `file` or `file_url`, but not both. | | +| `pageRange` | ```string``` | The zero-based page indexes to analyze. Accepts `all`, individual pages, inclusive ranges, or comma-separated combinations, such as `0-2,5,7-9`. Defaults to `all`. | | + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/sdks/node/docs/model/DocumentFieldDetectionRequestDetectionMode.md b/sdks/node/docs/model/DocumentFieldDetectionRequestDetectionMode.md new file mode 100644 index 000000000..bb29fc02e --- /dev/null +++ b/sdks/node/docs/model/DocumentFieldDetectionRequestDetectionMode.md @@ -0,0 +1,10 @@ +# # DocumentFieldDetectionRequestDetectionMode + +The field detection method to use. Set to `annotations` to detect PDF form annotations or `text_tags` to detect Dropbox Sign text tags. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/sdks/node/docs/model/DocumentFieldDetectionResponse.md b/sdks/node/docs/model/DocumentFieldDetectionResponse.md new file mode 100644 index 000000000..f29ea0d3e --- /dev/null +++ b/sdks/node/docs/model/DocumentFieldDetectionResponse.md @@ -0,0 +1,12 @@ +# # DocumentFieldDetectionResponse + + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +| `detectionResult`*_required_ | [```DocumentFieldDetectionResponseDetectionResult```](DocumentFieldDetectionResponseDetectionResult.md) | | | +| `warnings` | [```Array```](WarningResponse.md) | A list of warnings. | | + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/sdks/node/docs/model/DocumentFieldDetectionResponseDetectionResult.md b/sdks/node/docs/model/DocumentFieldDetectionResponseDetectionResult.md new file mode 100644 index 000000000..6f63f67a6 --- /dev/null +++ b/sdks/node/docs/model/DocumentFieldDetectionResponseDetectionResult.md @@ -0,0 +1,20 @@ +# # DocumentFieldDetectionResponseDetectionResult + + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +| `documentHash`*_required_ | ```string``` | The SHA-256 hash of the analyzed document. | | +| `detectionMode`*_required_ | [```DocumentFieldDetectionResponseDetectionResultDetectionMode```](DocumentFieldDetectionResponseDetectionResultDetectionMode.md) | | | +| `pageCount`*_required_ | ```number``` | The total number of pages in the document. | | +| `pagesAnalyzed`*_required_ | ```string``` | The zero-based page indexes analyzed, represented by the requested `page_range`, or `all` when every page was analyzed. | | +| `detectedAt`*_required_ | ```number``` | The Unix timestamp when the field detection result was generated. | | +| `formFieldsPerDocument`*_required_ | [```Array```](SubFormFieldsPerDocumentBase.md) | The fields that should appear on the document, expressed as an array of objects. (For more details you can read about it here: [Using Form Fields per Document](/docs/openapi/form-fields-per-document).)

**NOTE:** Fields like **text**, **dropdown**, **checkbox**, **radio**, and **hyperlink** have additional required and optional parameters. Check out the list of [additional parameters](/api/reference/constants/#form-fields-per-document) for these field types.

* Text Field use `SubFormFieldsPerDocumentText`
* Dropdown Field use `SubFormFieldsPerDocumentDropdown`
* Hyperlink Field use `SubFormFieldsPerDocumentHyperlink`
* Checkbox Field use `SubFormFieldsPerDocumentCheckbox`
* Radio Field use `SubFormFieldsPerDocumentRadio`
* Signature Field use `SubFormFieldsPerDocumentSignature`
* Date Signed Field use `SubFormFieldsPerDocumentDateSigned`
* Initials Field use `SubFormFieldsPerDocumentInitials`
* Text Merge Field use `SubFormFieldsPerDocumentTextMerge`
* Checkbox Merge Field use `SubFormFieldsPerDocumentCheckboxMerge` | | +| `formFieldGroups`*_required_ | [```Array```](SubFormFieldGroup.md) | Group information for fields defined in `form_fields_per_document`. String-indexed JSON array with `group_label` and `requirement` keys. `form_fields_per_document` must contain fields referencing a group defined in `form_field_groups`. | | +| `warnings`*_required_ | [```Array```](WarningResponse.md) | Non-fatal issues encountered during field detection. | | +| `errors`*_required_ | [```Array```](ErrorResponseError.md) | Errors encountered during field detection. Successfully detected fields may still be included in the response. | | +| `suggestions`*_required_ | ```Array``` | Suggestions for improving the field detection results. | | + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/sdks/node/docs/model/DocumentFieldDetectionResponseDetectionResultDetectionMode.md b/sdks/node/docs/model/DocumentFieldDetectionResponseDetectionResultDetectionMode.md new file mode 100644 index 000000000..2f43d493b --- /dev/null +++ b/sdks/node/docs/model/DocumentFieldDetectionResponseDetectionResultDetectionMode.md @@ -0,0 +1,10 @@ +# # DocumentFieldDetectionResponseDetectionResultDetectionMode + +The field detection method used to analyze the document: `annotations` or `text_tags`. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/sdks/node/docs/model/FaxResponse.md b/sdks/node/docs/model/FaxResponse.md index 349cb6bc6..137d0be61 100644 --- a/sdks/node/docs/model/FaxResponse.md +++ b/sdks/node/docs/model/FaxResponse.md @@ -14,6 +14,7 @@ Name | Type | Description | Notes | `sender`*_required_ | ```string``` | Fax Sender Email | | | `filesUrl`*_required_ | ```string``` | Fax Files URL | | | `transmissions`*_required_ | [```Array```](FaxResponseTransmission.md) | Fax Transmissions List | | +| `testMode`*_required_ | ```boolean``` | Whether this is a test fax. Test faxes are not delivered to the recipient. Defaults to `false`. | [default to false] | | `subject` | ```string``` | Fax Subject | | | `message` | ```string``` | Fax Message | | | `finalCopyUri` | ```string``` | The path where the completed document can be downloaded | | diff --git a/sdks/node/docs/model/SignatureRequestBulkCreateEmbeddedWithTemplateRequest.md b/sdks/node/docs/model/SignatureRequestBulkCreateEmbeddedWithTemplateRequest.md index d541a0d51..eeed3331f 100644 --- a/sdks/node/docs/model/SignatureRequestBulkCreateEmbeddedWithTemplateRequest.md +++ b/sdks/node/docs/model/SignatureRequestBulkCreateEmbeddedWithTemplateRequest.md @@ -19,5 +19,6 @@ Name | Type | Description | Notes | `subject` | ```string``` | The subject in the email that will be sent to the signers. | | | `testMode` | ```boolean``` | Whether this is a test, the signature request will not be legally binding if set to `true`. Defaults to `false`. | [default to false] | | `title` | ```string``` | The title you want to assign to the SignatureRequest. | | +| `expiresAt` | ```number``` | When the signature request will expire. Unsigned signatures will be moved to the expired status, and no longer signable. See [Signature Request Expiration Date](https://developers.hellosign.com/docs/signature-request/expiration/) for details. | | [[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/sdks/node/docs/model/SignatureRequestBulkSendWithTemplateRequest.md b/sdks/node/docs/model/SignatureRequestBulkSendWithTemplateRequest.md index 66d9f1a0a..b00013e0f 100644 --- a/sdks/node/docs/model/SignatureRequestBulkSendWithTemplateRequest.md +++ b/sdks/node/docs/model/SignatureRequestBulkSendWithTemplateRequest.md @@ -19,5 +19,6 @@ Name | Type | Description | Notes | `subject` | ```string``` | The subject in the email that will be sent to the signers. | | | `testMode` | ```boolean``` | Whether this is a test, the signature request will not be legally binding if set to `true`. Defaults to `false`. | [default to false] | | `title` | ```string``` | The title you want to assign to the SignatureRequest. | | +| `expiresAt` | ```number``` | When the signature request will expire. Unsigned signatures will be moved to the expired status, and no longer signable. See [Signature Request Expiration Date](https://developers.hellosign.com/docs/signature-request/expiration/) for details. | | [[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/sdks/node/docs/model/SignatureRequestCreateEmbeddedWithTemplateRequest.md b/sdks/node/docs/model/SignatureRequestCreateEmbeddedWithTemplateRequest.md index d440db010..25566b6bb 100644 --- a/sdks/node/docs/model/SignatureRequestCreateEmbeddedWithTemplateRequest.md +++ b/sdks/node/docs/model/SignatureRequestCreateEmbeddedWithTemplateRequest.md @@ -21,5 +21,6 @@ Name | Type | Description | Notes | `testMode` | ```boolean``` | Whether this is a test, the signature request will not be legally binding if set to `true`. Defaults to `false`. | [default to false] | | `title` | ```string``` | The title you want to assign to the SignatureRequest. | | | `populateAutoFillFields` | ```boolean``` | Controls whether [auto fill fields](https://faq.hellosign.com/hc/en-us/articles/360051467511-Auto-Fill-Fields) can automatically populate a signer's information during signing.

**NOTE:** Keep your signer's information safe by ensuring that the _signer on your signature request is the intended party_ before using this feature. | [default to false] | +| `expiresAt` | ```number``` | When the signature request will expire. Unsigned signatures will be moved to the expired status, and no longer signable. See [Signature Request Expiration Date](https://developers.hellosign.com/docs/signature-request/expiration/) for details. | | [[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/sdks/node/docs/model/SignatureRequestSendWithTemplateRequest.md b/sdks/node/docs/model/SignatureRequestSendWithTemplateRequest.md index 04cf0739f..f4e64dc01 100644 --- a/sdks/node/docs/model/SignatureRequestSendWithTemplateRequest.md +++ b/sdks/node/docs/model/SignatureRequestSendWithTemplateRequest.md @@ -23,5 +23,6 @@ Name | Type | Description | Notes | `subject` | ```string``` | The subject in the email that will be sent to the signers. | | | `testMode` | ```boolean``` | Whether this is a test, the signature request will not be legally binding if set to `true`. Defaults to `false`. | [default to false] | | `title` | ```string``` | The title you want to assign to the SignatureRequest. | | +| `expiresAt` | ```number``` | When the signature request will expire. Unsigned signatures will be moved to the expired status, and no longer signable. See [Signature Request Expiration Date](https://developers.hellosign.com/docs/signature-request/expiration/) for details. | | [[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/documentFieldDetectionRequest.ts b/sdks/node/model/documentFieldDetectionRequest.ts new file mode 100644 index 000000000..a28570f69 --- /dev/null +++ b/sdks/node/model/documentFieldDetectionRequest.ts @@ -0,0 +1,78 @@ +/** + * 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, RequestFile } from "./"; + +export class DocumentFieldDetectionRequest { + /** + * The field detection method to use. Set to `annotations` to detect PDF form annotations or `text_tags` to detect Dropbox Sign text tags. + */ + "detectionMode": string; + /** + * The PDF file to analyze. This endpoint requires either `file` or `file_url`, but not both. + */ + "file"?: RequestFile; + /** + * The URL of the PDF file to analyze. This endpoint requires either `file` or `file_url`, but not both. + */ + "fileUrl"?: string; + /** + * The zero-based page indexes to analyze. Accepts `all`, individual pages, inclusive ranges, or comma-separated combinations, such as `0-2,5,7-9`. Defaults to `all`. + */ + "pageRange"?: string; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: AttributeTypeMap = [ + { + name: "detectionMode", + baseName: "detection_mode", + type: "string", + }, + { + name: "file", + baseName: "file", + type: "RequestFile", + }, + { + name: "fileUrl", + baseName: "file_url", + type: "string", + }, + { + name: "pageRange", + baseName: "page_range", + type: "string", + }, + ]; + + static getAttributeTypeMap(): AttributeTypeMap { + return DocumentFieldDetectionRequest.attributeTypeMap; + } + + /** Attempt to instantiate and hydrate a new instance of this class */ + static init(data: any): DocumentFieldDetectionRequest { + return ObjectSerializer.deserialize(data, "DocumentFieldDetectionRequest"); + } +} diff --git a/sdks/node/model/documentFieldDetectionResponse.ts b/sdks/node/model/documentFieldDetectionResponse.ts new file mode 100644 index 000000000..e3ae64d7d --- /dev/null +++ b/sdks/node/model/documentFieldDetectionResponse.ts @@ -0,0 +1,59 @@ +/** + * 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 { DocumentFieldDetectionResponseDetectionResult } from "./documentFieldDetectionResponseDetectionResult"; +import { WarningResponse } from "./warningResponse"; + +export class DocumentFieldDetectionResponse { + "detectionResult": DocumentFieldDetectionResponseDetectionResult; + /** + * A list of warnings. + */ + "warnings"?: Array; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: AttributeTypeMap = [ + { + name: "detectionResult", + baseName: "detection_result", + type: "DocumentFieldDetectionResponseDetectionResult", + }, + { + name: "warnings", + baseName: "warnings", + type: "Array", + }, + ]; + + static getAttributeTypeMap(): AttributeTypeMap { + return DocumentFieldDetectionResponse.attributeTypeMap; + } + + /** Attempt to instantiate and hydrate a new instance of this class */ + static init(data: any): DocumentFieldDetectionResponse { + return ObjectSerializer.deserialize(data, "DocumentFieldDetectionResponse"); + } +} diff --git a/sdks/node/model/documentFieldDetectionResponseDetectionResult.ts b/sdks/node/model/documentFieldDetectionResponseDetectionResult.ts new file mode 100644 index 000000000..76795508c --- /dev/null +++ b/sdks/node/model/documentFieldDetectionResponseDetectionResult.ts @@ -0,0 +1,139 @@ +/** + * 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 { ErrorResponseError } from "./errorResponseError"; +import { SubFormFieldGroup } from "./subFormFieldGroup"; +import { SubFormFieldsPerDocumentBase } from "./subFormFieldsPerDocumentBase"; +import { WarningResponse } from "./warningResponse"; + +export class DocumentFieldDetectionResponseDetectionResult { + /** + * The SHA-256 hash of the analyzed document. + */ + "documentHash": string; + /** + * The field detection method used to analyze the document: `annotations` or `text_tags`. + */ + "detectionMode": string; + /** + * The total number of pages in the document. + */ + "pageCount": number; + /** + * The zero-based page indexes analyzed, represented by the requested `page_range`, or `all` when every page was analyzed. + */ + "pagesAnalyzed": string; + /** + * The Unix timestamp when the field detection result was generated. + */ + "detectedAt": number; + /** + * The fields that should appear on the document, expressed as an array of objects. (For more details you can read about it here: [Using Form Fields per Document](/docs/openapi/form-fields-per-document).) **NOTE:** Fields like **text**, **dropdown**, **checkbox**, **radio**, and **hyperlink** have additional required and optional parameters. Check out the list of [additional parameters](/api/reference/constants/#form-fields-per-document) for these field types. * Text Field use `SubFormFieldsPerDocumentText` * Dropdown Field use `SubFormFieldsPerDocumentDropdown` * Hyperlink Field use `SubFormFieldsPerDocumentHyperlink` * Checkbox Field use `SubFormFieldsPerDocumentCheckbox` * Radio Field use `SubFormFieldsPerDocumentRadio` * Signature Field use `SubFormFieldsPerDocumentSignature` * Date Signed Field use `SubFormFieldsPerDocumentDateSigned` * Initials Field use `SubFormFieldsPerDocumentInitials` * Text Merge Field use `SubFormFieldsPerDocumentTextMerge` * Checkbox Merge Field use `SubFormFieldsPerDocumentCheckboxMerge` + */ + "formFieldsPerDocument": Array; + /** + * Group information for fields defined in `form_fields_per_document`. String-indexed JSON array with `group_label` and `requirement` keys. `form_fields_per_document` must contain fields referencing a group defined in `form_field_groups`. + */ + "formFieldGroups": Array; + /** + * Non-fatal issues encountered during field detection. + */ + "warnings": Array; + /** + * Errors encountered during field detection. Successfully detected fields may still be included in the response. + */ + "errors": Array; + /** + * Suggestions for improving the field detection results. + */ + "suggestions": Array; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: AttributeTypeMap = [ + { + name: "documentHash", + baseName: "document_hash", + type: "string", + }, + { + name: "detectionMode", + baseName: "detection_mode", + type: "string", + }, + { + name: "pageCount", + baseName: "page_count", + type: "number", + }, + { + name: "pagesAnalyzed", + baseName: "pages_analyzed", + type: "string", + }, + { + name: "detectedAt", + baseName: "detected_at", + type: "number", + }, + { + name: "formFieldsPerDocument", + baseName: "form_fields_per_document", + type: "Array", + }, + { + name: "formFieldGroups", + baseName: "form_field_groups", + type: "Array", + }, + { + name: "warnings", + baseName: "warnings", + type: "Array", + }, + { + name: "errors", + baseName: "errors", + type: "Array", + }, + { + name: "suggestions", + baseName: "suggestions", + type: "Array", + }, + ]; + + static getAttributeTypeMap(): AttributeTypeMap { + return DocumentFieldDetectionResponseDetectionResult.attributeTypeMap; + } + + /** Attempt to instantiate and hydrate a new instance of this class */ + static init(data: any): DocumentFieldDetectionResponseDetectionResult { + return ObjectSerializer.deserialize( + data, + "DocumentFieldDetectionResponseDetectionResult" + ); + } +} diff --git a/sdks/node/model/faxResponse.ts b/sdks/node/model/faxResponse.ts index 2a615a4bd..b8f8ead9e 100644 --- a/sdks/node/model/faxResponse.ts +++ b/sdks/node/model/faxResponse.ts @@ -58,6 +58,10 @@ export class FaxResponse { * Fax Transmissions List */ "transmissions": Array; + /** + * Whether this is a test fax. Test faxes are not delivered to the recipient. Defaults to `false`. + */ + "testMode": boolean = false; /** * Fax Subject */ @@ -114,6 +118,11 @@ export class FaxResponse { baseName: "transmissions", type: "Array", }, + { + name: "testMode", + baseName: "test_mode", + type: "boolean", + }, { name: "subject", baseName: "subject", diff --git a/sdks/node/model/index.ts b/sdks/node/model/index.ts index 47632382b..9aa90a2b0 100644 --- a/sdks/node/model/index.ts +++ b/sdks/node/model/index.ts @@ -23,6 +23,9 @@ import { BulkSendJobGetResponseSignatureRequests } from "./bulkSendJobGetRespons import { BulkSendJobListResponse } from "./bulkSendJobListResponse"; import { BulkSendJobResponse } from "./bulkSendJobResponse"; import { BulkSendJobSendResponse } from "./bulkSendJobSendResponse"; +import { DocumentFieldDetectionRequest } from "./documentFieldDetectionRequest"; +import { DocumentFieldDetectionResponse } from "./documentFieldDetectionResponse"; +import { DocumentFieldDetectionResponseDetectionResult } from "./documentFieldDetectionResponseDetectionResult"; import { EmbeddedEditUrlRequest } from "./embeddedEditUrlRequest"; import { EmbeddedEditUrlResponse } from "./embeddedEditUrlResponse"; import { EmbeddedEditUrlResponseEmbedded } from "./embeddedEditUrlResponseEmbedded"; @@ -281,6 +284,10 @@ export let typeMap: { [index: string]: any } = { BulkSendJobListResponse: BulkSendJobListResponse, BulkSendJobResponse: BulkSendJobResponse, BulkSendJobSendResponse: BulkSendJobSendResponse, + DocumentFieldDetectionRequest: DocumentFieldDetectionRequest, + DocumentFieldDetectionResponse: DocumentFieldDetectionResponse, + DocumentFieldDetectionResponseDetectionResult: + DocumentFieldDetectionResponseDetectionResult, EmbeddedEditUrlRequest: EmbeddedEditUrlRequest, EmbeddedEditUrlResponse: EmbeddedEditUrlResponse, EmbeddedEditUrlResponseEmbedded: EmbeddedEditUrlResponseEmbedded, @@ -511,6 +518,9 @@ export { BulkSendJobListResponse, BulkSendJobResponse, BulkSendJobSendResponse, + DocumentFieldDetectionRequest, + DocumentFieldDetectionResponse, + DocumentFieldDetectionResponseDetectionResult, EmbeddedEditUrlRequest, EmbeddedEditUrlResponse, EmbeddedEditUrlResponseEmbedded, diff --git a/sdks/node/model/signatureRequestBulkCreateEmbeddedWithTemplateRequest.ts b/sdks/node/model/signatureRequestBulkCreateEmbeddedWithTemplateRequest.ts index 8901d5b16..634a34210 100644 --- a/sdks/node/model/signatureRequestBulkCreateEmbeddedWithTemplateRequest.ts +++ b/sdks/node/model/signatureRequestBulkCreateEmbeddedWithTemplateRequest.ts @@ -80,6 +80,10 @@ export class SignatureRequestBulkCreateEmbeddedWithTemplateRequest { * The title you want to assign to the SignatureRequest. */ "title"?: string; + /** + * When the signature request will expire. Unsigned signatures will be moved to the expired status, and no longer signable. See [Signature Request Expiration Date](https://developers.hellosign.com/docs/signature-request/expiration/) for details. + */ + "expiresAt"?: number | null; static discriminator: string | undefined = undefined; @@ -149,6 +153,11 @@ export class SignatureRequestBulkCreateEmbeddedWithTemplateRequest { baseName: "title", type: "string", }, + { + name: "expiresAt", + baseName: "expires_at", + type: "number", + }, ]; static getAttributeTypeMap(): AttributeTypeMap { diff --git a/sdks/node/model/signatureRequestBulkSendWithTemplateRequest.ts b/sdks/node/model/signatureRequestBulkSendWithTemplateRequest.ts index c8c07dc36..88344fe28 100644 --- a/sdks/node/model/signatureRequestBulkSendWithTemplateRequest.ts +++ b/sdks/node/model/signatureRequestBulkSendWithTemplateRequest.ts @@ -80,6 +80,10 @@ export class SignatureRequestBulkSendWithTemplateRequest { * The title you want to assign to the SignatureRequest. */ "title"?: string; + /** + * When the signature request will expire. Unsigned signatures will be moved to the expired status, and no longer signable. See [Signature Request Expiration Date](https://developers.hellosign.com/docs/signature-request/expiration/) for details. + */ + "expiresAt"?: number | null; static discriminator: string | undefined = undefined; @@ -149,6 +153,11 @@ export class SignatureRequestBulkSendWithTemplateRequest { baseName: "title", type: "string", }, + { + name: "expiresAt", + baseName: "expires_at", + type: "number", + }, ]; static getAttributeTypeMap(): AttributeTypeMap { diff --git a/sdks/node/model/signatureRequestCreateEmbeddedWithTemplateRequest.ts b/sdks/node/model/signatureRequestCreateEmbeddedWithTemplateRequest.ts index 08b7b6e58..67a605db9 100644 --- a/sdks/node/model/signatureRequestCreateEmbeddedWithTemplateRequest.ts +++ b/sdks/node/model/signatureRequestCreateEmbeddedWithTemplateRequest.ts @@ -86,6 +86,10 @@ export class SignatureRequestCreateEmbeddedWithTemplateRequest { * Controls whether [auto fill fields](https://faq.hellosign.com/hc/en-us/articles/360051467511-Auto-Fill-Fields) can automatically populate a signer\'s information during signing. **NOTE:** Keep your signer\'s information safe by ensuring that the _signer on your signature request is the intended party_ before using this feature. */ "populateAutoFillFields"?: boolean = false; + /** + * When the signature request will expire. Unsigned signatures will be moved to the expired status, and no longer signable. See [Signature Request Expiration Date](https://developers.hellosign.com/docs/signature-request/expiration/) for details. + */ + "expiresAt"?: number | null; static discriminator: string | undefined = undefined; @@ -165,6 +169,11 @@ export class SignatureRequestCreateEmbeddedWithTemplateRequest { baseName: "populate_auto_fill_fields", type: "boolean", }, + { + name: "expiresAt", + baseName: "expires_at", + type: "number", + }, ]; static getAttributeTypeMap(): AttributeTypeMap { diff --git a/sdks/node/model/signatureRequestSendWithTemplateRequest.ts b/sdks/node/model/signatureRequestSendWithTemplateRequest.ts index 2d0d5981a..9d96c718a 100644 --- a/sdks/node/model/signatureRequestSendWithTemplateRequest.ts +++ b/sdks/node/model/signatureRequestSendWithTemplateRequest.ts @@ -99,6 +99,10 @@ export class SignatureRequestSendWithTemplateRequest { * The title you want to assign to the SignatureRequest. */ "title"?: string; + /** + * When the signature request will expire. Unsigned signatures will be moved to the expired status, and no longer signable. See [Signature Request Expiration Date](https://developers.hellosign.com/docs/signature-request/expiration/) for details. + */ + "expiresAt"?: number | null; static discriminator: string | undefined = undefined; @@ -188,6 +192,11 @@ export class SignatureRequestSendWithTemplateRequest { baseName: "title", type: "string", }, + { + name: "expiresAt", + baseName: "expires_at", + type: "number", + }, ]; static getAttributeTypeMap(): AttributeTypeMap { diff --git a/sdks/node/templates/api-single.mustache b/sdks/node/templates/api-single.mustache index ef38b1f15..c6dad7c58 100644 --- a/sdks/node/templates/api-single.mustache +++ b/sdks/node/templates/api-single.mustache @@ -20,7 +20,7 @@ import axios, { AxiosError, AxiosRequestConfig, AxiosResponse } from 'axios'; import http from 'http'; import { - ObjectSerializer, Authentication, VoidAuth, Interceptor, + ObjectSerializer, Authentication, VoidAuth, Interceptor, RequestFile, HttpBasicAuth, HttpBearerAuth, ApiKeyAuth, OAuth, {{#imports}}{{classname}},{{/imports}} } from '../model'; diff --git a/sdks/node/tests/api/documentApi.test.ts b/sdks/node/tests/api/documentApi.test.ts new file mode 100644 index 000000000..1c4dca6cc --- /dev/null +++ b/sdks/node/tests/api/documentApi.test.ts @@ -0,0 +1,54 @@ +import "jest"; + +import { DocumentApi } from "../../api/"; +import * as m from "../../model/"; +import { setExpectedResponse } from "../test_utils"; + +const axios = require("axios"); +const MockAdapter = require("axios-mock-adapter"); + +describe("DocumentApiTest", () => { + let mock: typeof MockAdapter; + + beforeEach(() => { + mock = new MockAdapter(axios); + }); + + const api = new DocumentApi(); + + it("serializes a file URL request as JSON", async () => { + const request = m.DocumentFieldDetectionRequest.init({ + detection_mode: "text_tags", + file_url: "https://example.com/document.pdf", + page_range: "0-2,5", + }); + + setExpectedResponse(mock, {}, 200, "application/json", request); + + await api.documentDetectFields(request); + }); + + it("serializes an uploaded file and options as multipart form data", async () => { + mock.onPost(/hellosign.com/).reply((config) => { + expect(config.headers["Content-Type"]).toContain("multipart/form-data"); + + const payload = config.data.getBuffer().toString(); + expect(payload).toContain('name="detection_mode"'); + expect(payload).toContain("annotations"); + expect(payload).toContain('name="file"'); + expect(payload).toContain("%PDF"); + expect(payload).toContain('name="page_range"'); + expect(payload).toContain("all"); + + return [200, {}]; + }); + + const request = m.DocumentFieldDetectionRequest.init({ + detection_mode: "annotations", + file: Buffer.from("%PDF"), + page_range: "all", + }); + + await api.documentDetectFields(request); + }); +}); diff --git a/sdks/node/types/api/documentApi.d.ts b/sdks/node/types/api/documentApi.d.ts new file mode 100644 index 000000000..0a815230a --- /dev/null +++ b/sdks/node/types/api/documentApi.d.ts @@ -0,0 +1,28 @@ +import { Authentication, DocumentFieldDetectionRequest, DocumentFieldDetectionResponse, HttpBasicAuth, HttpBearerAuth, Interceptor } from "../model"; +import { optionsI, returnTypeT } from "./"; +export declare enum DocumentApiApiKeys { +} +export declare class DocumentApi { + protected _basePath: string; + protected _defaultHeaders: any; + protected _useQuerystring: boolean; + protected authentications: { + default: Authentication; + api_key: HttpBasicAuth; + oauth2: HttpBearerAuth; + }; + protected interceptors: Interceptor[]; + constructor(basePath?: string); + set useQuerystring(value: boolean); + set basePath(basePath: string); + set defaultHeaders(defaultHeaders: any); + get defaultHeaders(): any; + get basePath(): string; + setDefaultAuthentication(auth: Authentication): void; + setApiKey(key: string): void; + set username(username: string); + set password(password: string); + set accessToken(accessToken: string | (() => string)); + addInterceptor(interceptor: Interceptor): void; + documentDetectFields(documentFieldDetectionRequest: DocumentFieldDetectionRequest, options?: optionsI): Promise>; +} diff --git a/sdks/node/types/api/index.d.ts b/sdks/node/types/api/index.d.ts index 4fb28dcef..6098ecd61 100644 --- a/sdks/node/types/api/index.d.ts +++ b/sdks/node/types/api/index.d.ts @@ -1,6 +1,7 @@ import { AccountApi } from "./accountApi"; import { ApiAppApi } from "./apiAppApi"; import { BulkSendJobApi } from "./bulkSendJobApi"; +import { DocumentApi } from "./documentApi"; import { EmbeddedApi } from "./embeddedApi"; import { FaxApi } from "./faxApi"; import { FaxLineApi } from "./faxLineApi"; @@ -10,6 +11,6 @@ import { SignatureRequestApi } from "./signatureRequestApi"; import { TeamApi } from "./teamApi"; import { TemplateApi } from "./templateApi"; import { UnclaimedDraftApi } from "./unclaimedDraftApi"; -export { AccountApi, ApiAppApi, BulkSendJobApi, EmbeddedApi, FaxApi, FaxLineApi, OAuthApi, ReportApi, SignatureRequestApi, TeamApi, TemplateApi, UnclaimedDraftApi, }; +export { AccountApi, ApiAppApi, BulkSendJobApi, DocumentApi, EmbeddedApi, FaxApi, FaxLineApi, OAuthApi, ReportApi, SignatureRequestApi, TeamApi, TemplateApi, UnclaimedDraftApi, }; export { generateFormData, HttpError, optionsI, queryParamsSerializer, returnTypeI, returnTypeT, toFormData, USER_AGENT, } from "./apis"; -export declare const APIS: (typeof AccountApi | typeof ApiAppApi | typeof BulkSendJobApi | typeof EmbeddedApi | typeof FaxApi | typeof FaxLineApi | typeof OAuthApi | typeof ReportApi | typeof SignatureRequestApi | typeof TeamApi | typeof TemplateApi | typeof UnclaimedDraftApi)[]; +export declare const APIS: (typeof AccountApi | typeof ApiAppApi | typeof BulkSendJobApi | typeof DocumentApi | typeof EmbeddedApi | typeof FaxApi | typeof FaxLineApi | typeof OAuthApi | typeof ReportApi | typeof SignatureRequestApi | typeof TeamApi | typeof TemplateApi | typeof UnclaimedDraftApi)[]; diff --git a/sdks/node/types/model/documentFieldDetectionRequest.d.ts b/sdks/node/types/model/documentFieldDetectionRequest.d.ts new file mode 100644 index 000000000..bf581d3bb --- /dev/null +++ b/sdks/node/types/model/documentFieldDetectionRequest.d.ts @@ -0,0 +1,11 @@ +import { AttributeTypeMap, RequestFile } from "./"; +export declare class DocumentFieldDetectionRequest { + "detectionMode": string; + "file"?: RequestFile; + "fileUrl"?: string; + "pageRange"?: string; + static discriminator: string | undefined; + static attributeTypeMap: AttributeTypeMap; + static getAttributeTypeMap(): AttributeTypeMap; + static init(data: any): DocumentFieldDetectionRequest; +} diff --git a/sdks/node/types/model/documentFieldDetectionResponse.d.ts b/sdks/node/types/model/documentFieldDetectionResponse.d.ts new file mode 100644 index 000000000..f71ec7dc9 --- /dev/null +++ b/sdks/node/types/model/documentFieldDetectionResponse.d.ts @@ -0,0 +1,11 @@ +import { AttributeTypeMap } from "./"; +import { DocumentFieldDetectionResponseDetectionResult } from "./documentFieldDetectionResponseDetectionResult"; +import { WarningResponse } from "./warningResponse"; +export declare class DocumentFieldDetectionResponse { + "detectionResult": DocumentFieldDetectionResponseDetectionResult; + "warnings"?: Array; + static discriminator: string | undefined; + static attributeTypeMap: AttributeTypeMap; + static getAttributeTypeMap(): AttributeTypeMap; + static init(data: any): DocumentFieldDetectionResponse; +} diff --git a/sdks/node/types/model/documentFieldDetectionResponseDetectionResult.d.ts b/sdks/node/types/model/documentFieldDetectionResponseDetectionResult.d.ts new file mode 100644 index 000000000..b51415bcc --- /dev/null +++ b/sdks/node/types/model/documentFieldDetectionResponseDetectionResult.d.ts @@ -0,0 +1,21 @@ +import { AttributeTypeMap } from "./"; +import { ErrorResponseError } from "./errorResponseError"; +import { SubFormFieldGroup } from "./subFormFieldGroup"; +import { SubFormFieldsPerDocumentBase } from "./subFormFieldsPerDocumentBase"; +import { WarningResponse } from "./warningResponse"; +export declare class DocumentFieldDetectionResponseDetectionResult { + "documentHash": string; + "detectionMode": string; + "pageCount": number; + "pagesAnalyzed": string; + "detectedAt": number; + "formFieldsPerDocument": Array; + "formFieldGroups": Array; + "warnings": Array; + "errors": Array; + "suggestions": Array; + static discriminator: string | undefined; + static attributeTypeMap: AttributeTypeMap; + static getAttributeTypeMap(): AttributeTypeMap; + static init(data: any): DocumentFieldDetectionResponseDetectionResult; +} diff --git a/sdks/node/types/model/faxResponse.d.ts b/sdks/node/types/model/faxResponse.d.ts index 89c96f004..5511caf2f 100644 --- a/sdks/node/types/model/faxResponse.d.ts +++ b/sdks/node/types/model/faxResponse.d.ts @@ -11,6 +11,7 @@ export declare class FaxResponse { "sender": string; "filesUrl": string; "transmissions": Array; + "testMode": boolean; "subject"?: string | null; "message"?: string | null; "finalCopyUri"?: string | null; diff --git a/sdks/node/types/model/index.d.ts b/sdks/node/types/model/index.d.ts index d36185eb5..9dd11e0b2 100644 --- a/sdks/node/types/model/index.d.ts +++ b/sdks/node/types/model/index.d.ts @@ -23,6 +23,9 @@ import { BulkSendJobGetResponseSignatureRequests } from "./bulkSendJobGetRespons import { BulkSendJobListResponse } from "./bulkSendJobListResponse"; import { BulkSendJobResponse } from "./bulkSendJobResponse"; import { BulkSendJobSendResponse } from "./bulkSendJobSendResponse"; +import { DocumentFieldDetectionRequest } from "./documentFieldDetectionRequest"; +import { DocumentFieldDetectionResponse } from "./documentFieldDetectionResponse"; +import { DocumentFieldDetectionResponseDetectionResult } from "./documentFieldDetectionResponseDetectionResult"; import { EmbeddedEditUrlRequest } from "./embeddedEditUrlRequest"; import { EmbeddedEditUrlResponse } from "./embeddedEditUrlResponse"; import { EmbeddedEditUrlResponseEmbedded } from "./embeddedEditUrlResponseEmbedded"; @@ -198,4 +201,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, 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, }; +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, DocumentFieldDetectionRequest, DocumentFieldDetectionResponse, DocumentFieldDetectionResponseDetectionResult, EmbeddedEditUrlRequest, EmbeddedEditUrlResponse, EmbeddedEditUrlResponseEmbedded, EmbeddedSignUrlResponse, EmbeddedSignUrlResponseEmbedded, ErrorResponse, ErrorResponseError, EventCallbackHelper, EventCallbackRequest, EventCallbackRequestEvent, EventCallbackRequestEventMetadata, FaxGetResponse, FaxLineAddUserRequest, FaxLineAreaCodeGetCountryEnum, FaxLineAreaCodeGetProvinceEnum, FaxLineAreaCodeGetResponse, FaxLineAreaCodeGetStateEnum, FaxLineCreateRequest, FaxLineDeleteRequest, FaxLineListResponse, FaxLineRemoveUserRequest, FaxLineResponse, FaxLineResponseFaxLine, FaxListResponse, FaxResponse, FaxResponseTransmission, FaxSendRequest, FileResponse, FileResponseDataUri, HttpBasicAuth, HttpBearerAuth, Interceptor, ListInfoResponse, OAuth, OAuthTokenGenerateRequest, OAuthTokenRefreshRequest, OAuthTokenResponse, ObjectSerializer, ReportCreateRequest, ReportCreateResponse, ReportResponse, RequestDetailedFile, RequestFile, SignatureRequestBulkCreateEmbeddedWithTemplateRequest, SignatureRequestBulkSendWithTemplateRequest, SignatureRequestCreateEmbeddedRequest, SignatureRequestCreateEmbeddedWithTemplateRequest, SignatureRequestEditEmbeddedRequest, SignatureRequestEditEmbeddedWithTemplateRequest, SignatureRequestEditRequest, SignatureRequestEditWithTemplateRequest, SignatureRequestGetResponse, SignatureRequestListResponse, SignatureRequestRemindRequest, SignatureRequestResponse, SignatureRequestResponseAttachment, SignatureRequestResponseCustomFieldBase, SignatureRequestResponseCustomFieldCheckbox, SignatureRequestResponseCustomFieldText, SignatureRequestResponseCustomFieldTypeEnum, SignatureRequestResponseDataBase, SignatureRequestResponseDataTypeEnum, SignatureRequestResponseDataValueCheckbox, SignatureRequestResponseDataValueCheckboxMerge, SignatureRequestResponseDataValueDateSigned, SignatureRequestResponseDataValueDropdown, SignatureRequestResponseDataValueInitials, SignatureRequestResponseDataValueRadio, SignatureRequestResponseDataValueSignature, SignatureRequestResponseDataValueText, SignatureRequestResponseDataValueTextMerge, SignatureRequestResponseSignatures, SignatureRequestSendRequest, SignatureRequestSendWithTemplateRequest, SignatureRequestUpdateRequest, SubAttachment, SubBulkSignerList, SubBulkSignerListCustomField, SubCC, SubCustomField, SubEditorOptions, SubFieldOptions, SubFormFieldGroup, SubFormFieldRule, SubFormFieldRuleAction, SubFormFieldRuleTrigger, SubFormFieldsPerDocumentBase, SubFormFieldsPerDocumentCheckbox, SubFormFieldsPerDocumentCheckboxMerge, SubFormFieldsPerDocumentDateSigned, SubFormFieldsPerDocumentDropdown, SubFormFieldsPerDocumentFontEnum, SubFormFieldsPerDocumentHyperlink, SubFormFieldsPerDocumentInitials, SubFormFieldsPerDocumentRadio, SubFormFieldsPerDocumentSignature, SubFormFieldsPerDocumentText, SubFormFieldsPerDocumentTextMerge, SubFormFieldsPerDocumentTypeEnum, SubMergeField, SubOAuth, SubOptions, SubSignatureRequestGroupedSigners, SubSignatureRequestSigner, SubSignatureRequestTemplateSigner, SubSigningOptions, SubTeamResponse, SubTemplateRole, SubUnclaimedDraftSigner, SubUnclaimedDraftTemplateSigner, SubWhiteLabelingOptions, TeamAddMemberRequest, TeamCreateRequest, TeamGetInfoResponse, TeamGetResponse, TeamInfoResponse, TeamInviteResponse, TeamInvitesResponse, TeamMemberResponse, TeamMembersResponse, TeamParentResponse, TeamRemoveMemberRequest, TeamResponse, TeamSubTeamsResponse, TeamUpdateRequest, TemplateAddUserRequest, TemplateCreateEmbeddedDraftRequest, TemplateCreateEmbeddedDraftResponse, TemplateCreateEmbeddedDraftResponseTemplate, TemplateCreateRequest, TemplateCreateResponse, TemplateCreateResponseTemplate, 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/signatureRequestBulkCreateEmbeddedWithTemplateRequest.d.ts b/sdks/node/types/model/signatureRequestBulkCreateEmbeddedWithTemplateRequest.d.ts index 0846addef..0ea969e00 100644 --- a/sdks/node/types/model/signatureRequestBulkCreateEmbeddedWithTemplateRequest.d.ts +++ b/sdks/node/types/model/signatureRequestBulkCreateEmbeddedWithTemplateRequest.d.ts @@ -18,6 +18,7 @@ export declare class SignatureRequestBulkCreateEmbeddedWithTemplateRequest { "subject"?: string; "testMode"?: boolean; "title"?: string; + "expiresAt"?: number | null; static discriminator: string | undefined; static attributeTypeMap: AttributeTypeMap; static getAttributeTypeMap(): AttributeTypeMap; diff --git a/sdks/node/types/model/signatureRequestBulkSendWithTemplateRequest.d.ts b/sdks/node/types/model/signatureRequestBulkSendWithTemplateRequest.d.ts index e021f5165..ead6cbf19 100644 --- a/sdks/node/types/model/signatureRequestBulkSendWithTemplateRequest.d.ts +++ b/sdks/node/types/model/signatureRequestBulkSendWithTemplateRequest.d.ts @@ -18,6 +18,7 @@ export declare class SignatureRequestBulkSendWithTemplateRequest { "subject"?: string; "testMode"?: boolean; "title"?: string; + "expiresAt"?: number | null; static discriminator: string | undefined; static attributeTypeMap: AttributeTypeMap; static getAttributeTypeMap(): AttributeTypeMap; diff --git a/sdks/node/types/model/signatureRequestCreateEmbeddedWithTemplateRequest.d.ts b/sdks/node/types/model/signatureRequestCreateEmbeddedWithTemplateRequest.d.ts index a707ac1a9..ec474217d 100644 --- a/sdks/node/types/model/signatureRequestCreateEmbeddedWithTemplateRequest.d.ts +++ b/sdks/node/types/model/signatureRequestCreateEmbeddedWithTemplateRequest.d.ts @@ -21,6 +21,7 @@ export declare class SignatureRequestCreateEmbeddedWithTemplateRequest { "testMode"?: boolean; "title"?: string; "populateAutoFillFields"?: boolean; + "expiresAt"?: number | null; static discriminator: string | undefined; static attributeTypeMap: AttributeTypeMap; static getAttributeTypeMap(): AttributeTypeMap; diff --git a/sdks/node/types/model/signatureRequestSendWithTemplateRequest.d.ts b/sdks/node/types/model/signatureRequestSendWithTemplateRequest.d.ts index 3bacfad01..f76675c87 100644 --- a/sdks/node/types/model/signatureRequestSendWithTemplateRequest.d.ts +++ b/sdks/node/types/model/signatureRequestSendWithTemplateRequest.d.ts @@ -23,6 +23,7 @@ export declare class SignatureRequestSendWithTemplateRequest { "subject"?: string; "testMode"?: boolean; "title"?: string; + "expiresAt"?: number | null; static discriminator: string | undefined; static attributeTypeMap: AttributeTypeMap; static getAttributeTypeMap(): AttributeTypeMap; diff --git a/sdks/php/README.md b/sdks/php/README.md index d510976a0..57e6ab2f0 100644 --- a/sdks/php/README.md +++ b/sdks/php/README.md @@ -158,6 +158,7 @@ All URIs are relative to *https://api.hellosign.com/v3* | *ApiAppApi* | [**apiAppUpdate**](docs/Api/ApiAppApi.md#apiappupdate) | **PUT** /api_app/{client_id} | Update API App | | *BulkSendJobApi* | [**bulkSendJobGet**](docs/Api/BulkSendJobApi.md#bulksendjobget) | **GET** /bulk_send_job/{bulk_send_job_id} | Get Bulk Send Job | | *BulkSendJobApi* | [**bulkSendJobList**](docs/Api/BulkSendJobApi.md#bulksendjoblist) | **GET** /bulk_send_job/list | List Bulk Send Jobs | +| *DocumentApi* | [**documentDetectFields**](docs/Api/DocumentApi.md#documentdetectfields) | **POST** /document/detect_fields | Detect Document Fields | | *EmbeddedApi* | [**embeddedEditUrl**](docs/Api/EmbeddedApi.md#embeddedediturl) | **POST** /embedded/edit_url/{template_id} | Get Embedded Template Edit URL | | *EmbeddedApi* | [**embeddedSignUrl**](docs/Api/EmbeddedApi.md#embeddedsignurl) | **GET** /embedded/sign_url/{signature_id} | Get Embedded Sign URL | | *FaxApi* | [**faxDelete**](docs/Api/FaxApi.md#faxdelete) | **DELETE** /fax/{fax_id} | Delete Fax | @@ -249,6 +250,9 @@ All URIs are relative to *https://api.hellosign.com/v3* - [BulkSendJobListResponse](docs/Model/BulkSendJobListResponse.md) - [BulkSendJobResponse](docs/Model/BulkSendJobResponse.md) - [BulkSendJobSendResponse](docs/Model/BulkSendJobSendResponse.md) +- [DocumentFieldDetectionRequest](docs/Model/DocumentFieldDetectionRequest.md) +- [DocumentFieldDetectionResponse](docs/Model/DocumentFieldDetectionResponse.md) +- [DocumentFieldDetectionResponseDetectionResult](docs/Model/DocumentFieldDetectionResponseDetectionResult.md) - [EmbeddedEditUrlRequest](docs/Model/EmbeddedEditUrlRequest.md) - [EmbeddedEditUrlResponse](docs/Model/EmbeddedEditUrlResponse.md) - [EmbeddedEditUrlResponseEmbedded](docs/Model/EmbeddedEditUrlResponseEmbedded.md) diff --git a/sdks/php/bin/php b/sdks/php/bin/php index 70dc0364e..9e31aee11 100755 --- a/sdks/php/bin/php +++ b/sdks/php/bin/php @@ -10,6 +10,7 @@ WORKING_DIR="/app/php" if [[ "$PHP_USE_NATIVE" -ne 1 ]]; then docker run --rm \ + --platform linux/amd64 \ -v "${ROOT_DIR}:${WORKING_DIR}" \ -v "dropbox-sign-sdk-composer-cache:/.composer" \ -w "${WORKING_DIR}" \ diff --git a/sdks/php/bin/php-8 b/sdks/php/bin/php-8 index 78acc6d73..147bb2b15 100755 --- a/sdks/php/bin/php-8 +++ b/sdks/php/bin/php-8 @@ -9,6 +9,7 @@ ROOT_DIR="${DIR}/.." WORKING_DIR="/app/php" docker run --rm \ + --platform linux/amd64 \ -v "${ROOT_DIR}:${WORKING_DIR}" \ -v "dropbox-sign-sdk-composer-cache:/.composer" \ -w "${WORKING_DIR}" \ diff --git a/sdks/php/docs/Api/DocumentApi.md b/sdks/php/docs/Api/DocumentApi.md new file mode 100644 index 000000000..668f2d3f8 --- /dev/null +++ b/sdks/php/docs/Api/DocumentApi.md @@ -0,0 +1,73 @@ +# Dropbox\Sign\DocumentApi + +All URIs are relative to https://api.hellosign.com/v3. + +| Method | HTTP request | Description | +| ------------- | ------------- | ------------- | +| [**documentDetectFields()**](DocumentApi.md#documentDetectFields) | **POST** /document/detect_fields | Detect Document Fields | + + +## `documentDetectFields()` + +```php +documentDetectFields($document_field_detection_request): \Dropbox\Sign\Model\DocumentFieldDetectionResponse +``` +Detect Document Fields + +Detects form fields in a PDF document using either PDF form annotations or Dropbox Sign text tags. + +### Example + +```php +setUsername("YOUR_API_KEY"); +// $config->setAccessToken("YOUR_ACCESS_TOKEN"); + +$document_field_detection_request = (new Dropbox\Sign\Model\DocumentFieldDetectionRequest()) + ->setDetectionMode("annotations") + ->setFile(new SplFileObject("./example_document.pdf")) + ->setPageRange("all"); + +try { + $response = (new Dropbox\Sign\Api\DocumentApi(config: $config))->documentDetectFields( + document_field_detection_request: $document_field_detection_request, + ); + + print_r($response); +} catch (Dropbox\Sign\ApiException $e) { + echo "Exception when calling DocumentApi#documentDetectFields: {$e->getMessage()}"; +} + +``` + +### Parameters + +|Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **document_field_detection_request** | [**\Dropbox\Sign\Model\DocumentFieldDetectionRequest**](../Model/DocumentFieldDetectionRequest.md)| | | + +### Return type + +[**\Dropbox\Sign\Model\DocumentFieldDetectionResponse**](../Model/DocumentFieldDetectionResponse.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) diff --git a/sdks/php/docs/Model/DocumentFieldDetectionRequest.md b/sdks/php/docs/Model/DocumentFieldDetectionRequest.md new file mode 100644 index 000000000..728d7b104 --- /dev/null +++ b/sdks/php/docs/Model/DocumentFieldDetectionRequest.md @@ -0,0 +1,14 @@ +# # DocumentFieldDetectionRequest + + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +| `detection_mode`*_required_ | ```string``` | The field detection method to use. Set to `annotations` to detect PDF form annotations or `text_tags` to detect Dropbox Sign text tags. | | +| `file` | ```\SplFileObject``` | The PDF file to analyze.

This endpoint requires either `file` or `file_url`, but not both. | | +| `file_url` | ```string``` | The URL of the PDF file to analyze.

This endpoint requires either `file` or `file_url`, but not both. | | +| `page_range` | ```string``` | The zero-based page indexes to analyze. Accepts `all`, individual pages, inclusive ranges, or comma-separated combinations, such as `0-2,5,7-9`. Defaults to `all`. | | + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/sdks/php/docs/Model/DocumentFieldDetectionResponse.md b/sdks/php/docs/Model/DocumentFieldDetectionResponse.md new file mode 100644 index 000000000..f4dedb084 --- /dev/null +++ b/sdks/php/docs/Model/DocumentFieldDetectionResponse.md @@ -0,0 +1,12 @@ +# # DocumentFieldDetectionResponse + + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +| `detection_result`*_required_ | [```\Dropbox\Sign\Model\DocumentFieldDetectionResponseDetectionResult```](DocumentFieldDetectionResponseDetectionResult.md) | | | +| `warnings` | [```\Dropbox\Sign\Model\WarningResponse[]```](WarningResponse.md) | A list of warnings. | | + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/sdks/php/docs/Model/DocumentFieldDetectionResponseDetectionResult.md b/sdks/php/docs/Model/DocumentFieldDetectionResponseDetectionResult.md new file mode 100644 index 000000000..9035cbec4 --- /dev/null +++ b/sdks/php/docs/Model/DocumentFieldDetectionResponseDetectionResult.md @@ -0,0 +1,20 @@ +# # DocumentFieldDetectionResponseDetectionResult + + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +| `document_hash`*_required_ | ```string``` | The SHA-256 hash of the analyzed document. | | +| `detection_mode`*_required_ | ```string``` | The field detection method used to analyze the document: `annotations` or `text_tags`. | | +| `page_count`*_required_ | ```int``` | The total number of pages in the document. | | +| `pages_analyzed`*_required_ | ```string``` | The zero-based page indexes analyzed, represented by the requested `page_range`, or `all` when every page was analyzed. | | +| `detected_at`*_required_ | ```int``` | The Unix timestamp when the field detection result was generated. | | +| `form_fields_per_document`*_required_ | [```\Dropbox\Sign\Model\SubFormFieldsPerDocumentBase[]```](SubFormFieldsPerDocumentBase.md) | The fields that should appear on the document, expressed as an array of objects. (For more details you can read about it here: [Using Form Fields per Document](/docs/openapi/form-fields-per-document).)

**NOTE:** Fields like **text**, **dropdown**, **checkbox**, **radio**, and **hyperlink** have additional required and optional parameters. Check out the list of [additional parameters](/api/reference/constants/#form-fields-per-document) for these field types.

* Text Field use `SubFormFieldsPerDocumentText`
* Dropdown Field use `SubFormFieldsPerDocumentDropdown`
* Hyperlink Field use `SubFormFieldsPerDocumentHyperlink`
* Checkbox Field use `SubFormFieldsPerDocumentCheckbox`
* Radio Field use `SubFormFieldsPerDocumentRadio`
* Signature Field use `SubFormFieldsPerDocumentSignature`
* Date Signed Field use `SubFormFieldsPerDocumentDateSigned`
* Initials Field use `SubFormFieldsPerDocumentInitials`
* Text Merge Field use `SubFormFieldsPerDocumentTextMerge`
* Checkbox Merge Field use `SubFormFieldsPerDocumentCheckboxMerge` | | +| `form_field_groups`*_required_ | [```\Dropbox\Sign\Model\SubFormFieldGroup[]```](SubFormFieldGroup.md) | Group information for fields defined in `form_fields_per_document`. String-indexed JSON array with `group_label` and `requirement` keys. `form_fields_per_document` must contain fields referencing a group defined in `form_field_groups`. | | +| `warnings`*_required_ | [```\Dropbox\Sign\Model\WarningResponse[]```](WarningResponse.md) | Non-fatal issues encountered during field detection. | | +| `errors`*_required_ | [```\Dropbox\Sign\Model\ErrorResponseError[]```](ErrorResponseError.md) | Errors encountered during field detection. Successfully detected fields may still be included in the response. | | +| `suggestions`*_required_ | ```string[]``` | Suggestions for improving the field detection results. | | + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/sdks/php/docs/Model/FaxResponse.md b/sdks/php/docs/Model/FaxResponse.md index 130845b57..2d1865fde 100644 --- a/sdks/php/docs/Model/FaxResponse.md +++ b/sdks/php/docs/Model/FaxResponse.md @@ -14,6 +14,7 @@ Name | Type | Description | Notes | `sender`*_required_ | ```string``` | Fax Sender Email | | | `files_url`*_required_ | ```string``` | Fax Files URL | | | `transmissions`*_required_ | [```\Dropbox\Sign\Model\FaxResponseTransmission[]```](FaxResponseTransmission.md) | Fax Transmissions List | | +| `test_mode`*_required_ | ```bool``` | Whether this is a test fax. Test faxes are not delivered to the recipient. Defaults to `false`. | [default to false] | | `subject` | ```string``` | Fax Subject | | | `message` | ```string``` | Fax Message | | | `final_copy_uri` | ```string``` | The path where the completed document can be downloaded | | diff --git a/sdks/php/docs/Model/SignatureRequestBulkCreateEmbeddedWithTemplateRequest.md b/sdks/php/docs/Model/SignatureRequestBulkCreateEmbeddedWithTemplateRequest.md index 53be15f83..73430a885 100644 --- a/sdks/php/docs/Model/SignatureRequestBulkCreateEmbeddedWithTemplateRequest.md +++ b/sdks/php/docs/Model/SignatureRequestBulkCreateEmbeddedWithTemplateRequest.md @@ -19,5 +19,6 @@ Name | Type | Description | Notes | `subject` | ```string``` | The subject in the email that will be sent to the signers. | | | `test_mode` | ```bool``` | Whether this is a test, the signature request will not be legally binding if set to `true`. Defaults to `false`. | [default to false] | | `title` | ```string``` | The title you want to assign to the SignatureRequest. | | +| `expires_at` | ```int``` | When the signature request will expire. Unsigned signatures will be moved to the expired status, and no longer signable. See [Signature Request Expiration Date](https://developers.hellosign.com/docs/signature-request/expiration/) for details. | | [[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/sdks/php/docs/Model/SignatureRequestBulkSendWithTemplateRequest.md b/sdks/php/docs/Model/SignatureRequestBulkSendWithTemplateRequest.md index 10d93b867..99c568f22 100644 --- a/sdks/php/docs/Model/SignatureRequestBulkSendWithTemplateRequest.md +++ b/sdks/php/docs/Model/SignatureRequestBulkSendWithTemplateRequest.md @@ -19,5 +19,6 @@ Name | Type | Description | Notes | `subject` | ```string``` | The subject in the email that will be sent to the signers. | | | `test_mode` | ```bool``` | Whether this is a test, the signature request will not be legally binding if set to `true`. Defaults to `false`. | [default to false] | | `title` | ```string``` | The title you want to assign to the SignatureRequest. | | +| `expires_at` | ```int``` | When the signature request will expire. Unsigned signatures will be moved to the expired status, and no longer signable. See [Signature Request Expiration Date](https://developers.hellosign.com/docs/signature-request/expiration/) for details. | | [[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/sdks/php/docs/Model/SignatureRequestCreateEmbeddedWithTemplateRequest.md b/sdks/php/docs/Model/SignatureRequestCreateEmbeddedWithTemplateRequest.md index b41a8e311..a876a41ad 100644 --- a/sdks/php/docs/Model/SignatureRequestCreateEmbeddedWithTemplateRequest.md +++ b/sdks/php/docs/Model/SignatureRequestCreateEmbeddedWithTemplateRequest.md @@ -21,5 +21,6 @@ Name | Type | Description | Notes | `test_mode` | ```bool``` | Whether this is a test, the signature request will not be legally binding if set to `true`. Defaults to `false`. | [default to false] | | `title` | ```string``` | The title you want to assign to the SignatureRequest. | | | `populate_auto_fill_fields` | ```bool``` | Controls whether [auto fill fields](https://faq.hellosign.com/hc/en-us/articles/360051467511-Auto-Fill-Fields) can automatically populate a signer's information during signing.

**NOTE:** Keep your signer's information safe by ensuring that the _signer on your signature request is the intended party_ before using this feature. | [default to false] | +| `expires_at` | ```int``` | When the signature request will expire. Unsigned signatures will be moved to the expired status, and no longer signable. See [Signature Request Expiration Date](https://developers.hellosign.com/docs/signature-request/expiration/) for details. | | [[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/sdks/php/docs/Model/SignatureRequestSendWithTemplateRequest.md b/sdks/php/docs/Model/SignatureRequestSendWithTemplateRequest.md index 4942a5c71..73dcb88c5 100644 --- a/sdks/php/docs/Model/SignatureRequestSendWithTemplateRequest.md +++ b/sdks/php/docs/Model/SignatureRequestSendWithTemplateRequest.md @@ -23,5 +23,6 @@ Name | Type | Description | Notes | `subject` | ```string``` | The subject in the email that will be sent to the signers. | | | `test_mode` | ```bool``` | Whether this is a test, the signature request will not be legally binding if set to `true`. Defaults to `false`. | [default to false] | | `title` | ```string``` | The title you want to assign to the SignatureRequest. | | +| `expires_at` | ```int``` | When the signature request will expire. Unsigned signatures will be moved to the expired status, and no longer signable. See [Signature Request Expiration Date](https://developers.hellosign.com/docs/signature-request/expiration/) for details. | | [[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/sdks/php/run-build b/sdks/php/run-build index 51a9fe1d8..dd69c1ae1 100755 --- a/sdks/php/run-build +++ b/sdks/php/run-build @@ -13,6 +13,7 @@ if [[ -n "$GITHUB_ACTIONS" && -n "${DOCKER_USERNAME:-}" && -n "${DOCKER_TOKEN:-} fi # cleanup +rm -f "${DIR}/composer.lock" rm -f "${DIR}/src/Api/"*.php rm -f "${DIR}/src/Model/"*.php diff --git a/sdks/php/src/Api/DocumentApi.php b/sdks/php/src/Api/DocumentApi.php new file mode 100644 index 000000000..ca075b351 --- /dev/null +++ b/sdks/php/src/Api/DocumentApi.php @@ -0,0 +1,559 @@ + [ + 'application/json', + 'multipart/form-data', + ], + ]; + + /** @var ResponseInterface|null */ + protected $response; + + /** + * @param int $hostIndex (Optional) host index to select the list of hosts if defined in the OpenAPI spec + */ + public function __construct( + ?Configuration $config = null, + ?ClientInterface $client = null, + ?HeaderSelector $selector = null, + int $hostIndex = 0 + ) { + $this->client = $client ?: new Client(); + $this->config = $config ?: new Configuration(); + $this->headerSelector = $selector ?: new HeaderSelector(); + $this->hostIndex = $hostIndex; + } + + /** + * Set the host index + * + * @param int $hostIndex Host index (required) + * @deprecated To be made private in the future + */ + public function setHostIndex(int $hostIndex): void + { + $this->hostIndex = $hostIndex; + } + + /** + * Get the host index + * + * @return int Host index + * @deprecated To be made private in the future + */ + public function getHostIndex() + { + return $this->hostIndex; + } + + /** + * @return Configuration + */ + public function getConfig() + { + return $this->config; + } + + /** + * @return ResponseInterface|null + */ + public function getResponse() + { + return $this->response; + } + + /** + * Operation documentDetectFields + * + * Detect Document Fields + * + * Example: https://github.com/hellosign/dropbox-sign-php/blob/main/examples/DocumentDetectFieldsExample.php + * + * @param Model\DocumentFieldDetectionRequest $document_field_detection_request document_field_detection_request (required) + * + * @return Model\DocumentFieldDetectionResponse + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + */ + public function documentDetectFields(Model\DocumentFieldDetectionRequest $document_field_detection_request) + { + list($response) = $this->documentDetectFieldsWithHttpInfo($document_field_detection_request); + return $response; + } + + /** + * Operation documentDetectFieldsWithHttpInfo + * + * Detect Document Fields + * + * Example: https://github.com/hellosign/dropbox-sign-php/blob/main/examples/DocumentDetectFieldsExample.php + * + * @param Model\DocumentFieldDetectionRequest $document_field_detection_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['documentDetectFields'] to see the possible values for this operation + * + * @return array of Model\DocumentFieldDetectionResponse, 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 ::documentDetectFields. This method will eventually become unavailable + */ + public function documentDetectFieldsWithHttpInfo(Model\DocumentFieldDetectionRequest $document_field_detection_request, string $contentType = self::contentTypes['documentDetectFields'][0]) + { + $request = $this->documentDetectFieldsRequest($document_field_detection_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\DocumentFieldDetectionResponse' === '\SplFileObject') { + $content = $response->getBody(); // stream goes to serializer + } else { + $content = (string)$response->getBody(); + if ('\Dropbox\Sign\Model\DocumentFieldDetectionResponse' !== '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\DocumentFieldDetectionResponse', []), + $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\DocumentFieldDetectionResponse'; + 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\DocumentFieldDetectionResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation documentDetectFieldsAsync + * + * Detect Document Fields + * + * Example: https://github.com/hellosign/dropbox-sign-php/blob/main/examples/DocumentDetectFieldsExample.php + * + * @param Model\DocumentFieldDetectionRequest $document_field_detection_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['documentDetectFields'] to see the possible values for this operation + * + * @return \GuzzleHttp\Promise\PromiseInterface + * @throws InvalidArgumentException + * @deprecated Prefer to use ::documentDetectFields. This method will eventually become unavailable + */ + public function documentDetectFieldsAsync(Model\DocumentFieldDetectionRequest $document_field_detection_request, string $contentType = self::contentTypes['documentDetectFields'][0]) + { + return $this->documentDetectFieldsAsyncWithHttpInfo($document_field_detection_request, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation documentDetectFieldsAsyncWithHttpInfo + * + * Detect Document Fields + * + * Example: https://github.com/hellosign/dropbox-sign-php/blob/main/examples/DocumentDetectFieldsExample.php + * + * @param Model\DocumentFieldDetectionRequest $document_field_detection_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['documentDetectFields'] to see the possible values for this operation + * + * @return \GuzzleHttp\Promise\PromiseInterface + * @throws InvalidArgumentException + * @deprecated Prefer to use ::documentDetectFields. This method will eventually become unavailable + */ + public function documentDetectFieldsAsyncWithHttpInfo(Model\DocumentFieldDetectionRequest $document_field_detection_request, string $contentType = self::contentTypes['documentDetectFields'][0]) + { + $returnType = '\Dropbox\Sign\Model\DocumentFieldDetectionResponse'; + $request = $this->documentDetectFieldsRequest($document_field_detection_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 'documentDetectFields' + * + * @param Model\DocumentFieldDetectionRequest $document_field_detection_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['documentDetectFields'] to see the possible values for this operation + * + * @return Request + * @throws InvalidArgumentException + * @deprecated Prefer to use ::documentDetectFields. This method will eventually become unavailable + */ + public function documentDetectFieldsRequest(Model\DocumentFieldDetectionRequest $document_field_detection_request, string $contentType = self::contentTypes['documentDetectFields'][0]) + { + // verify the required parameter 'document_field_detection_request' is set + if ($document_field_detection_request === null || (is_array($document_field_detection_request) && count($document_field_detection_request) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $document_field_detection_request when calling documentDetectFields' + ); + } + + $resourcePath = '/document/detect_fields'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + $formParams = ObjectSerializer::getFormParams( + $document_field_detection_request + ); + + $multipart = !empty($formParams); + + $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($document_field_detection_request)); + } else { + $httpBody = $document_field_detection_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, $document_field_detection_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 + ); + } + + /** + * Create http client option + * + * @return array of http client options + * @throws RuntimeException on file opening failure + */ + protected function createHttpClientOption() + { + $options = $this->config->getOptions(); + if ($this->config->getDebug()) { + $options[RequestOptions::DEBUG] = fopen($this->config->getDebugFile(), 'a'); + if (!$options[RequestOptions::DEBUG]) { + throw new RuntimeException('Failed to open the debug file: ' . $this->config->getDebugFile()); + } + } + + return $options; + } + + /** + * @return object|array|null + */ + private function handleRangeCodeResponse( + ResponseInterface $response, + string $rangeCode, + string $returnDataType + ) { + $statusCode = $response->getStatusCode(); + $rangeCodeLeft = (int)(substr($rangeCode, 0, 1) . '00'); + $rangeCodeRight = (int)(substr($rangeCode, 0, 1) . '99'); + + if ( + $statusCode < $rangeCodeLeft + || $statusCode > $rangeCodeRight + ) { + return null; + } + + if ($returnDataType === '\SplFileObject') { + $content = $response->getBody(); // stream goes to serializer + } else { + $content = (string)$response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, $returnDataType, []), + $statusCode, + $response->getHeaders(), + ]; + } + + /** + * @return object|array|null + */ + private function handleRangeCodeException( + ApiException $e, + string $rangeCode, + string $exceptionDataType + ): bool { + $statusCode = $e->getCode(); + $rangeCodeLeft = (int)(substr($rangeCode, 0, 1) . '00'); + $rangeCodeRight = (int)(substr($rangeCode, 0, 1) . '99'); + + if ( + $statusCode < $rangeCodeLeft + || $statusCode > $rangeCodeRight + ) { + return false; + } + + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + $exceptionDataType, + $e->getResponseHeaders() + ); + + $e->setResponseObject($data); + + return true; + } +} diff --git a/sdks/php/src/Model/DocumentFieldDetectionRequest.php b/sdks/php/src/Model/DocumentFieldDetectionRequest.php new file mode 100644 index 000000000..edadee4e7 --- /dev/null +++ b/sdks/php/src/Model/DocumentFieldDetectionRequest.php @@ -0,0 +1,528 @@ + + */ +class DocumentFieldDetectionRequest implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'DocumentFieldDetectionRequest'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'detection_mode' => 'string', + 'file' => '\SplFileObject', + 'file_url' => 'string', + 'page_range' => 'string', + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'detection_mode' => null, + 'file' => 'binary', + 'file_url' => 'uri', + 'page_range' => null, + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var bool[] + */ + protected static array $openAPINullables = [ + 'detection_mode' => false, + 'file' => false, + 'file_url' => false, + 'page_range' => 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 = [ + 'detection_mode' => 'detection_mode', + 'file' => 'file', + 'file_url' => 'file_url', + 'page_range' => 'page_range', + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'detection_mode' => 'setDetectionMode', + 'file' => 'setFile', + 'file_url' => 'setFileUrl', + 'page_range' => 'setPageRange', + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'detection_mode' => 'getDetectionMode', + 'file' => 'getFile', + 'file_url' => 'getFileUrl', + 'page_range' => 'getPageRange', + ]; + + /** + * 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('detection_mode', $data ?? [], null); + $this->setIfExists('file', $data ?? [], null); + $this->setIfExists('file_url', $data ?? [], null); + $this->setIfExists('page_range', $data ?? [], null); + } + + /** + * @deprecated use ::init() + */ + public static function fromArray(array $data): DocumentFieldDetectionRequest + { + return self::init($data); + } + + /** + * Attempt to instantiate and hydrate a new instance of this class + */ + public static function init(array $data): DocumentFieldDetectionRequest + { + /** @var DocumentFieldDetectionRequest */ + return ObjectSerializer::deserialize( + $data, + DocumentFieldDetectionRequest::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 ($this->container['detection_mode'] === null) { + $invalidProperties[] = "'detection_mode' can't be null"; + } + if (!is_null($this->container['page_range']) && !preg_match('/^(?:all|\\d+(?:-\\d+)?(?:,\\d+(?:-\\d+)?)*)$/', $this->container['page_range'])) { + $invalidProperties[] = "invalid value for 'page_range', must be conform to the pattern /^(?:all|\\d+(?:-\\d+)?(?:,\\d+(?:-\\d+)?)*)$/."; + } + + 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 detection_mode + * + * @return string + */ + public function getDetectionMode() + { + return $this->container['detection_mode']; + } + + /** + * Sets detection_mode + * + * @param string $detection_mode The field detection method to use. Set to `annotations` to detect PDF form annotations or `text_tags` to detect Dropbox Sign text tags. + * + * @return self + */ + public function setDetectionMode(string $detection_mode) + { + if (is_null($detection_mode)) { + throw new InvalidArgumentException('non-nullable detection_mode cannot be null'); + } + $this->container['detection_mode'] = $detection_mode; + + return $this; + } + + /** + * Gets file + * + * @return SplFileObject|null + */ + public function getFile() + { + return $this->container['file']; + } + + /** + * Sets file + * + * @param SplFileObject|null $file The PDF file to analyze. This endpoint requires either `file` or `file_url`, but not both. + * + * @return self + */ + public function setFile(?SplFileObject $file) + { + if (is_null($file)) { + throw new InvalidArgumentException('non-nullable file cannot be null'); + } + $this->container['file'] = $file; + + return $this; + } + + /** + * Gets file_url + * + * @return string|null + */ + public function getFileUrl() + { + return $this->container['file_url']; + } + + /** + * Sets file_url + * + * @param string|null $file_url The URL of the PDF file to analyze. This endpoint requires either `file` or `file_url`, but not both. + * + * @return self + */ + public function setFileUrl(?string $file_url) + { + if (is_null($file_url)) { + throw new InvalidArgumentException('non-nullable file_url cannot be null'); + } + $this->container['file_url'] = $file_url; + + return $this; + } + + /** + * Gets page_range + * + * @return string|null + */ + public function getPageRange() + { + return $this->container['page_range']; + } + + /** + * Sets page_range + * + * @param string|null $page_range The zero-based page indexes to analyze. Accepts `all`, individual pages, inclusive ranges, or comma-separated combinations, such as `0-2,5,7-9`. Defaults to `all`. + * + * @return self + */ + public function setPageRange(?string $page_range) + { + if (is_null($page_range)) { + throw new InvalidArgumentException('non-nullable page_range cannot be null'); + } + + if (!preg_match('/^(?:all|\\d+(?:-\\d+)?(?:,\\d+(?:-\\d+)?)*)$/', ObjectSerializer::toString($page_range))) { + throw new InvalidArgumentException('invalid value for $page_range when calling DocumentFieldDetectionRequest., must conform to the pattern /^(?:all|\\d+(?:-\\d+)?(?:,\\d+(?:-\\d+)?)*)$/.'); + } + + $this->container['page_range'] = $page_range; + + 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/php/src/Model/DocumentFieldDetectionResponse.php b/sdks/php/src/Model/DocumentFieldDetectionResponse.php new file mode 100644 index 000000000..1d6f2d14c --- /dev/null +++ b/sdks/php/src/Model/DocumentFieldDetectionResponse.php @@ -0,0 +1,450 @@ + + */ +class DocumentFieldDetectionResponse implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'DocumentFieldDetectionResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'detection_result' => '\Dropbox\Sign\Model\DocumentFieldDetectionResponseDetectionResult', + 'warnings' => '\Dropbox\Sign\Model\WarningResponse[]', + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'detection_result' => null, + 'warnings' => null, + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var bool[] + */ + protected static array $openAPINullables = [ + 'detection_result' => false, + 'warnings' => 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 = [ + 'detection_result' => 'detection_result', + 'warnings' => 'warnings', + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'detection_result' => 'setDetectionResult', + 'warnings' => 'setWarnings', + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'detection_result' => 'getDetectionResult', + 'warnings' => 'getWarnings', + ]; + + /** + * 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('detection_result', $data ?? [], null); + $this->setIfExists('warnings', $data ?? [], null); + } + + /** + * @deprecated use ::init() + */ + public static function fromArray(array $data): DocumentFieldDetectionResponse + { + return self::init($data); + } + + /** + * Attempt to instantiate and hydrate a new instance of this class + */ + public static function init(array $data): DocumentFieldDetectionResponse + { + /** @var DocumentFieldDetectionResponse */ + return ObjectSerializer::deserialize( + $data, + DocumentFieldDetectionResponse::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 ($this->container['detection_result'] === null) { + $invalidProperties[] = "'detection_result' can't be null"; + } + 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 detection_result + * + * @return DocumentFieldDetectionResponseDetectionResult + */ + public function getDetectionResult() + { + return $this->container['detection_result']; + } + + /** + * Sets detection_result + * + * @param DocumentFieldDetectionResponseDetectionResult $detection_result detection_result + * + * @return self + */ + public function setDetectionResult(DocumentFieldDetectionResponseDetectionResult $detection_result) + { + if (is_null($detection_result)) { + throw new InvalidArgumentException('non-nullable detection_result cannot be null'); + } + $this->container['detection_result'] = $detection_result; + + return $this; + } + + /** + * Gets warnings + * + * @return WarningResponse[]|null + */ + public function getWarnings() + { + return $this->container['warnings']; + } + + /** + * Sets warnings + * + * @param WarningResponse[]|null $warnings a list of warnings + * + * @return self + */ + public function setWarnings(?array $warnings) + { + if (is_null($warnings)) { + throw new InvalidArgumentException('non-nullable warnings cannot be null'); + } + $this->container['warnings'] = $warnings; + + 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/php/src/Model/DocumentFieldDetectionResponseDetectionResult.php b/sdks/php/src/Model/DocumentFieldDetectionResponseDetectionResult.php new file mode 100644 index 000000000..95232f20e --- /dev/null +++ b/sdks/php/src/Model/DocumentFieldDetectionResponseDetectionResult.php @@ -0,0 +1,773 @@ + + */ +class DocumentFieldDetectionResponseDetectionResult implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'DocumentFieldDetectionResponseDetectionResult'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'document_hash' => 'string', + 'detection_mode' => 'string', + 'page_count' => 'int', + 'pages_analyzed' => 'string', + 'detected_at' => 'int', + 'form_fields_per_document' => '\Dropbox\Sign\Model\SubFormFieldsPerDocumentBase[]', + 'form_field_groups' => '\Dropbox\Sign\Model\SubFormFieldGroup[]', + 'warnings' => '\Dropbox\Sign\Model\WarningResponse[]', + 'errors' => '\Dropbox\Sign\Model\ErrorResponseError[]', + 'suggestions' => 'string[]', + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'document_hash' => null, + 'detection_mode' => null, + 'page_count' => null, + 'pages_analyzed' => null, + 'detected_at' => 'int64', + 'form_fields_per_document' => null, + 'form_field_groups' => null, + 'warnings' => null, + 'errors' => null, + 'suggestions' => null, + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var bool[] + */ + protected static array $openAPINullables = [ + 'document_hash' => false, + 'detection_mode' => false, + 'page_count' => false, + 'pages_analyzed' => false, + 'detected_at' => false, + 'form_fields_per_document' => false, + 'form_field_groups' => false, + 'warnings' => false, + 'errors' => false, + 'suggestions' => 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 = [ + 'document_hash' => 'document_hash', + 'detection_mode' => 'detection_mode', + 'page_count' => 'page_count', + 'pages_analyzed' => 'pages_analyzed', + 'detected_at' => 'detected_at', + 'form_fields_per_document' => 'form_fields_per_document', + 'form_field_groups' => 'form_field_groups', + 'warnings' => 'warnings', + 'errors' => 'errors', + 'suggestions' => 'suggestions', + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'document_hash' => 'setDocumentHash', + 'detection_mode' => 'setDetectionMode', + 'page_count' => 'setPageCount', + 'pages_analyzed' => 'setPagesAnalyzed', + 'detected_at' => 'setDetectedAt', + 'form_fields_per_document' => 'setFormFieldsPerDocument', + 'form_field_groups' => 'setFormFieldGroups', + 'warnings' => 'setWarnings', + 'errors' => 'setErrors', + 'suggestions' => 'setSuggestions', + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'document_hash' => 'getDocumentHash', + 'detection_mode' => 'getDetectionMode', + 'page_count' => 'getPageCount', + 'pages_analyzed' => 'getPagesAnalyzed', + 'detected_at' => 'getDetectedAt', + 'form_fields_per_document' => 'getFormFieldsPerDocument', + 'form_field_groups' => 'getFormFieldGroups', + 'warnings' => 'getWarnings', + 'errors' => 'getErrors', + 'suggestions' => 'getSuggestions', + ]; + + /** + * 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('document_hash', $data ?? [], null); + $this->setIfExists('detection_mode', $data ?? [], null); + $this->setIfExists('page_count', $data ?? [], null); + $this->setIfExists('pages_analyzed', $data ?? [], null); + $this->setIfExists('detected_at', $data ?? [], null); + $this->setIfExists('form_fields_per_document', $data ?? [], null); + $this->setIfExists('form_field_groups', $data ?? [], null); + $this->setIfExists('warnings', $data ?? [], null); + $this->setIfExists('errors', $data ?? [], null); + $this->setIfExists('suggestions', $data ?? [], null); + } + + /** + * @deprecated use ::init() + */ + public static function fromArray(array $data): DocumentFieldDetectionResponseDetectionResult + { + return self::init($data); + } + + /** + * Attempt to instantiate and hydrate a new instance of this class + */ + public static function init(array $data): DocumentFieldDetectionResponseDetectionResult + { + /** @var DocumentFieldDetectionResponseDetectionResult */ + return ObjectSerializer::deserialize( + $data, + DocumentFieldDetectionResponseDetectionResult::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 ($this->container['document_hash'] === null) { + $invalidProperties[] = "'document_hash' can't be null"; + } + if (mb_strlen($this->container['document_hash']) > 64) { + $invalidProperties[] = "invalid value for 'document_hash', the character length must be smaller than or equal to 64."; + } + + if (mb_strlen($this->container['document_hash']) < 64) { + $invalidProperties[] = "invalid value for 'document_hash', the character length must be bigger than or equal to 64."; + } + + if ($this->container['detection_mode'] === null) { + $invalidProperties[] = "'detection_mode' can't be null"; + } + if ($this->container['page_count'] === null) { + $invalidProperties[] = "'page_count' can't be null"; + } + if ($this->container['page_count'] < 0) { + $invalidProperties[] = "invalid value for 'page_count', must be bigger than or equal to 0."; + } + + if ($this->container['pages_analyzed'] === null) { + $invalidProperties[] = "'pages_analyzed' can't be null"; + } + if ($this->container['detected_at'] === null) { + $invalidProperties[] = "'detected_at' can't be null"; + } + if ($this->container['form_fields_per_document'] === null) { + $invalidProperties[] = "'form_fields_per_document' can't be null"; + } + if ($this->container['form_field_groups'] === null) { + $invalidProperties[] = "'form_field_groups' can't be null"; + } + if ($this->container['warnings'] === null) { + $invalidProperties[] = "'warnings' can't be null"; + } + if ($this->container['errors'] === null) { + $invalidProperties[] = "'errors' can't be null"; + } + if ($this->container['suggestions'] === null) { + $invalidProperties[] = "'suggestions' can't be null"; + } + 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 document_hash + * + * @return string + */ + public function getDocumentHash() + { + return $this->container['document_hash']; + } + + /** + * Sets document_hash + * + * @param string $document_hash the SHA-256 hash of the analyzed document + * + * @return self + */ + public function setDocumentHash(string $document_hash) + { + if (is_null($document_hash)) { + throw new InvalidArgumentException('non-nullable document_hash cannot be null'); + } + if (mb_strlen($document_hash) > 64) { + throw new InvalidArgumentException('invalid length for $document_hash when calling DocumentFieldDetectionResponseDetectionResult., must be smaller than or equal to 64.'); + } + if (mb_strlen($document_hash) < 64) { + throw new InvalidArgumentException('invalid length for $document_hash when calling DocumentFieldDetectionResponseDetectionResult., must be bigger than or equal to 64.'); + } + + $this->container['document_hash'] = $document_hash; + + return $this; + } + + /** + * Gets detection_mode + * + * @return string + */ + public function getDetectionMode() + { + return $this->container['detection_mode']; + } + + /** + * Sets detection_mode + * + * @param string $detection_mode the field detection method used to analyze the document: `annotations` or `text_tags` + * + * @return self + */ + public function setDetectionMode(string $detection_mode) + { + if (is_null($detection_mode)) { + throw new InvalidArgumentException('non-nullable detection_mode cannot be null'); + } + $this->container['detection_mode'] = $detection_mode; + + return $this; + } + + /** + * Gets page_count + * + * @return int + */ + public function getPageCount() + { + return $this->container['page_count']; + } + + /** + * Sets page_count + * + * @param int $page_count the total number of pages in the document + * + * @return self + */ + public function setPageCount(int $page_count) + { + if (is_null($page_count)) { + throw new InvalidArgumentException('non-nullable page_count cannot be null'); + } + + if ($page_count < 0) { + throw new InvalidArgumentException('invalid value for $page_count when calling DocumentFieldDetectionResponseDetectionResult., must be bigger than or equal to 0.'); + } + + $this->container['page_count'] = $page_count; + + return $this; + } + + /** + * Gets pages_analyzed + * + * @return string + */ + public function getPagesAnalyzed() + { + return $this->container['pages_analyzed']; + } + + /** + * Sets pages_analyzed + * + * @param string $pages_analyzed the zero-based page indexes analyzed, represented by the requested `page_range`, or `all` when every page was analyzed + * + * @return self + */ + public function setPagesAnalyzed(string $pages_analyzed) + { + if (is_null($pages_analyzed)) { + throw new InvalidArgumentException('non-nullable pages_analyzed cannot be null'); + } + $this->container['pages_analyzed'] = $pages_analyzed; + + return $this; + } + + /** + * Gets detected_at + * + * @return int + */ + public function getDetectedAt() + { + return $this->container['detected_at']; + } + + /** + * Sets detected_at + * + * @param int $detected_at the Unix timestamp when the field detection result was generated + * + * @return self + */ + public function setDetectedAt(int $detected_at) + { + if (is_null($detected_at)) { + throw new InvalidArgumentException('non-nullable detected_at cannot be null'); + } + $this->container['detected_at'] = $detected_at; + + return $this; + } + + /** + * Gets form_fields_per_document + * + * @return SubFormFieldsPerDocumentBase[] + */ + public function getFormFieldsPerDocument() + { + return $this->container['form_fields_per_document']; + } + + /** + * Sets form_fields_per_document + * + * @param SubFormFieldsPerDocumentBase[] $form_fields_per_document The fields that should appear on the document, expressed as an array of objects. (For more details you can read about it here: [Using Form Fields per Document](/docs/openapi/form-fields-per-document).) **NOTE:** Fields like **text**, **dropdown**, **checkbox**, **radio**, and **hyperlink** have additional required and optional parameters. Check out the list of [additional parameters](/api/reference/constants/#form-fields-per-document) for these field types. * Text Field use `SubFormFieldsPerDocumentText` * Dropdown Field use `SubFormFieldsPerDocumentDropdown` * Hyperlink Field use `SubFormFieldsPerDocumentHyperlink` * Checkbox Field use `SubFormFieldsPerDocumentCheckbox` * Radio Field use `SubFormFieldsPerDocumentRadio` * Signature Field use `SubFormFieldsPerDocumentSignature` * Date Signed Field use `SubFormFieldsPerDocumentDateSigned` * Initials Field use `SubFormFieldsPerDocumentInitials` * Text Merge Field use `SubFormFieldsPerDocumentTextMerge` * Checkbox Merge Field use `SubFormFieldsPerDocumentCheckboxMerge` + * + * @return self + */ + public function setFormFieldsPerDocument(array $form_fields_per_document) + { + if (is_null($form_fields_per_document)) { + throw new InvalidArgumentException('non-nullable form_fields_per_document cannot be null'); + } + $this->container['form_fields_per_document'] = $form_fields_per_document; + + return $this; + } + + /** + * Gets form_field_groups + * + * @return SubFormFieldGroup[] + */ + public function getFormFieldGroups() + { + return $this->container['form_field_groups']; + } + + /** + * Sets form_field_groups + * + * @param SubFormFieldGroup[] $form_field_groups Group information for fields defined in `form_fields_per_document`. String-indexed JSON array with `group_label` and `requirement` keys. `form_fields_per_document` must contain fields referencing a group defined in `form_field_groups`. + * + * @return self + */ + public function setFormFieldGroups(array $form_field_groups) + { + if (is_null($form_field_groups)) { + throw new InvalidArgumentException('non-nullable form_field_groups cannot be null'); + } + $this->container['form_field_groups'] = $form_field_groups; + + return $this; + } + + /** + * Gets warnings + * + * @return WarningResponse[] + */ + public function getWarnings() + { + return $this->container['warnings']; + } + + /** + * Sets warnings + * + * @param WarningResponse[] $warnings non-fatal issues encountered during field detection + * + * @return self + */ + public function setWarnings(array $warnings) + { + if (is_null($warnings)) { + throw new InvalidArgumentException('non-nullable warnings cannot be null'); + } + $this->container['warnings'] = $warnings; + + return $this; + } + + /** + * Gets errors + * + * @return ErrorResponseError[] + */ + public function getErrors() + { + return $this->container['errors']; + } + + /** + * Sets errors + * + * @param ErrorResponseError[] $errors Errors encountered during field detection. Successfully detected fields may still be included in the response. + * + * @return self + */ + public function setErrors(array $errors) + { + if (is_null($errors)) { + throw new InvalidArgumentException('non-nullable errors cannot be null'); + } + $this->container['errors'] = $errors; + + return $this; + } + + /** + * Gets suggestions + * + * @return string[] + */ + public function getSuggestions() + { + return $this->container['suggestions']; + } + + /** + * Sets suggestions + * + * @param string[] $suggestions suggestions for improving the field detection results + * + * @return self + */ + public function setSuggestions(array $suggestions) + { + if (is_null($suggestions)) { + throw new InvalidArgumentException('non-nullable suggestions cannot be null'); + } + $this->container['suggestions'] = $suggestions; + + 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/php/src/Model/FaxResponse.php b/sdks/php/src/Model/FaxResponse.php index 3db2cd08e..2c260c385 100644 --- a/sdks/php/src/Model/FaxResponse.php +++ b/sdks/php/src/Model/FaxResponse.php @@ -65,6 +65,7 @@ class FaxResponse implements ModelInterface, ArrayAccess, JsonSerializable 'sender' => 'string', 'files_url' => 'string', 'transmissions' => '\Dropbox\Sign\Model\FaxResponseTransmission[]', + 'test_mode' => 'bool', 'subject' => 'string', 'message' => 'string', 'final_copy_uri' => 'string', @@ -86,6 +87,7 @@ class FaxResponse implements ModelInterface, ArrayAccess, JsonSerializable 'sender' => null, 'files_url' => null, 'transmissions' => null, + 'test_mode' => null, 'subject' => null, 'message' => null, 'final_copy_uri' => null, @@ -105,6 +107,7 @@ class FaxResponse implements ModelInterface, ArrayAccess, JsonSerializable 'sender' => false, 'files_url' => false, 'transmissions' => false, + 'test_mode' => false, 'subject' => true, 'message' => true, 'final_copy_uri' => true, @@ -196,6 +199,7 @@ public function isNullableSetToNull(string $property): bool 'sender' => 'sender', 'files_url' => 'files_url', 'transmissions' => 'transmissions', + 'test_mode' => 'test_mode', 'subject' => 'subject', 'message' => 'message', 'final_copy_uri' => 'final_copy_uri', @@ -215,6 +219,7 @@ public function isNullableSetToNull(string $property): bool 'sender' => 'setSender', 'files_url' => 'setFilesUrl', 'transmissions' => 'setTransmissions', + 'test_mode' => 'setTestMode', 'subject' => 'setSubject', 'message' => 'setMessage', 'final_copy_uri' => 'setFinalCopyUri', @@ -234,6 +239,7 @@ public function isNullableSetToNull(string $property): bool 'sender' => 'getSender', 'files_url' => 'getFilesUrl', 'transmissions' => 'getTransmissions', + 'test_mode' => 'getTestMode', 'subject' => 'getSubject', 'message' => 'getMessage', 'final_copy_uri' => 'getFinalCopyUri', @@ -303,6 +309,7 @@ public function __construct(?array $data = null) $this->setIfExists('sender', $data ?? [], null); $this->setIfExists('files_url', $data ?? [], null); $this->setIfExists('transmissions', $data ?? [], null); + $this->setIfExists('test_mode', $data ?? [], false); $this->setIfExists('subject', $data ?? [], null); $this->setIfExists('message', $data ?? [], null); $this->setIfExists('final_copy_uri', $data ?? [], null); @@ -377,6 +384,9 @@ public function listInvalidProperties() if ($this->container['transmissions'] === null) { $invalidProperties[] = "'transmissions' can't be null"; } + if ($this->container['test_mode'] === null) { + $invalidProperties[] = "'test_mode' can't be null"; + } return $invalidProperties; } @@ -607,6 +617,33 @@ public function setTransmissions(array $transmissions) return $this; } + /** + * Gets test_mode + * + * @return bool + */ + public function getTestMode() + { + return $this->container['test_mode']; + } + + /** + * Sets test_mode + * + * @param bool $test_mode Whether this is a test fax. Test faxes are not delivered to the recipient. Defaults to `false`. + * + * @return self + */ + public function setTestMode(bool $test_mode) + { + if (is_null($test_mode)) { + throw new InvalidArgumentException('non-nullable test_mode cannot be null'); + } + $this->container['test_mode'] = $test_mode; + + return $this; + } + /** * Gets subject * diff --git a/sdks/php/src/Model/SignatureRequestBulkCreateEmbeddedWithTemplateRequest.php b/sdks/php/src/Model/SignatureRequestBulkCreateEmbeddedWithTemplateRequest.php index b5f51a559..ce85cb62f 100644 --- a/sdks/php/src/Model/SignatureRequestBulkCreateEmbeddedWithTemplateRequest.php +++ b/sdks/php/src/Model/SignatureRequestBulkCreateEmbeddedWithTemplateRequest.php @@ -71,6 +71,7 @@ class SignatureRequestBulkCreateEmbeddedWithTemplateRequest implements ModelInte 'subject' => 'string', 'test_mode' => 'bool', 'title' => 'string', + 'expires_at' => 'int', ]; /** @@ -94,6 +95,7 @@ class SignatureRequestBulkCreateEmbeddedWithTemplateRequest implements ModelInte 'subject' => null, 'test_mode' => null, 'title' => null, + 'expires_at' => null, ]; /** @@ -115,6 +117,7 @@ class SignatureRequestBulkCreateEmbeddedWithTemplateRequest implements ModelInte 'subject' => false, 'test_mode' => false, 'title' => false, + 'expires_at' => true, ]; /** @@ -208,6 +211,7 @@ public function isNullableSetToNull(string $property): bool 'subject' => 'subject', 'test_mode' => 'test_mode', 'title' => 'title', + 'expires_at' => 'expires_at', ]; /** @@ -229,6 +233,7 @@ public function isNullableSetToNull(string $property): bool 'subject' => 'setSubject', 'test_mode' => 'setTestMode', 'title' => 'setTitle', + 'expires_at' => 'setExpiresAt', ]; /** @@ -250,6 +255,7 @@ public function isNullableSetToNull(string $property): bool 'subject' => 'getSubject', 'test_mode' => 'getTestMode', 'title' => 'getTitle', + 'expires_at' => 'getExpiresAt', ]; /** @@ -321,6 +327,7 @@ public function __construct(?array $data = null) $this->setIfExists('subject', $data ?? [], null); $this->setIfExists('test_mode', $data ?? [], false); $this->setIfExists('title', $data ?? [], null); + $this->setIfExists('expires_at', $data ?? [], null); } /** @@ -764,6 +771,40 @@ public function setTitle(?string $title) return $this; } + /** + * Gets expires_at + * + * @return int|null + */ + public function getExpiresAt() + { + return $this->container['expires_at']; + } + + /** + * Sets expires_at + * + * @param int|null $expires_at When the signature request will expire. Unsigned signatures will be moved to the expired status, and no longer signable. See [Signature Request Expiration Date](https://developers.hellosign.com/docs/signature-request/expiration/) for details. + * + * @return self + */ + public function setExpiresAt(?int $expires_at) + { + if (is_null($expires_at)) { + array_push($this->openAPINullablesSetToNull, 'expires_at'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('expires_at', $nullablesSetToNull); + if ($index !== false) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['expires_at'] = $expires_at; + + return $this; + } + /** * Returns true if offset exists. False otherwise. * diff --git a/sdks/php/src/Model/SignatureRequestBulkSendWithTemplateRequest.php b/sdks/php/src/Model/SignatureRequestBulkSendWithTemplateRequest.php index 3ad0b37af..13c584b47 100644 --- a/sdks/php/src/Model/SignatureRequestBulkSendWithTemplateRequest.php +++ b/sdks/php/src/Model/SignatureRequestBulkSendWithTemplateRequest.php @@ -71,6 +71,7 @@ class SignatureRequestBulkSendWithTemplateRequest implements ModelInterface, Arr 'subject' => 'string', 'test_mode' => 'bool', 'title' => 'string', + 'expires_at' => 'int', ]; /** @@ -94,6 +95,7 @@ class SignatureRequestBulkSendWithTemplateRequest implements ModelInterface, Arr 'subject' => null, 'test_mode' => null, 'title' => null, + 'expires_at' => null, ]; /** @@ -115,6 +117,7 @@ class SignatureRequestBulkSendWithTemplateRequest implements ModelInterface, Arr 'subject' => false, 'test_mode' => false, 'title' => false, + 'expires_at' => true, ]; /** @@ -208,6 +211,7 @@ public function isNullableSetToNull(string $property): bool 'subject' => 'subject', 'test_mode' => 'test_mode', 'title' => 'title', + 'expires_at' => 'expires_at', ]; /** @@ -229,6 +233,7 @@ public function isNullableSetToNull(string $property): bool 'subject' => 'setSubject', 'test_mode' => 'setTestMode', 'title' => 'setTitle', + 'expires_at' => 'setExpiresAt', ]; /** @@ -250,6 +255,7 @@ public function isNullableSetToNull(string $property): bool 'subject' => 'getSubject', 'test_mode' => 'getTestMode', 'title' => 'getTitle', + 'expires_at' => 'getExpiresAt', ]; /** @@ -321,6 +327,7 @@ public function __construct(?array $data = null) $this->setIfExists('subject', $data ?? [], null); $this->setIfExists('test_mode', $data ?? [], false); $this->setIfExists('title', $data ?? [], null); + $this->setIfExists('expires_at', $data ?? [], null); } /** @@ -761,6 +768,40 @@ public function setTitle(?string $title) return $this; } + /** + * Gets expires_at + * + * @return int|null + */ + public function getExpiresAt() + { + return $this->container['expires_at']; + } + + /** + * Sets expires_at + * + * @param int|null $expires_at When the signature request will expire. Unsigned signatures will be moved to the expired status, and no longer signable. See [Signature Request Expiration Date](https://developers.hellosign.com/docs/signature-request/expiration/) for details. + * + * @return self + */ + public function setExpiresAt(?int $expires_at) + { + if (is_null($expires_at)) { + array_push($this->openAPINullablesSetToNull, 'expires_at'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('expires_at', $nullablesSetToNull); + if ($index !== false) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['expires_at'] = $expires_at; + + return $this; + } + /** * Returns true if offset exists. False otherwise. * diff --git a/sdks/php/src/Model/SignatureRequestCreateEmbeddedWithTemplateRequest.php b/sdks/php/src/Model/SignatureRequestCreateEmbeddedWithTemplateRequest.php index b90396231..ffd796b62 100644 --- a/sdks/php/src/Model/SignatureRequestCreateEmbeddedWithTemplateRequest.php +++ b/sdks/php/src/Model/SignatureRequestCreateEmbeddedWithTemplateRequest.php @@ -73,6 +73,7 @@ class SignatureRequestCreateEmbeddedWithTemplateRequest implements ModelInterfac 'test_mode' => 'bool', 'title' => 'string', 'populate_auto_fill_fields' => 'bool', + 'expires_at' => 'int', ]; /** @@ -98,6 +99,7 @@ class SignatureRequestCreateEmbeddedWithTemplateRequest implements ModelInterfac 'test_mode' => null, 'title' => null, 'populate_auto_fill_fields' => null, + 'expires_at' => null, ]; /** @@ -121,6 +123,7 @@ class SignatureRequestCreateEmbeddedWithTemplateRequest implements ModelInterfac 'test_mode' => false, 'title' => false, 'populate_auto_fill_fields' => false, + 'expires_at' => true, ]; /** @@ -216,6 +219,7 @@ public function isNullableSetToNull(string $property): bool 'test_mode' => 'test_mode', 'title' => 'title', 'populate_auto_fill_fields' => 'populate_auto_fill_fields', + 'expires_at' => 'expires_at', ]; /** @@ -239,6 +243,7 @@ public function isNullableSetToNull(string $property): bool 'test_mode' => 'setTestMode', 'title' => 'setTitle', 'populate_auto_fill_fields' => 'setPopulateAutoFillFields', + 'expires_at' => 'setExpiresAt', ]; /** @@ -262,6 +267,7 @@ public function isNullableSetToNull(string $property): bool 'test_mode' => 'getTestMode', 'title' => 'getTitle', 'populate_auto_fill_fields' => 'getPopulateAutoFillFields', + 'expires_at' => 'getExpiresAt', ]; /** @@ -335,6 +341,7 @@ public function __construct(?array $data = null) $this->setIfExists('test_mode', $data ?? [], false); $this->setIfExists('title', $data ?? [], null); $this->setIfExists('populate_auto_fill_fields', $data ?? [], false); + $this->setIfExists('expires_at', $data ?? [], null); } /** @@ -835,6 +842,40 @@ public function setPopulateAutoFillFields(?bool $populate_auto_fill_fields) return $this; } + /** + * Gets expires_at + * + * @return int|null + */ + public function getExpiresAt() + { + return $this->container['expires_at']; + } + + /** + * Sets expires_at + * + * @param int|null $expires_at When the signature request will expire. Unsigned signatures will be moved to the expired status, and no longer signable. See [Signature Request Expiration Date](https://developers.hellosign.com/docs/signature-request/expiration/) for details. + * + * @return self + */ + public function setExpiresAt(?int $expires_at) + { + if (is_null($expires_at)) { + array_push($this->openAPINullablesSetToNull, 'expires_at'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('expires_at', $nullablesSetToNull); + if ($index !== false) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['expires_at'] = $expires_at; + + return $this; + } + /** * Returns true if offset exists. False otherwise. * diff --git a/sdks/php/src/Model/SignatureRequestSendWithTemplateRequest.php b/sdks/php/src/Model/SignatureRequestSendWithTemplateRequest.php index b7487179c..04c560341 100644 --- a/sdks/php/src/Model/SignatureRequestSendWithTemplateRequest.php +++ b/sdks/php/src/Model/SignatureRequestSendWithTemplateRequest.php @@ -76,6 +76,7 @@ class SignatureRequestSendWithTemplateRequest implements ModelInterface, ArrayAc 'subject' => 'string', 'test_mode' => 'bool', 'title' => 'string', + 'expires_at' => 'int', ]; /** @@ -103,6 +104,7 @@ class SignatureRequestSendWithTemplateRequest implements ModelInterface, ArrayAc 'subject' => null, 'test_mode' => null, 'title' => null, + 'expires_at' => null, ]; /** @@ -128,6 +130,7 @@ class SignatureRequestSendWithTemplateRequest implements ModelInterface, ArrayAc 'subject' => false, 'test_mode' => false, 'title' => false, + 'expires_at' => true, ]; /** @@ -225,6 +228,7 @@ public function isNullableSetToNull(string $property): bool 'subject' => 'subject', 'test_mode' => 'test_mode', 'title' => 'title', + 'expires_at' => 'expires_at', ]; /** @@ -250,6 +254,7 @@ public function isNullableSetToNull(string $property): bool 'subject' => 'setSubject', 'test_mode' => 'setTestMode', 'title' => 'setTitle', + 'expires_at' => 'setExpiresAt', ]; /** @@ -275,6 +280,7 @@ public function isNullableSetToNull(string $property): bool 'subject' => 'getSubject', 'test_mode' => 'getTestMode', 'title' => 'getTitle', + 'expires_at' => 'getExpiresAt', ]; /** @@ -350,6 +356,7 @@ public function __construct(?array $data = null) $this->setIfExists('subject', $data ?? [], null); $this->setIfExists('test_mode', $data ?? [], false); $this->setIfExists('title', $data ?? [], null); + $this->setIfExists('expires_at', $data ?? [], null); } /** @@ -903,6 +910,40 @@ public function setTitle(?string $title) return $this; } + /** + * Gets expires_at + * + * @return int|null + */ + public function getExpiresAt() + { + return $this->container['expires_at']; + } + + /** + * Sets expires_at + * + * @param int|null $expires_at When the signature request will expire. Unsigned signatures will be moved to the expired status, and no longer signable. See [Signature Request Expiration Date](https://developers.hellosign.com/docs/signature-request/expiration/) for details. + * + * @return self + */ + public function setExpiresAt(?int $expires_at) + { + if (is_null($expires_at)) { + array_push($this->openAPINullablesSetToNull, 'expires_at'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('expires_at', $nullablesSetToNull); + if ($index !== false) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['expires_at'] = $expires_at; + + return $this; + } + /** * Returns true if offset exists. False otherwise. * diff --git a/sdks/python/README.md b/sdks/python/README.md index 1837792ca..820c67eb6 100644 --- a/sdks/python/README.md +++ b/sdks/python/README.md @@ -114,6 +114,7 @@ Class | Method | HTTP request | Description ```ApiAppApi``` | [```api_app_update```](docs/ApiAppApi.md#api_app_update) | ```PUT /api_app/{client_id}``` | Update API App| |```BulkSendJobApi``` | [```bulk_send_job_get```](docs/BulkSendJobApi.md#bulk_send_job_get) | ```GET /bulk_send_job/{bulk_send_job_id}``` | Get Bulk Send Job| ```BulkSendJobApi``` | [```bulk_send_job_list```](docs/BulkSendJobApi.md#bulk_send_job_list) | ```GET /bulk_send_job/list``` | List Bulk Send Jobs| +|```DocumentApi``` | [```document_detect_fields```](docs/DocumentApi.md#document_detect_fields) | ```POST /document/detect_fields``` | Detect Document Fields| |```EmbeddedApi``` | [```embedded_edit_url```](docs/EmbeddedApi.md#embedded_edit_url) | ```POST /embedded/edit_url/{template_id}``` | Get Embedded Template Edit URL| ```EmbeddedApi``` | [```embedded_sign_url```](docs/EmbeddedApi.md#embedded_sign_url) | ```GET /embedded/sign_url/{signature_id}``` | Get Embedded Sign URL| |```FaxApi``` | [```fax_delete```](docs/FaxApi.md#fax_delete) | ```DELETE /fax/{fax_id}``` | Delete Fax| @@ -205,6 +206,9 @@ Class | Method | HTTP request | Description - [BulkSendJobListResponse](docs/BulkSendJobListResponse.md) - [BulkSendJobResponse](docs/BulkSendJobResponse.md) - [BulkSendJobSendResponse](docs/BulkSendJobSendResponse.md) + - [DocumentFieldDetectionRequest](docs/DocumentFieldDetectionRequest.md) + - [DocumentFieldDetectionResponse](docs/DocumentFieldDetectionResponse.md) + - [DocumentFieldDetectionResponseDetectionResult](docs/DocumentFieldDetectionResponseDetectionResult.md) - [EmbeddedEditUrlRequest](docs/EmbeddedEditUrlRequest.md) - [EmbeddedEditUrlResponse](docs/EmbeddedEditUrlResponse.md) - [EmbeddedEditUrlResponseEmbedded](docs/EmbeddedEditUrlResponseEmbedded.md) diff --git a/sdks/python/docs/DocumentApi.md b/sdks/python/docs/DocumentApi.md new file mode 100644 index 000000000..c5e2321c9 --- /dev/null +++ b/sdks/python/docs/DocumentApi.md @@ -0,0 +1,79 @@ +# ```dropbox_sign.DocumentApi``` + +All URIs are relative to *https://api.hellosign.com/v3* + +Method | HTTP request | Description +------------- | ------------- | ------------- +|[```document_detect_fields```](DocumentApi.md#document_detect_fields) | ```POST /document/detect_fields``` | Detect Document Fields| + + +# ```document_detect_fields``` +> ```DocumentFieldDetectionResponse document_detect_fields(document_field_detection_request)``` + +Detect Document Fields + +Detects form fields in a PDF document using either PDF form annotations or Dropbox Sign text tags. + +### 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: + document_field_detection_request = models.DocumentFieldDetectionRequest( + detection_mode="annotations", + file=open("./example_document.pdf", "rb").read(), + page_range="all", + ) + + try: + response = api.DocumentApi(api_client).document_detect_fields( + document_field_detection_request=document_field_detection_request, + ) + + pprint(response) + except ApiException as e: + print("Exception when calling DocumentApi#document_detect_fields: %s\n" % e) + +``` +``` + +### Parameters +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| `document_field_detection_request` | [**DocumentFieldDetectionRequest**](DocumentFieldDetectionRequest.md) | | | + +### Return type + +[**DocumentFieldDetectionResponse**](DocumentFieldDetectionResponse.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) + diff --git a/sdks/python/docs/DocumentFieldDetectionRequest.md b/sdks/python/docs/DocumentFieldDetectionRequest.md new file mode 100644 index 000000000..8476b7ddd --- /dev/null +++ b/sdks/python/docs/DocumentFieldDetectionRequest.md @@ -0,0 +1,15 @@ +# DocumentFieldDetectionRequest + + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +| `detection_mode`*_required_ | ```str``` | The field detection method to use. Set to `annotations` to detect PDF form annotations or `text_tags` to detect Dropbox Sign text tags. | | +| `file` | ```io.IOBase``` | The PDF file to analyze.

This endpoint requires either `file` or `file_url`, but not both. | | +| `file_url` | ```str``` | The URL of the PDF file to analyze.

This endpoint requires either `file` or `file_url`, but not both. | | +| `page_range` | ```str``` | The zero-based page indexes to analyze. Accepts `all`, individual pages, inclusive ranges, or comma-separated combinations, such as `0-2,5,7-9`. Defaults to `all`. | | + +[[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/docs/DocumentFieldDetectionResponse.md b/sdks/python/docs/DocumentFieldDetectionResponse.md new file mode 100644 index 000000000..59acfd2f9 --- /dev/null +++ b/sdks/python/docs/DocumentFieldDetectionResponse.md @@ -0,0 +1,13 @@ +# DocumentFieldDetectionResponse + + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +| `detection_result`*_required_ | [```DocumentFieldDetectionResponseDetectionResult```](DocumentFieldDetectionResponseDetectionResult.md) | | | +| `warnings` | [```List[WarningResponse]```](WarningResponse.md) | A list of warnings. | | + +[[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/docs/DocumentFieldDetectionResponseDetectionResult.md b/sdks/python/docs/DocumentFieldDetectionResponseDetectionResult.md new file mode 100644 index 000000000..15e3abaf3 --- /dev/null +++ b/sdks/python/docs/DocumentFieldDetectionResponseDetectionResult.md @@ -0,0 +1,21 @@ +# DocumentFieldDetectionResponseDetectionResult + + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +| `document_hash`*_required_ | ```str``` | The SHA-256 hash of the analyzed document. | | +| `detection_mode`*_required_ | ```str``` | The field detection method used to analyze the document: `annotations` or `text_tags`. | | +| `page_count`*_required_ | ```int``` | The total number of pages in the document. | | +| `pages_analyzed`*_required_ | ```str``` | The zero-based page indexes analyzed, represented by the requested `page_range`, or `all` when every page was analyzed. | | +| `detected_at`*_required_ | ```int``` | The Unix timestamp when the field detection result was generated. | | +| `form_fields_per_document`*_required_ | [```List[SubFormFieldsPerDocumentBase]```](SubFormFieldsPerDocumentBase.md) | The fields that should appear on the document, expressed as an array of objects. (For more details you can read about it here: [Using Form Fields per Document](/docs/openapi/form-fields-per-document).)

**NOTE:** Fields like **text**, **dropdown**, **checkbox**, **radio**, and **hyperlink** have additional required and optional parameters. Check out the list of [additional parameters](/api/reference/constants/#form-fields-per-document) for these field types.

* Text Field use `SubFormFieldsPerDocumentText`
* Dropdown Field use `SubFormFieldsPerDocumentDropdown`
* Hyperlink Field use `SubFormFieldsPerDocumentHyperlink`
* Checkbox Field use `SubFormFieldsPerDocumentCheckbox`
* Radio Field use `SubFormFieldsPerDocumentRadio`
* Signature Field use `SubFormFieldsPerDocumentSignature`
* Date Signed Field use `SubFormFieldsPerDocumentDateSigned`
* Initials Field use `SubFormFieldsPerDocumentInitials`
* Text Merge Field use `SubFormFieldsPerDocumentTextMerge`
* Checkbox Merge Field use `SubFormFieldsPerDocumentCheckboxMerge` | | +| `form_field_groups`*_required_ | [```List[SubFormFieldGroup]```](SubFormFieldGroup.md) | Group information for fields defined in `form_fields_per_document`. String-indexed JSON array with `group_label` and `requirement` keys. `form_fields_per_document` must contain fields referencing a group defined in `form_field_groups`. | | +| `warnings`*_required_ | [```List[WarningResponse]```](WarningResponse.md) | Non-fatal issues encountered during field detection. | | +| `errors`*_required_ | [```List[ErrorResponseError]```](ErrorResponseError.md) | Errors encountered during field detection. Successfully detected fields may still be included in the response. | | +| `suggestions`*_required_ | ```List[str]``` | Suggestions for improving the field detection results. | | + +[[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/docs/FaxResponse.md b/sdks/python/docs/FaxResponse.md index 81070c5aa..3f7f49b61 100644 --- a/sdks/python/docs/FaxResponse.md +++ b/sdks/python/docs/FaxResponse.md @@ -13,6 +13,7 @@ Name | Type | Description | Notes | `sender`*_required_ | ```str``` | Fax Sender Email | | | `files_url`*_required_ | ```str``` | Fax Files URL | | | `transmissions`*_required_ | [```List[FaxResponseTransmission]```](FaxResponseTransmission.md) | Fax Transmissions List | | +| `test_mode`*_required_ | ```bool``` | Whether this is a test fax. Test faxes are not delivered to the recipient. Defaults to `false`. | [default to False] | | `subject` | ```str``` | Fax Subject | | | `message` | ```str``` | Fax Message | | | `final_copy_uri` | ```str``` | The path where the completed document can be downloaded | | diff --git a/sdks/python/docs/SignatureRequestBulkCreateEmbeddedWithTemplateRequest.md b/sdks/python/docs/SignatureRequestBulkCreateEmbeddedWithTemplateRequest.md index d09fa3c05..21530206a 100644 --- a/sdks/python/docs/SignatureRequestBulkCreateEmbeddedWithTemplateRequest.md +++ b/sdks/python/docs/SignatureRequestBulkCreateEmbeddedWithTemplateRequest.md @@ -18,6 +18,7 @@ Name | Type | Description | Notes | `subject` | ```str``` | The subject in the email that will be sent to the signers. | | | `test_mode` | ```bool``` | Whether this is a test, the signature request will not be legally binding if set to `true`. Defaults to `false`. | [default to False] | | `title` | ```str``` | The title you want to assign to the SignatureRequest. | | +| `expires_at` | ```int``` | When the signature request will expire. Unsigned signatures will be moved to the expired status, and no longer signable. See [Signature Request Expiration Date](https://developers.hellosign.com/docs/signature-request/expiration/) for details. | | [[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/docs/SignatureRequestBulkSendWithTemplateRequest.md b/sdks/python/docs/SignatureRequestBulkSendWithTemplateRequest.md index 0780a3cea..f400bd969 100644 --- a/sdks/python/docs/SignatureRequestBulkSendWithTemplateRequest.md +++ b/sdks/python/docs/SignatureRequestBulkSendWithTemplateRequest.md @@ -18,6 +18,7 @@ Name | Type | Description | Notes | `subject` | ```str``` | The subject in the email that will be sent to the signers. | | | `test_mode` | ```bool``` | Whether this is a test, the signature request will not be legally binding if set to `true`. Defaults to `false`. | [default to False] | | `title` | ```str``` | The title you want to assign to the SignatureRequest. | | +| `expires_at` | ```int``` | When the signature request will expire. Unsigned signatures will be moved to the expired status, and no longer signable. See [Signature Request Expiration Date](https://developers.hellosign.com/docs/signature-request/expiration/) for details. | | [[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/docs/SignatureRequestCreateEmbeddedWithTemplateRequest.md b/sdks/python/docs/SignatureRequestCreateEmbeddedWithTemplateRequest.md index 261759720..f9a07ce48 100644 --- a/sdks/python/docs/SignatureRequestCreateEmbeddedWithTemplateRequest.md +++ b/sdks/python/docs/SignatureRequestCreateEmbeddedWithTemplateRequest.md @@ -20,6 +20,7 @@ Name | Type | Description | Notes | `test_mode` | ```bool``` | Whether this is a test, the signature request will not be legally binding if set to `true`. Defaults to `false`. | [default to False] | | `title` | ```str``` | The title you want to assign to the SignatureRequest. | | | `populate_auto_fill_fields` | ```bool``` | Controls whether [auto fill fields](https://faq.hellosign.com/hc/en-us/articles/360051467511-Auto-Fill-Fields) can automatically populate a signer's information during signing.

**NOTE:** Keep your signer's information safe by ensuring that the _signer on your signature request is the intended party_ before using this feature. | [default to False] | +| `expires_at` | ```int``` | When the signature request will expire. Unsigned signatures will be moved to the expired status, and no longer signable. See [Signature Request Expiration Date](https://developers.hellosign.com/docs/signature-request/expiration/) for details. | | [[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/docs/SignatureRequestSendWithTemplateRequest.md b/sdks/python/docs/SignatureRequestSendWithTemplateRequest.md index 6cdff0346..8b2637d01 100644 --- a/sdks/python/docs/SignatureRequestSendWithTemplateRequest.md +++ b/sdks/python/docs/SignatureRequestSendWithTemplateRequest.md @@ -22,6 +22,7 @@ Name | Type | Description | Notes | `subject` | ```str``` | The subject in the email that will be sent to the signers. | | | `test_mode` | ```bool``` | Whether this is a test, the signature request will not be legally binding if set to `true`. Defaults to `false`. | [default to False] | | `title` | ```str``` | The title you want to assign to the SignatureRequest. | | +| `expires_at` | ```int``` | When the signature request will expire. Unsigned signatures will be moved to the expired status, and no longer signable. See [Signature Request Expiration Date](https://developers.hellosign.com/docs/signature-request/expiration/) for details. | | [[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 a45398df8..7ce90d462 100644 --- a/sdks/python/dropbox_sign/__init__.py +++ b/sdks/python/dropbox_sign/__init__.py @@ -65,6 +65,15 @@ from dropbox_sign.models.bulk_send_job_list_response import BulkSendJobListResponse from dropbox_sign.models.bulk_send_job_response import BulkSendJobResponse from dropbox_sign.models.bulk_send_job_send_response import BulkSendJobSendResponse +from dropbox_sign.models.document_field_detection_request import ( + DocumentFieldDetectionRequest, +) +from dropbox_sign.models.document_field_detection_response import ( + DocumentFieldDetectionResponse, +) +from dropbox_sign.models.document_field_detection_response_detection_result import ( + DocumentFieldDetectionResponseDetectionResult, +) from dropbox_sign.models.embedded_edit_url_request import EmbeddedEditUrlRequest from dropbox_sign.models.embedded_edit_url_response import EmbeddedEditUrlResponse from dropbox_sign.models.embedded_edit_url_response_embedded import ( diff --git a/sdks/python/dropbox_sign/api/__init__.py b/sdks/python/dropbox_sign/api/__init__.py index f4000e522..7a9e7fa08 100644 --- a/sdks/python/dropbox_sign/api/__init__.py +++ b/sdks/python/dropbox_sign/api/__init__.py @@ -4,6 +4,7 @@ from dropbox_sign.api.account_api import AccountApi from dropbox_sign.api.api_app_api import ApiAppApi from dropbox_sign.api.bulk_send_job_api import BulkSendJobApi +from dropbox_sign.api.document_api import DocumentApi from dropbox_sign.api.embedded_api import EmbeddedApi from dropbox_sign.api.fax_api import FaxApi from dropbox_sign.api.fax_line_api import FaxLineApi diff --git a/sdks/python/dropbox_sign/api/document_api.py b/sdks/python/dropbox_sign/api/document_api.py new file mode 100644 index 000000000..eb92dc1c2 --- /dev/null +++ b/sdks/python/dropbox_sign/api/document_api.py @@ -0,0 +1,329 @@ +# 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 + +import warnings +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union +from typing_extensions import Annotated + +from dropbox_sign.models.document_field_detection_request import ( + DocumentFieldDetectionRequest, +) +from dropbox_sign.models.document_field_detection_response import ( + DocumentFieldDetectionResponse, +) + +from dropbox_sign.api_client import ApiClient, RequestSerialized +from dropbox_sign.api_response import ApiResponse +from dropbox_sign.rest import RESTResponseType +import io + + +class DocumentApi: + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None) -> None: + if api_client is None: + api_client = ApiClient.get_default() + self.api_client = api_client + + @validate_call + def document_detect_fields( + self, + document_field_detection_request: DocumentFieldDetectionRequest, + _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, + ) -> DocumentFieldDetectionResponse: + """Detect Document Fields + + Detects form fields in a PDF document using either PDF form annotations or Dropbox Sign text tags. + + Example: https://github.com/hellosign/dropbox-sign-python/blob/main/examples/DocumentDetectFieldsExample.py + + :param document_field_detection_request: (required) + :type document_field_detection_request: DocumentFieldDetectionRequest + :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._document_detect_fields_serialize( + document_field_detection_request=document_field_detection_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "DocumentFieldDetectionResponse", + "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 document_detect_fields_with_http_info( + self, + document_field_detection_request: DocumentFieldDetectionRequest, + _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[DocumentFieldDetectionResponse]: + """Detect Document Fields + + Detects form fields in a PDF document using either PDF form annotations or Dropbox Sign text tags. + + Example: https://github.com/hellosign/dropbox-sign-python/blob/main/examples/DocumentDetectFieldsExample.py + + :param document_field_detection_request: (required) + :type document_field_detection_request: DocumentFieldDetectionRequest + :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._document_detect_fields_serialize( + document_field_detection_request=document_field_detection_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "DocumentFieldDetectionResponse", + "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 document_detect_fields_without_preload_content( + self, + document_field_detection_request: DocumentFieldDetectionRequest, + _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: + """Detect Document Fields + + Detects form fields in a PDF document using either PDF form annotations or Dropbox Sign text tags. + + Example: https://github.com/hellosign/dropbox-sign-python/blob/main/examples/DocumentDetectFieldsExample.py + + :param document_field_detection_request: (required) + :type document_field_detection_request: DocumentFieldDetectionRequest + :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._document_detect_fields_serialize( + document_field_detection_request=document_field_detection_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "DocumentFieldDetectionResponse", + "4XX": "ErrorResponse", + } + + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + return response_data.response + + def _document_detect_fields_serialize( + self, + document_field_detection_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 = document_field_detection_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 + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if document_field_detection_request is not None and has_files is False: + _body_params = document_field_detection_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="/document/detect_fields", + 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, + ) diff --git a/sdks/python/dropbox_sign/apis/__init__.py b/sdks/python/dropbox_sign/apis/__init__.py index 0df638089..819c49c0d 100644 --- a/sdks/python/dropbox_sign/apis/__init__.py +++ b/sdks/python/dropbox_sign/apis/__init__.py @@ -4,6 +4,7 @@ from dropbox_sign.api.account_api import AccountApi from dropbox_sign.api.api_app_api import ApiAppApi from dropbox_sign.api.bulk_send_job_api import BulkSendJobApi +from dropbox_sign.api.document_api import DocumentApi from dropbox_sign.api.embedded_api import EmbeddedApi from dropbox_sign.api.fax_api import FaxApi from dropbox_sign.api.fax_line_api import FaxLineApi diff --git a/sdks/python/dropbox_sign/models/__init__.py b/sdks/python/dropbox_sign/models/__init__.py index 2fd334213..fd379ccb5 100644 --- a/sdks/python/dropbox_sign/models/__init__.py +++ b/sdks/python/dropbox_sign/models/__init__.py @@ -48,6 +48,15 @@ from dropbox_sign.models.bulk_send_job_list_response import BulkSendJobListResponse from dropbox_sign.models.bulk_send_job_response import BulkSendJobResponse from dropbox_sign.models.bulk_send_job_send_response import BulkSendJobSendResponse +from dropbox_sign.models.document_field_detection_request import ( + DocumentFieldDetectionRequest, +) +from dropbox_sign.models.document_field_detection_response import ( + DocumentFieldDetectionResponse, +) +from dropbox_sign.models.document_field_detection_response_detection_result import ( + DocumentFieldDetectionResponseDetectionResult, +) from dropbox_sign.models.embedded_edit_url_request import EmbeddedEditUrlRequest from dropbox_sign.models.embedded_edit_url_response import EmbeddedEditUrlResponse from dropbox_sign.models.embedded_edit_url_response_embedded import ( diff --git a/sdks/python/dropbox_sign/models/document_field_detection_request.py b/sdks/python/dropbox_sign/models/document_field_detection_request.py new file mode 100644 index 000000000..7c501fc01 --- /dev/null +++ b/sdks/python/dropbox_sign/models/document_field_detection_request.py @@ -0,0 +1,171 @@ +# 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, + StrictBytes, + StrictStr, + field_validator, +) +from typing import Any, ClassVar, Dict, List, Optional, Tuple, Union +from typing_extensions import Annotated +from typing import Optional, Set +from typing_extensions import Self +from typing import Tuple, Union +import io +from pydantic import StrictBool + + +class DocumentFieldDetectionRequest(BaseModel): + """ + DocumentFieldDetectionRequest + """ # noqa: E501 + + detection_mode: StrictStr = Field( + description="The field detection method to use. Set to `annotations` to detect PDF form annotations or `text_tags` to detect Dropbox Sign text tags." + ) + file: Optional[Union[StrictBytes, StrictStr, io.IOBase, Tuple[StrictStr, StrictBytes, io.IOBase]]] = ( + Field( + default=None, + description="The PDF file to analyze. This endpoint requires either `file` or `file_url`, but not both.", + ) + ) + file_url: Optional[StrictStr] = Field( + default=None, + description="The URL of the PDF file to analyze. This endpoint requires either `file` or `file_url`, but not both.", + ) + page_range: Optional[Annotated[str, Field(strict=True)]] = Field( + default=None, + description="The zero-based page indexes to analyze. Accepts `all`, individual pages, inclusive ranges, or comma-separated combinations, such as `0-2,5,7-9`. Defaults to `all`.", + ) + __properties: ClassVar[List[str]] = [ + "detection_mode", + "file", + "file_url", + "page_range", + ] + + @field_validator("page_range") + def page_range_validate_regular_expression(cls, value): + """Validates the regular expression""" + if value is None: + return value + + if not re.match(r"^(?:all|\d+(?:-\d+)?(?:,\d+(?:-\d+)?)*)$", value): + raise ValueError( + r"must validate the regular expression /^(?:all|\d+(?:-\d+)?(?:,\d+(?:-\d+)?)*)$/" + ) + return value + + 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 DocumentFieldDetectionRequest 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, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of DocumentFieldDetectionRequest from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate( + { + "detection_mode": obj.get("detection_mode"), + "file": obj.get("file"), + "file_url": obj.get("file_url"), + "page_range": obj.get("page_range"), + } + ) + 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 { + "detection_mode": "(str,)", + "file": "(io.IOBase,)", + "file_url": "(str,)", + "page_range": "(str,)", + } + + @classmethod + def openapi_type_is_array(cls, property_name: str) -> bool: + return property_name in [] diff --git a/sdks/python/dropbox_sign/models/document_field_detection_response.py b/sdks/python/dropbox_sign/models/document_field_detection_response.py new file mode 100644 index 000000000..c20a6a887 --- /dev/null +++ b/sdks/python/dropbox_sign/models/document_field_detection_response.py @@ -0,0 +1,155 @@ +# 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 +from typing import Any, ClassVar, Dict, List, Optional +from dropbox_sign.models.document_field_detection_response_detection_result import ( + DocumentFieldDetectionResponseDetectionResult, +) +from dropbox_sign.models.warning_response import WarningResponse +from typing import Optional, Set +from typing_extensions import Self +from typing import Tuple, Union +import io +from pydantic import StrictBool + + +class DocumentFieldDetectionResponse(BaseModel): + """ + DocumentFieldDetectionResponse + """ # noqa: E501 + + detection_result: DocumentFieldDetectionResponseDetectionResult + warnings: Optional[List[WarningResponse]] = Field( + default=None, description="A list of warnings." + ) + __properties: ClassVar[List[str]] = ["detection_result", "warnings"] + + 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 DocumentFieldDetectionResponse 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 detection_result + if self.detection_result: + _dict["detection_result"] = self.detection_result.to_dict() + # override the default output from pydantic by calling `to_dict()` of each item in warnings (list) + _items = [] + if self.warnings: + for _item_warnings in self.warnings: + if _item_warnings: + _items.append(_item_warnings.to_dict()) + _dict["warnings"] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of DocumentFieldDetectionResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate( + { + "detection_result": ( + DocumentFieldDetectionResponseDetectionResult.from_dict( + obj["detection_result"] + ) + if obj.get("detection_result") is not None + else None + ), + "warnings": ( + [WarningResponse.from_dict(_item) for _item in obj["warnings"]] + if obj.get("warnings") 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 { + "detection_result": "(DocumentFieldDetectionResponseDetectionResult,)", + "warnings": "(List[WarningResponse],)", + } + + @classmethod + def openapi_type_is_array(cls, property_name: str) -> bool: + return property_name in [ + "warnings", + ] diff --git a/sdks/python/dropbox_sign/models/document_field_detection_response_detection_result.py b/sdks/python/dropbox_sign/models/document_field_detection_response_detection_result.py new file mode 100644 index 000000000..e242b0859 --- /dev/null +++ b/sdks/python/dropbox_sign/models/document_field_detection_response_detection_result.py @@ -0,0 +1,245 @@ +# 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, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List +from typing_extensions import Annotated +from dropbox_sign.models.error_response_error import ErrorResponseError +from dropbox_sign.models.sub_form_field_group import SubFormFieldGroup +from dropbox_sign.models.sub_form_fields_per_document_base import ( + SubFormFieldsPerDocumentBase, +) +from dropbox_sign.models.warning_response import WarningResponse +from typing import Optional, Set +from typing_extensions import Self +from typing import Tuple, Union +import io +from pydantic import StrictBool + + +class DocumentFieldDetectionResponseDetectionResult(BaseModel): + """ + DocumentFieldDetectionResponseDetectionResult + """ # noqa: E501 + + document_hash: Annotated[str, Field(min_length=64, strict=True, max_length=64)] = ( + Field(description="The SHA-256 hash of the analyzed document.") + ) + detection_mode: StrictStr = Field( + description="The field detection method used to analyze the document: `annotations` or `text_tags`." + ) + page_count: Annotated[int, Field(strict=True, ge=0)] = Field( + description="The total number of pages in the document." + ) + pages_analyzed: StrictStr = Field( + description="The zero-based page indexes analyzed, represented by the requested `page_range`, or `all` when every page was analyzed." + ) + detected_at: StrictInt = Field( + description="The Unix timestamp when the field detection result was generated." + ) + form_fields_per_document: List[SubFormFieldsPerDocumentBase] = Field( + description="The fields that should appear on the document, expressed as an array of objects. (For more details you can read about it here: [Using Form Fields per Document](/docs/openapi/form-fields-per-document).) **NOTE:** Fields like **text**, **dropdown**, **checkbox**, **radio**, and **hyperlink** have additional required and optional parameters. Check out the list of [additional parameters](/api/reference/constants/#form-fields-per-document) for these field types. * Text Field use `SubFormFieldsPerDocumentText` * Dropdown Field use `SubFormFieldsPerDocumentDropdown` * Hyperlink Field use `SubFormFieldsPerDocumentHyperlink` * Checkbox Field use `SubFormFieldsPerDocumentCheckbox` * Radio Field use `SubFormFieldsPerDocumentRadio` * Signature Field use `SubFormFieldsPerDocumentSignature` * Date Signed Field use `SubFormFieldsPerDocumentDateSigned` * Initials Field use `SubFormFieldsPerDocumentInitials` * Text Merge Field use `SubFormFieldsPerDocumentTextMerge` * Checkbox Merge Field use `SubFormFieldsPerDocumentCheckboxMerge`" + ) + form_field_groups: List[SubFormFieldGroup] = Field( + description="Group information for fields defined in `form_fields_per_document`. String-indexed JSON array with `group_label` and `requirement` keys. `form_fields_per_document` must contain fields referencing a group defined in `form_field_groups`." + ) + warnings: List[WarningResponse] = Field( + description="Non-fatal issues encountered during field detection." + ) + errors: List[ErrorResponseError] = Field( + description="Errors encountered during field detection. Successfully detected fields may still be included in the response." + ) + suggestions: List[StrictStr] = Field( + description="Suggestions for improving the field detection results." + ) + __properties: ClassVar[List[str]] = [ + "document_hash", + "detection_mode", + "page_count", + "pages_analyzed", + "detected_at", + "form_fields_per_document", + "form_field_groups", + "warnings", + "errors", + "suggestions", + ] + + 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 DocumentFieldDetectionResponseDetectionResult 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_per_document (list) + _items = [] + if self.form_fields_per_document: + for _item_form_fields_per_document in self.form_fields_per_document: + if _item_form_fields_per_document: + _items.append(_item_form_fields_per_document.to_dict()) + _dict["form_fields_per_document"] = _items + # override the default output from pydantic by calling `to_dict()` of each item in form_field_groups (list) + _items = [] + if self.form_field_groups: + for _item_form_field_groups in self.form_field_groups: + if _item_form_field_groups: + _items.append(_item_form_field_groups.to_dict()) + _dict["form_field_groups"] = _items + # override the default output from pydantic by calling `to_dict()` of each item in warnings (list) + _items = [] + if self.warnings: + for _item_warnings in self.warnings: + if _item_warnings: + _items.append(_item_warnings.to_dict()) + _dict["warnings"] = _items + # override the default output from pydantic by calling `to_dict()` of each item in errors (list) + _items = [] + if self.errors: + for _item_errors in self.errors: + if _item_errors: + _items.append(_item_errors.to_dict()) + _dict["errors"] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of DocumentFieldDetectionResponseDetectionResult from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate( + { + "document_hash": obj.get("document_hash"), + "detection_mode": obj.get("detection_mode"), + "page_count": obj.get("page_count"), + "pages_analyzed": obj.get("pages_analyzed"), + "detected_at": obj.get("detected_at"), + "form_fields_per_document": ( + [ + SubFormFieldsPerDocumentBase.from_dict(_item) + for _item in obj["form_fields_per_document"] + ] + if obj.get("form_fields_per_document") is not None + else None + ), + "form_field_groups": ( + [ + SubFormFieldGroup.from_dict(_item) + for _item in obj["form_field_groups"] + ] + if obj.get("form_field_groups") is not None + else None + ), + "warnings": ( + [WarningResponse.from_dict(_item) for _item in obj["warnings"]] + if obj.get("warnings") is not None + else None + ), + "errors": ( + [ErrorResponseError.from_dict(_item) for _item in obj["errors"]] + if obj.get("errors") is not None + else None + ), + "suggestions": obj.get("suggestions"), + } + ) + 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 { + "document_hash": "(str,)", + "detection_mode": "(str,)", + "page_count": "(int,)", + "pages_analyzed": "(str,)", + "detected_at": "(int,)", + "form_fields_per_document": "(List[SubFormFieldsPerDocumentBase],)", + "form_field_groups": "(List[SubFormFieldGroup],)", + "warnings": "(List[WarningResponse],)", + "errors": "(List[ErrorResponseError],)", + "suggestions": "(List[str],)", + } + + @classmethod + def openapi_type_is_array(cls, property_name: str) -> bool: + return property_name in [ + "form_fields_per_document", + "form_field_groups", + "warnings", + "errors", + "suggestions", + ] diff --git a/sdks/python/dropbox_sign/models/fax_response.py b/sdks/python/dropbox_sign/models/fax_response.py index 1648df8e2..2fab76f4d 100644 --- a/sdks/python/dropbox_sign/models/fax_response.py +++ b/sdks/python/dropbox_sign/models/fax_response.py @@ -18,7 +18,7 @@ import re # noqa: F401 import json -from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictInt, StrictStr from typing import Any, ClassVar, Dict, List, Optional from dropbox_sign.models.fax_response_transmission import FaxResponseTransmission from typing import Optional, Set @@ -43,6 +43,9 @@ class FaxResponse(BaseModel): transmissions: List[FaxResponseTransmission] = Field( description="Fax Transmissions List" ) + test_mode: StrictBool = Field( + description="Whether this is a test fax. Test faxes are not delivered to the recipient. Defaults to `false`." + ) subject: Optional[StrictStr] = Field(default=None, description="Fax Subject") message: Optional[StrictStr] = Field(default=None, description="Fax Message") final_copy_uri: Optional[StrictStr] = Field( @@ -58,6 +61,7 @@ class FaxResponse(BaseModel): "sender", "files_url", "transmissions", + "test_mode", "subject", "message", "final_copy_uri", @@ -148,6 +152,9 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if obj.get("transmissions") is not None else None ), + "test_mode": ( + obj.get("test_mode") if obj.get("test_mode") is not None else False + ), "subject": obj.get("subject"), "message": obj.get("message"), "final_copy_uri": obj.get("final_copy_uri"), @@ -176,6 +183,7 @@ def openapi_types(cls) -> Dict[str, str]: "sender": "(str,)", "files_url": "(str,)", "transmissions": "(List[FaxResponseTransmission],)", + "test_mode": "(bool,)", "subject": "(str,)", "message": "(str,)", "final_copy_uri": "(str,)", diff --git a/sdks/python/dropbox_sign/models/signature_request_bulk_create_embedded_with_template_request.py b/sdks/python/dropbox_sign/models/signature_request_bulk_create_embedded_with_template_request.py index 54fd997c1..b1558bcc3 100644 --- a/sdks/python/dropbox_sign/models/signature_request_bulk_create_embedded_with_template_request.py +++ b/sdks/python/dropbox_sign/models/signature_request_bulk_create_embedded_with_template_request.py @@ -18,7 +18,15 @@ import re # noqa: F401 import json -from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictBytes, StrictStr +from pydantic import ( + BaseModel, + ConfigDict, + Field, + StrictBool, + StrictBytes, + StrictInt, + StrictStr, +) from typing import Any, ClassVar, Dict, List, Optional, Tuple, Union from typing_extensions import Annotated from dropbox_sign.models.sub_bulk_signer_list import SubBulkSignerList @@ -88,6 +96,10 @@ class SignatureRequestBulkCreateEmbeddedWithTemplateRequest(BaseModel): default=None, description="The title you want to assign to the SignatureRequest.", ) + expires_at: Optional[StrictInt] = Field( + default=None, + description="When the signature request will expire. Unsigned signatures will be moved to the expired status, and no longer signable. See [Signature Request Expiration Date](https://developers.hellosign.com/docs/signature-request/expiration/) for details.", + ) __properties: ClassVar[List[str]] = [ "template_ids", "client_id", @@ -102,6 +114,7 @@ class SignatureRequestBulkCreateEmbeddedWithTemplateRequest(BaseModel): "subject", "test_mode", "title", + "expires_at", ] model_config = ConfigDict( @@ -219,6 +232,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: obj.get("test_mode") if obj.get("test_mode") is not None else False ), "title": obj.get("title"), + "expires_at": obj.get("expires_at"), } ) return _obj @@ -249,6 +263,7 @@ def openapi_types(cls) -> Dict[str, str]: "subject": "(str,)", "test_mode": "(bool,)", "title": "(str,)", + "expires_at": "(int,)", } @classmethod diff --git a/sdks/python/dropbox_sign/models/signature_request_bulk_send_with_template_request.py b/sdks/python/dropbox_sign/models/signature_request_bulk_send_with_template_request.py index 54cb9808f..80abb08a6 100644 --- a/sdks/python/dropbox_sign/models/signature_request_bulk_send_with_template_request.py +++ b/sdks/python/dropbox_sign/models/signature_request_bulk_send_with_template_request.py @@ -18,7 +18,15 @@ import re # noqa: F401 import json -from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictBytes, StrictStr +from pydantic import ( + BaseModel, + ConfigDict, + Field, + StrictBool, + StrictBytes, + StrictInt, + StrictStr, +) from typing import Any, ClassVar, Dict, List, Optional, Tuple, Union from typing_extensions import Annotated from dropbox_sign.models.sub_bulk_signer_list import SubBulkSignerList @@ -89,6 +97,10 @@ class SignatureRequestBulkSendWithTemplateRequest(BaseModel): default=None, description="The title you want to assign to the SignatureRequest.", ) + expires_at: Optional[StrictInt] = Field( + default=None, + description="When the signature request will expire. Unsigned signatures will be moved to the expired status, and no longer signable. See [Signature Request Expiration Date](https://developers.hellosign.com/docs/signature-request/expiration/) for details.", + ) __properties: ClassVar[List[str]] = [ "template_ids", "signer_file", @@ -103,6 +115,7 @@ class SignatureRequestBulkSendWithTemplateRequest(BaseModel): "subject", "test_mode", "title", + "expires_at", ] model_config = ConfigDict( @@ -220,6 +233,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: obj.get("test_mode") if obj.get("test_mode") is not None else False ), "title": obj.get("title"), + "expires_at": obj.get("expires_at"), } ) return _obj @@ -250,6 +264,7 @@ def openapi_types(cls) -> Dict[str, str]: "subject": "(str,)", "test_mode": "(bool,)", "title": "(str,)", + "expires_at": "(int,)", } @classmethod diff --git a/sdks/python/dropbox_sign/models/signature_request_create_embedded_with_template_request.py b/sdks/python/dropbox_sign/models/signature_request_create_embedded_with_template_request.py index 07c2d0cfe..e0e069935 100644 --- a/sdks/python/dropbox_sign/models/signature_request_create_embedded_with_template_request.py +++ b/sdks/python/dropbox_sign/models/signature_request_create_embedded_with_template_request.py @@ -18,7 +18,15 @@ import re # noqa: F401 import json -from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictBytes, StrictStr +from pydantic import ( + BaseModel, + ConfigDict, + Field, + StrictBool, + StrictBytes, + StrictInt, + StrictStr, +) from typing import Any, ClassVar, Dict, List, Optional, Tuple, Union from typing_extensions import Annotated from dropbox_sign.models.sub_cc import SubCC @@ -95,6 +103,10 @@ class SignatureRequestCreateEmbeddedWithTemplateRequest(BaseModel): default=False, description="Controls whether [auto fill fields](https://faq.hellosign.com/hc/en-us/articles/360051467511-Auto-Fill-Fields) can automatically populate a signer's information during signing. **NOTE:** Keep your signer's information safe by ensuring that the _signer on your signature request is the intended party_ before using this feature.", ) + expires_at: Optional[StrictInt] = Field( + default=None, + description="When the signature request will expire. Unsigned signatures will be moved to the expired status, and no longer signable. See [Signature Request Expiration Date](https://developers.hellosign.com/docs/signature-request/expiration/) for details.", + ) __properties: ClassVar[List[str]] = [ "template_ids", "client_id", @@ -111,6 +123,7 @@ class SignatureRequestCreateEmbeddedWithTemplateRequest(BaseModel): "test_mode", "title", "populate_auto_fill_fields", + "expires_at", ] model_config = ConfigDict( @@ -244,6 +257,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if obj.get("populate_auto_fill_fields") is not None else False ), + "expires_at": obj.get("expires_at"), } ) return _obj @@ -276,6 +290,7 @@ def openapi_types(cls) -> Dict[str, str]: "test_mode": "(bool,)", "title": "(str,)", "populate_auto_fill_fields": "(bool,)", + "expires_at": "(int,)", } @classmethod diff --git a/sdks/python/dropbox_sign/models/signature_request_send_with_template_request.py b/sdks/python/dropbox_sign/models/signature_request_send_with_template_request.py index 71cbf1153..f5c064cd1 100644 --- a/sdks/python/dropbox_sign/models/signature_request_send_with_template_request.py +++ b/sdks/python/dropbox_sign/models/signature_request_send_with_template_request.py @@ -18,7 +18,15 @@ import re # noqa: F401 import json -from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictBytes, StrictStr +from pydantic import ( + BaseModel, + ConfigDict, + Field, + StrictBool, + StrictBytes, + StrictInt, + StrictStr, +) from typing import Any, ClassVar, Dict, List, Optional, Tuple, Union from typing_extensions import Annotated from dropbox_sign.models.sub_cc import SubCC @@ -102,6 +110,10 @@ class SignatureRequestSendWithTemplateRequest(BaseModel): default=None, description="The title you want to assign to the SignatureRequest.", ) + expires_at: Optional[StrictInt] = Field( + default=None, + description="When the signature request will expire. Unsigned signatures will be moved to the expired status, and no longer signable. See [Signature Request Expiration Date](https://developers.hellosign.com/docs/signature-request/expiration/) for details.", + ) __properties: ClassVar[List[str]] = [ "template_ids", "signers", @@ -120,6 +132,7 @@ class SignatureRequestSendWithTemplateRequest(BaseModel): "subject", "test_mode", "title", + "expires_at", ] model_config = ConfigDict( @@ -255,6 +268,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: obj.get("test_mode") if obj.get("test_mode") is not None else False ), "title": obj.get("title"), + "expires_at": obj.get("expires_at"), } ) return _obj @@ -289,6 +303,7 @@ def openapi_types(cls) -> Dict[str, str]: "subject": "(str,)", "test_mode": "(bool,)", "title": "(str,)", + "expires_at": "(int,)", } @classmethod diff --git a/sdks/ruby/README.md b/sdks/ruby/README.md index 4d11460d2..206a50a34 100644 --- a/sdks/ruby/README.md +++ b/sdks/ruby/README.md @@ -118,6 +118,7 @@ All URIs are relative to *https://api.hellosign.com/v3* |*Dropbox::Sign::ApiAppApi* | [**api_app_update**](docs/ApiAppApi.md#api_app_update) | **PUT** /api_app/{client_id} | Update API App | |*Dropbox::Sign::BulkSendJobApi* | [**bulk_send_job_get**](docs/BulkSendJobApi.md#bulk_send_job_get) | **GET** /bulk_send_job/{bulk_send_job_id} | Get Bulk Send Job | |*Dropbox::Sign::BulkSendJobApi* | [**bulk_send_job_list**](docs/BulkSendJobApi.md#bulk_send_job_list) | **GET** /bulk_send_job/list | List Bulk Send Jobs | +|*Dropbox::Sign::DocumentApi* | [**document_detect_fields**](docs/DocumentApi.md#document_detect_fields) | **POST** /document/detect_fields | Detect Document Fields | |*Dropbox::Sign::EmbeddedApi* | [**embedded_edit_url**](docs/EmbeddedApi.md#embedded_edit_url) | **POST** /embedded/edit_url/{template_id} | Get Embedded Template Edit URL | |*Dropbox::Sign::EmbeddedApi* | [**embedded_sign_url**](docs/EmbeddedApi.md#embedded_sign_url) | **GET** /embedded/sign_url/{signature_id} | Get Embedded Sign URL | |*Dropbox::Sign::FaxApi* | [**fax_delete**](docs/FaxApi.md#fax_delete) | **DELETE** /fax/{fax_id} | Delete Fax | @@ -209,6 +210,9 @@ All URIs are relative to *https://api.hellosign.com/v3* - [Dropbox::Sign::BulkSendJobListResponse](docs/BulkSendJobListResponse.md) - [Dropbox::Sign::BulkSendJobResponse](docs/BulkSendJobResponse.md) - [Dropbox::Sign::BulkSendJobSendResponse](docs/BulkSendJobSendResponse.md) + - [Dropbox::Sign::DocumentFieldDetectionRequest](docs/DocumentFieldDetectionRequest.md) + - [Dropbox::Sign::DocumentFieldDetectionResponse](docs/DocumentFieldDetectionResponse.md) + - [Dropbox::Sign::DocumentFieldDetectionResponseDetectionResult](docs/DocumentFieldDetectionResponseDetectionResult.md) - [Dropbox::Sign::EmbeddedEditUrlRequest](docs/EmbeddedEditUrlRequest.md) - [Dropbox::Sign::EmbeddedEditUrlResponse](docs/EmbeddedEditUrlResponse.md) - [Dropbox::Sign::EmbeddedEditUrlResponseEmbedded](docs/EmbeddedEditUrlResponseEmbedded.md) diff --git a/sdks/ruby/docs/DocumentApi.md b/sdks/ruby/docs/DocumentApi.md new file mode 100644 index 000000000..074517671 --- /dev/null +++ b/sdks/ruby/docs/DocumentApi.md @@ -0,0 +1,82 @@ +# Dropbox::Sign::DocumentApi + +All URIs are relative to *https://api.hellosign.com/v3* + +| Method | HTTP request | Description | +| ------ | ------------ | ----------- | +| [`document_detect_fields`](DocumentApi.md#document_detect_fields) | **POST** `/document/detect_fields` | Detect Document Fields | + + +## `document_detect_fields` + +> ` document_detect_fields(document_field_detection_request)` + +Detect Document Fields + +Detects form fields in a PDF document using either PDF form annotations or Dropbox Sign text tags. + +### Examples + +```ruby +require "json" +require "dropbox-sign" + +Dropbox::Sign.configure do |config| + config.username = "YOUR_API_KEY" + # config.access_token = "YOUR_ACCESS_TOKEN" +end + +document_field_detection_request = Dropbox::Sign::DocumentFieldDetectionRequest.new +document_field_detection_request.detection_mode = "annotations" +document_field_detection_request.file = File.new("./example_document.pdf", "r") +document_field_detection_request.page_range = "all" + +begin + response = Dropbox::Sign::DocumentApi.new.document_detect_fields( + document_field_detection_request, + ) + + p response +rescue Dropbox::Sign::ApiError => e + puts "Exception when calling DocumentApi#document_detect_fields: #{e}" +end + +``` + +#### Using the `document_detect_fields_with_http_info` variant + +This returns an Array which contains the response data, status code and headers. + +> `, Integer, Hash)> document_detect_fields_with_http_info(document_field_detection_request)` + +```ruby +begin + # Detect Document Fields + data, status_code, headers = api_instance.document_detect_fields_with_http_info(document_field_detection_request) + p status_code # => 2xx + p headers # => { ... } + p data # => +rescue Dropbox::Sign::ApiError => e + puts "Error when calling DocumentApi->document_detect_fields_with_http_info: #{e}" +end +``` + +### Parameters + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| `document_field_detection_request` | [**DocumentFieldDetectionRequest**](DocumentFieldDetectionRequest.md) | | | + +### Return type + +[**DocumentFieldDetectionResponse**](DocumentFieldDetectionResponse.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 + diff --git a/sdks/ruby/docs/DocumentFieldDetectionRequest.md b/sdks/ruby/docs/DocumentFieldDetectionRequest.md new file mode 100644 index 000000000..038becde1 --- /dev/null +++ b/sdks/ruby/docs/DocumentFieldDetectionRequest.md @@ -0,0 +1,13 @@ +# Dropbox::Sign::DocumentFieldDetectionRequest + + + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| `detection_mode`*_required_ | ```String``` | The field detection method to use. Set to `annotations` to detect PDF form annotations or `text_tags` to detect Dropbox Sign text tags. | | +| `file` | ```File``` | The PDF file to analyze.

This endpoint requires either `file` or `file_url`, but not both. | | +| `file_url` | ```String``` | The URL of the PDF file to analyze.

This endpoint requires either `file` or `file_url`, but not both. | | +| `page_range` | ```String``` | The zero-based page indexes to analyze. Accepts `all`, individual pages, inclusive ranges, or comma-separated combinations, such as `0-2,5,7-9`. Defaults to `all`. | | + diff --git a/sdks/ruby/docs/DocumentFieldDetectionResponse.md b/sdks/ruby/docs/DocumentFieldDetectionResponse.md new file mode 100644 index 000000000..cf2bf8eb2 --- /dev/null +++ b/sdks/ruby/docs/DocumentFieldDetectionResponse.md @@ -0,0 +1,11 @@ +# Dropbox::Sign::DocumentFieldDetectionResponse + + + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| `detection_result`*_required_ | [```DocumentFieldDetectionResponseDetectionResult```](DocumentFieldDetectionResponseDetectionResult.md) | | | +| `warnings` | [```Array```](WarningResponse.md) | A list of warnings. | | + diff --git a/sdks/ruby/docs/DocumentFieldDetectionResponseDetectionResult.md b/sdks/ruby/docs/DocumentFieldDetectionResponseDetectionResult.md new file mode 100644 index 000000000..fe11ca59c --- /dev/null +++ b/sdks/ruby/docs/DocumentFieldDetectionResponseDetectionResult.md @@ -0,0 +1,19 @@ +# Dropbox::Sign::DocumentFieldDetectionResponseDetectionResult + + + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| `document_hash`*_required_ | ```String``` | The SHA-256 hash of the analyzed document. | | +| `detection_mode`*_required_ | ```String``` | The field detection method used to analyze the document: `annotations` or `text_tags`. | | +| `page_count`*_required_ | ```Integer``` | The total number of pages in the document. | | +| `pages_analyzed`*_required_ | ```String``` | The zero-based page indexes analyzed, represented by the requested `page_range`, or `all` when every page was analyzed. | | +| `detected_at`*_required_ | ```Integer``` | The Unix timestamp when the field detection result was generated. | | +| `form_fields_per_document`*_required_ | [```Array```](SubFormFieldsPerDocumentBase.md) | The fields that should appear on the document, expressed as an array of objects. (For more details you can read about it here: [Using Form Fields per Document](/docs/openapi/form-fields-per-document).)

**NOTE:** Fields like **text**, **dropdown**, **checkbox**, **radio**, and **hyperlink** have additional required and optional parameters. Check out the list of [additional parameters](/api/reference/constants/#form-fields-per-document) for these field types.

* Text Field use `SubFormFieldsPerDocumentText`
* Dropdown Field use `SubFormFieldsPerDocumentDropdown`
* Hyperlink Field use `SubFormFieldsPerDocumentHyperlink`
* Checkbox Field use `SubFormFieldsPerDocumentCheckbox`
* Radio Field use `SubFormFieldsPerDocumentRadio`
* Signature Field use `SubFormFieldsPerDocumentSignature`
* Date Signed Field use `SubFormFieldsPerDocumentDateSigned`
* Initials Field use `SubFormFieldsPerDocumentInitials`
* Text Merge Field use `SubFormFieldsPerDocumentTextMerge`
* Checkbox Merge Field use `SubFormFieldsPerDocumentCheckboxMerge` | | +| `form_field_groups`*_required_ | [```Array```](SubFormFieldGroup.md) | Group information for fields defined in `form_fields_per_document`. String-indexed JSON array with `group_label` and `requirement` keys. `form_fields_per_document` must contain fields referencing a group defined in `form_field_groups`. | | +| `warnings`*_required_ | [```Array```](WarningResponse.md) | Non-fatal issues encountered during field detection. | | +| `errors`*_required_ | [```Array```](ErrorResponseError.md) | Errors encountered during field detection. Successfully detected fields may still be included in the response. | | +| `suggestions`*_required_ | ```Array``` | Suggestions for improving the field detection results. | | + diff --git a/sdks/ruby/docs/FaxResponse.md b/sdks/ruby/docs/FaxResponse.md index 9f0feb844..08c93f9ec 100644 --- a/sdks/ruby/docs/FaxResponse.md +++ b/sdks/ruby/docs/FaxResponse.md @@ -14,6 +14,7 @@ | `sender`*_required_ | ```String``` | Fax Sender Email | | | `files_url`*_required_ | ```String``` | Fax Files URL | | | `transmissions`*_required_ | [```Array```](FaxResponseTransmission.md) | Fax Transmissions List | | +| `test_mode`*_required_ | ```Boolean``` | Whether this is a test fax. Test faxes are not delivered to the recipient. Defaults to `false`. | [default to false] | | `subject` | ```String``` | Fax Subject | | | `message` | ```String``` | Fax Message | | | `final_copy_uri` | ```String``` | The path where the completed document can be downloaded | | diff --git a/sdks/ruby/docs/SignatureRequestBulkCreateEmbeddedWithTemplateRequest.md b/sdks/ruby/docs/SignatureRequestBulkCreateEmbeddedWithTemplateRequest.md index ac2c30e32..68e91f635 100644 --- a/sdks/ruby/docs/SignatureRequestBulkCreateEmbeddedWithTemplateRequest.md +++ b/sdks/ruby/docs/SignatureRequestBulkCreateEmbeddedWithTemplateRequest.md @@ -19,4 +19,5 @@ | `subject` | ```String``` | The subject in the email that will be sent to the signers. | | | `test_mode` | ```Boolean``` | Whether this is a test, the signature request will not be legally binding if set to `true`. Defaults to `false`. | [default to false] | | `title` | ```String``` | The title you want to assign to the SignatureRequest. | | +| `expires_at` | ```Integer``` | When the signature request will expire. Unsigned signatures will be moved to the expired status, and no longer signable. See [Signature Request Expiration Date](https://developers.hellosign.com/docs/signature-request/expiration/) for details. | | diff --git a/sdks/ruby/docs/SignatureRequestBulkSendWithTemplateRequest.md b/sdks/ruby/docs/SignatureRequestBulkSendWithTemplateRequest.md index b3afc36b9..2c1ca54e7 100644 --- a/sdks/ruby/docs/SignatureRequestBulkSendWithTemplateRequest.md +++ b/sdks/ruby/docs/SignatureRequestBulkSendWithTemplateRequest.md @@ -19,4 +19,5 @@ | `subject` | ```String``` | The subject in the email that will be sent to the signers. | | | `test_mode` | ```Boolean``` | Whether this is a test, the signature request will not be legally binding if set to `true`. Defaults to `false`. | [default to false] | | `title` | ```String``` | The title you want to assign to the SignatureRequest. | | +| `expires_at` | ```Integer``` | When the signature request will expire. Unsigned signatures will be moved to the expired status, and no longer signable. See [Signature Request Expiration Date](https://developers.hellosign.com/docs/signature-request/expiration/) for details. | | diff --git a/sdks/ruby/docs/SignatureRequestCreateEmbeddedWithTemplateRequest.md b/sdks/ruby/docs/SignatureRequestCreateEmbeddedWithTemplateRequest.md index a345e97b1..8e902fd94 100644 --- a/sdks/ruby/docs/SignatureRequestCreateEmbeddedWithTemplateRequest.md +++ b/sdks/ruby/docs/SignatureRequestCreateEmbeddedWithTemplateRequest.md @@ -21,4 +21,5 @@ | `test_mode` | ```Boolean``` | Whether this is a test, the signature request will not be legally binding if set to `true`. Defaults to `false`. | [default to false] | | `title` | ```String``` | The title you want to assign to the SignatureRequest. | | | `populate_auto_fill_fields` | ```Boolean``` | Controls whether [auto fill fields](https://faq.hellosign.com/hc/en-us/articles/360051467511-Auto-Fill-Fields) can automatically populate a signer's information during signing.

**NOTE:** Keep your signer's information safe by ensuring that the _signer on your signature request is the intended party_ before using this feature. | [default to false] | +| `expires_at` | ```Integer``` | When the signature request will expire. Unsigned signatures will be moved to the expired status, and no longer signable. See [Signature Request Expiration Date](https://developers.hellosign.com/docs/signature-request/expiration/) for details. | | diff --git a/sdks/ruby/docs/SignatureRequestSendWithTemplateRequest.md b/sdks/ruby/docs/SignatureRequestSendWithTemplateRequest.md index 39b16522b..b39163f85 100644 --- a/sdks/ruby/docs/SignatureRequestSendWithTemplateRequest.md +++ b/sdks/ruby/docs/SignatureRequestSendWithTemplateRequest.md @@ -23,4 +23,5 @@ | `subject` | ```String``` | The subject in the email that will be sent to the signers. | | | `test_mode` | ```Boolean``` | Whether this is a test, the signature request will not be legally binding if set to `true`. Defaults to `false`. | [default to false] | | `title` | ```String``` | The title you want to assign to the SignatureRequest. | | +| `expires_at` | ```Integer``` | When the signature request will expire. Unsigned signatures will be moved to the expired status, and no longer signable. See [Signature Request Expiration Date](https://developers.hellosign.com/docs/signature-request/expiration/) for details. | | diff --git a/sdks/ruby/lib/dropbox-sign.rb b/sdks/ruby/lib/dropbox-sign.rb index e85d1d545..e83c59754 100644 --- a/sdks/ruby/lib/dropbox-sign.rb +++ b/sdks/ruby/lib/dropbox-sign.rb @@ -42,6 +42,9 @@ require 'dropbox-sign/models/bulk_send_job_list_response' require 'dropbox-sign/models/bulk_send_job_response' require 'dropbox-sign/models/bulk_send_job_send_response' +require 'dropbox-sign/models/document_field_detection_request' +require 'dropbox-sign/models/document_field_detection_response' +require 'dropbox-sign/models/document_field_detection_response_detection_result' require 'dropbox-sign/models/embedded_edit_url_request' require 'dropbox-sign/models/embedded_edit_url_response' require 'dropbox-sign/models/embedded_edit_url_response_embedded' @@ -214,6 +217,7 @@ require 'dropbox-sign/api/account_api' require 'dropbox-sign/api/api_app_api' require 'dropbox-sign/api/bulk_send_job_api' +require 'dropbox-sign/api/document_api' require 'dropbox-sign/api/embedded_api' require 'dropbox-sign/api/fax_api' require 'dropbox-sign/api/fax_line_api' diff --git a/sdks/ruby/lib/dropbox-sign/api/document_api.rb b/sdks/ruby/lib/dropbox-sign/api/document_api.rb new file mode 100644 index 000000000..84322c7e2 --- /dev/null +++ b/sdks/ruby/lib/dropbox-sign/api/document_api.rb @@ -0,0 +1,137 @@ +=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 'cgi' + +module Dropbox +end + +module Dropbox::Sign + class DocumentApi + attr_accessor :api_client + + def initialize(api_client = ApiClient.default) + @api_client = api_client + end + # Detect Document Fields + # Detects form fields in a PDF document using either PDF form annotations or Dropbox Sign text tags. + # Example: https://github.com/hellosign/dropbox-sign-ruby/blob/main/examples/DocumentDetectFieldsExample.rb + # @param document_field_detection_request [DocumentFieldDetectionRequest] + # @param [Hash] opts the optional parameters + # @return [DocumentFieldDetectionResponse] + def document_detect_fields(document_field_detection_request, opts = {}) + data, _status_code, _headers = document_detect_fields_with_http_info(document_field_detection_request, opts) + data + end + + # Detect Document Fields + # Detects form fields in a PDF document using either PDF form annotations or Dropbox Sign text tags. + # Example: https://github.com/hellosign/dropbox-sign-ruby/blob/main/examples/DocumentDetectFieldsExample.rb + # @param document_field_detection_request [DocumentFieldDetectionRequest] + # @param [Hash] opts the optional parameters + # @return [Array<(DocumentFieldDetectionResponse, Integer, Hash)>] DocumentFieldDetectionResponse data, response status code and response headers + def document_detect_fields_with_http_info(document_field_detection_request, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: DocumentApi.document_detect_fields ...' + end + # verify the required parameter 'document_field_detection_request' is set + if @api_client.config.client_side_validation && document_field_detection_request.nil? + fail ArgumentError, "Missing the required parameter 'document_field_detection_request' when calling DocumentApi.document_detect_fields" + end + # resource path + local_var_path = '/document/detect_fields' + + # 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( + document_field_detection_request, + Dropbox::Sign::DocumentFieldDetectionRequest.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] || 'DocumentFieldDetectionResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || ['api_key', 'oauth2'] + + new_options = opts.merge( + :operation => :"DocumentApi.document_detect_fields", + :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::DocumentFieldDetectionResponse" + ) + + 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 && 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 + + raise e + end + + if @api_client.config.debugging + @api_client.config.logger.debug "API called: DocumentApi#document_detect_fields\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + end +end diff --git a/sdks/ruby/lib/dropbox-sign/models/document_field_detection_request.rb b/sdks/ruby/lib/dropbox-sign/models/document_field_detection_request.rb new file mode 100644 index 000000000..8104b45b4 --- /dev/null +++ b/sdks/ruby/lib/dropbox-sign/models/document_field_detection_request.rb @@ -0,0 +1,317 @@ +=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 DocumentFieldDetectionRequest + # The field detection method to use. Set to `annotations` to detect PDF form annotations or `text_tags` to detect Dropbox Sign text tags. + # @return [String] + attr_accessor :detection_mode + + # The PDF file to analyze. This endpoint requires either `file` or `file_url`, but not both. + # @return [File] + attr_accessor :file + + # The URL of the PDF file to analyze. This endpoint requires either `file` or `file_url`, but not both. + # @return [String] + attr_accessor :file_url + + # The zero-based page indexes to analyze. Accepts `all`, individual pages, inclusive ranges, or comma-separated combinations, such as `0-2,5,7-9`. Defaults to `all`. + # @return [String] + attr_accessor :page_range + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'detection_mode' => :'detection_mode', + :'file' => :'file', + :'file_url' => :'file_url', + :'page_range' => :'page_range' + } + 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 + { + :'detection_mode' => :'String', + :'file' => :'File', + :'file_url' => :'String', + :'page_range' => :'String' + } + 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 [DocumentFieldDetectionRequest] + def self.init(data) + ApiClient.default.convert_to_type( + data, + "DocumentFieldDetectionRequest" + ) || DocumentFieldDetectionRequest.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::DocumentFieldDetectionRequest` 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::DocumentFieldDetectionRequest`. 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?(:'detection_mode') + self.detection_mode = attributes[:'detection_mode'] + end + + if attributes.key?(:'file') + self.file = attributes[:'file'] + end + + if attributes.key?(:'file_url') + self.file_url = attributes[:'file_url'] + end + + if attributes.key?(:'page_range') + self.page_range = attributes[:'page_range'] + 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 @detection_mode.nil? + invalid_properties.push('invalid value for "detection_mode", detection_mode cannot be nil.') + end + + pattern = Regexp.new(/^(?:all|\d+(?:-\d+)?(?:,\d+(?:-\d+)?)*)$/) + if !@page_range.nil? && @page_range !~ pattern + invalid_properties.push("invalid value for \"page_range\", must conform to the pattern #{pattern}.") + 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 @detection_mode.nil? + return false if !@page_range.nil? && @page_range !~ Regexp.new(/^(?:all|\d+(?:-\d+)?(?:,\d+(?:-\d+)?)*)$/) + true + end + + # Custom attribute writer method with validation + # @param [Object] detection_mode Value to be assigned + def detection_mode=(detection_mode) + if detection_mode.nil? + fail ArgumentError, 'detection_mode cannot be nil' + end + + @detection_mode = detection_mode + end + + # Custom attribute writer method with validation + # @param [Object] page_range Value to be assigned + def page_range=(page_range) + pattern = Regexp.new(/^(?:all|\d+(?:-\d+)?(?:,\d+(?:-\d+)?)*)$/) + if page_range !~ pattern + fail ArgumentError, "invalid value for \"page_range\", must conform to the pattern #{pattern}." + end + + @page_range = page_range + 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 && + detection_mode == o.detection_mode && + file == o.file && + file_url == o.file_url && + page_range == o.page_range + 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 + [detection_mode, file, file_url, page_range].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 diff --git a/sdks/ruby/lib/dropbox-sign/models/document_field_detection_response.rb b/sdks/ruby/lib/dropbox-sign/models/document_field_detection_response.rb new file mode 100644 index 000000000..42413c076 --- /dev/null +++ b/sdks/ruby/lib/dropbox-sign/models/document_field_detection_response.rb @@ -0,0 +1,279 @@ +=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 DocumentFieldDetectionResponse + # @return [DocumentFieldDetectionResponseDetectionResult] + attr_accessor :detection_result + + # A list of warnings. + # @return [Array] + attr_accessor :warnings + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'detection_result' => :'detection_result', + :'warnings' => :'warnings' + } + 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 + { + :'detection_result' => :'DocumentFieldDetectionResponseDetectionResult', + :'warnings' => :'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 [DocumentFieldDetectionResponse] + def self.init(data) + ApiClient.default.convert_to_type( + data, + "DocumentFieldDetectionResponse" + ) || DocumentFieldDetectionResponse.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::DocumentFieldDetectionResponse` 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::DocumentFieldDetectionResponse`. 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?(:'detection_result') + self.detection_result = attributes[:'detection_result'] + end + + if attributes.key?(:'warnings') + if (value = attributes[:'warnings']).is_a?(Array) + self.warnings = 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 @detection_result.nil? + invalid_properties.push('invalid value for "detection_result", detection_result cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + return false if @detection_result.nil? + true + end + + # Custom attribute writer method with validation + # @param [Object] detection_result Value to be assigned + def detection_result=(detection_result) + if detection_result.nil? + fail ArgumentError, 'detection_result cannot be nil' + end + + @detection_result = detection_result + 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 && + detection_result == o.detection_result && + warnings == o.warnings + 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 + [detection_result, warnings].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 diff --git a/sdks/ruby/lib/dropbox-sign/models/document_field_detection_response_detection_result.rb b/sdks/ruby/lib/dropbox-sign/models/document_field_detection_response_detection_result.rb new file mode 100644 index 000000000..71f380b00 --- /dev/null +++ b/sdks/ruby/lib/dropbox-sign/models/document_field_detection_response_detection_result.rb @@ -0,0 +1,536 @@ +=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 DocumentFieldDetectionResponseDetectionResult + # The SHA-256 hash of the analyzed document. + # @return [String] + attr_accessor :document_hash + + # The field detection method used to analyze the document: `annotations` or `text_tags`. + # @return [String] + attr_accessor :detection_mode + + # The total number of pages in the document. + # @return [Integer] + attr_accessor :page_count + + # The zero-based page indexes analyzed, represented by the requested `page_range`, or `all` when every page was analyzed. + # @return [String] + attr_accessor :pages_analyzed + + # The Unix timestamp when the field detection result was generated. + # @return [Integer] + attr_accessor :detected_at + + # The fields that should appear on the document, expressed as an array of objects. (For more details you can read about it here: [Using Form Fields per Document](/docs/openapi/form-fields-per-document).) **NOTE:** Fields like **text**, **dropdown**, **checkbox**, **radio**, and **hyperlink** have additional required and optional parameters. Check out the list of [additional parameters](/api/reference/constants/#form-fields-per-document) for these field types. * Text Field use `SubFormFieldsPerDocumentText` * Dropdown Field use `SubFormFieldsPerDocumentDropdown` * Hyperlink Field use `SubFormFieldsPerDocumentHyperlink` * Checkbox Field use `SubFormFieldsPerDocumentCheckbox` * Radio Field use `SubFormFieldsPerDocumentRadio` * Signature Field use `SubFormFieldsPerDocumentSignature` * Date Signed Field use `SubFormFieldsPerDocumentDateSigned` * Initials Field use `SubFormFieldsPerDocumentInitials` * Text Merge Field use `SubFormFieldsPerDocumentTextMerge` * Checkbox Merge Field use `SubFormFieldsPerDocumentCheckboxMerge` + # @return [Array] + attr_accessor :form_fields_per_document + + # Group information for fields defined in `form_fields_per_document`. String-indexed JSON array with `group_label` and `requirement` keys. `form_fields_per_document` must contain fields referencing a group defined in `form_field_groups`. + # @return [Array] + attr_accessor :form_field_groups + + # Non-fatal issues encountered during field detection. + # @return [Array] + attr_accessor :warnings + + # Errors encountered during field detection. Successfully detected fields may still be included in the response. + # @return [Array] + attr_accessor :errors + + # Suggestions for improving the field detection results. + # @return [Array] + attr_accessor :suggestions + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'document_hash' => :'document_hash', + :'detection_mode' => :'detection_mode', + :'page_count' => :'page_count', + :'pages_analyzed' => :'pages_analyzed', + :'detected_at' => :'detected_at', + :'form_fields_per_document' => :'form_fields_per_document', + :'form_field_groups' => :'form_field_groups', + :'warnings' => :'warnings', + :'errors' => :'errors', + :'suggestions' => :'suggestions' + } + 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 + { + :'document_hash' => :'String', + :'detection_mode' => :'String', + :'page_count' => :'Integer', + :'pages_analyzed' => :'String', + :'detected_at' => :'Integer', + :'form_fields_per_document' => :'Array', + :'form_field_groups' => :'Array', + :'warnings' => :'Array', + :'errors' => :'Array', + :'suggestions' => :'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 [DocumentFieldDetectionResponseDetectionResult] + def self.init(data) + ApiClient.default.convert_to_type( + data, + "DocumentFieldDetectionResponseDetectionResult" + ) || DocumentFieldDetectionResponseDetectionResult.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::DocumentFieldDetectionResponseDetectionResult` 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::DocumentFieldDetectionResponseDetectionResult`. 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?(:'document_hash') + self.document_hash = attributes[:'document_hash'] + end + + if attributes.key?(:'detection_mode') + self.detection_mode = attributes[:'detection_mode'] + end + + if attributes.key?(:'page_count') + self.page_count = attributes[:'page_count'] + end + + if attributes.key?(:'pages_analyzed') + self.pages_analyzed = attributes[:'pages_analyzed'] + end + + if attributes.key?(:'detected_at') + self.detected_at = attributes[:'detected_at'] + end + + if attributes.key?(:'form_fields_per_document') + if (value = attributes[:'form_fields_per_document']).is_a?(Array) + self.form_fields_per_document = value + end + end + + if attributes.key?(:'form_field_groups') + if (value = attributes[:'form_field_groups']).is_a?(Array) + self.form_field_groups = value + end + end + + if attributes.key?(:'warnings') + if (value = attributes[:'warnings']).is_a?(Array) + self.warnings = value + end + end + + if attributes.key?(:'errors') + if (value = attributes[:'errors']).is_a?(Array) + self.errors = value + end + end + + if attributes.key?(:'suggestions') + if (value = attributes[:'suggestions']).is_a?(Array) + self.suggestions = 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 @document_hash.nil? + invalid_properties.push('invalid value for "document_hash", document_hash cannot be nil.') + end + + if @document_hash.to_s.length > 64 + invalid_properties.push('invalid value for "document_hash", the character length must be smaller than or equal to 64.') + end + + if @document_hash.to_s.length < 64 + invalid_properties.push('invalid value for "document_hash", the character length must be great than or equal to 64.') + end + + if @detection_mode.nil? + invalid_properties.push('invalid value for "detection_mode", detection_mode cannot be nil.') + end + + if @page_count.nil? + invalid_properties.push('invalid value for "page_count", page_count cannot be nil.') + end + + if @page_count < 0 + invalid_properties.push('invalid value for "page_count", must be greater than or equal to 0.') + end + + if @pages_analyzed.nil? + invalid_properties.push('invalid value for "pages_analyzed", pages_analyzed cannot be nil.') + end + + if @detected_at.nil? + invalid_properties.push('invalid value for "detected_at", detected_at cannot be nil.') + end + + if @form_fields_per_document.nil? + invalid_properties.push('invalid value for "form_fields_per_document", form_fields_per_document cannot be nil.') + end + + if @form_field_groups.nil? + invalid_properties.push('invalid value for "form_field_groups", form_field_groups cannot be nil.') + end + + if @warnings.nil? + invalid_properties.push('invalid value for "warnings", warnings cannot be nil.') + end + + if @errors.nil? + invalid_properties.push('invalid value for "errors", errors cannot be nil.') + end + + if @suggestions.nil? + invalid_properties.push('invalid value for "suggestions", suggestions cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + return false if @document_hash.nil? + return false if @document_hash.to_s.length > 64 + return false if @document_hash.to_s.length < 64 + return false if @detection_mode.nil? + return false if @page_count.nil? + return false if @page_count < 0 + return false if @pages_analyzed.nil? + return false if @detected_at.nil? + return false if @form_fields_per_document.nil? + return false if @form_field_groups.nil? + return false if @warnings.nil? + return false if @errors.nil? + return false if @suggestions.nil? + true + end + + # Custom attribute writer method with validation + # @param [Object] document_hash Value to be assigned + def document_hash=(document_hash) + if document_hash.nil? + fail ArgumentError, 'document_hash cannot be nil' + end + if document_hash.to_s.length > 64 + fail ArgumentError, 'invalid value for "document_hash", the character length must be smaller than or equal to 64.' + end + + if document_hash.to_s.length < 64 + fail ArgumentError, 'invalid value for "document_hash", the character length must be great than or equal to 64.' + end + + @document_hash = document_hash + end + + # Custom attribute writer method with validation + # @param [Object] detection_mode Value to be assigned + def detection_mode=(detection_mode) + if detection_mode.nil? + fail ArgumentError, 'detection_mode cannot be nil' + end + + @detection_mode = detection_mode + end + + # Custom attribute writer method with validation + # @param [Object] page_count Value to be assigned + def page_count=(page_count) + if page_count.nil? + fail ArgumentError, 'page_count cannot be nil' + end + if page_count < 0 + fail ArgumentError, 'invalid value for "page_count", must be greater than or equal to 0.' + end + + @page_count = page_count + end + + # Custom attribute writer method with validation + # @param [Object] pages_analyzed Value to be assigned + def pages_analyzed=(pages_analyzed) + if pages_analyzed.nil? + fail ArgumentError, 'pages_analyzed cannot be nil' + end + + @pages_analyzed = pages_analyzed + end + + # Custom attribute writer method with validation + # @param [Object] detected_at Value to be assigned + def detected_at=(detected_at) + if detected_at.nil? + fail ArgumentError, 'detected_at cannot be nil' + end + + @detected_at = detected_at + end + + # Custom attribute writer method with validation + # @param [Object] form_fields_per_document Value to be assigned + def form_fields_per_document=(form_fields_per_document) + if form_fields_per_document.nil? + fail ArgumentError, 'form_fields_per_document cannot be nil' + end + + @form_fields_per_document = form_fields_per_document + end + + # Custom attribute writer method with validation + # @param [Object] form_field_groups Value to be assigned + def form_field_groups=(form_field_groups) + if form_field_groups.nil? + fail ArgumentError, 'form_field_groups cannot be nil' + end + + @form_field_groups = form_field_groups + end + + # Custom attribute writer method with validation + # @param [Object] warnings Value to be assigned + def warnings=(warnings) + if warnings.nil? + fail ArgumentError, 'warnings cannot be nil' + end + + @warnings = warnings + end + + # Custom attribute writer method with validation + # @param [Object] errors Value to be assigned + def errors=(errors) + if errors.nil? + fail ArgumentError, 'errors cannot be nil' + end + + @errors = errors + end + + # Custom attribute writer method with validation + # @param [Object] suggestions Value to be assigned + def suggestions=(suggestions) + if suggestions.nil? + fail ArgumentError, 'suggestions cannot be nil' + end + + @suggestions = suggestions + 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 && + document_hash == o.document_hash && + detection_mode == o.detection_mode && + page_count == o.page_count && + pages_analyzed == o.pages_analyzed && + detected_at == o.detected_at && + form_fields_per_document == o.form_fields_per_document && + form_field_groups == o.form_field_groups && + warnings == o.warnings && + errors == o.errors && + suggestions == o.suggestions + 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 + [document_hash, detection_mode, page_count, pages_analyzed, detected_at, form_fields_per_document, form_field_groups, warnings, errors, suggestions].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 diff --git a/sdks/ruby/lib/dropbox-sign/models/fax_response.rb b/sdks/ruby/lib/dropbox-sign/models/fax_response.rb index b9f7ae1ae..50c3d9e11 100644 --- a/sdks/ruby/lib/dropbox-sign/models/fax_response.rb +++ b/sdks/ruby/lib/dropbox-sign/models/fax_response.rb @@ -50,6 +50,10 @@ class FaxResponse # @return [Array] attr_accessor :transmissions + # Whether this is a test fax. Test faxes are not delivered to the recipient. Defaults to `false`. + # @return [Boolean] + attr_accessor :test_mode + # Fax Subject # @return [String, nil] attr_accessor :subject @@ -73,6 +77,7 @@ def self.attribute_map :'sender' => :'sender', :'files_url' => :'files_url', :'transmissions' => :'transmissions', + :'test_mode' => :'test_mode', :'subject' => :'subject', :'message' => :'message', :'final_copy_uri' => :'final_copy_uri' @@ -100,6 +105,7 @@ def self.openapi_types :'sender' => :'String', :'files_url' => :'String', :'transmissions' => :'Array', + :'test_mode' => :'Boolean', :'subject' => :'String', :'message' => :'String', :'final_copy_uri' => :'String' @@ -192,6 +198,12 @@ def initialize(attributes = {}) end end + if attributes.key?(:'test_mode') + self.test_mode = attributes[:'test_mode'] + else + self.test_mode = false + end + if attributes.key?(:'subject') self.subject = attributes[:'subject'] end @@ -241,6 +253,10 @@ def list_invalid_properties invalid_properties.push('invalid value for "transmissions", transmissions cannot be nil.') end + if @test_mode.nil? + invalid_properties.push('invalid value for "test_mode", test_mode cannot be nil.') + end + invalid_properties end @@ -255,6 +271,7 @@ def valid? return false if @sender.nil? return false if @files_url.nil? return false if @transmissions.nil? + return false if @test_mode.nil? true end @@ -338,6 +355,16 @@ def transmissions=(transmissions) @transmissions = transmissions end + # Custom attribute writer method with validation + # @param [Object] test_mode Value to be assigned + def test_mode=(test_mode) + if test_mode.nil? + fail ArgumentError, 'test_mode cannot be nil' + end + + @test_mode = test_mode + end + # Checks equality by comparing each attribute. # @param [Object] Object to be compared def ==(o) @@ -351,6 +378,7 @@ def ==(o) sender == o.sender && files_url == o.files_url && transmissions == o.transmissions && + test_mode == o.test_mode && subject == o.subject && message == o.message && final_copy_uri == o.final_copy_uri @@ -365,7 +393,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [fax_id, title, original_title, metadata, created_at, sender, files_url, transmissions, subject, message, final_copy_uri].hash + [fax_id, title, original_title, metadata, created_at, sender, files_url, transmissions, test_mode, subject, message, final_copy_uri].hash end # Builds the object from hash diff --git a/sdks/ruby/lib/dropbox-sign/models/signature_request_bulk_create_embedded_with_template_request.rb b/sdks/ruby/lib/dropbox-sign/models/signature_request_bulk_create_embedded_with_template_request.rb index 138175730..d3f3e4b76 100644 --- a/sdks/ruby/lib/dropbox-sign/models/signature_request_bulk_create_embedded_with_template_request.rb +++ b/sdks/ruby/lib/dropbox-sign/models/signature_request_bulk_create_embedded_with_template_request.rb @@ -70,6 +70,10 @@ class SignatureRequestBulkCreateEmbeddedWithTemplateRequest # @return [String] attr_accessor :title + # When the signature request will expire. Unsigned signatures will be moved to the expired status, and no longer signable. See [Signature Request Expiration Date](https://developers.hellosign.com/docs/signature-request/expiration/) for details. + # @return [Integer, nil] + attr_accessor :expires_at + # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { @@ -85,7 +89,8 @@ def self.attribute_map :'signing_redirect_url' => :'signing_redirect_url', :'subject' => :'subject', :'test_mode' => :'test_mode', - :'title' => :'title' + :'title' => :'title', + :'expires_at' => :'expires_at' } end @@ -114,13 +119,15 @@ def self.openapi_types :'signing_redirect_url' => :'String', :'subject' => :'String', :'test_mode' => :'Boolean', - :'title' => :'String' + :'title' => :'String', + :'expires_at' => :'Integer' } end # List of attributes with nullable: true def self.openapi_nullable Set.new([ + :'expires_at' ]) end @@ -230,6 +237,10 @@ def initialize(attributes = {}) if attributes.key?(:'title') self.title = attributes[:'title'] end + + if attributes.key?(:'expires_at') + self.expires_at = attributes[:'expires_at'] + end end # Show invalid properties with the reasons. Usually used together with valid? @@ -343,7 +354,8 @@ def ==(o) signing_redirect_url == o.signing_redirect_url && subject == o.subject && test_mode == o.test_mode && - title == o.title + title == o.title && + expires_at == o.expires_at end # @see the `==` method @@ -355,7 +367,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [template_ids, client_id, signer_file, signer_list, allow_decline, ccs, custom_fields, message, metadata, signing_redirect_url, subject, test_mode, title].hash + [template_ids, client_id, signer_file, signer_list, allow_decline, ccs, custom_fields, message, metadata, signing_redirect_url, subject, test_mode, title, expires_at].hash end # Builds the object from hash diff --git a/sdks/ruby/lib/dropbox-sign/models/signature_request_bulk_send_with_template_request.rb b/sdks/ruby/lib/dropbox-sign/models/signature_request_bulk_send_with_template_request.rb index 1cc28d608..b4d9c432e 100644 --- a/sdks/ruby/lib/dropbox-sign/models/signature_request_bulk_send_with_template_request.rb +++ b/sdks/ruby/lib/dropbox-sign/models/signature_request_bulk_send_with_template_request.rb @@ -70,6 +70,10 @@ class SignatureRequestBulkSendWithTemplateRequest # @return [String] attr_accessor :title + # When the signature request will expire. Unsigned signatures will be moved to the expired status, and no longer signable. See [Signature Request Expiration Date](https://developers.hellosign.com/docs/signature-request/expiration/) for details. + # @return [Integer, nil] + attr_accessor :expires_at + # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { @@ -85,7 +89,8 @@ def self.attribute_map :'signing_redirect_url' => :'signing_redirect_url', :'subject' => :'subject', :'test_mode' => :'test_mode', - :'title' => :'title' + :'title' => :'title', + :'expires_at' => :'expires_at' } end @@ -114,13 +119,15 @@ def self.openapi_types :'signing_redirect_url' => :'String', :'subject' => :'String', :'test_mode' => :'Boolean', - :'title' => :'String' + :'title' => :'String', + :'expires_at' => :'Integer' } end # List of attributes with nullable: true def self.openapi_nullable Set.new([ + :'expires_at' ]) end @@ -230,6 +237,10 @@ def initialize(attributes = {}) if attributes.key?(:'title') self.title = attributes[:'title'] end + + if attributes.key?(:'expires_at') + self.expires_at = attributes[:'expires_at'] + end end # Show invalid properties with the reasons. Usually used together with valid? @@ -328,7 +339,8 @@ def ==(o) signing_redirect_url == o.signing_redirect_url && subject == o.subject && test_mode == o.test_mode && - title == o.title + title == o.title && + expires_at == o.expires_at end # @see the `==` method @@ -340,7 +352,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [template_ids, signer_file, signer_list, allow_decline, ccs, client_id, custom_fields, message, metadata, signing_redirect_url, subject, test_mode, title].hash + [template_ids, signer_file, signer_list, allow_decline, ccs, client_id, custom_fields, message, metadata, signing_redirect_url, subject, test_mode, title, expires_at].hash end # Builds the object from hash diff --git a/sdks/ruby/lib/dropbox-sign/models/signature_request_create_embedded_with_template_request.rb b/sdks/ruby/lib/dropbox-sign/models/signature_request_create_embedded_with_template_request.rb index 8fdc7b267..4a80f909e 100644 --- a/sdks/ruby/lib/dropbox-sign/models/signature_request_create_embedded_with_template_request.rb +++ b/sdks/ruby/lib/dropbox-sign/models/signature_request_create_embedded_with_template_request.rb @@ -77,6 +77,10 @@ class SignatureRequestCreateEmbeddedWithTemplateRequest # @return [Boolean] attr_accessor :populate_auto_fill_fields + # When the signature request will expire. Unsigned signatures will be moved to the expired status, and no longer signable. See [Signature Request Expiration Date](https://developers.hellosign.com/docs/signature-request/expiration/) for details. + # @return [Integer, nil] + attr_accessor :expires_at + # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { @@ -94,7 +98,8 @@ def self.attribute_map :'subject' => :'subject', :'test_mode' => :'test_mode', :'title' => :'title', - :'populate_auto_fill_fields' => :'populate_auto_fill_fields' + :'populate_auto_fill_fields' => :'populate_auto_fill_fields', + :'expires_at' => :'expires_at' } end @@ -125,13 +130,15 @@ def self.openapi_types :'subject' => :'String', :'test_mode' => :'Boolean', :'title' => :'String', - :'populate_auto_fill_fields' => :'Boolean' + :'populate_auto_fill_fields' => :'Boolean', + :'expires_at' => :'Integer' } end # List of attributes with nullable: true def self.openapi_nullable Set.new([ + :'expires_at' ]) end @@ -255,6 +262,10 @@ def initialize(attributes = {}) else self.populate_auto_fill_fields = false end + + if attributes.key?(:'expires_at') + self.expires_at = attributes[:'expires_at'] + end end # Show invalid properties with the reasons. Usually used together with valid? @@ -385,7 +396,8 @@ def ==(o) subject == o.subject && test_mode == o.test_mode && title == o.title && - populate_auto_fill_fields == o.populate_auto_fill_fields + populate_auto_fill_fields == o.populate_auto_fill_fields && + expires_at == o.expires_at end # @see the `==` method @@ -397,7 +409,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [template_ids, client_id, signers, allow_decline, ccs, custom_fields, files, file_urls, message, metadata, signing_options, subject, test_mode, title, populate_auto_fill_fields].hash + [template_ids, client_id, signers, allow_decline, ccs, custom_fields, files, file_urls, message, metadata, signing_options, subject, test_mode, title, populate_auto_fill_fields, expires_at].hash end # Builds the object from hash diff --git a/sdks/ruby/lib/dropbox-sign/models/signature_request_send_with_template_request.rb b/sdks/ruby/lib/dropbox-sign/models/signature_request_send_with_template_request.rb index cf024ca6f..48ffcc0a7 100644 --- a/sdks/ruby/lib/dropbox-sign/models/signature_request_send_with_template_request.rb +++ b/sdks/ruby/lib/dropbox-sign/models/signature_request_send_with_template_request.rb @@ -86,6 +86,10 @@ class SignatureRequestSendWithTemplateRequest # @return [String] attr_accessor :title + # When the signature request will expire. Unsigned signatures will be moved to the expired status, and no longer signable. See [Signature Request Expiration Date](https://developers.hellosign.com/docs/signature-request/expiration/) for details. + # @return [Integer, nil] + attr_accessor :expires_at + # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { @@ -105,7 +109,8 @@ def self.attribute_map :'signing_redirect_url' => :'signing_redirect_url', :'subject' => :'subject', :'test_mode' => :'test_mode', - :'title' => :'title' + :'title' => :'title', + :'expires_at' => :'expires_at' } end @@ -138,13 +143,15 @@ def self.openapi_types :'signing_redirect_url' => :'String', :'subject' => :'String', :'test_mode' => :'Boolean', - :'title' => :'String' + :'title' => :'String', + :'expires_at' => :'Integer' } end # List of attributes with nullable: true def self.openapi_nullable Set.new([ + :'expires_at' ]) end @@ -278,6 +285,10 @@ def initialize(attributes = {}) if attributes.key?(:'title') self.title = attributes[:'title'] end + + if attributes.key?(:'expires_at') + self.expires_at = attributes[:'expires_at'] + end end # Show invalid properties with the reasons. Usually used together with valid? @@ -395,7 +406,8 @@ def ==(o) signing_redirect_url == o.signing_redirect_url && subject == o.subject && test_mode == o.test_mode && - title == o.title + title == o.title && + expires_at == o.expires_at end # @see the `==` method @@ -407,7 +419,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [template_ids, signers, allow_decline, ccs, client_id, custom_fields, files, file_urls, is_qualified_signature, is_eid, message, metadata, signing_options, signing_redirect_url, subject, test_mode, title].hash + [template_ids, signers, allow_decline, ccs, client_id, custom_fields, files, file_urls, is_qualified_signature, is_eid, message, metadata, signing_options, signing_redirect_url, subject, test_mode, title, expires_at].hash end # Builds the object from hash diff --git a/test_fixtures/FaxGetResponse.json b/test_fixtures/FaxGetResponse.json index 0d668e0e3..f4bf43563 100644 --- a/test_fixtures/FaxGetResponse.json +++ b/test_fixtures/FaxGetResponse.json @@ -24,7 +24,8 @@ "status_code": "success" } ], - "files_url": "https://api.hellosign.com/v3/fax/files/2b388914e3ae3b738bd4e2ee2850c677e6dc53d2" + "files_url": "https://api.hellosign.com/v3/fax/files/2b388914e3ae3b738bd4e2ee2850c677e6dc53d2", + "test_mode": false } } } diff --git a/test_fixtures/FaxListResponse.json b/test_fixtures/FaxListResponse.json index d0ce7feb6..9dbdb969f 100644 --- a/test_fixtures/FaxListResponse.json +++ b/test_fixtures/FaxListResponse.json @@ -31,7 +31,8 @@ "status_code": "success" } ], - "files_url": "https://api.hellosign.com/v3/fax/files/2b388914e3ae3b738bd4e2ee2850c677e6dc53d2" + "files_url": "https://api.hellosign.com/v3/fax/files/2b388914e3ae3b738bd4e2ee2850c677e6dc53d2", + "test_mode": false } ] } diff --git a/translations/en.yaml b/translations/en.yaml index 7dc184c55..866334d59 100644 --- a/translations/en.yaml +++ b/translations/en.yaml @@ -107,6 +107,19 @@ "BulkSendJobList::PAGE": Which page number of the BulkSendJob List to return. Defaults to `1`. "BulkSendJobList::PAGE_SIZE": Number of objects to be returned per page. Must be between `1` and `100`. Default is 20. +"DocumentFieldDetection::SUMMARY": Detect Document Fields +"DocumentFieldDetection::DESCRIPTION": Detects form fields in a PDF document using either PDF form annotations or Dropbox Sign text tags. +"DocumentFieldDetection::FILE": |- + The PDF file to analyze. + + This endpoint requires either `file` or `file_url`, but not both. +"DocumentFieldDetection::FILE_URL": |- + The URL of the PDF file to analyze. + + This endpoint requires either `file` or `file_url`, but not both. +"DocumentFieldDetection::DETECTION_MODE": The field detection method to use. Set to `annotations` to detect PDF form annotations or `text_tags` to detect Dropbox Sign text tags. +"DocumentFieldDetection::PAGE_RANGE": The zero-based page indexes to analyze. Accepts `all`, individual pages, inclusive ranges, or comma-separated combinations, such as `0-2,5,7-9`. Defaults to `all`. + "EmbeddedEditUrl::SUMMARY": Get Embedded Template Edit URL "EmbeddedEditUrl::DESCRIPTION": Retrieves an embedded object containing a template url that can be opened in an iFrame. Note that only templates created via the embedded template process are available to be edited with this endpoint. "EmbeddedEditUrl::ALLOW_EDIT_CCS": This allows the requester to enable/disable to add or change CC roles when editing the template. @@ -175,6 +188,7 @@ "FaxResponse::TRANSMISSIONS": Fax Transmissions List "FaxResponse::FILES_URL": Fax Files URL "FaxResponse::FINAL_COPY_URI": The path where the completed document can be downloaded +"FaxResponse::TEST_MODE": Whether this is a test fax. Test faxes are not delivered to the recipient. Defaults to `false`. "Sub::FaxResponseTransmission::RECIPIENT": Fax Transmission Recipient "Sub::FaxResponseTransmission::STATUS_CODE": Fax Transmission Status Code "Sub::FaxResponseTransmission::SENT_AT": Fax Transmission Sent Timestamp @@ -251,6 +265,7 @@ **NOTE:** Only available for Standard plan and higher. "SignatureRequestBulkCreateEmbeddedWithTemplate::ALLOW_DECLINE": Allows signers to decline to sign a document if `true`. Defaults to `false`. "SignatureRequestBulkCreateEmbeddedWithTemplate::CLIENT_ID": Client id of the app you're using to create this embedded signature request. Used for security purposes. +"SignatureRequestBulkCreateEmbeddedWithTemplate::EXPIRES_AT": When the signature request will expire. Unsigned signatures will be moved to the expired status, and no longer signable. See [Signature Request Expiration Date](https://developers.hellosign.com/docs/signature-request/expiration/) for details. "SignatureRequestBulkCreateEmbeddedWithTemplate::MESSAGE": The custom message in the email that will be sent to the signers. "SignatureRequestBulkCreateEmbeddedWithTemplate::SIGNER_FILE": |- `signer_file` is a CSV file defining values and options for signer fields. Required unless a `signer_list` is used, you may not use both. The CSV can have the following columns: @@ -287,6 +302,7 @@ **NOTE:** Only available for Standard plan and higher. "SignatureRequestBulkSendWithTemplate::ALLOW_DECLINE": Allows signers to decline to sign a document if `true`. Defaults to `false`. +"SignatureRequestBulkSendWithTemplate::EXPIRES_AT": When the signature request will expire. Unsigned signatures will be moved to the expired status, and no longer signable. See [Signature Request Expiration Date](https://developers.hellosign.com/docs/signature-request/expiration/) for details. "SignatureRequestBulkSendWithTemplate::MESSAGE": The custom message in the email that will be sent to the signers. "SignatureRequestBulkSendWithTemplate::SIGNER_FILE": |- `signer_file` is a CSV file defining values and options for signer fields. Required unless a `signer_list` is used, you may not use both. The CSV can have the following columns: @@ -386,6 +402,7 @@ Use `file_urls[]` to have Dropbox Sign download the file(s) to send for signature. This endpoint requires either **files** or **file_urls[]**, but not both. +"SignatureRequestCreateEmbeddedWithTemplate::EXPIRES_AT": When the signature request will expire. Unsigned signatures will be moved to the expired status, and no longer signable. See [Signature Request Expiration Date](https://developers.hellosign.com/docs/signature-request/expiration/) for details. "SignatureRequestCreateEmbeddedWithTemplate::MESSAGE": The custom message in the email that will be sent to the signers. "SignatureRequestCreateEmbeddedWithTemplate::SUBJECT": The subject in the email that will be sent to the signers. "SignatureRequestCreateEmbeddedWithTemplate::TEMPLATE_IDS": Use `template_ids` to create a SignatureRequest from one or more templates, in the order in which the template will be used. @@ -526,6 +543,7 @@ Use `file_urls[]` to have Dropbox Sign download the file(s) to send for signature. This endpoint requires either **files** or **file_urls[]**, but not both. +"SignatureRequestSendWithTemplate::EXPIRES_AT": When the signature request will expire. Unsigned signatures will be moved to the expired status, and no longer signable. See [Signature Request Expiration Date](https://developers.hellosign.com/docs/signature-request/expiration/) for details. "SignatureRequestSendWithTemplate::IS_QUALIFIED_SIGNATURE": |- Send with a value of `true` if you wish to enable [Qualified Electronic Signatures](https://www.hellosign.com/features/qualified-electronic-signatures) (QES), @@ -1356,6 +1374,16 @@ "BulkSendJobGetResponse::SIGNATURE_REQUESTS": Contains information about the Signature Requests sent in bulk. "BulkSendJobGetResponseSignatureRequests::BULK_SEND_JOB_ID": The id of the BulkSendJob. +"DocumentFieldDetectionResponse::DOCUMENT_HASH": The SHA-256 hash of the analyzed document. +"DocumentFieldDetectionResponse::DETECTION_MODE": |- + The field detection method used to analyze the document: `annotations` or `text_tags`. +"DocumentFieldDetectionResponse::PAGE_COUNT": The total number of pages in the document. +"DocumentFieldDetectionResponse::PAGES_ANALYZED": The zero-based page indexes analyzed, represented by the requested `page_range`, or `all` when every page was analyzed. +"DocumentFieldDetectionResponse::DETECTED_AT": The Unix timestamp when the field detection result was generated. +"DocumentFieldDetectionResponse::WARNINGS": Non-fatal issues encountered during field detection. +"DocumentFieldDetectionResponse::ERRORS": Errors encountered during field detection. Successfully detected fields may still be included in the response. +"DocumentFieldDetectionResponse::SUGGESTIONS": Suggestions for improving the field detection results. + "Common::RateLimiting::LIMIT": The maximum number of requests per hour that you can make. "Common::RateLimiting::REMAINING": The number of requests remaining in the current rate limit window. "Common::RateLimiting::RESET": The Unix time at which the rate limit will reset to its maximum. @@ -1892,6 +1920,8 @@ "BulkSendJobGet::SEO::DESCRIPTION": "The Dropbox Sign API allows you to build custom integrations. To find out how to return the status of the BulkSendJob and SignatureRequests, click here." "BulkSendJobList::SEO::TITLE": "List Bulk Send Jobs | Documentation | Dropbox Sign for Developers" "BulkSendJobList::SEO::DESCRIPTION": "The Dropbox Sign API allows you to build custom integrations. To find out how to return a list of BulkSendJob that you can access, click here." +"DocumentDetectFields::SEO::TITLE": "Detect Document Fields | API Documentation | Dropbox Sign for Developers" +"DocumentDetectFields::SEO::DESCRIPTION": "Use the Dropbox Sign API to detect form fields in PDF documents from PDF form annotations or Dropbox Sign text tags." "EmbeddedEditUrl::SEO::TITLE": "Get Embedded Template URL | iFrame | Dropbox Sign for Developers" "EmbeddedEditUrl::SEO::DESCRIPTION": "The Dropbox Sign API allows you to build custom integrations. To find out how to retrieve an embedded iFrame object containing a template url, click here." "EmbeddedSignUrl::SEO::TITLE": "Get Embedded Sign URL | iFrame | Dropbox Sign for Developers"