diff --git a/README.md b/README.md index 39f2b4a..957eced 100644 --- a/README.md +++ b/README.md @@ -55,7 +55,7 @@ Add this dependency to your project's POM: com.dropbox.sign dropbox-sign - 1.13.0 + 1.14.0 compile ``` @@ -71,7 +71,7 @@ Add this dependency to your project's build file: } dependencies { - implementation "com.dropbox.sign:dropbox-sign:1.13.0" + implementation "com.dropbox.sign:dropbox-sign:1.14.0" } ``` @@ -85,7 +85,7 @@ mvn clean package Then manually install the following JARs: -- `target/dropbox-sign-1.13.0.jar` +- `target/dropbox-sign-1.14.0.jar` - `target/lib/*.jar` ## Getting Started @@ -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) @@ -477,7 +481,7 @@ apisupport@hellosign.com This Java package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project: - API version: `3.0.0` - - Package version: `1.13.0` + - Package version: `1.14.0` - Build package: `org.openapitools.codegen.languages.JavaClientCodegen` diff --git a/VERSION b/VERSION index feaae22..850e742 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.13.0 +1.14.0 diff --git a/build.gradle b/build.gradle index 40479cb..5bd7703 100644 --- a/build.gradle +++ b/build.gradle @@ -7,7 +7,7 @@ plugins { } group = 'com.dropbox.sign' -version = '1.13.0' +version = '1.14.0' base { archivesName.set('dropbox-sign') diff --git a/build.sbt b/build.sbt index 05537b7..4c87d68 100644 --- a/build.sbt +++ b/build.sbt @@ -2,7 +2,7 @@ lazy val root = (project in file(".")). settings( organization := "com.dropbox.sign", name := "dropbox-sign", - version := "1.13.0", + version := "1.14.0", scalaVersion := "2.11.4", scalacOptions ++= Seq("-feature"), Compile / javacOptions ++= Seq("-Xlint:deprecation"), diff --git a/docs/DocumentApi.md b/docs/DocumentApi.md new file mode 100644 index 0000000..c72d11a --- /dev/null +++ b/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/docs/DocumentFieldDetectionRequest.md b/docs/DocumentFieldDetectionRequest.md new file mode 100644 index 0000000..482d279 --- /dev/null +++ b/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/docs/DocumentFieldDetectionResponse.md b/docs/DocumentFieldDetectionResponse.md new file mode 100644 index 0000000..2a7329e --- /dev/null +++ b/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/docs/DocumentFieldDetectionResponseDetectionResult.md b/docs/DocumentFieldDetectionResponseDetectionResult.md new file mode 100644 index 0000000..b8f0e04 --- /dev/null +++ b/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/docs/ErrorResponseError.md b/docs/ErrorResponseError.md index 656aa5c..9db1a2d 100644 --- a/docs/ErrorResponseError.md +++ b/docs/ErrorResponseError.md @@ -9,7 +9,7 @@ Contains information about an error that occurred. | Name | Type | Description | Notes | |------------ | ------------- | ------------- | -------------| | `errorMsg`*_required_ | ```String``` | Message describing an error. | | -| `errorName`*_required_ | ```String``` | Name of the error. | | +| `errorName`*_required_ | ```String``` | Name of the error. See the `x-error-codes` catalog in openapi file for a complete list of possible error codes with detailed information including HTTP status codes, causes, remediation steps, and retry guidance. | | | `errorPath` | ```String``` | Path at which an error occurred. | | diff --git a/docs/EventCallbackRequestEvent.md b/docs/EventCallbackRequestEvent.md index 19ab491..2f5cbd1 100644 --- a/docs/EventCallbackRequestEvent.md +++ b/docs/EventCallbackRequestEvent.md @@ -42,6 +42,13 @@ Basic information about the event that occurred. | TEMPLATE_ERROR | "template_error" | | CALLBACK_TEST | "callback_test" | | SIGNATURE_REQUEST_SIGNER_REMOVED | "signature_request_signer_removed" | +| FAX_RECEIVED | "fax_received" | +| FAX_SENT | "fax_sent" | +| FAX_ON_HOLD | "fax_on_hold" | +| FAX_BUSY | "fax_busy" | +| FAX_NO_ANSWER | "fax_no_answer" | +| FAX_DISCONNECTED | "fax_disconnected" | +| FAX_BLACKLISTED | "fax_blacklisted" | diff --git a/docs/FaxResponse.md b/docs/FaxResponse.md index a1c857b..a5707cf 100644 --- a/docs/FaxResponse.md +++ b/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/docs/SignatureRequestBulkCreateEmbeddedWithTemplateRequest.md b/docs/SignatureRequestBulkCreateEmbeddedWithTemplateRequest.md index 4243ead..ef7454f 100644 --- a/docs/SignatureRequestBulkCreateEmbeddedWithTemplateRequest.md +++ b/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/docs/SignatureRequestBulkSendWithTemplateRequest.md b/docs/SignatureRequestBulkSendWithTemplateRequest.md index 1798f6f..34a3281 100644 --- a/docs/SignatureRequestBulkSendWithTemplateRequest.md +++ b/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/docs/SignatureRequestCreateEmbeddedWithTemplateRequest.md b/docs/SignatureRequestCreateEmbeddedWithTemplateRequest.md index 050a7e6..da8343b 100644 --- a/docs/SignatureRequestCreateEmbeddedWithTemplateRequest.md +++ b/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/docs/SignatureRequestSendWithTemplateRequest.md b/docs/SignatureRequestSendWithTemplateRequest.md index 425ccff..621d66a 100644 --- a/docs/SignatureRequestSendWithTemplateRequest.md +++ b/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/examples/DocumentDetectFieldsExample.java b/examples/DocumentDetectFieldsExample.java new file mode 100644 index 0000000..ab017fd --- /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/gradle.properties b/gradle.properties index 446e538..fcedf74 100644 --- a/gradle.properties +++ b/gradle.properties @@ -6,7 +6,7 @@ #target = android GROUP=com.dropbox.sign POM_ARTIFACT_ID=dropbox-sign -VERSION_NAME=1.13.0 +VERSION_NAME=1.14.0 POM_NAME=Dropbox Sign Java SDK POM_DESCRIPTION=Use the Dropbox Sign Java SDK to connect your Java app to the service of Dropbox Sign in microseconds! diff --git a/openapi-config.yaml b/openapi-config.yaml index f772d21..13fc0d2 100644 --- a/openapi-config.yaml +++ b/openapi-config.yaml @@ -16,7 +16,7 @@ additionalProperties: groupId: com.dropbox.sign artifactId: dropbox-sign artifactName: Dropbox Sign Java SDK - artifactVersion: "1.13.0" + artifactVersion: "1.14.0" artifactUrl: https://github.com/hellosign/dropbox-sign-java artifactDescription: Use the Dropbox Sign Java SDK to connect your Java app to the service of Dropbox Sign in microseconds! scmConnection: scm:git:git://github.com/hellosign/dropbox-sign-java.git diff --git a/openapi-sdk.yaml b/openapi-sdk.yaml index 576b442..a05971e 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: @@ -5087,6 +5185,8 @@ paths: $ref: '#/components/examples/Error429Response' 404_example: $ref: '#/components/examples/Error404Response' + 409_example: + $ref: '#/components/examples/Error409Response' 4XX_example: $ref: '#/components/examples/Error4XXResponse' security: @@ -7925,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: @@ -8323,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: @@ -8412,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: @@ -8652,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: @@ -9416,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: @@ -11520,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 @@ -11940,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: @@ -11975,7 +12223,7 @@ components: description: 'Path at which an error occurred.' type: string error_name: - description: 'Name of the error.' + description: 'Name of the error. See the `x-error-codes` catalog in openapi file for a complete list of possible error codes with detailed information including HTTP status codes, causes, remediation steps, and retry guidance.' type: string type: object FaxResponse: @@ -11988,6 +12236,7 @@ components: - sender - files_url - transmissions + - test_mode properties: fax_id: description: 'Fax ID' @@ -12028,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: @@ -13782,6 +14035,8 @@ components: template: $ref: '#/components/schemas/TemplateResponse' type: object + x-fern-audiences: + - events EventCallbackRequestEvent: description: 'Basic information about the event that occurred.' required: @@ -13819,12 +14074,21 @@ components: - template_error - callback_test - signature_request_signer_removed + - fax_received + - fax_sent + - fax_on_hold + - fax_busy + - fax_no_answer + - fax_disconnected + - fax_blacklisted event_hash: description: 'Generated hash used to verify source of event data.' type: string event_metadata: $ref: '#/components/schemas/EventCallbackRequestEventMetadata' type: object + x-fern-audiences: + - events EventCallbackRequestEventMetadata: description: 'Specific metadata about the event.' properties: @@ -13845,6 +14109,8 @@ components: type: string nullable: true type: object + x-fern-audiences: + - events responses: EventCallbackResponse: description: 'successful operation' @@ -13853,6 +14119,8 @@ components: schema: type: string default: 'Hello API Event Received' + x-fern-audiences: + - events examples: AccountCreateRequest: summary: 'Default Example' @@ -14354,22 +14622,212 @@ components: summary: 'Example: signature_request_sent' value: $ref: examples/json/EventCallbackAccountSignatureRequestSent.json + x-fern-audiences: + - events EventCallbackAccountTemplateCreated: summary: 'Example: template_created' value: $ref: examples/json/EventCallbackAccountTemplateCreated.json + x-fern-audiences: + - events EventCallbackAppAccountConfirmed: summary: 'Example: account_confirmed' value: $ref: examples/json/EventCallbackAppAccountConfirmed.json + x-fern-audiences: + - events EventCallbackAppSignatureRequestSent: summary: 'Example: signature_request_sent' value: $ref: examples/json/EventCallbackAppSignatureRequestSent.json + x-fern-audiences: + - events EventCallbackAppTemplateCreated: summary: 'Example: template_created' value: $ref: examples/json/EventCallbackAppTemplateCreated.json + x-fern-audiences: + - events + EventCallbackSignatureRequestViewed: + summary: 'Signature Request Viewed Event Example' + value: + $ref: examples/json/EventCallbackSignatureRequestViewed.json + x-fern-audiences: + - events + EventCallbackSignatureRequestSigned: + summary: 'Signature Request Signed Event Example' + value: + $ref: examples/json/EventCallbackSignatureRequestSigned.json + x-fern-audiences: + - events + EventCallbackSignatureRequestSignerRemoved: + summary: 'Signature Request Signer Removed Event Example' + value: + $ref: examples/json/EventCallbackSignatureRequestSignerRemoved.json + x-fern-audiences: + - events + EventCallbackSignatureRequestDownloadable: + summary: 'Signature Request Downloadable Event Example' + value: + $ref: examples/json/EventCallbackSignatureRequestDownloadable.json + x-fern-audiences: + - events + EventCallbackSignatureRequestSent: + summary: 'Signature Request Sent Event Example' + value: + $ref: examples/json/EventCallbackSignatureRequestSent.json + x-fern-audiences: + - events + EventCallbackSignatureRequestAllSigned: + summary: 'Signature Request All Signed Event Example' + value: + $ref: examples/json/EventCallbackSignatureRequestAllSigned.json + x-fern-audiences: + - events + EventCallbackSignatureRequestInvalid: + summary: 'Signature Request Invalid Event Example' + value: + $ref: examples/json/EventCallbackSignatureRequestInvalid.json + x-fern-audiences: + - events + EventCallbackSignatureRequestEmailBounce: + summary: 'Signature Request Email Bounce Event Example' + value: + $ref: examples/json/EventCallbackSignatureRequestEmailBounce.json + x-fern-audiences: + - events + EventCallbackSignatureRequestRemind: + summary: 'Signature Request Remind Event Example' + value: + $ref: examples/json/EventCallbackSignatureRequestRemind.json + x-fern-audiences: + - events + EventCallbackSignatureRequestIncompleteQes: + summary: 'Signature Request Incomplete QES Event Example' + value: + $ref: examples/json/EventCallbackSignatureRequestIncompleteQes.json + x-fern-audiences: + - events + EventCallbackSignatureRequestDestroyed: + summary: 'Signature Request Destroyed Event Example' + value: + $ref: examples/json/EventCallbackSignatureRequestDestroyed.json + x-fern-audiences: + - events + EventCallbackSignatureRequestCanceled: + summary: 'Signature Request Canceled Event Example' + value: + $ref: examples/json/EventCallbackSignatureRequestCanceled.json + x-fern-audiences: + - events + EventCallbackSignatureRequestDeclined: + summary: 'Signature Request Declined Event Example' + value: + $ref: examples/json/EventCallbackSignatureRequestDeclined.json + x-fern-audiences: + - events + EventCallbackSignatureRequestExpired: + summary: 'Signature Request Expired Event Example' + value: + $ref: examples/json/EventCallbackSignatureRequestExpired.json + x-fern-audiences: + - events + EventCallbackSignatureRequestReassigned: + summary: 'Signature Request Reassigned Event Example' + value: + $ref: examples/json/EventCallbackSignatureRequestReassigned.json + x-fern-audiences: + - events + EventCallbackSignatureRequestPrepared: + summary: 'Signature Request Prepared Event Example' + value: + $ref: examples/json/EventCallbackSignatureRequestPrepared.json + x-fern-audiences: + - events + EventCallbackAccountConfirmed: + summary: 'Account Confirmed Event Example' + value: + $ref: examples/json/EventCallbackAccountConfirmed.json + x-fern-audiences: + - events + EventCallbackUnknownError: + summary: 'Unknown Error Event Example' + value: + $ref: examples/json/EventCallbackUnknownError.json + x-fern-audiences: + - events + EventCallbackFileError: + summary: 'File Error Event Example' + value: + $ref: examples/json/EventCallbackFileError.json + x-fern-audiences: + - events + EventCallbackTemplateCreated: + summary: 'Template Created Event Example' + value: + $ref: examples/json/EventCallbackTemplateCreated.json + x-fern-audiences: + - events + EventCallbackTemplateError: + summary: 'Template Error Event Example' + value: + $ref: examples/json/EventCallbackTemplateError.json + x-fern-audiences: + - events + EventCallbackSignUrlInvalid: + summary: 'Sign URL Invalid Event Example' + value: + $ref: examples/json/EventCallbackSignUrlInvalid.json + x-fern-audiences: + - events + EventCallbackCallbackTest: + summary: 'Callback Test Event Example' + value: + $ref: examples/json/EventCallbackCallbackTest.json + x-fern-audiences: + - events + EventCallbackFaxReceived: + summary: 'Fax Received Event Example' + value: + $ref: examples/json/EventCallbackFaxReceived.json + x-fern-audiences: + - events + EventCallbackFaxSent: + summary: 'Fax Sent Event Example' + value: + $ref: examples/json/EventCallbackFaxSent.json + x-fern-audiences: + - events + EventCallbackFaxOnHold: + summary: 'Fax On Hold Event Example' + value: + $ref: examples/json/EventCallbackFaxOnHold.json + x-fern-audiences: + - events + EventCallbackFaxBusy: + summary: 'Fax Busy Event Example' + value: + $ref: examples/json/EventCallbackFaxBusy.json + x-fern-audiences: + - events + EventCallbackFaxNoAnswer: + summary: 'Fax No Answer Event Example' + value: + $ref: examples/json/EventCallbackFaxNoAnswer.json + x-fern-audiences: + - events + EventCallbackFaxDisconnected: + summary: 'Fax Disconnected Event Example' + value: + $ref: examples/json/EventCallbackFaxDisconnected.json + x-fern-audiences: + - events + EventCallbackFaxBlacklisted: + summary: 'Fax Blacklisted Event Example' + value: + $ref: examples/json/EventCallbackFaxBlacklisted.json + x-fern-audiences: + - events requestBodies: EventCallbackAccountRequest: description: |- @@ -14447,100 +14905,242 @@ security: externalDocs: description: 'Legacy API Reference' url: 'https://app.hellosign.com/api/reference' -x-webhooks: - accountCallback: - post: - summary: 'Account Callbacks' - operationId: accountUpdateEventCallback - description: - $ref: ./markdown/en/descriptions/account-callback-description.md - x-meta: - seo: - title: 'Account Callbacks | API Documentation | Dropbox Sign for Developers' - description: 'The Dropbox Sign API allows you to build with a wide range of tools. To find out how to consume Dropbox Sign Events at the account level, click here.' - x-codeSamples: - - - lang: PHP - label: PHP - source: - $ref: examples/EventCallbackExample.php - - - lang: 'C#' - label: 'C#' - source: - $ref: examples/EventCallbackExample.cs - - - lang: TypeScript - label: TypeScript - source: - $ref: examples/EventCallbackExample.ts - - - lang: Java - label: Java - source: - $ref: examples/EventCallbackExample.java - - - lang: Ruby - label: Ruby - source: - $ref: examples/EventCallbackExample.rb - - - lang: Python - label: Python - source: - $ref: examples/EventCallbackExample.py - tags: - - 'Callbacks and Events' - requestBody: - $ref: '#/components/requestBodies/EventCallbackAccountRequest' - responses: - 200: - $ref: '#/components/responses/EventCallbackResponse' - appCallback: - post: - summary: 'App Callbacks' - description: - $ref: ./markdown/en/descriptions/api-app-callback-description.md - operationId: apiAppCreateEventCallback - x-meta: - seo: - title: 'App Callbacks | API Documentation | Dropbox Sign for Developers' - description: 'The Dropbox Sign API allows you to build with a wide range of tools. To find out how to consume Dropbox Sign Events at the App level, click here.' - x-codeSamples: - - - lang: PHP - label: PHP - source: - $ref: examples/EventCallbackExample.php - - - lang: 'C#' - label: 'C#' - source: - $ref: examples/EventCallbackExample.cs - - - lang: TypeScript - label: TypeScript - source: - $ref: examples/EventCallbackExample.ts - - - lang: Java - label: Java - source: - $ref: examples/EventCallbackExample.java - - - lang: Ruby - label: Ruby - source: - $ref: examples/EventCallbackExample.rb - - - lang: Python - label: Python - source: - $ref: examples/EventCallbackExample.py - tags: - - 'Callbacks and Events' - requestBody: - $ref: '#/components/requestBodies/EventCallbackAppRequest' - responses: - 200: - $ref: '#/components/responses/EventCallbackResponse' +x-webhooks: [] +x-error-codes: + bad_request: + http_status: 400 + summary: 'The request contained invalid or malformed parameters.' + cause: 'A parameter failed validation, or the request body was malformed.' + remediation: 'Inspect error_msg and error_path, correct the offending parameter, and resend.' + retryable: 'no' + unauthorized: + http_status: 401 + summary: 'The credentials supplied are missing or invalid.' + cause: 'Missing, malformed, or invalid API key or OAuth access token.' + remediation: 'Verify the API key or OAuth token and the Authorization header, then retry.' + retryable: 'no' + payment_required: + http_status: 402 + summary: 'The account must be credited or upgraded to perform this action.' + cause: 'The action requires a paid plan, additional quota, or API credits.' + remediation: 'Upgrade the plan or add the required credits/quota, then retry.' + retryable: 'no' + forbidden: + http_status: 403 + summary: 'The action is not allowed for these credentials or in the current context.' + cause: 'The authenticated account lacks access to the resource or operation.' + remediation: 'Confirm the account has access to the resource and the required permissions.' + retryable: 'no' + not_found: + http_status: 404 + summary: 'Nothing matches the requested resource.' + cause: 'The resource id does not exist or is not visible to this account.' + remediation: 'Verify the id and that the resource belongs to the authenticated account.' + retryable: 'no' + conflict: + http_status: 409 + summary: 'The request was well-formed but conflicts with the current state.' + cause: 'The target resource is in a state incompatible with the request (e.g. a signature request is still being set up).' + remediation: 'Wait briefly and retry, or listen for a callback event confirming the resource is ready.' + retryable: conditional + exceeded_rate: + http_status: 429 + summary: 'Your account''s API request rate limit has been exceeded.' + cause: 'Too many requests were sent within the rate-limit window for this request type.' + remediation: 'Pace requests using the X-RateLimit-* response headers and retry after the window resets.' + retryable: 'yes' + backoff: 'Honor X-Ratelimit-Reset (Unix epoch); otherwise exponential backoff with jitter. No Retry-After header is sent.' + unknown: + http_status: 500 + summary: 'An unexpected error occurred.' + cause: 'An unhandled server-side error, or a status code without a more specific error_name.' + remediation: 'Retry transient failures; if it persists, contact support with the request details.' + retryable: conditional + backoff: 'For transient 5xx, retry with exponential backoff; otherwise do not retry.' + team_invite_failed: + http_status: 403 + summary: 'The team invitation could not be completed.' + cause: 'The invitee already belongs to a team, or the invite is otherwise not permitted.' + remediation: 'Confirm the invitee is not already on a team before inviting.' + retryable: 'no' + max_faxes: + http_status: 429 + summary: 'Too many fax transmissions are currently pending or transmitting.' + cause: 'The account has reached the limit of concurrent in-flight fax transmissions.' + remediation: 'Wait for outstanding transmissions to complete, then retry.' + retryable: 'yes' + backoff: 'Retry with exponential backoff once pending transmissions clear.' + invalid_recipient: + http_status: 400 + summary: 'The recipient (fax number or email address) is invalid.' + cause: 'A recipient value did not pass validation.' + remediation: 'Correct the recipient value and resend.' + retryable: 'no' + signature_request_cancel_failed: + http_status: 400 + summary: 'The signature request could not be cancelled.' + cause: 'The caller is not the requester, or the request is already fully executed/closed.' + remediation: 'Only the requester can cancel, and only before the request is fully executed.' + retryable: 'no' + signature_request_remove_failed: + http_status: 400 + summary: 'Access to the signature request could not be removed.' + cause: 'The signature request has not yet been fully executed, so access cannot be revoked.' + remediation: 'Wait until all parties have signed, or call /signature_request/cancel to cancel incomplete requests instead.' + retryable: 'no' + maintenance: + http_status: 503 + summary: 'The request could not be completed because the site is under maintenance.' + cause: 'The API is in a scheduled maintenance window.' + remediation: 'Retry once the maintenance window ends.' + retryable: 'yes' + backoff: 'Retry later with exponential backoff.' + method_not_supported: + http_status: 405 + summary: 'The HTTP method is not supported for this endpoint.' + cause: 'The request used a verb the endpoint does not accept.' + remediation: 'Use the HTTP method documented for the endpoint.' + retryable: 'no' + invalid_reminder: + http_status: 400 + summary: 'The signature request reminder was invalid.' + cause: 'A reminder was attempted against an ineligible request (e.g. embedded, closed, or expired).' + remediation: 'Only send reminders for eligible (non-embedded, open) signature requests.' + retryable: 'no' + unavailable: + http_status: 503 + summary: 'The service is temporarily unavailable.' + cause: 'A downstream dependency or the service itself is temporarily unavailable.' + remediation: 'Retry later with exponential backoff.' + retryable: 'yes' + backoff: 'Retry later with exponential backoff and jitter.' + unprocessable_entity: + http_status: 422 + summary: 'The request was understood but the target entity cannot be processed.' + cause: 'The resource is still being processed, or it is in an error state.' + remediation: 'If the resource is still processing, wait and retry; if it is in an error state, recreate/resend it instead of retrying.' + retryable: conditional + backoff: 'If still processing, retry with exponential backoff; if in an error state, do not retry.' + signature_request_expired: + http_status: + - 400 + - 403 + summary: 'The signature request has expired.' + cause: 'The operation targets a request whose expiration has passed. Most endpoints return 400; final-copy/download endpoints return 403.' + remediation: 'The request can no longer be acted upon; create a new signature request.' + retryable: 'no' + deleted: + http_status: 410 + summary: 'The request was cancelled or deleted.' + cause: 'The resource has been cancelled or removed and is no longer available.' + remediation: 'Do not retry; the resource is permanently gone.' + retryable: 'no' +x-oauth-error-codes: + invalid_grant: + http_status: + - 400 + - 401 + summary: 'The OAuth grant (authorization code or refresh token) is invalid or expired.' + cause: 'The code/token was already used, expired, or does not match the client.' + remediation: 'Re-initiate the OAuth flow to obtain a fresh authorization code.' + retryable: 'no' + invalid_client: + http_status: 400 + summary: 'The OAuth client credentials are invalid.' + cause: 'The client_id or client_secret is unrecognized or incorrect.' + remediation: 'Verify the client_id and client_secret from the API app settings.' + retryable: 'no' + invalid_request: + http_status: 400 + summary: 'The OAuth request is malformed or missing required parameters.' + cause: 'A required parameter is missing, or the request format is invalid.' + remediation: 'Check the request against the OAuth token endpoint documentation.' + retryable: 'no' + unauthorized_client: + http_status: + - 401 + - 403 + summary: 'The OAuth client is not authorized to perform this action.' + cause: 'The app has not been approved, or the action is outside the granted scopes.' + remediation: 'Ensure the app is approved and the required scopes are granted.' + retryable: 'no' + unsupported_grant_type: + http_status: 400 + summary: 'The grant type is not supported.' + cause: 'The grant_type parameter value is not recognized.' + remediation: 'Use authorization_code or refresh_token as the grant_type.' + retryable: 'no' + payment_required: + http_status: 402 + summary: 'The account requires a paid plan to use this OAuth app.' + cause: 'The authorizing account does not have a plan that supports this integration.' + remediation: 'Upgrade the account to a plan that includes OAuth app access.' + retryable: 'no' + addon_required: + http_status: 402 + summary: 'An add-on is required to use this OAuth app.' + cause: 'The account plan does not include the add-on needed for this integration.' + remediation: 'Add the required add-on to the account subscription.' + retryable: 'no' + invalid_scope: + http_status: 400 + summary: 'The requested OAuth scope is invalid.' + cause: 'The scope parameter contains values not permitted for the app.' + remediation: 'Request only scopes that the app is configured to use.' + retryable: 'no' + quota_reached: + http_status: 402 + summary: 'The account has reached its usage quota for this OAuth app.' + cause: 'The authorizing account has exhausted its quota for the integration.' + remediation: 'Contact the app owner or upgrade the account quota.' + retryable: 'no' + server_error: + http_status: 500 + summary: 'An internal server error occurred during OAuth processing.' + cause: 'An unexpected error on the server side while handling the OAuth request.' + remediation: 'Retry the request; if it persists, contact support.' + retryable: 'yes' + backoff: 'Retry with exponential backoff.' + temporary_unavailable: + http_status: 503 + summary: 'The OAuth service is temporarily unavailable.' + cause: 'The service is under maintenance or experiencing temporary issues.' + remediation: 'Retry after a short delay.' + retryable: 'yes' + backoff: 'Retry with exponential backoff.' +x-error-events: + signature_request_invalid: + event_type: signature_request_invalid + delivery: webhook + summary: 'Asynchronous error while processing a signature request.' + cause: 'A signature request could not be processed (e.g. invalid tags, fields, or merge data).' + remediation: 'Inspect event.event_metadata.event_message in the callback, correct the request, and resend.' + retryable: conditional + unknown_error: + event_type: unknown_error + delivery: webhook + summary: 'An unspecified asynchronous processing error occurred.' + cause: 'An unexpected error occurred while processing the request asynchronously.' + remediation: 'Check the request status in the API dashboard; retry or contact support if it persists.' + retryable: conditional + file_error: + event_type: file_error + delivery: webhook + summary: 'Asynchronous error while processing an uploaded file.' + cause: 'A file attached to a request could not be processed.' + remediation: 'Resend the request with a supported, non-corrupt file.' + retryable: conditional + template_error: + event_type: template_error + delivery: webhook + summary: 'Asynchronous error while creating a template.' + cause: 'Template file processing failed (e.g. unsupported or corrupt file).' + remediation: 'Recreate the template with a valid file; check status in the API dashboard.' + retryable: conditional + sign_url_invalid: + event_type: sign_url_invalid + delivery: webhook + summary: 'An embedded signing URL has expired or become invalid.' + cause: 'The embedded sign_url is no longer valid (e.g. expired).' + remediation: 'Generate a fresh embedded sign_url via the embedded sign URL endpoint.' + retryable: 'yes' diff --git a/pom.xml b/pom.xml index 29cb179..3c1ff0e 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ dropbox-sign jar dropbox-sign - 1.13.0 + 1.14.0 https://github.com/hellosign/dropbox-sign-java Use the Dropbox Sign Java SDK to connect your Java app to the service of Dropbox Sign in microseconds! diff --git a/src/main/java/com/dropbox/sign/ApiClient.java b/src/main/java/com/dropbox/sign/ApiClient.java index 1ece0d7..d133948 100644 --- a/src/main/java/com/dropbox/sign/ApiClient.java +++ b/src/main/java/com/dropbox/sign/ApiClient.java @@ -147,7 +147,7 @@ public ApiClient(Map authMap) { this.dateFormat = new RFC3339DateFormat(); // Set default User-Agent. - setUserAgent("OpenAPI-Generator/1.13.0/java"); + setUserAgent("OpenAPI-Generator/1.14.0/java"); // Setup authentications (key: authentication name, value: authentication). authentications = new HashMap<>(); diff --git a/src/main/java/com/dropbox/sign/Configuration.java b/src/main/java/com/dropbox/sign/Configuration.java index 3502780..499f380 100644 --- a/src/main/java/com/dropbox/sign/Configuration.java +++ b/src/main/java/com/dropbox/sign/Configuration.java @@ -16,7 +16,7 @@ value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.12.0") public class Configuration { - public static final String VERSION = "1.13.0"; + public static final String VERSION = "1.14.0"; private static volatile ApiClient defaultApiClient = new ApiClient(); diff --git a/src/main/java/com/dropbox/sign/api/DocumentApi.java b/src/main/java/com/dropbox/sign/api/DocumentApi.java new file mode 100644 index 0000000..ccb5775 --- /dev/null +++ b/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/src/main/java/com/dropbox/sign/model/DocumentFieldDetectionRequest.java b/src/main/java/com/dropbox/sign/model/DocumentFieldDetectionRequest.java new file mode 100644 index 0000000..a9db580 --- /dev/null +++ b/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/src/main/java/com/dropbox/sign/model/DocumentFieldDetectionResponse.java b/src/main/java/com/dropbox/sign/model/DocumentFieldDetectionResponse.java new file mode 100644 index 0000000..d877c97 --- /dev/null +++ b/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/src/main/java/com/dropbox/sign/model/DocumentFieldDetectionResponseDetectionResult.java b/src/main/java/com/dropbox/sign/model/DocumentFieldDetectionResponseDetectionResult.java new file mode 100644 index 0000000..37eac20 --- /dev/null +++ b/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/src/main/java/com/dropbox/sign/model/ErrorResponseError.java b/src/main/java/com/dropbox/sign/model/ErrorResponseError.java index e9624c6..dfe621e 100644 --- a/src/main/java/com/dropbox/sign/model/ErrorResponseError.java +++ b/src/main/java/com/dropbox/sign/model/ErrorResponseError.java @@ -88,7 +88,9 @@ public ErrorResponseError errorName(@javax.annotation.Nonnull String errorName) } /** - * Name of the error. + * Name of the error. See the `x-error-codes` catalog in openapi file for a complete + * list of possible error codes with detailed information including HTTP status codes, causes, + * remediation steps, and retry guidance. * * @return errorName */ diff --git a/src/main/java/com/dropbox/sign/model/EventCallbackRequestEvent.java b/src/main/java/com/dropbox/sign/model/EventCallbackRequestEvent.java index a3e9998..3215245 100644 --- a/src/main/java/com/dropbox/sign/model/EventCallbackRequestEvent.java +++ b/src/main/java/com/dropbox/sign/model/EventCallbackRequestEvent.java @@ -86,7 +86,21 @@ public enum EventTypeEnum { CALLBACK_TEST(String.valueOf("callback_test")), - SIGNATURE_REQUEST_SIGNER_REMOVED(String.valueOf("signature_request_signer_removed")); + SIGNATURE_REQUEST_SIGNER_REMOVED(String.valueOf("signature_request_signer_removed")), + + FAX_RECEIVED(String.valueOf("fax_received")), + + FAX_SENT(String.valueOf("fax_sent")), + + FAX_ON_HOLD(String.valueOf("fax_on_hold")), + + FAX_BUSY(String.valueOf("fax_busy")), + + FAX_NO_ANSWER(String.valueOf("fax_no_answer")), + + FAX_DISCONNECTED(String.valueOf("fax_disconnected")), + + FAX_BLACKLISTED(String.valueOf("fax_blacklisted")); private String value; diff --git a/src/main/java/com/dropbox/sign/model/FaxResponse.java b/src/main/java/com/dropbox/sign/model/FaxResponse.java index 7ef24b5..b72e26e 100644 --- a/src/main/java/com/dropbox/sign/model/FaxResponse.java +++ b/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/src/main/java/com/dropbox/sign/model/SignatureRequestBulkCreateEmbeddedWithTemplateRequest.java b/src/main/java/com/dropbox/sign/model/SignatureRequestBulkCreateEmbeddedWithTemplateRequest.java index fda33d5..b83a7c8 100644 --- a/src/main/java/com/dropbox/sign/model/SignatureRequestBulkCreateEmbeddedWithTemplateRequest.java +++ b/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/src/main/java/com/dropbox/sign/model/SignatureRequestBulkSendWithTemplateRequest.java b/src/main/java/com/dropbox/sign/model/SignatureRequestBulkSendWithTemplateRequest.java index 67ab53e..96b3b03 100644 --- a/src/main/java/com/dropbox/sign/model/SignatureRequestBulkSendWithTemplateRequest.java +++ b/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/src/main/java/com/dropbox/sign/model/SignatureRequestCreateEmbeddedWithTemplateRequest.java b/src/main/java/com/dropbox/sign/model/SignatureRequestCreateEmbeddedWithTemplateRequest.java index a6b8c00..c734926 100644 --- a/src/main/java/com/dropbox/sign/model/SignatureRequestCreateEmbeddedWithTemplateRequest.java +++ b/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/src/main/java/com/dropbox/sign/model/SignatureRequestSendWithTemplateRequest.java b/src/main/java/com/dropbox/sign/model/SignatureRequestSendWithTemplateRequest.java index 0c0055e..a09639d 100644 --- a/src/main/java/com/dropbox/sign/model/SignatureRequestSendWithTemplateRequest.java +++ b/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/test_fixtures/FaxGetResponse.json b/test_fixtures/FaxGetResponse.json index 0d668e0..f4bf435 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 d0ce7fe..9dbdb96 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 } ] }