diff --git a/examples/json/SignatureRequestEditEmbeddedRequestDefaultExample.json b/examples/json/SignatureRequestEditEmbeddedRequestDefaultExample.json new file mode 100644 index 000000000..724db5940 --- /dev/null +++ b/examples/json/SignatureRequestEditEmbeddedRequestDefaultExample.json @@ -0,0 +1,33 @@ +{ + "client_id": "b6b8e7deaf8f0b95c029dca049356d4a2cf9710a", + "title": "NDA with Acme Co.", + "subject": "The NDA we talked about", + "message": "Please sign this NDA and then we can discuss more. Let me know if you\nhave any questions.", + "signers": [ + { + "email_address": "jack@example.com", + "name": "Jack", + "order": 0 + }, + { + "email_address": "jill@example.com", + "name": "Jill", + "order": 1 + } + ], + "cc_email_addresses": [ + "lawyer1@dropboxsign.com", + "lawyer2@dropboxsign.com" + ], + "file_urls": [ + "https://www.dropbox.com/s/ad9qnhbrjjn64tu/mutual-NDA-example.pdf?dl=1" + ], + "signing_options": { + "draw": true, + "type": true, + "upload": true, + "phone": false, + "default_type": "draw" + }, + "test_mode": true +} diff --git a/examples/json/SignatureRequestEditEmbeddedRequestGroupedSignersExample.json b/examples/json/SignatureRequestEditEmbeddedRequestGroupedSignersExample.json new file mode 100644 index 000000000..fb8cb1935 --- /dev/null +++ b/examples/json/SignatureRequestEditEmbeddedRequestGroupedSignersExample.json @@ -0,0 +1,51 @@ +{ + "client_id": "b6b8e7deaf8f0b95c029dca049356d4a2cf9710a", + "title": "NDA with Acme Co.", + "subject": "The NDA we talked about", + "message": "Please sign this NDA and then we can discuss more. Let me know if you\nhave any questions.", + "grouped_signers": [ + { + "group": "Group #1", + "order": 0, + "signers": [ + { + "email_address": "jack@example.com", + "name": "Jack" + }, + { + "email_address": "jill@example.com", + "name": "Jill" + } + ] + }, + { + "group": "Group #2", + "order": 1, + "signers": [ + { + "email_address": "bob@example.com", + "name": "Bob" + }, + { + "email_address": "charlie@example.com", + "name": "Charlie" + } + ] + } + ], + "cc_email_addresses": [ + "lawyer1@dropboxsign.com", + "lawyer2@dropboxsign.com" + ], + "file_urls": [ + "https://www.dropbox.com/s/ad9qnhbrjjn64tu/mutual-NDA-example.pdf?dl=1" + ], + "signing_options": { + "draw": true, + "type": true, + "upload": true, + "phone": false, + "default_type": "draw" + }, + "test_mode": true +} diff --git a/examples/json/SignatureRequestEditEmbeddedResponseExample.json b/examples/json/SignatureRequestEditEmbeddedResponseExample.json new file mode 100644 index 000000000..5def13bab --- /dev/null +++ b/examples/json/SignatureRequestEditEmbeddedResponseExample.json @@ -0,0 +1,52 @@ +{ + "signature_request": { + "signature_request_id": "a9f4825edef25f47e7b4c14ce8100d81d1693160", + "title": "NDA with Acme Co.", + "original_title": "The NDA we talked about", + "subject": "The NDA we talked about", + "message": "Please sign this NDA and then we can discuss more. Let me know if you have any questions.", + "metadata": {}, + "created_at": 1570471067, + "is_complete": false, + "is_declined": false, + "has_error": false, + "custom_fields": [], + "response_data": [], + "signing_url": null, + "signing_redirect_url": null, + "details_url": "https://app.hellosign.com/home/manage?guid=a9f4825edef25f47e7b4c14ce8100d81d1693160", + "requester_email_address": "me@dropboxsign.com", + "signatures": [ + { + "signature_id": "78caf2a1d01cd39cea2bc1cbb340dac3", + "signer_email_address": "jack@example.com", + "signer_name": "Jack", + "signer_role": null, + "order": 0, + "status_code": "awaiting_signature", + "signed_at": null, + "last_viewed_at": null, + "last_reminded_at": null, + "has_pin": false, + "has_sms_auth": false + }, + { + "signature_id": "616629ed37f8588d28600be17ab5d6b7", + "signer_email_address": "jill@example.com", + "signer_name": "Jill", + "signer_role": null, + "order": 1, + "status_code": "awaiting_signature", + "signed_at": null, + "last_viewed_at": null, + "last_reminded_at": null, + "has_pin": false, + "has_sms_auth": false + } + ], + "cc_email_addresses": [ + "lawyer1@dropboxsign.com", + "lawyer2@dropboxsign.com" + ] + } +} diff --git a/examples/json/SignatureRequestEditEmbeddedWithTemplateRequestDefaultExample.json b/examples/json/SignatureRequestEditEmbeddedWithTemplateRequestDefaultExample.json new file mode 100644 index 000000000..742998123 --- /dev/null +++ b/examples/json/SignatureRequestEditEmbeddedWithTemplateRequestDefaultExample.json @@ -0,0 +1,23 @@ +{ + "client_id": "b6b8e7deaf8f0b95c029dca049356d4a2cf9710a", + "template_ids": [ + "c26b8a16784a872da37ea946b9ddec7c1e11dff6" + ], + "subject": "Purchase Order", + "message": "Glad we could come to an agreement.", + "signers": [ + { + "role": "Client", + "name": "George", + "email_address": "george@example.com" + } + ], + "signing_options": { + "draw": true, + "type": true, + "upload": true, + "phone": false, + "default_type": "draw" + }, + "test_mode": true +} diff --git a/examples/json/SignatureRequestEditEmbeddedWithTemplateResponseExample.json b/examples/json/SignatureRequestEditEmbeddedWithTemplateResponseExample.json new file mode 100644 index 000000000..3099142f2 --- /dev/null +++ b/examples/json/SignatureRequestEditEmbeddedWithTemplateResponseExample.json @@ -0,0 +1,45 @@ +{ + "signature_request": { + "signature_request_id": "17d163069282df5eb63857d31ff4a3bffa9e46c0", + "title": "Purchase Order", + "original_title": "Purchase Order", + "subject": "Purchase Order", + "metadata": {}, + "message": "Glad we could come to an agreement.", + "is_complete": false, + "is_declined": false, + "has_error": false, + "custom_fields": [ + { + "name": "Cost", + "value": "$20,000", + "type": "text", + "editor": "Client", + "required": true + } + ], + "response_data": [], + "signing_url": null, + "signing_redirect_url": null, + "details_url": "https://app.hellosign.com/home/manage?guid=17d163069282df5eb63857d31ff4a3bffa9e46c0", + "requester_email_address": "me@dropboxsign.com", + "signatures": [ + { + "signature_id": "78caf2a1d01cd39cea2bc1cbb340dac3", + "signer_email_address": "george@example.com", + "signer_name": "George", + "signer_role": "Client", + "order": null, + "status_code": "awaiting_signature", + "signed_at": null, + "last_viewed_at": null, + "last_reminded_at": null, + "has_pin": false, + "has_sms_auth": false + } + ], + "cc_email_addresses": [ + "accounting@dropboxsign.com" + ] + } +} diff --git a/examples/json/SignatureRequestEditRequestDefaultExample.json b/examples/json/SignatureRequestEditRequestDefaultExample.json new file mode 100644 index 000000000..adfda81ec --- /dev/null +++ b/examples/json/SignatureRequestEditRequestDefaultExample.json @@ -0,0 +1,39 @@ +{ + "title": "NDA with Acme Co.", + "subject": "The NDA we talked about", + "message": "Please sign this NDA and then we can discuss more. Let me know if you\nhave any questions.", + "signers": [ + { + "email_address": "jack@example.com", + "name": "Jack", + "order": 0 + }, + { + "email_address": "jill@example.com", + "name": "Jill", + "order": 1 + } + ], + "cc_email_addresses": [ + "lawyer1@dropboxsign.com", + "lawyer2@dropboxsign.com" + ], + "file_urls": [ + "https://www.dropbox.com/s/ad9qnhbrjjn64tu/mutual-NDA-example.pdf?dl=1" + ], + "metadata": { + "custom_id": 1234, + "custom_text": "NDA #9" + }, + "signing_options": { + "draw": true, + "type": true, + "upload": true, + "phone": false, + "default_type": "draw" + }, + "field_options": { + "date_format": "DD - MM - YYYY" + }, + "test_mode": true +} diff --git a/examples/json/SignatureRequestEditRequestGroupedSignersExample.json b/examples/json/SignatureRequestEditRequestGroupedSignersExample.json new file mode 100644 index 000000000..d78f99101 --- /dev/null +++ b/examples/json/SignatureRequestEditRequestGroupedSignersExample.json @@ -0,0 +1,57 @@ +{ + "title": "NDA with Acme Co.", + "subject": "The NDA we talked about", + "message": "Please sign this NDA and then we can discuss more. Let me know if you\nhave any questions.", + "grouped_signers": [ + { + "group": "Group #1", + "order": 0, + "signers": [ + { + "email_address": "jack@example.com", + "name": "Jack" + }, + { + "email_address": "jill@example.com", + "name": "Jill" + } + ] + }, + { + "group": "Group #2", + "order": 1, + "signers": [ + { + "email_address": "bob@example.com", + "name": "Bob" + }, + { + "email_address": "charlie@example.com", + "name": "Charlie" + } + ] + } + ], + "cc_email_addresses": [ + "lawyer1@dropboxsign.com", + "lawyer2@dropboxsign.com" + ], + "file_urls": [ + "https://www.dropbox.com/s/ad9qnhbrjjn64tu/mutual-NDA-example.pdf?dl=1" + ], + "metadata": { + "custom_id": 1234, + "custom_text": "NDA #9" + }, + "signing_options": { + "draw": true, + "type": true, + "upload": true, + "phone": false, + "default_type": "draw" + }, + "field_options": { + "date_format": "DD - MM - YYYY" + }, + "test_mode": true +} diff --git a/examples/json/SignatureRequestEditResponseExample.json b/examples/json/SignatureRequestEditResponseExample.json new file mode 100644 index 000000000..52834625a --- /dev/null +++ b/examples/json/SignatureRequestEditResponseExample.json @@ -0,0 +1,76 @@ +{ + "signature_request": { + "signature_request_id": "2b388914e3ae3b738bd4e2ee2850c677e6dc53d2", + "title": "NDA with Acme Co.", + "original_title": "The NDA we talked about", + "subject": "The NDA we talked about", + "message": "Please sign this NDA and then we can discuss more. Let me know if you have any questions.", + "test_mode": true, + "metadata": { + "custom_id": "1234", + "custom_text": "NDA #9" + }, + "created_at": 1570471067, + "is_complete": false, + "is_declined": false, + "has_error": false, + "custom_fields": [], + "response_data": [], + "signing_url": "https://app.hellosign.com/sign/2b388914e3ae3b738bd4e2ee2850c677e6dc53d2", + "signing_redirect_url": null, + "files_url": "https://api.hellosign.com/v3/signature_request/files/2b388914e3ae3b738bd4e2ee2850c677e6dc53d2", + "details_url": "https://app.hellosign.com/home/manage?guid=2b388914e3ae3b738bd4e2ee2850c677e6dc53d2", + "requester_email_address": "me@dropboxsign.com", + "signatures": [ + { + "signature_id": "78caf2a1d01cd39cea2bc1cbb340dac3", + "signer_email_address": "jack@example.com", + "signer_name": "Jack", + "signer_role": null, + "order": 0, + "status_code": "awaiting_signature", + "signed_at": null, + "last_viewed_at": null, + "last_reminded_at": null, + "has_pin": false, + "has_sms_auth": false + }, + { + "signature_id": "616629ed37f8588d28600be17ab5d6b7", + "signer_email_address": "jill@example.com", + "signer_name": "Jill", + "signer_role": null, + "order": 1, + "status_code": "awaiting_signature", + "signed_at": null, + "last_viewed_at": null, + "last_reminded_at": null, + "has_pin": false, + "has_sms_auth": false + } + ], + "cc_email_addresses": [ + "lawyer1@dropboxsign.com", + "lawyer2@example.com" + ], + "attachments": [ + { + "id": "id_1", + "signer": "1", + "name": "Attachment #1", + "required": true, + "instructions": "Instructions #1", + "uploaded_at": 1650398513 + }, + { + "id": "id_2", + "signer": "2", + "name": "Attachment #2", + "required": true, + "instructions": null, + "uploaded_at": null + } + ], + "template_ids": null + } +} diff --git a/examples/json/SignatureRequestEditWithTemplateRequestDefaultExample.json b/examples/json/SignatureRequestEditWithTemplateRequestDefaultExample.json new file mode 100644 index 000000000..a79d1c35b --- /dev/null +++ b/examples/json/SignatureRequestEditWithTemplateRequestDefaultExample.json @@ -0,0 +1,36 @@ +{ + "template_ids": [ + "61a832ff0d8423f91d503e76bfbcc750f7417c78" + ], + "subject": "Purchase Order", + "message": "Glad we could come to an agreement.", + "signers": [ + { + "role": "Client", + "name": "George", + "email_address": "george@example.com" + } + ], + "ccs": [ + { + "role": "Accounting", + "email_address": "accounting@example.com" + } + ], + "custom_fields": [ + { + "name": "Cost", + "value": "$20,000", + "editor": "Client", + "required": true + } + ], + "signing_options": { + "draw": true, + "type": true, + "upload": true, + "phone": false, + "default_type": "draw" + }, + "test_mode": true +} diff --git a/examples/json/SignatureRequestEditWithTemplateResponseExample.json b/examples/json/SignatureRequestEditWithTemplateResponseExample.json new file mode 100644 index 000000000..8df366a7a --- /dev/null +++ b/examples/json/SignatureRequestEditWithTemplateResponseExample.json @@ -0,0 +1,46 @@ +{ + "signature_request": { + "signature_request_id": "17d163069282df5eb63857d31ff4a3bffa9e46c0", + "title": "Purchase Order", + "original_title": "Purchase Order", + "subject": "Purchase Order", + "metadata": {}, + "message": "Glad we could come to an agreement.", + "created_at": 1570471067, + "is_complete": false, + "is_declined": false, + "has_error": false, + "custom_fields": [ + { + "name": "Cost", + "value": "$20,000", + "type": "text", + "editor": "Client", + "required": true + } + ], + "response_data": [], + "signing_url": "https://app.hellosign.com/sign/17d163069282df5eb63857d31ff4a3bffa9e46c0", + "signing_redirect_url": null, + "details_url": "https://app.hellosign.com/home/manage?guid=17d163069282df5eb63857d31ff4a3bffa9e46c0", + "requester_email_address": "me@dropboxsign.com", + "signatures": [ + { + "signature_id": "10ab1cd037d9b6cba7975d61ff428c8d", + "signer_email_address": "george@example.com", + "signer_name": "George", + "signer_role": "Client", + "order": null, + "status_code": "awaiting_signature", + "signed_at": null, + "last_viewed_at": null, + "last_reminded_at": null, + "has_pin": false, + "has_sms_auth": false + } + ], + "cc_email_addresses": [ + "accounting@dropboxsign.com" + ] + } +} diff --git a/openapi-raw.yaml b/openapi-raw.yaml index 64d635940..b03c3d48d 100644 --- a/openapi-raw.yaml +++ b/openapi-raw.yaml @@ -1820,7 +1820,6 @@ paths: - CA - US - UK - example: US - name: state in: query @@ -2102,7 +2101,6 @@ paths: required: true schema: type: string - example: '[FAX_NUMBER]' responses: '200': description: 'successful operation' @@ -3547,6 +3545,496 @@ paths: seo: title: '_t__SignatureRequestCreateEmbeddedWithTemplate::SEO::TITLE' description: '_t__SignatureRequestCreateEmbeddedWithTemplate::SEO::DESCRIPTION' + '/signature_request/edit/{signature_request_id}': + put: + tags: + - 'Signature Request' + summary: '_t__SignatureRequestEdit::SUMMARY' + description: '_t__SignatureRequestEdit::DESCRIPTION' + operationId: signatureRequestEdit + parameters: + - + name: signature_request_id + in: path + description: '_t__SignatureRequestEdit::SIGNATURE_REQUEST_ID' + required: true + schema: + type: string + example: fa5c8a0b0f492d768749333ad6fcc214c111e967 + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/SignatureRequestEditRequest' + examples: + default_example: + $ref: '#/components/examples/SignatureRequestEditRequestDefaultExample' + grouped_signers_example: + $ref: '#/components/examples/SignatureRequestEditRequestGroupedSignersExample' + multipart/form-data: + schema: + $ref: '#/components/schemas/SignatureRequestEditRequest' + 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/SignatureRequestGetResponse' + examples: + default_example: + $ref: '#/components/examples/SignatureRequestEditResponseExample' + 4XX: + description: failed_operation + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + 400_example: + $ref: '#/components/examples/Error400ResponseExample' + 401_example: + $ref: '#/components/examples/Error401ResponseExample' + 402_example: + $ref: '#/components/examples/Error402ResponseExample' + 403_example: + $ref: '#/components/examples/Error403ResponseExample' + 404_example: + $ref: '#/components/examples/Error404ResponseExample' + 409_example: + $ref: '#/components/examples/Error409ResponseExample' + 429_example: + $ref: '#/components/examples/Error429ResponseExample' + 4XX_example: + $ref: '#/components/examples/Error4XXResponseExample' + security: + - + api_key: [] + - + oauth2: + - request_signature + - signature_request_access + x-codeSamples: + - + lang: PHP + label: PHP + source: + $ref: examples/SignatureRequestEdit.php + - + lang: 'C#' + label: 'C#' + source: + $ref: examples/SignatureRequestEdit.cs + - + lang: JavaScript + label: JavaScript + source: + $ref: examples/SignatureRequestEdit.js + - + lang: TypeScript + label: TypeScript + source: + $ref: examples/SignatureRequestEdit.ts + - + lang: Java + label: Java + source: + $ref: examples/SignatureRequestEdit.java + - + lang: Ruby + label: Ruby + source: + $ref: examples/SignatureRequestEdit.rb + - + lang: Python + label: Python + source: + $ref: examples/SignatureRequestEdit.py + - + lang: cURL + label: cURL + source: + $ref: examples/SignatureRequestEdit.sh + x-meta: + seo: + title: '_t__SignatureRequestEdit::SEO::TITLE' + description: '_t__SignatureRequestEdit::SEO::DESCRIPTION' + x-hideOn: doc + x-beta: closed + '/signature_request/edit_embedded/{signature_request_id}': + put: + tags: + - 'Signature Request' + summary: '_t__SignatureRequestEditEmbedded::SUMMARY' + description: '_t__SignatureRequestEditEmbedded::DESCRIPTION' + operationId: signatureRequestEditEmbedded + parameters: + - + name: signature_request_id + in: path + description: '_t__SignatureRequestEditEmbedded::SIGNATURE_REQUEST_ID' + required: true + schema: + type: string + example: fa5c8a0b0f492d768749333ad6fcc214c111e967 + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/SignatureRequestEditEmbeddedRequest' + examples: + default_example: + $ref: '#/components/examples/SignatureRequestEditEmbeddedRequestDefaultExample' + grouped_signers_example: + $ref: '#/components/examples/SignatureRequestEditEmbeddedRequestGroupedSignersExample' + multipart/form-data: + schema: + $ref: '#/components/schemas/SignatureRequestEditEmbeddedRequest' + 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/SignatureRequestGetResponse' + examples: + default_example: + $ref: '#/components/examples/SignatureRequestEditEmbeddedResponseExample' + 4XX: + description: failed_operation + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + 400_example: + $ref: '#/components/examples/Error400ResponseExample' + 401_example: + $ref: '#/components/examples/Error401ResponseExample' + 402_example: + $ref: '#/components/examples/Error402ResponseExample' + 403_example: + $ref: '#/components/examples/Error403ResponseExample' + 404_example: + $ref: '#/components/examples/Error404ResponseExample' + 409_example: + $ref: '#/components/examples/Error409ResponseExample' + 429_example: + $ref: '#/components/examples/Error429ResponseExample' + 4XX_example: + $ref: '#/components/examples/Error4XXResponseExample' + security: + - + api_key: [] + - + oauth2: + - signature_request_access + x-codeSamples: + - + lang: PHP + label: PHP + source: + $ref: examples/SignatureRequestEditEmbedded.php + - + lang: 'C#' + label: 'C#' + source: + $ref: examples/SignatureRequestEditEmbedded.cs + - + lang: JavaScript + label: JavaScript + source: + $ref: examples/SignatureRequestEditEmbedded.js + - + lang: TypeScript + label: TypeScript + source: + $ref: examples/SignatureRequestEditEmbedded.ts + - + lang: Java + label: Java + source: + $ref: examples/SignatureRequestEditEmbedded.java + - + lang: Ruby + label: Ruby + source: + $ref: examples/SignatureRequestEditEmbedded.rb + - + lang: Python + label: Python + source: + $ref: examples/SignatureRequestEditEmbedded.py + - + lang: cURL + label: cURL + source: + $ref: examples/SignatureRequestEditEmbedded.sh + x-meta: + seo: + title: '_t__SignatureRequestEditEmbedded::SEO::TITLE' + description: '_t__SignatureRequestEditEmbedded::SEO::DESCRIPTION' + x-hideOn: doc + x-beta: closed + '/signature_request/edit_embedded_with_template/{signature_request_id}': + put: + tags: + - 'Signature Request' + summary: '_t__SignatureRequestEditEmbeddedWithTemplate::SUMMARY' + description: '_t__SignatureRequestEditEmbeddedWithTemplate::DESCRIPTION' + operationId: signatureRequestEditEmbeddedWithTemplate + parameters: + - + name: signature_request_id + in: path + description: '_t__SignatureRequestEditEmbeddedWithTemplate::SIGNATURE_REQUEST_ID' + required: true + schema: + type: string + example: fa5c8a0b0f492d768749333ad6fcc214c111e967 + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/SignatureRequestEditEmbeddedWithTemplateRequest' + examples: + default_example: + $ref: '#/components/examples/SignatureRequestEditEmbeddedWithTemplateRequestDefaultExample' + multipart/form-data: + schema: + $ref: '#/components/schemas/SignatureRequestEditEmbeddedWithTemplateRequest' + 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/SignatureRequestGetResponse' + examples: + default_example: + $ref: '#/components/examples/SignatureRequestEditEmbeddedWithTemplateResponseExample' + 4XX: + description: failed_operation + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + 400_example: + $ref: '#/components/examples/Error400ResponseExample' + 401_example: + $ref: '#/components/examples/Error401ResponseExample' + 402_example: + $ref: '#/components/examples/Error402ResponseExample' + 403_example: + $ref: '#/components/examples/Error403ResponseExample' + 404_example: + $ref: '#/components/examples/Error404ResponseExample' + 409_example: + $ref: '#/components/examples/Error409ResponseExample' + 429_example: + $ref: '#/components/examples/Error429ResponseExample' + 4XX_example: + $ref: '#/components/examples/Error4XXResponseExample' + security: + - + api_key: [] + - + oauth2: + - signature_request_access + x-codeSamples: + - + lang: PHP + label: PHP + source: + $ref: examples/SignatureRequestEditEmbeddedWithTemplate.php + - + lang: 'C#' + label: 'C#' + source: + $ref: examples/SignatureRequestEditEmbeddedWithTemplate.cs + - + lang: JavaScript + label: JavaScript + source: + $ref: examples/SignatureRequestEditEmbeddedWithTemplate.js + - + lang: TypeScript + label: TypeScript + source: + $ref: examples/SignatureRequestEditEmbeddedWithTemplate.ts + - + lang: Java + label: Java + source: + $ref: examples/SignatureRequestEditEmbeddedWithTemplate.java + - + lang: Ruby + label: Ruby + source: + $ref: examples/SignatureRequestEditEmbeddedWithTemplate.rb + - + lang: Python + label: Python + source: + $ref: examples/SignatureRequestEditEmbeddedWithTemplate.py + - + lang: cURL + label: cURL + source: + $ref: examples/SignatureRequestEditEmbeddedWithTemplate.sh + x-meta: + seo: + title: '_t__SignatureRequestEditEmbeddedWithTemplate::SEO::TITLE' + description: '_t__SignatureRequestEditEmbeddedWithTemplate::SEO::DESCRIPTION' + x-hideOn: doc + x-beta: closed + '/signature_request/edit_with_template/{signature_request_id}': + put: + tags: + - 'Signature Request' + summary: '_t__SignatureRequestEditWithTemplate::SUMMARY' + description: '_t__SignatureRequestEditWithTemplate::DESCRIPTION' + operationId: signatureRequestEditWithTemplate + parameters: + - + name: signature_request_id + in: path + description: '_t__SignatureRequestEditWithTemplate::SIGNATURE_REQUEST_ID' + required: true + schema: + type: string + example: fa5c8a0b0f492d768749333ad6fcc214c111e967 + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/SignatureRequestEditWithTemplateRequest' + examples: + default_example: + $ref: '#/components/examples/SignatureRequestEditWithTemplateRequestDefaultExample' + multipart/form-data: + schema: + $ref: '#/components/schemas/SignatureRequestEditWithTemplateRequest' + 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/SignatureRequestGetResponse' + examples: + default_example: + $ref: '#/components/examples/SignatureRequestEditWithTemplateResponseExample' + 4XX: + description: failed_operation + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + 400_example: + $ref: '#/components/examples/Error400ResponseExample' + 401_example: + $ref: '#/components/examples/Error401ResponseExample' + 402_example: + $ref: '#/components/examples/Error402ResponseExample' + 403_example: + $ref: '#/components/examples/Error403ResponseExample' + 404_example: + $ref: '#/components/examples/Error404ResponseExample' + 409_example: + $ref: '#/components/examples/Error409ResponseExample' + 429_example: + $ref: '#/components/examples/Error429ResponseExample' + 4XX_example: + $ref: '#/components/examples/Error4XXResponseExample' + security: + - + api_key: [] + - + oauth2: + - request_signature + - signature_request_access + x-codeSamples: + - + lang: PHP + label: PHP + source: + $ref: examples/SignatureRequestEditWithTemplate.php + - + lang: 'C#' + label: 'C#' + source: + $ref: examples/SignatureRequestEditWithTemplate.cs + - + lang: JavaScript + label: JavaScript + source: + $ref: examples/SignatureRequestEditWithTemplate.js + - + lang: TypeScript + label: TypeScript + source: + $ref: examples/SignatureRequestEditWithTemplate.ts + - + lang: Java + label: Java + source: + $ref: examples/SignatureRequestEditWithTemplate.java + - + lang: Ruby + label: Ruby + source: + $ref: examples/SignatureRequestEditWithTemplate.rb + - + lang: Python + label: Python + source: + $ref: examples/SignatureRequestEditWithTemplate.py + - + lang: cURL + label: cURL + source: + $ref: examples/SignatureRequestEditWithTemplate.sh + x-meta: + seo: + title: '_t__SignatureRequestEditWithTemplate::SEO::TITLE' + description: '_t__SignatureRequestEditWithTemplate::SEO::DESCRIPTION' + x-hideOn: doc + x-beta: closed '/signature_request/files/{signature_request_id}': get: tags: @@ -7768,6 +8256,10 @@ components: - US - UK x-enum-varnames-override: + csharp: + - CA + - US + - UK typescript-node: - Ca - Us @@ -7915,27 +8407,249 @@ components: description: '_t__ReportCreate::START_DATE' type: string type: object - SignatureRequestBulkCreateEmbeddedWithTemplateRequest: + SignatureRequestBulkCreateEmbeddedWithTemplateRequest: + required: + - client_id + - template_ids + properties: + template_ids: + description: '_t__SignatureRequestBulkCreateEmbeddedWithTemplate::TEMPLATE_IDS' + type: array + items: + type: string + signer_file: + description: '_t__SignatureRequestBulkCreateEmbeddedWithTemplate::SIGNER_FILE' + type: string + format: binary + signer_list: + description: '_t__SignatureRequestBulkCreateEmbeddedWithTemplate::SIGNER_LIST' + type: array + items: + $ref: '#/components/schemas/SubBulkSignerList' + allow_decline: + description: '_t__SignatureRequestBulkCreateEmbeddedWithTemplate::ALLOW_DECLINE' + type: boolean + default: false + ccs: + description: '_t__Sub::CC::DESCRIPTION' + type: array + items: + $ref: '#/components/schemas/SubCC' + client_id: + description: '_t__SignatureRequestBulkCreateEmbeddedWithTemplate::CLIENT_ID' + type: string + custom_fields: + description: '_t__Sub::CustomField::DESCRIPTION' + type: array + items: + $ref: '#/components/schemas/SubCustomField' + message: + description: '_t__SignatureRequestBulkCreateEmbeddedWithTemplate::MESSAGE' + type: string + maxLength: 5000 + metadata: + description: '_t__Sub::Metadata::DESCRIPTION' + type: object + maxItems: 10 + additionalProperties: { } + signing_redirect_url: + description: '_t__SignatureRequestBulkCreateEmbeddedWithTemplate::SIGNING_REDIRECT_URL' + type: string + subject: + description: '_t__SignatureRequestBulkCreateEmbeddedWithTemplate::SUBJECT' + type: string + maxLength: 255 + test_mode: + description: '_t__SignatureRequestBulkCreateEmbeddedWithTemplate::TEST_MODE' + type: boolean + default: false + title: + description: '_t__SignatureRequestBulkCreateEmbeddedWithTemplate::TITLE' + type: string + maxLength: 255 + type: object + SignatureRequestBulkSendWithTemplateRequest: + required: + - template_ids + properties: + template_ids: + description: '_t__SignatureRequestBulkSendWithTemplate::TEMPLATE_IDS' + type: array + items: + type: string + signer_file: + description: '_t__SignatureRequestBulkSendWithTemplate::SIGNER_FILE' + type: string + format: binary + signer_list: + description: '_t__SignatureRequestBulkSendWithTemplate::SIGNER_LIST' + type: array + items: + $ref: '#/components/schemas/SubBulkSignerList' + allow_decline: + description: '_t__SignatureRequestBulkSendWithTemplate::ALLOW_DECLINE' + type: boolean + default: false + ccs: + description: '_t__Sub::CC::DESCRIPTION' + type: array + items: + $ref: '#/components/schemas/SubCC' + client_id: + description: '_t__SignatureRequestBulkSendWithTemplate::CLIENT_ID' + type: string + custom_fields: + description: '_t__Sub::CustomField::DESCRIPTION' + type: array + items: + $ref: '#/components/schemas/SubCustomField' + message: + description: '_t__SignatureRequestBulkSendWithTemplate::MESSAGE' + type: string + maxLength: 5000 + metadata: + description: '_t__Sub::Metadata::DESCRIPTION' + type: object + maxItems: 10 + additionalProperties: { } + signing_redirect_url: + description: '_t__SignatureRequestBulkSendWithTemplate::SIGNING_REDIRECT_URL' + type: string + subject: + description: '_t__SignatureRequestBulkSendWithTemplate::SUBJECT' + type: string + maxLength: 255 + test_mode: + description: '_t__SignatureRequestBulkSendWithTemplate::TEST_MODE' + type: boolean + default: false + title: + description: '_t__SignatureRequestBulkSendWithTemplate::TITLE' + type: string + maxLength: 255 + type: object + SignatureRequestCreateEmbeddedRequest: + required: + - client_id + properties: + files: + description: '_t__SignatureRequestCreateEmbedded::FILES' + type: array + items: + type: string + format: binary + file_urls: + description: '_t__SignatureRequestCreateEmbedded::FILE_URLS' + type: array + items: + type: string + signers: + description: '_t__Sub::SignatureRequestSigner::DESCRIPTION' + type: array + items: + $ref: '#/components/schemas/SubSignatureRequestSigner' + grouped_signers: + description: '_t__Sub::SignatureRequestGroupedSigners::DESCRIPTION' + type: array + items: + $ref: '#/components/schemas/SubSignatureRequestGroupedSigners' + allow_decline: + description: '_t__SignatureRequestCreateEmbedded::ALLOW_DECLINE' + type: boolean + default: false + allow_reassign: + description: '_t__SignatureRequestCreateEmbedded::ALLOW_REASSIGN' + type: boolean + default: false + attachments: + description: '_t__SubAttachment::LIST_DESCRIPTION' + type: array + items: + $ref: '#/components/schemas/SubAttachment' + cc_email_addresses: + description: '_t__SignatureRequestCreateEmbedded::CC_EMAIL_ADDRESSES' + type: array + items: + type: string + format: email + client_id: + description: '_t__SignatureRequestCreateEmbedded::CLIENT_ID' + type: string + custom_fields: + description: '_t__Sub::CustomField::DESCRIPTION' + type: array + items: + $ref: '#/components/schemas/SubCustomField' + field_options: + $ref: '#/components/schemas/SubFieldOptions' + form_field_groups: + description: '_t__Sub::FormFieldGroup::DESCRIPTION' + type: array + items: + $ref: '#/components/schemas/SubFormFieldGroup' + form_field_rules: + description: '_t__Sub::FormFieldRule::DESCRIPTION' + type: array + items: + $ref: '#/components/schemas/SubFormFieldRule' + form_fields_per_document: + description: '_t__Sub::FormFieldsPerDocument::DESCRIPTION' + type: array + items: + $ref: '#/components/schemas/SubFormFieldsPerDocumentBase' + hide_text_tags: + description: '_t__SignatureRequestCreateEmbedded::HIDE_TEXT_TAGS' + type: boolean + default: false + message: + description: '_t__SignatureRequestCreateEmbedded::MESSAGE' + type: string + maxLength: 5000 + metadata: + description: '_t__Sub::Metadata::DESCRIPTION' + type: object + maxItems: 10 + additionalProperties: { } + signing_options: + $ref: '#/components/schemas/SubSigningOptions' + subject: + description: '_t__SignatureRequestCreateEmbedded::SUBJECT' + type: string + maxLength: 255 + test_mode: + description: '_t__SignatureRequestCreateEmbedded::TEST_MODE' + type: boolean + default: false + title: + description: '_t__SignatureRequestCreateEmbedded::TITLE' + type: string + maxLength: 255 + use_text_tags: + description: '_t__SignatureRequestCreateEmbedded::USE_TEXT_TAGS' + type: boolean + default: false + populate_auto_fill_fields: + description: '_t__SignatureRequestCreateEmbedded::POPULATE_AUTO_FILL_FIELDS' + type: boolean + default: false + expires_at: + description: '_t__SignatureRequestCreateEmbedded::EXPIRES_AT' + type: integer + nullable: true + type: object + SignatureRequestCreateEmbeddedWithTemplateRequest: required: - client_id - template_ids + - signers properties: template_ids: - description: '_t__SignatureRequestBulkCreateEmbeddedWithTemplate::TEMPLATE_IDS' + description: '_t__SignatureRequestCreateEmbeddedWithTemplate::TEMPLATE_IDS' type: array items: type: string - signer_file: - description: '_t__SignatureRequestBulkCreateEmbeddedWithTemplate::SIGNER_FILE' - type: string - format: binary - signer_list: - description: '_t__SignatureRequestBulkCreateEmbeddedWithTemplate::SIGNER_LIST' - type: array - items: - $ref: '#/components/schemas/SubBulkSignerList' allow_decline: - description: '_t__SignatureRequestBulkCreateEmbeddedWithTemplate::ALLOW_DECLINE' + description: '_t__SignatureRequestCreateEmbeddedWithTemplate::ALLOW_DECLINE' type: boolean default: false ccs: @@ -7944,15 +8658,26 @@ components: items: $ref: '#/components/schemas/SubCC' client_id: - description: '_t__SignatureRequestBulkCreateEmbeddedWithTemplate::CLIENT_ID' + description: '_t__SignatureRequestCreateEmbeddedWithTemplate::CLIENT_ID' type: string custom_fields: - description: '_t__Sub::CustomField::DESCRIPTION' + description: '_t__Sub::CustomField::TEMPLATE' type: array items: $ref: '#/components/schemas/SubCustomField' + files: + description: '_t__SignatureRequestCreateEmbeddedWithTemplate::FILES' + type: array + items: + type: string + format: binary + file_urls: + description: '_t__SignatureRequestCreateEmbeddedWithTemplate::FILE_URLS' + type: array + items: + type: string message: - description: '_t__SignatureRequestBulkCreateEmbeddedWithTemplate::MESSAGE' + description: '_t__SignatureRequestCreateEmbeddedWithTemplate::MESSAGE' type: string maxLength: 5000 metadata: @@ -7960,59 +8685,107 @@ components: type: object maxItems: 10 additionalProperties: { } - signing_redirect_url: - description: '_t__SignatureRequestBulkCreateEmbeddedWithTemplate::SIGNING_REDIRECT_URL' - type: string + signers: + description: '_t__Sub::SignatureRequestTemplateSigner::DESCRIPTION' + type: array + items: + $ref: '#/components/schemas/SubSignatureRequestTemplateSigner' + signing_options: + $ref: '#/components/schemas/SubSigningOptions' subject: - description: '_t__SignatureRequestBulkCreateEmbeddedWithTemplate::SUBJECT' + description: '_t__SignatureRequestCreateEmbeddedWithTemplate::SUBJECT' type: string maxLength: 255 test_mode: - description: '_t__SignatureRequestBulkCreateEmbeddedWithTemplate::TEST_MODE' + description: '_t__SignatureRequestCreateEmbeddedWithTemplate::TEST_MODE' type: boolean default: false title: - description: '_t__SignatureRequestBulkCreateEmbeddedWithTemplate::TITLE' + description: '_t__SignatureRequestCreateEmbeddedWithTemplate::TITLE' type: string maxLength: 255 + populate_auto_fill_fields: + description: '_t__SignatureRequestCreateEmbeddedWithTemplate::POPULATE_AUTO_FILL_FIELDS' + type: boolean + default: false type: object - SignatureRequestBulkSendWithTemplateRequest: - required: - - template_ids + SignatureRequestEditRequest: properties: - template_ids: - description: '_t__SignatureRequestBulkSendWithTemplate::TEMPLATE_IDS' + files: + description: '_t__SignatureRequestSend::FILES' type: array items: type: string - signer_file: - description: '_t__SignatureRequestBulkSendWithTemplate::SIGNER_FILE' - type: string - format: binary - signer_list: - description: '_t__SignatureRequestBulkSendWithTemplate::SIGNER_LIST' + format: binary + file_urls: + description: '_t__SignatureRequestSend::FILE_URLS' type: array items: - $ref: '#/components/schemas/SubBulkSignerList' + type: string + signers: + description: '_t__Sub::SignatureRequestSigner::DESCRIPTION' + type: array + items: + $ref: '#/components/schemas/SubSignatureRequestSigner' + grouped_signers: + description: '_t__Sub::SignatureRequestGroupedSigners::DESCRIPTION' + type: array + items: + $ref: '#/components/schemas/SubSignatureRequestGroupedSigners' allow_decline: - description: '_t__SignatureRequestBulkSendWithTemplate::ALLOW_DECLINE' + description: '_t__SignatureRequestSend::ALLOW_DECLINE' type: boolean default: false - ccs: - description: '_t__Sub::CC::DESCRIPTION' + allow_reassign: + description: '_t__SignatureRequestSend::ALLOW_REASSIGN' + type: boolean + default: false + attachments: + description: '_t__SubAttachment::LIST_DESCRIPTION' type: array items: - $ref: '#/components/schemas/SubCC' + $ref: '#/components/schemas/SubAttachment' + cc_email_addresses: + description: '_t__SignatureRequestSend::CC_EMAIL_ADDRESSES' + type: array + items: + type: string + format: email client_id: - description: '_t__SignatureRequestBulkSendWithTemplate::CLIENT_ID' + description: '_t__SignatureRequestSend::CLIENT_ID' type: string custom_fields: description: '_t__Sub::CustomField::DESCRIPTION' type: array items: $ref: '#/components/schemas/SubCustomField' + field_options: + $ref: '#/components/schemas/SubFieldOptions' + form_field_groups: + description: '_t__Sub::FormFieldGroup::DESCRIPTION' + type: array + items: + $ref: '#/components/schemas/SubFormFieldGroup' + form_field_rules: + description: '_t__Sub::FormFieldRule::DESCRIPTION' + type: array + items: + $ref: '#/components/schemas/SubFormFieldRule' + form_fields_per_document: + description: '_t__Sub::FormFieldsPerDocument::DESCRIPTION' + type: array + items: + $ref: '#/components/schemas/SubFormFieldsPerDocumentBase' + hide_text_tags: + description: '_t__SignatureRequestSend::HIDE_TEXT_TAGS' + type: boolean + default: false + is_eid: + description: '_t__SignatureRequestSend::IS_EID' + type: boolean + default: false message: - description: '_t__SignatureRequestBulkSendWithTemplate::MESSAGE' + description: '_t__SignatureRequestSend::MESSAGE' type: string maxLength: 5000 metadata: @@ -8020,23 +8793,33 @@ components: type: object maxItems: 10 additionalProperties: { } + signing_options: + $ref: '#/components/schemas/SubSigningOptions' signing_redirect_url: - description: '_t__SignatureRequestBulkSendWithTemplate::SIGNING_REDIRECT_URL' + description: '_t__SignatureRequestSend::SIGNING_REDIRECT_URL' type: string subject: - description: '_t__SignatureRequestBulkSendWithTemplate::SUBJECT' + description: '_t__SignatureRequestSend::SUBJECT' type: string maxLength: 255 test_mode: - description: '_t__SignatureRequestBulkSendWithTemplate::TEST_MODE' + description: '_t__SignatureRequestSend::TEST_MODE' type: boolean default: false title: - description: '_t__SignatureRequestBulkSendWithTemplate::TITLE' + description: '_t__SignatureRequestSend::TITLE' type: string maxLength: 255 + use_text_tags: + description: '_t__SignatureRequestSend::USE_PREEXISTING_FIELDS' + type: boolean + default: false + expires_at: + description: '_t__SignatureRequestSend::EXPIRES_AT' + type: integer + nullable: true type: object - SignatureRequestCreateEmbeddedRequest: + SignatureRequestEditEmbeddedRequest: required: - client_id properties: @@ -8145,7 +8928,7 @@ components: type: integer nullable: true type: object - SignatureRequestCreateEmbeddedWithTemplateRequest: + SignatureRequestEditEmbeddedWithTemplateRequest: required: - client_id - template_ids @@ -8217,6 +9000,81 @@ components: type: boolean default: false type: object + SignatureRequestEditWithTemplateRequest: + description: '' + required: + - signers + - template_ids + properties: + template_ids: + description: '_t__SignatureRequestSendWithTemplate::TEMPLATE_IDS' + type: array + items: + type: string + allow_decline: + description: '_t__SignatureRequestSendWithTemplate::ALLOW_DECLINE' + type: boolean + default: false + ccs: + description: '_t__Sub::CC::DESCRIPTION' + type: array + items: + $ref: '#/components/schemas/SubCC' + client_id: + description: '_t__SignatureRequestSendWithTemplate::CLIENT_ID' + type: string + custom_fields: + description: '_t__Sub::CustomField::TEMPLATE' + type: array + items: + $ref: '#/components/schemas/SubCustomField' + files: + description: '_t__SignatureRequestSendWithTemplate::FILES' + type: array + items: + type: string + format: binary + file_urls: + description: '_t__SignatureRequestSendWithTemplate::FILE_URLS' + type: array + items: + type: string + is_eid: + description: '_t__SignatureRequestSendWithTemplate::IS_EID' + type: boolean + default: false + message: + description: '_t__SignatureRequestSendWithTemplate::MESSAGE' + type: string + maxLength: 5000 + metadata: + description: '_t__Sub::Metadata::DESCRIPTION' + type: object + maxItems: 10 + additionalProperties: { } + signers: + description: '_t__Sub::SignatureRequestTemplateSigner::DESCRIPTION' + type: array + items: + $ref: '#/components/schemas/SubSignatureRequestTemplateSigner' + signing_options: + $ref: '#/components/schemas/SubSigningOptions' + signing_redirect_url: + description: '_t__SignatureRequestSendWithTemplate::SIGNING_REDIRECT_URL' + type: string + subject: + description: '_t__SignatureRequestSendWithTemplate::SUBJECT' + type: string + maxLength: 255 + test_mode: + description: '_t__SignatureRequestSendWithTemplate::TEST_MODE' + type: boolean + default: false + title: + description: '_t__SignatureRequestSendWithTemplate::TITLE' + type: string + maxLength: 255 + type: object SignatureRequestRemindRequest: required: - email_address @@ -8623,6 +9481,9 @@ components: csharp: - FieldVisibility - GroupVisibility + java: + - FIELD_VISIBILITY + - GROUP_VISIBILITY php: - TYPE_FIELD_VISIBILITY - TYPE_GROUP_VISIBILITY @@ -12390,6 +13251,30 @@ components: summary: 'Default Example' value: $ref: examples/json/SignatureRequestCreateEmbeddedWithTemplateRequestDefaultExample.json + SignatureRequestEditRequestDefaultExample: + summary: 'Default Example' + value: + $ref: examples/json/SignatureRequestEditRequestDefaultExample.json + SignatureRequestEditRequestGroupedSignersExample: + summary: 'Grouped Signers Example' + value: + $ref: examples/json/SignatureRequestEditRequestGroupedSignersExample.json + SignatureRequestEditEmbeddedRequestDefaultExample: + summary: 'Default Example' + value: + $ref: examples/json/SignatureRequestEditEmbeddedRequestDefaultExample.json + SignatureRequestEditEmbeddedRequestGroupedSignersExample: + summary: 'Grouped Signers Example' + value: + $ref: examples/json/SignatureRequestEditEmbeddedRequestGroupedSignersExample.json + SignatureRequestEditEmbeddedWithTemplateRequestDefaultExample: + summary: 'Default Example' + value: + $ref: examples/json/SignatureRequestEditEmbeddedWithTemplateRequestDefaultExample.json + SignatureRequestEditWithTemplateRequestDefaultExample: + summary: 'Default Example' + value: + $ref: examples/json/SignatureRequestEditWithTemplateRequestDefaultExample.json SignatureRequestRemindRequestDefaultExample: summary: 'Default Example' value: diff --git a/openapi-sdk.yaml b/openapi-sdk.yaml index 818930290..8002ee27a 100644 --- a/openapi-sdk.yaml +++ b/openapi-sdk.yaml @@ -1826,7 +1826,6 @@ paths: - CA - US - UK - example: US - name: state in: query @@ -2108,7 +2107,6 @@ paths: required: true schema: type: string - example: '[FAX_NUMBER]' responses: '200': description: 'successful operation' @@ -3571,35 +3569,39 @@ paths: seo: title: 'Signature Request with Template | Dropbox Sign for Developers' description: 'The Dropbox Sign API allows you to build custom integrations. To find out how to create a new SignatureRequest based on the given Template, click here.' - '/signature_request/files/{signature_request_id}': - get: + '/signature_request/edit/{signature_request_id}': + put: tags: - 'Signature Request' - summary: 'Download Files' + summary: 'Edit Signature Request' description: |- - Obtain a copy of the current documents specified by the `signature_request_id` parameter. Returns a PDF or ZIP file. + Edits and sends a SignatureRequest with the submitted documents. If `form_fields_per_document` is not specified, a signature page will be affixed where all signers will be required to add their signature, signifying their agreement to all contained documents. - If the files are currently being prepared, a status code of `409` will be returned instead. - operationId: signatureRequestFiles + **NOTE:** Edit and resend will not deduct your signature request quota. + operationId: signatureRequestEdit parameters: - name: signature_request_id in: path - description: 'The id of the SignatureRequest to retrieve.' + description: 'The id of the SignatureRequest to edit.' required: true schema: type: string example: fa5c8a0b0f492d768749333ad6fcc214c111e967 - - - name: file_type - in: query - description: 'Set to `pdf` for a single merged document or `zip` for a collection of individual documents.' - schema: - type: string - default: pdf - enum: - - pdf - - zip + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/SignatureRequestEditRequest' + examples: + default_example: + $ref: '#/components/examples/SignatureRequestEditRequestDefaultExample' + grouped_signers_example: + $ref: '#/components/examples/SignatureRequestEditRequestGroupedSignersExample' + multipart/form-data: + schema: + $ref: '#/components/schemas/SignatureRequestEditRequest' responses: '200': description: 'successful operation' @@ -3611,14 +3613,12 @@ paths: X-Ratelimit-Reset: $ref: '#/components/headers/X-Ratelimit-Reset' content: - application/pdf: - schema: - type: string - format: binary - application/zip: + application/json: schema: - type: string - format: binary + $ref: '#/components/schemas/SignatureRequestGetResponse' + examples: + default_example: + $ref: '#/components/examples/SignatureRequestEditResponseExample' '4XX': description: failed_operation content: @@ -3638,8 +3638,6 @@ paths: $ref: '#/components/examples/Error404ResponseExample' 409_example: $ref: '#/components/examples/Error409ResponseExample' - 410_example: - $ref: '#/components/examples/Error410ResponseExample' 429_example: $ref: '#/components/examples/Error429ResponseExample' 4XX_example: @@ -3656,65 +3654,78 @@ paths: lang: PHP label: PHP source: - $ref: examples/SignatureRequestFiles.php + $ref: examples/SignatureRequestEdit.php - lang: 'C#' label: 'C#' source: - $ref: examples/SignatureRequestFiles.cs + $ref: examples/SignatureRequestEdit.cs - lang: JavaScript label: JavaScript source: - $ref: examples/SignatureRequestFiles.js + $ref: examples/SignatureRequestEdit.js - lang: TypeScript label: TypeScript source: - $ref: examples/SignatureRequestFiles.ts + $ref: examples/SignatureRequestEdit.ts - lang: Java label: Java source: - $ref: examples/SignatureRequestFiles.java + $ref: examples/SignatureRequestEdit.java - lang: Ruby label: Ruby source: - $ref: examples/SignatureRequestFiles.rb + $ref: examples/SignatureRequestEdit.rb - lang: Python label: Python source: - $ref: examples/SignatureRequestFiles.py + $ref: examples/SignatureRequestEdit.py - lang: cURL label: cURL source: - $ref: examples/SignatureRequestFiles.sh + $ref: examples/SignatureRequestEdit.sh x-meta: seo: - title: 'Download Files | API Documentation | Dropbox Sign for Developers' - description: 'The RESTful Dropbox Sign API allows you to build custom integrations. To find out how to get the current documents specified by the parameters, click here' - '/signature_request/files_as_data_uri/{signature_request_id}': - get: + title: 'Edit Signature Request | REST API | Dropbox Sign for Developers' + description: 'Dropbox Sign API allows you to build custom integrations. To find out how to edit a SignatureRequest with the submitted documents, click here.' + x-hideOn: doc + x-beta: closed + '/signature_request/edit_embedded/{signature_request_id}': + put: tags: - 'Signature Request' - summary: 'Download Files as Data Uri' - description: |- - Obtain a copy of the current documents specified by the `signature_request_id` parameter. Returns a JSON object with a `data_uri` representing the base64 encoded file (PDFs only). - - If the files are currently being prepared, a status code of `409` will be returned instead. - operationId: signatureRequestFilesAsDataUri + summary: 'Edit Embedded Signature Request' + description: 'Edits a SignatureRequest with the submitted documents to be signed in an embedded iFrame. If form_fields_per_document is not specified, a signature page will be affixed where all signers will be required to add their signature, signifying their agreement to all contained documents. Note that embedded signature requests can only be signed in embedded iFrames whereas normal signature requests can only be signed on Dropbox Sign.' + operationId: signatureRequestEditEmbedded parameters: - name: signature_request_id in: path - description: 'The id of the SignatureRequest to retrieve.' + description: 'The id of the SignatureRequest to edit.' required: true schema: type: string example: fa5c8a0b0f492d768749333ad6fcc214c111e967 + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/SignatureRequestEditEmbeddedRequest' + examples: + default_example: + $ref: '#/components/examples/SignatureRequestEditEmbeddedRequestDefaultExample' + grouped_signers_example: + $ref: '#/components/examples/SignatureRequestEditEmbeddedRequestGroupedSignersExample' + multipart/form-data: + schema: + $ref: '#/components/schemas/SignatureRequestEditEmbeddedRequest' responses: '200': description: 'successful operation' @@ -3728,10 +3739,10 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/FileResponseDataUri' + $ref: '#/components/schemas/SignatureRequestGetResponse' examples: default_example: - $ref: '#/components/examples/SignatureRequestFilesResponseExample' + $ref: '#/components/examples/SignatureRequestEditEmbeddedResponseExample' '4XX': description: failed_operation content: @@ -3751,8 +3762,6 @@ paths: $ref: '#/components/examples/Error404ResponseExample' 409_example: $ref: '#/components/examples/Error409ResponseExample' - 410_example: - $ref: '#/components/examples/Error410ResponseExample' 429_example: $ref: '#/components/examples/Error429ResponseExample' 4XX_example: @@ -3762,79 +3771,82 @@ paths: api_key: [] - oauth2: - - request_signature - signature_request_access x-codeSamples: - lang: PHP label: PHP source: - $ref: examples/SignatureRequestFilesAsDataUri.php + $ref: examples/SignatureRequestEditEmbedded.php - lang: 'C#' label: 'C#' source: - $ref: examples/SignatureRequestFilesAsDataUri.cs + $ref: examples/SignatureRequestEditEmbedded.cs - lang: JavaScript label: JavaScript source: - $ref: examples/SignatureRequestFilesAsDataUri.js + $ref: examples/SignatureRequestEditEmbedded.js - lang: TypeScript label: TypeScript source: - $ref: examples/SignatureRequestFilesAsDataUri.ts + $ref: examples/SignatureRequestEditEmbedded.ts - lang: Java label: Java source: - $ref: examples/SignatureRequestFilesAsDataUri.java + $ref: examples/SignatureRequestEditEmbedded.java - lang: Ruby label: Ruby source: - $ref: examples/SignatureRequestFilesAsDataUri.rb + $ref: examples/SignatureRequestEditEmbedded.rb - lang: Python label: Python source: - $ref: examples/SignatureRequestFilesAsDataUri.py + $ref: examples/SignatureRequestEditEmbedded.py - lang: cURL label: cURL source: - $ref: examples/SignatureRequestFilesAsDataUri.sh + $ref: examples/SignatureRequestEditEmbedded.sh x-meta: seo: - title: 'Download Files | API Documentation | Dropbox Sign for Developers' - description: 'The RESTful Dropbox Sign API allows you to build custom integrations. To find out how to get the current documents specified by the parameters, click here' - '/signature_request/files_as_file_url/{signature_request_id}': - get: + title: 'Edit Embedded Signature Request | Dropbox Sign for Developers' + description: 'The RESTful Dropbox Sign API easily allows you to build custom integrations. To find out how to edit a SignatureRequest in an iFrame, click here.' + x-hideOn: doc + x-beta: closed + '/signature_request/edit_embedded_with_template/{signature_request_id}': + put: tags: - 'Signature Request' - summary: 'Download Files as File Url' - description: |- - Obtain a copy of the current documents specified by the `signature_request_id` parameter. Returns a JSON object with a url to the file (PDFs only). - - If the files are currently being prepared, a status code of `409` will be returned instead. - operationId: signatureRequestFilesAsFileUrl + summary: 'Edit Embedded Signature Request with Template' + description: 'Edits a SignatureRequest based on the given Template(s) to be signed in an embedded iFrame. Note that embedded signature requests can only be signed in embedded iFrames whereas normal signature requests can only be signed on Dropbox Sign.' + operationId: signatureRequestEditEmbeddedWithTemplate parameters: - name: signature_request_id in: path - description: 'The id of the SignatureRequest to retrieve.' + description: 'The id of the SignatureRequest to edit.' required: true schema: type: string example: fa5c8a0b0f492d768749333ad6fcc214c111e967 - - - name: force_download - in: query - description: 'By default when opening the `file_url` a browser will download the PDF and save it locally. When set to `0` the PDF file will be displayed in the browser.' - schema: - type: integer - default: 1 + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/SignatureRequestEditEmbeddedWithTemplateRequest' + examples: + default_example: + $ref: '#/components/examples/SignatureRequestEditEmbeddedWithTemplateRequestDefaultExample' + multipart/form-data: + schema: + $ref: '#/components/schemas/SignatureRequestEditEmbeddedWithTemplateRequest' responses: '200': description: 'successful operation' @@ -3848,10 +3860,10 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/FileResponse' + $ref: '#/components/schemas/SignatureRequestGetResponse' examples: default_example: - $ref: '#/components/examples/SignatureRequestFilesResponseExample' + $ref: '#/components/examples/SignatureRequestEditEmbeddedWithTemplateResponseExample' '4XX': description: failed_operation content: @@ -3871,8 +3883,6 @@ paths: $ref: '#/components/examples/Error404ResponseExample' 409_example: $ref: '#/components/examples/Error409ResponseExample' - 410_example: - $ref: '#/components/examples/Error410ResponseExample' 429_example: $ref: '#/components/examples/Error429ResponseExample' 4XX_example: @@ -3882,69 +3892,85 @@ paths: api_key: [] - oauth2: - - request_signature - signature_request_access x-codeSamples: - lang: PHP label: PHP source: - $ref: examples/SignatureRequestFilesAsFileUrl.php + $ref: examples/SignatureRequestEditEmbeddedWithTemplate.php - lang: 'C#' label: 'C#' source: - $ref: examples/SignatureRequestFilesAsFileUrl.cs + $ref: examples/SignatureRequestEditEmbeddedWithTemplate.cs - lang: JavaScript label: JavaScript source: - $ref: examples/SignatureRequestFilesAsFileUrl.js + $ref: examples/SignatureRequestEditEmbeddedWithTemplate.js - lang: TypeScript label: TypeScript source: - $ref: examples/SignatureRequestFilesAsFileUrl.ts + $ref: examples/SignatureRequestEditEmbeddedWithTemplate.ts - lang: Java label: Java source: - $ref: examples/SignatureRequestFilesAsFileUrl.java + $ref: examples/SignatureRequestEditEmbeddedWithTemplate.java - lang: Ruby label: Ruby source: - $ref: examples/SignatureRequestFilesAsFileUrl.rb + $ref: examples/SignatureRequestEditEmbeddedWithTemplate.rb - lang: Python label: Python source: - $ref: examples/SignatureRequestFilesAsFileUrl.py + $ref: examples/SignatureRequestEditEmbeddedWithTemplate.py - lang: cURL label: cURL source: - $ref: examples/SignatureRequestFilesAsFileUrl.sh + $ref: examples/SignatureRequestEditEmbeddedWithTemplate.sh x-meta: seo: - title: 'Download Files | API Documentation | Dropbox Sign for Developers' - description: 'The RESTful Dropbox Sign API allows you to build custom integrations. To find out how to get the current documents specified by the parameters, click here' - '/signature_request/{signature_request_id}': - get: + title: 'Signature Request with Template | Dropbox Sign for Developers' + description: 'The Dropbox Sign API allows you to build custom integrations. To find out how to edit a SignatureRequest based on the given Template, click here.' + x-hideOn: doc + x-beta: closed + '/signature_request/edit_with_template/{signature_request_id}': + put: tags: - 'Signature Request' - summary: 'Get Signature Request' - description: 'Returns the status of the SignatureRequest specified by the `signature_request_id` parameter.' - operationId: signatureRequestGet + summary: 'Edit Signature Request With Template' + description: |- + Edits and sends a SignatureRequest based off of the Template(s) specified with the template_ids parameter. + + **NOTE:** Edit and resend will not deduct your signature request quota. + operationId: signatureRequestEditWithTemplate parameters: - name: signature_request_id in: path - description: 'The id of the SignatureRequest to retrieve.' + description: 'The id of the SignatureRequest to edit.' required: true schema: type: string example: fa5c8a0b0f492d768749333ad6fcc214c111e967 + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/SignatureRequestEditWithTemplateRequest' + examples: + default_example: + $ref: '#/components/examples/SignatureRequestEditWithTemplateRequestDefaultExample' + multipart/form-data: + schema: + $ref: '#/components/schemas/SignatureRequestEditWithTemplateRequest' responses: '200': description: 'successful operation' @@ -3961,7 +3987,7 @@ paths: $ref: '#/components/schemas/SignatureRequestGetResponse' examples: default_example: - $ref: '#/components/examples/SignatureRequestGetResponseExample' + $ref: '#/components/examples/SignatureRequestEditWithTemplateResponseExample' '4XX': description: failed_operation content: @@ -3979,8 +4005,10 @@ paths: $ref: '#/components/examples/Error403ResponseExample' 404_example: $ref: '#/components/examples/Error404ResponseExample' - 410_example: - $ref: '#/components/examples/Error410ResponseExample' + 409_example: + $ref: '#/components/examples/Error409ResponseExample' + 429_example: + $ref: '#/components/examples/Error429ResponseExample' 4XX_example: $ref: '#/components/examples/Error4XXResponseExample' security: @@ -3995,84 +4023,77 @@ paths: lang: PHP label: PHP source: - $ref: examples/SignatureRequestGet.php + $ref: examples/SignatureRequestEditWithTemplate.php - lang: 'C#' label: 'C#' source: - $ref: examples/SignatureRequestGet.cs + $ref: examples/SignatureRequestEditWithTemplate.cs - lang: JavaScript label: JavaScript source: - $ref: examples/SignatureRequestGet.js + $ref: examples/SignatureRequestEditWithTemplate.js - lang: TypeScript label: TypeScript source: - $ref: examples/SignatureRequestGet.ts + $ref: examples/SignatureRequestEditWithTemplate.ts - lang: Java label: Java source: - $ref: examples/SignatureRequestGet.java + $ref: examples/SignatureRequestEditWithTemplate.java - lang: Ruby label: Ruby source: - $ref: examples/SignatureRequestGet.rb + $ref: examples/SignatureRequestEditWithTemplate.rb - lang: Python label: Python source: - $ref: examples/SignatureRequestGet.py + $ref: examples/SignatureRequestEditWithTemplate.py - lang: cURL label: cURL source: - $ref: examples/SignatureRequestGet.sh + $ref: examples/SignatureRequestEditWithTemplate.sh x-meta: seo: - title: 'Get Signature Request | Documentation | Dropbox Sign for Developers' - description: 'The Dropbox Sign API allows you to build custom integrations. To find out how to return the status of SignatureRequest specified by the parameters, click here.' - /signature_request/list: + title: 'Edit Signature Request with Template | API Documentation | Dropbox Sign for Developers' + description: 'Dropbox Sign API allows you to build custom integrations. To find out how to edit a SignatureRequest based off of the Template, click here.' + x-hideOn: doc + x-beta: closed + '/signature_request/files/{signature_request_id}': get: tags: - 'Signature Request' - summary: 'List Signature Requests' + summary: 'Download Files' description: |- - Returns a list of SignatureRequests that you can access. This includes SignatureRequests you have sent as well as received, but not ones that you have been CCed on. + Obtain a copy of the current documents specified by the `signature_request_id` parameter. Returns a PDF or ZIP file. - Take a look at our [search guide](/api/reference/search/) to learn more about querying signature requests. - operationId: signatureRequestList + If the files are currently being prepared, a status code of `409` will be returned instead. + operationId: signatureRequestFiles parameters: - - name: account_id - in: query - description: 'Which account to return SignatureRequests for. Must be a team member. Use `all` to indicate all team members. Defaults to your account.' + name: signature_request_id + in: path + description: 'The id of the SignatureRequest to retrieve.' + required: true schema: type: string + example: fa5c8a0b0f492d768749333ad6fcc214c111e967 - - name: page - in: query - description: 'Which page number of the SignatureRequest List to return. Defaults to `1`.' - schema: - type: integer - default: 1 - example: 1 - - - name: page_size - in: query - description: 'Number of objects to be returned per page. Must be between `1` and `100`. Default is `20`.' - schema: - type: integer - default: 20 - - - name: query + name: file_type in: query - description: 'String that includes search terms and/or fields to be used to filter the SignatureRequest objects.' + description: 'Set to `pdf` for a single merged document or `zip` for a collection of individual documents.' schema: type: string + default: pdf + enum: + - pdf + - zip responses: '200': description: 'successful operation' @@ -4084,12 +4105,14 @@ paths: X-Ratelimit-Reset: $ref: '#/components/headers/X-Ratelimit-Reset' content: - application/json: + application/pdf: schema: - $ref: '#/components/schemas/SignatureRequestListResponse' - examples: - default_example: - $ref: '#/components/examples/SignatureRequestListResponseExample' + type: string + format: binary + application/zip: + schema: + type: string + format: binary '4XX': description: failed_operation content: @@ -4105,8 +4128,14 @@ paths: $ref: '#/components/examples/Error402ResponseExample' 403_example: $ref: '#/components/examples/Error403ResponseExample' + 404_example: + $ref: '#/components/examples/Error404ResponseExample' 409_example: $ref: '#/components/examples/Error409ResponseExample' + 410_example: + $ref: '#/components/examples/Error410ResponseExample' + 429_example: + $ref: '#/components/examples/Error429ResponseExample' 4XX_example: $ref: '#/components/examples/Error4XXResponseExample' security: @@ -4121,58 +4150,61 @@ paths: lang: PHP label: PHP source: - $ref: examples/SignatureRequestList.php + $ref: examples/SignatureRequestFiles.php - lang: 'C#' label: 'C#' source: - $ref: examples/SignatureRequestList.cs + $ref: examples/SignatureRequestFiles.cs - lang: JavaScript label: JavaScript source: - $ref: examples/SignatureRequestList.js + $ref: examples/SignatureRequestFiles.js - lang: TypeScript label: TypeScript source: - $ref: examples/SignatureRequestList.ts + $ref: examples/SignatureRequestFiles.ts - lang: Java label: Java source: - $ref: examples/SignatureRequestList.java + $ref: examples/SignatureRequestFiles.java - lang: Ruby label: Ruby source: - $ref: examples/SignatureRequestList.rb + $ref: examples/SignatureRequestFiles.rb - lang: Python label: Python source: - $ref: examples/SignatureRequestList.py + $ref: examples/SignatureRequestFiles.py - lang: cURL label: cURL source: - $ref: examples/SignatureRequestList.sh + $ref: examples/SignatureRequestFiles.sh x-meta: seo: - title: 'List Signature Requests | REST API | Dropbox Sign for Developers' - description: 'The Dropbox Sign API allows you to build custom integrations. To find out how to return a list of SignatureRequests that you can access, click here.' - '/signature_request/release_hold/{signature_request_id}': - post: + title: 'Download Files | API Documentation | Dropbox Sign for Developers' + description: 'The RESTful Dropbox Sign API allows you to build custom integrations. To find out how to get the current documents specified by the parameters, click here' + '/signature_request/files_as_data_uri/{signature_request_id}': + get: tags: - 'Signature Request' - summary: 'Release On-Hold Signature Request' - description: 'Releases a held SignatureRequest that was claimed and prepared from an [UnclaimedDraft](/api/reference/tag/Unclaimed-Draft). The owner of the Draft must indicate at Draft creation that the SignatureRequest created from the Draft should be held. Releasing the SignatureRequest will send requests to all signers.' - operationId: signatureRequestReleaseHold - parameters: - - - name: signature_request_id - in: path - description: 'The id of the SignatureRequest to release.' + summary: 'Download Files as Data Uri' + description: |- + Obtain a copy of the current documents specified by the `signature_request_id` parameter. Returns a JSON object with a `data_uri` representing the base64 encoded file (PDFs only). + + If the files are currently being prepared, a status code of `409` will be returned instead. + operationId: signatureRequestFilesAsDataUri + parameters: + - + name: signature_request_id + in: path + description: 'The id of the SignatureRequest to retrieve.' required: true schema: type: string @@ -4190,10 +4222,10 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/SignatureRequestGetResponse' + $ref: '#/components/schemas/FileResponseDataUri' examples: default_example: - $ref: '#/components/examples/SignatureRequestReleaseHoldResponseExample' + $ref: '#/components/examples/SignatureRequestFilesResponseExample' '4XX': description: failed_operation content: @@ -4211,6 +4243,12 @@ paths: $ref: '#/components/examples/Error403ResponseExample' 404_example: $ref: '#/components/examples/Error404ResponseExample' + 409_example: + $ref: '#/components/examples/Error409ResponseExample' + 410_example: + $ref: '#/components/examples/Error410ResponseExample' + 429_example: + $ref: '#/components/examples/Error429ResponseExample' 4XX_example: $ref: '#/components/examples/Error4XXResponseExample' security: @@ -4218,80 +4256,79 @@ paths: api_key: [] - oauth2: + - request_signature - signature_request_access x-codeSamples: - lang: PHP label: PHP source: - $ref: examples/SignatureRequestReleaseHold.php + $ref: examples/SignatureRequestFilesAsDataUri.php - lang: 'C#' label: 'C#' source: - $ref: examples/SignatureRequestReleaseHold.cs + $ref: examples/SignatureRequestFilesAsDataUri.cs - lang: JavaScript label: JavaScript source: - $ref: examples/SignatureRequestReleaseHold.js + $ref: examples/SignatureRequestFilesAsDataUri.js - lang: TypeScript label: TypeScript source: - $ref: examples/SignatureRequestReleaseHold.ts + $ref: examples/SignatureRequestFilesAsDataUri.ts - lang: Java label: Java source: - $ref: examples/SignatureRequestReleaseHold.java + $ref: examples/SignatureRequestFilesAsDataUri.java - lang: Ruby label: Ruby source: - $ref: examples/SignatureRequestReleaseHold.rb + $ref: examples/SignatureRequestFilesAsDataUri.rb - lang: Python label: Python source: - $ref: examples/SignatureRequestReleaseHold.py + $ref: examples/SignatureRequestFilesAsDataUri.py - lang: cURL label: cURL source: - $ref: examples/SignatureRequestReleaseHold.sh + $ref: examples/SignatureRequestFilesAsDataUri.sh x-meta: seo: - title: 'Release On-Hold Signature Request | Dropbox Sign for Developers' - description: 'The RESTful Dropbox Sign API allows you to build custom eSign integrations. To find out how to release an on-hold SignatureRequest, click here.' - '/signature_request/remind/{signature_request_id}': - post: + title: 'Download Files | API Documentation | Dropbox Sign for Developers' + description: 'The RESTful Dropbox Sign API allows you to build custom integrations. To find out how to get the current documents specified by the parameters, click here' + '/signature_request/files_as_file_url/{signature_request_id}': + get: tags: - 'Signature Request' - summary: 'Send Request Reminder' + summary: 'Download Files as File Url' description: |- - Sends an email to the signer reminding them to sign the signature request. You cannot send a reminder within 1 hour of the last reminder that was sent. This includes manual AND automatic reminders. + Obtain a copy of the current documents specified by the `signature_request_id` parameter. Returns a JSON object with a url to the file (PDFs only). - **NOTE:** This action can **not** be used with embedded signature requests. - operationId: signatureRequestRemind + If the files are currently being prepared, a status code of `409` will be returned instead. + operationId: signatureRequestFilesAsFileUrl parameters: - name: signature_request_id in: path - description: 'The id of the SignatureRequest to send a reminder for.' + description: 'The id of the SignatureRequest to retrieve.' required: true schema: type: string example: fa5c8a0b0f492d768749333ad6fcc214c111e967 - requestBody: - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/SignatureRequestRemindRequest' - examples: - default_example: - $ref: '#/components/examples/SignatureRequestRemindRequestDefaultExample' + - + name: force_download + in: query + description: 'By default when opening the `file_url` a browser will download the PDF and save it locally. When set to `0` the PDF file will be displayed in the browser.' + schema: + type: integer + default: 1 responses: '200': description: 'successful operation' @@ -4305,10 +4342,10 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/SignatureRequestGetResponse' + $ref: '#/components/schemas/FileResponse' examples: default_example: - $ref: '#/components/examples/SignatureRequestRemindResponseExample' + $ref: '#/components/examples/SignatureRequestFilesResponseExample' '4XX': description: failed_operation content: @@ -4346,63 +4383,58 @@ paths: lang: PHP label: PHP source: - $ref: examples/SignatureRequestRemind.php + $ref: examples/SignatureRequestFilesAsFileUrl.php - lang: 'C#' label: 'C#' source: - $ref: examples/SignatureRequestRemind.cs + $ref: examples/SignatureRequestFilesAsFileUrl.cs - lang: JavaScript label: JavaScript source: - $ref: examples/SignatureRequestRemind.js + $ref: examples/SignatureRequestFilesAsFileUrl.js - lang: TypeScript label: TypeScript source: - $ref: examples/SignatureRequestRemind.ts + $ref: examples/SignatureRequestFilesAsFileUrl.ts - lang: Java label: Java source: - $ref: examples/SignatureRequestRemind.java + $ref: examples/SignatureRequestFilesAsFileUrl.java - lang: Ruby label: Ruby source: - $ref: examples/SignatureRequestRemind.rb + $ref: examples/SignatureRequestFilesAsFileUrl.rb - lang: Python label: Python source: - $ref: examples/SignatureRequestRemind.py + $ref: examples/SignatureRequestFilesAsFileUrl.py - lang: cURL label: cURL source: - $ref: examples/SignatureRequestRemind.sh + $ref: examples/SignatureRequestFilesAsFileUrl.sh x-meta: seo: - title: 'Send Request Reminder | REST API | Dropbox Sign for Developers' - description: 'The RESTful Dropbox Sign API allows you to build custom eSign integrations. To find out how to send an email reminder to the signer, click here.' - '/signature_request/remove/{signature_request_id}': - post: + title: 'Download Files | API Documentation | Dropbox Sign for Developers' + description: 'The RESTful Dropbox Sign API allows you to build custom integrations. To find out how to get the current documents specified by the parameters, click here' + '/signature_request/{signature_request_id}': + get: tags: - 'Signature Request' - summary: 'Remove Signature Request Access' - description: |- - Removes your access to a completed signature request. This action is **not reversible**. - - The signature request must be fully executed by all parties (signed or declined to sign). Other parties will continue to maintain access to the completed signature request document(s). - - Unlike /signature_request/cancel, this endpoint is synchronous and your access will be immediately removed. Upon successful removal, this endpoint will return a 200 OK response. - operationId: signatureRequestRemove + summary: 'Get Signature Request' + description: 'Returns the status of the SignatureRequest specified by the `signature_request_id` parameter.' + operationId: signatureRequestGet parameters: - name: signature_request_id in: path - description: 'The id of the SignatureRequest to remove.' + description: 'The id of the SignatureRequest to retrieve.' required: true schema: type: string @@ -4418,7 +4450,12 @@ paths: X-Ratelimit-Reset: $ref: '#/components/headers/X-Ratelimit-Reset' content: - application/json: {} + application/json: + schema: + $ref: '#/components/schemas/SignatureRequestGetResponse' + examples: + default_example: + $ref: '#/components/examples/SignatureRequestGetResponseExample' '4XX': description: failed_operation content: @@ -4436,8 +4473,6 @@ paths: $ref: '#/components/examples/Error403ResponseExample' 404_example: $ref: '#/components/examples/Error404ResponseExample' - 409_example: - $ref: '#/components/examples/Error409ResponseExample' 410_example: $ref: '#/components/examples/Error410ResponseExample' 4XX_example: @@ -4445,72 +4480,93 @@ paths: security: - api_key: [] + - + oauth2: + - request_signature + - signature_request_access x-codeSamples: - lang: PHP label: PHP source: - $ref: examples/SignatureRequestRemove.php + $ref: examples/SignatureRequestGet.php - lang: 'C#' label: 'C#' source: - $ref: examples/SignatureRequestRemove.cs + $ref: examples/SignatureRequestGet.cs - lang: JavaScript label: JavaScript source: - $ref: examples/SignatureRequestRemove.js + $ref: examples/SignatureRequestGet.js - lang: TypeScript label: TypeScript source: - $ref: examples/SignatureRequestRemove.ts + $ref: examples/SignatureRequestGet.ts - lang: Java label: Java source: - $ref: examples/SignatureRequestRemove.java + $ref: examples/SignatureRequestGet.java - lang: Ruby label: Ruby source: - $ref: examples/SignatureRequestRemove.rb + $ref: examples/SignatureRequestGet.rb - lang: Python label: Python source: - $ref: examples/SignatureRequestRemove.py + $ref: examples/SignatureRequestGet.py - lang: cURL label: cURL source: - $ref: examples/SignatureRequestRemove.sh + $ref: examples/SignatureRequestGet.sh x-meta: seo: - title: 'Remove Signature Request Access | Dropbox Sign for Developers' - description: 'The RESTful Dropbox Sign API allows you to build custom integrations. To find out how to remove your access to a completed signature request, click here.' - /signature_request/send: - post: + title: 'Get Signature Request | Documentation | Dropbox Sign for Developers' + description: 'The Dropbox Sign API allows you to build custom integrations. To find out how to return the status of SignatureRequest specified by the parameters, click here.' + /signature_request/list: + get: tags: - 'Signature Request' - summary: 'Send Signature Request' - description: 'Creates and sends a new SignatureRequest with the submitted documents. If `form_fields_per_document` is not specified, a signature page will be affixed where all signers will be required to add their signature, signifying their agreement to all contained documents.' - operationId: signatureRequestSend - requestBody: - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/SignatureRequestSendRequest' - examples: - default_example: - $ref: '#/components/examples/SignatureRequestSendRequestDefaultExample' - grouped_signers_example: - $ref: '#/components/examples/SignatureRequestSendRequestGroupedSignersExample' - multipart/form-data: - schema: - $ref: '#/components/schemas/SignatureRequestSendRequest' + summary: 'List Signature Requests' + description: |- + Returns a list of SignatureRequests that you can access. This includes SignatureRequests you have sent as well as received, but not ones that you have been CCed on. + + Take a look at our [search guide](/api/reference/search/) to learn more about querying signature requests. + operationId: signatureRequestList + parameters: + - + name: account_id + in: query + description: 'Which account to return SignatureRequests for. Must be a team member. Use `all` to indicate all team members. Defaults to your account.' + schema: + type: string + - + name: page + in: query + description: 'Which page number of the SignatureRequest List to return. Defaults to `1`.' + schema: + type: integer + default: 1 + example: 1 + - + name: page_size + in: query + description: 'Number of objects to be returned per page. Must be between `1` and `100`. Default is `20`.' + schema: + type: integer + default: 20 + - + name: query + in: query + description: 'String that includes search terms and/or fields to be used to filter the SignatureRequest objects.' + schema: + type: string responses: '200': description: 'successful operation' @@ -4524,10 +4580,10 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/SignatureRequestGetResponse' + $ref: '#/components/schemas/SignatureRequestListResponse' examples: default_example: - $ref: '#/components/examples/SignatureRequestSendResponseExample' + $ref: '#/components/examples/SignatureRequestListResponseExample' '4XX': description: failed_operation content: @@ -4545,8 +4601,6 @@ paths: $ref: '#/components/examples/Error403ResponseExample' 409_example: $ref: '#/components/examples/Error409ResponseExample' - 429_example: - $ref: '#/components/examples/Error429ResponseExample' 4XX_example: $ref: '#/components/examples/Error4XXResponseExample' security: @@ -4561,65 +4615,62 @@ paths: lang: PHP label: PHP source: - $ref: examples/SignatureRequestSend.php + $ref: examples/SignatureRequestList.php - lang: 'C#' label: 'C#' source: - $ref: examples/SignatureRequestSend.cs + $ref: examples/SignatureRequestList.cs - lang: JavaScript label: JavaScript source: - $ref: examples/SignatureRequestSend.js + $ref: examples/SignatureRequestList.js - lang: TypeScript label: TypeScript source: - $ref: examples/SignatureRequestSend.ts + $ref: examples/SignatureRequestList.ts - lang: Java label: Java source: - $ref: examples/SignatureRequestSend.java + $ref: examples/SignatureRequestList.java - lang: Ruby label: Ruby source: - $ref: examples/SignatureRequestSend.rb + $ref: examples/SignatureRequestList.rb - lang: Python label: Python source: - $ref: examples/SignatureRequestSend.py + $ref: examples/SignatureRequestList.py - lang: cURL label: cURL source: - $ref: examples/SignatureRequestSend.sh + $ref: examples/SignatureRequestList.sh x-meta: seo: - title: 'Send Signature Request | REST API | Dropbox Sign for Developers' - description: 'Dropbox Sign API allows you to build custom integrations. To find out how to create and send new SignatureRequest with the submitted documents, click here.' - /signature_request/send_with_template: + title: 'List Signature Requests | REST API | Dropbox Sign for Developers' + description: 'The Dropbox Sign API allows you to build custom integrations. To find out how to return a list of SignatureRequests that you can access, click here.' + '/signature_request/release_hold/{signature_request_id}': post: tags: - 'Signature Request' - summary: 'Send with Template' - description: 'Creates and sends a new SignatureRequest based off of the Template(s) specified with the `template_ids` parameter.' - operationId: signatureRequestSendWithTemplate - requestBody: - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/SignatureRequestSendWithTemplateRequest' - examples: - default_example: - $ref: '#/components/examples/SignatureRequestSendWithTemplateRequestDefaultExample' - multipart/form-data: - schema: - $ref: '#/components/schemas/SignatureRequestSendWithTemplateRequest' + summary: 'Release On-Hold Signature Request' + description: 'Releases a held SignatureRequest that was claimed and prepared from an [UnclaimedDraft](/api/reference/tag/Unclaimed-Draft). The owner of the Draft must indicate at Draft creation that the SignatureRequest created from the Draft should be held. Releasing the SignatureRequest will send requests to all signers.' + operationId: signatureRequestReleaseHold + parameters: + - + name: signature_request_id + in: path + description: 'The id of the SignatureRequest to release.' + required: true + schema: + type: string + example: fa5c8a0b0f492d768749333ad6fcc214c111e967 responses: '200': description: 'successful operation' @@ -4636,7 +4687,7 @@ paths: $ref: '#/components/schemas/SignatureRequestGetResponse' examples: default_example: - $ref: '#/components/examples/SignatureRequestSendWithTemplateResponseExample' + $ref: '#/components/examples/SignatureRequestReleaseHoldResponseExample' '4XX': description: failed_operation content: @@ -4652,8 +4703,8 @@ paths: $ref: '#/components/examples/Error402ResponseExample' 403_example: $ref: '#/components/examples/Error403ResponseExample' - 429_example: - $ref: '#/components/examples/Error429ResponseExample' + 404_example: + $ref: '#/components/examples/Error404ResponseExample' 4XX_example: $ref: '#/components/examples/Error4XXResponseExample' security: @@ -4661,70 +4712,67 @@ paths: api_key: [] - oauth2: - - request_signature - signature_request_access x-codeSamples: - lang: PHP label: PHP source: - $ref: examples/SignatureRequestSendWithTemplate.php + $ref: examples/SignatureRequestReleaseHold.php - lang: 'C#' label: 'C#' source: - $ref: examples/SignatureRequestSendWithTemplate.cs + $ref: examples/SignatureRequestReleaseHold.cs - lang: JavaScript label: JavaScript source: - $ref: examples/SignatureRequestSendWithTemplate.js + $ref: examples/SignatureRequestReleaseHold.js - lang: TypeScript label: TypeScript source: - $ref: examples/SignatureRequestSendWithTemplate.ts + $ref: examples/SignatureRequestReleaseHold.ts - lang: Java label: Java source: - $ref: examples/SignatureRequestSendWithTemplate.java + $ref: examples/SignatureRequestReleaseHold.java - lang: Ruby label: Ruby source: - $ref: examples/SignatureRequestSendWithTemplate.rb + $ref: examples/SignatureRequestReleaseHold.rb - lang: Python label: Python source: - $ref: examples/SignatureRequestSendWithTemplate.py + $ref: examples/SignatureRequestReleaseHold.py - lang: cURL label: cURL source: - $ref: examples/SignatureRequestSendWithTemplate.sh + $ref: examples/SignatureRequestReleaseHold.sh x-meta: seo: - title: 'Send with Template | API Documentation | Dropbox Sign for Developers' - description: 'Dropbox Sign API allows you to build custom integrations. To find out how to create and send a new SignatureRequest based off of the Template, click here.' - '/signature_request/update/{signature_request_id}': + title: 'Release On-Hold Signature Request | Dropbox Sign for Developers' + description: 'The RESTful Dropbox Sign API allows you to build custom eSign integrations. To find out how to release an on-hold SignatureRequest, click here.' + '/signature_request/remind/{signature_request_id}': post: tags: - 'Signature Request' - summary: 'Update Signature Request' + summary: 'Send Request Reminder' description: |- - Updates the email address and/or the name for a given signer on a signature request. You can listen for the `signature_request_email_bounce` event on your app or account to detect bounced emails, and respond with this method. - - Updating the email address of a signer will generate a new `signature_id` value. + Sends an email to the signer reminding them to sign the signature request. You cannot send a reminder within 1 hour of the last reminder that was sent. This includes manual AND automatic reminders. - **NOTE:** This action cannot be performed on a signature request with an appended signature page. - operationId: signatureRequestUpdate + **NOTE:** This action can **not** be used with embedded signature requests. + operationId: signatureRequestRemind parameters: - name: signature_request_id in: path - description: 'The id of the SignatureRequest to update.' + description: 'The id of the SignatureRequest to send a reminder for.' required: true schema: type: string @@ -4734,10 +4782,10 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/SignatureRequestUpdateRequest' + $ref: '#/components/schemas/SignatureRequestRemindRequest' examples: default_example: - $ref: '#/components/examples/SignatureRequestUpdateRequestDefaultExample' + $ref: '#/components/examples/SignatureRequestRemindRequestDefaultExample' responses: '200': description: 'successful operation' @@ -4754,7 +4802,7 @@ paths: $ref: '#/components/schemas/SignatureRequestGetResponse' examples: default_example: - $ref: '#/components/examples/SignatureRequestUpdateResponseExample' + $ref: '#/components/examples/SignatureRequestRemindResponseExample' '4XX': description: failed_operation content: @@ -4772,6 +4820,12 @@ paths: $ref: '#/components/examples/Error403ResponseExample' 404_example: $ref: '#/components/examples/Error404ResponseExample' + 409_example: + $ref: '#/components/examples/Error409ResponseExample' + 410_example: + $ref: '#/components/examples/Error410ResponseExample' + 429_example: + $ref: '#/components/examples/Error429ResponseExample' 4XX_example: $ref: '#/components/examples/Error4XXResponseExample' security: @@ -4779,79 +4833,74 @@ paths: api_key: [] - oauth2: + - request_signature - signature_request_access x-codeSamples: - lang: PHP label: PHP source: - $ref: examples/SignatureRequestUpdate.php + $ref: examples/SignatureRequestRemind.php - lang: 'C#' label: 'C#' source: - $ref: examples/SignatureRequestUpdate.cs + $ref: examples/SignatureRequestRemind.cs - lang: JavaScript label: JavaScript source: - $ref: examples/SignatureRequestUpdate.js + $ref: examples/SignatureRequestRemind.js - lang: TypeScript label: TypeScript source: - $ref: examples/SignatureRequestUpdate.ts + $ref: examples/SignatureRequestRemind.ts - lang: Java label: Java source: - $ref: examples/SignatureRequestUpdate.java + $ref: examples/SignatureRequestRemind.java - lang: Ruby label: Ruby source: - $ref: examples/SignatureRequestUpdate.rb + $ref: examples/SignatureRequestRemind.rb - lang: Python label: Python source: - $ref: examples/SignatureRequestUpdate.py + $ref: examples/SignatureRequestRemind.py - lang: cURL label: cURL source: - $ref: examples/SignatureRequestUpdate.sh + $ref: examples/SignatureRequestRemind.sh x-meta: seo: - title: 'Update Signature Request | REST API | Dropbox Sign for Developers' - description: 'Dropbox Sign API allows you to build custom integrations. To find out how to update the email address/name for a signer on a signature request, click here.' - /team/add_member: - put: + title: 'Send Request Reminder | REST API | Dropbox Sign for Developers' + description: 'The RESTful Dropbox Sign API allows you to build custom eSign integrations. To find out how to send an email reminder to the signer, click here.' + '/signature_request/remove/{signature_request_id}': + post: tags: - - Team - summary: 'Add User to Team' - description: 'Invites a user (specified using the `email_address` parameter) to your Team. If the user does not currently have a Dropbox Sign Account, a new one will be created for them. If a user is already a part of another Team, a `team_invite_failed` error will be returned.' - operationId: teamAddMember + - 'Signature Request' + summary: 'Remove Signature Request Access' + description: |- + Removes your access to a completed signature request. This action is **not reversible**. + + The signature request must be fully executed by all parties (signed or declined to sign). Other parties will continue to maintain access to the completed signature request document(s). + + Unlike /signature_request/cancel, this endpoint is synchronous and your access will be immediately removed. Upon successful removal, this endpoint will return a 200 OK response. + operationId: signatureRequestRemove parameters: - - name: team_id - in: query - description: 'The id of the team.' - required: false + name: signature_request_id + in: path + description: 'The id of the SignatureRequest to remove.' + required: true schema: type: string - example: 4fea99bfcf2b26bfccf6cea3e127fb8bb74d8d9c - requestBody: - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/TeamAddMemberRequest' - examples: - email_address: - $ref: '#/components/examples/TeamAddMemberRequestEmailAddressExample' - account_id: - $ref: '#/components/examples/TeamAddMemberRequestAccountIdExample' + example: fa5c8a0b0f492d768749333ad6fcc214c111e967 responses: '200': description: 'successful operation' @@ -4863,12 +4912,7 @@ paths: X-Ratelimit-Reset: $ref: '#/components/headers/X-Ratelimit-Reset' content: - application/json: - schema: - $ref: '#/components/schemas/TeamGetResponse' - examples: - default_example: - $ref: '#/components/examples/TeamAddMemberResponseExample' + application/json: {} '4XX': description: failed_operation content: @@ -4886,75 +4930,81 @@ paths: $ref: '#/components/examples/Error403ResponseExample' 404_example: $ref: '#/components/examples/Error404ResponseExample' + 409_example: + $ref: '#/components/examples/Error409ResponseExample' + 410_example: + $ref: '#/components/examples/Error410ResponseExample' 4XX_example: $ref: '#/components/examples/Error4XXResponseExample' security: - api_key: [] - - - oauth2: - - team_access x-codeSamples: - lang: PHP label: PHP source: - $ref: examples/TeamAddMember.php + $ref: examples/SignatureRequestRemove.php - lang: 'C#' label: 'C#' source: - $ref: examples/TeamAddMember.cs + $ref: examples/SignatureRequestRemove.cs - lang: JavaScript label: JavaScript source: - $ref: examples/TeamAddMember.js + $ref: examples/SignatureRequestRemove.js - lang: TypeScript label: TypeScript source: - $ref: examples/TeamAddMember.ts + $ref: examples/SignatureRequestRemove.ts - lang: Java label: Java source: - $ref: examples/TeamAddMember.java + $ref: examples/SignatureRequestRemove.java - lang: Ruby label: Ruby source: - $ref: examples/TeamAddMember.rb + $ref: examples/SignatureRequestRemove.rb - lang: Python label: Python source: - $ref: examples/TeamAddMember.py + $ref: examples/SignatureRequestRemove.py - lang: cURL label: cURL source: - $ref: examples/TeamAddMember.sh + $ref: examples/SignatureRequestRemove.sh x-meta: seo: - title: 'Add User to Team | API Documentation | Dropbox Sign for Developers' - description: 'The RESTful Dropbox Sign API easily allows you to build custom eSign integrations. To find out how to invite a specified user to your Team, click here.' - /team/create: + title: 'Remove Signature Request Access | Dropbox Sign for Developers' + description: 'The RESTful Dropbox Sign API allows you to build custom integrations. To find out how to remove your access to a completed signature request, click here.' + /signature_request/send: post: tags: - - Team - summary: 'Create Team' - description: 'Creates a new Team and makes you a member. You must not currently belong to a Team to invoke.' - operationId: teamCreate + - 'Signature Request' + summary: 'Send Signature Request' + description: 'Creates and sends a new SignatureRequest with the submitted documents. If `form_fields_per_document` is not specified, a signature page will be affixed where all signers will be required to add their signature, signifying their agreement to all contained documents.' + operationId: signatureRequestSend requestBody: required: true content: application/json: schema: - $ref: '#/components/schemas/TeamCreateRequest' + $ref: '#/components/schemas/SignatureRequestSendRequest' examples: default_example: - $ref: '#/components/examples/TeamCreateRequestDefaultExample' + $ref: '#/components/examples/SignatureRequestSendRequestDefaultExample' + grouped_signers_example: + $ref: '#/components/examples/SignatureRequestSendRequestGroupedSignersExample' + multipart/form-data: + schema: + $ref: '#/components/schemas/SignatureRequestSendRequest' responses: '200': description: 'successful operation' @@ -4968,10 +5018,10 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/TeamGetResponse' + $ref: '#/components/schemas/SignatureRequestGetResponse' examples: default_example: - $ref: '#/components/examples/TeamCreateResponseExample' + $ref: '#/components/examples/SignatureRequestSendResponseExample' '4XX': description: failed_operation content: @@ -4987,6 +5037,10 @@ paths: $ref: '#/components/examples/Error402ResponseExample' 403_example: $ref: '#/components/examples/Error403ResponseExample' + 409_example: + $ref: '#/components/examples/Error409ResponseExample' + 429_example: + $ref: '#/components/examples/Error429ResponseExample' 4XX_example: $ref: '#/components/examples/Error4XXResponseExample' security: @@ -4994,59 +5048,72 @@ paths: api_key: [] - oauth2: - - team_access + - request_signature + - signature_request_access x-codeSamples: - lang: PHP label: PHP source: - $ref: examples/TeamCreate.php + $ref: examples/SignatureRequestSend.php - lang: 'C#' label: 'C#' source: - $ref: examples/TeamCreate.cs + $ref: examples/SignatureRequestSend.cs - lang: JavaScript label: JavaScript source: - $ref: examples/TeamCreate.js + $ref: examples/SignatureRequestSend.js - lang: TypeScript label: TypeScript source: - $ref: examples/TeamCreate.ts + $ref: examples/SignatureRequestSend.ts - lang: Java label: Java source: - $ref: examples/TeamCreate.java + $ref: examples/SignatureRequestSend.java - lang: Ruby label: Ruby source: - $ref: examples/TeamCreate.rb + $ref: examples/SignatureRequestSend.rb - lang: Python label: Python source: - $ref: examples/TeamCreate.py + $ref: examples/SignatureRequestSend.py - lang: cURL label: cURL source: - $ref: examples/TeamCreate.sh + $ref: examples/SignatureRequestSend.sh x-meta: seo: - title: 'Create Team | REST API Documentation | Dropbox Sign for Developers' - description: 'The RESTful Dropbox Sign API allows you to build custom eSign integrations. To find out how to create a new team and make yourself a member, click here.' - /team/destroy: - delete: + title: 'Send Signature Request | REST API | Dropbox Sign for Developers' + description: 'Dropbox Sign API allows you to build custom integrations. To find out how to create and send new SignatureRequest with the submitted documents, click here.' + /signature_request/send_with_template: + post: tags: - - Team - summary: 'Delete Team' - description: 'Deletes your Team. Can only be invoked when you have a Team with only one member (yourself).' - operationId: teamDelete + - 'Signature Request' + summary: 'Send with Template' + description: 'Creates and sends a new SignatureRequest based off of the Template(s) specified with the `template_ids` parameter.' + operationId: signatureRequestSendWithTemplate + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/SignatureRequestSendWithTemplateRequest' + examples: + default_example: + $ref: '#/components/examples/SignatureRequestSendWithTemplateRequestDefaultExample' + multipart/form-data: + schema: + $ref: '#/components/schemas/SignatureRequestSendWithTemplateRequest' responses: '200': description: 'successful operation' @@ -5057,6 +5124,13 @@ paths: $ref: '#/components/headers/X-RateLimit-Remaining' X-Ratelimit-Reset: $ref: '#/components/headers/X-Ratelimit-Reset' + content: + application/json: + schema: + $ref: '#/components/schemas/SignatureRequestGetResponse' + examples: + default_example: + $ref: '#/components/examples/SignatureRequestSendWithTemplateResponseExample' '4XX': description: failed_operation content: @@ -5072,6 +5146,8 @@ paths: $ref: '#/components/examples/Error402ResponseExample' 403_example: $ref: '#/components/examples/Error403ResponseExample' + 429_example: + $ref: '#/components/examples/Error429ResponseExample' 4XX_example: $ref: '#/components/examples/Error4XXResponseExample' security: @@ -5079,59 +5155,83 @@ paths: api_key: [] - oauth2: - - team_access + - request_signature + - signature_request_access x-codeSamples: - lang: PHP label: PHP source: - $ref: examples/TeamDelete.php + $ref: examples/SignatureRequestSendWithTemplate.php - lang: 'C#' label: 'C#' source: - $ref: examples/TeamDelete.cs + $ref: examples/SignatureRequestSendWithTemplate.cs - lang: JavaScript label: JavaScript source: - $ref: examples/TeamDelete.js + $ref: examples/SignatureRequestSendWithTemplate.js - lang: TypeScript label: TypeScript source: - $ref: examples/TeamDelete.ts + $ref: examples/SignatureRequestSendWithTemplate.ts - lang: Java label: Java source: - $ref: examples/TeamDelete.java + $ref: examples/SignatureRequestSendWithTemplate.java - lang: Ruby label: Ruby source: - $ref: examples/TeamDelete.rb + $ref: examples/SignatureRequestSendWithTemplate.rb - lang: Python label: Python source: - $ref: examples/TeamDelete.py + $ref: examples/SignatureRequestSendWithTemplate.py - lang: cURL label: cURL source: - $ref: examples/TeamDelete.sh + $ref: examples/SignatureRequestSendWithTemplate.sh x-meta: seo: - title: 'Delete Team | REST API Documentation | Dropbox Sign for Developers' - description: 'The RESTful Dropbox Sign API easily allows you to build custom eSign integrations. To find out how to delete a team you are a member of, click here.' - /team: - get: + title: 'Send with Template | API Documentation | Dropbox Sign for Developers' + description: 'Dropbox Sign API allows you to build custom integrations. To find out how to create and send a new SignatureRequest based off of the Template, click here.' + '/signature_request/update/{signature_request_id}': + post: tags: - - Team - summary: 'Get Team' - description: 'Returns information about your Team as well as a list of its members. If you do not belong to a Team, a 404 error with an error_name of "not_found" will be returned.' - operationId: teamGet + - 'Signature Request' + summary: 'Update Signature Request' + description: |- + Updates the email address and/or the name for a given signer on a signature request. You can listen for the `signature_request_email_bounce` event on your app or account to detect bounced emails, and respond with this method. + + Updating the email address of a signer will generate a new `signature_id` value. + + **NOTE:** This action cannot be performed on a signature request with an appended signature page. + operationId: signatureRequestUpdate + parameters: + - + name: signature_request_id + in: path + description: 'The id of the SignatureRequest to update.' + required: true + schema: + type: string + example: fa5c8a0b0f492d768749333ad6fcc214c111e967 + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/SignatureRequestUpdateRequest' + examples: + default_example: + $ref: '#/components/examples/SignatureRequestUpdateRequestDefaultExample' responses: '200': description: 'successful operation' @@ -5145,10 +5245,10 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/TeamGetResponse' + $ref: '#/components/schemas/SignatureRequestGetResponse' examples: default_example: - $ref: '#/components/examples/TeamGetResponseExample' + $ref: '#/components/examples/SignatureRequestUpdateResponseExample' '4XX': description: failed_operation content: @@ -5173,67 +5273,79 @@ paths: api_key: [] - oauth2: - - team_access + - signature_request_access x-codeSamples: - lang: PHP label: PHP source: - $ref: examples/TeamGet.php + $ref: examples/SignatureRequestUpdate.php - lang: 'C#' label: 'C#' source: - $ref: examples/TeamGet.cs + $ref: examples/SignatureRequestUpdate.cs - lang: JavaScript label: JavaScript source: - $ref: examples/TeamGet.js + $ref: examples/SignatureRequestUpdate.js - lang: TypeScript label: TypeScript source: - $ref: examples/TeamGet.ts + $ref: examples/SignatureRequestUpdate.ts - lang: Java label: Java source: - $ref: examples/TeamGet.java + $ref: examples/SignatureRequestUpdate.java - lang: Ruby label: Ruby source: - $ref: examples/TeamGet.rb + $ref: examples/SignatureRequestUpdate.rb - lang: Python label: Python source: - $ref: examples/TeamGet.py + $ref: examples/SignatureRequestUpdate.py - lang: cURL label: cURL source: - $ref: examples/TeamGet.sh + $ref: examples/SignatureRequestUpdate.sh x-meta: seo: - title: 'Get Team | REST API Documentation | Dropbox Sign for Developers' - description: 'The RESTful Dropbox Sign API easily allows you to build custom eSign integrations. To find out how to return information about your Team, click here.' + title: 'Update Signature Request | REST API | Dropbox Sign for Developers' + description: 'Dropbox Sign API allows you to build custom integrations. To find out how to update the email address/name for a signer on a signature request, click here.' + /team/add_member: put: tags: - Team - summary: 'Update Team' - description: 'Updates the name of your Team.' - operationId: teamUpdate + summary: 'Add User to Team' + description: 'Invites a user (specified using the `email_address` parameter) to your Team. If the user does not currently have a Dropbox Sign Account, a new one will be created for them. If a user is already a part of another Team, a `team_invite_failed` error will be returned.' + operationId: teamAddMember + parameters: + - + name: team_id + in: query + description: 'The id of the team.' + required: false + schema: + type: string + example: 4fea99bfcf2b26bfccf6cea3e127fb8bb74d8d9c requestBody: required: true content: application/json: schema: - $ref: '#/components/schemas/TeamUpdateRequest' + $ref: '#/components/schemas/TeamAddMemberRequest' examples: - default_example: - $ref: '#/components/examples/TeamUpdateRequestDefaultExample' + email_address: + $ref: '#/components/examples/TeamAddMemberRequestEmailAddressExample' + account_id: + $ref: '#/components/examples/TeamAddMemberRequestAccountIdExample' responses: '200': description: 'successful operation' @@ -5250,7 +5362,7 @@ paths: $ref: '#/components/schemas/TeamGetResponse' examples: default_example: - $ref: '#/components/examples/TeamUpdateResponseExample' + $ref: '#/components/examples/TeamAddMemberResponseExample' '4XX': description: failed_operation content: @@ -5266,6 +5378,8 @@ paths: $ref: '#/components/examples/Error402ResponseExample' 403_example: $ref: '#/components/examples/Error403ResponseExample' + 404_example: + $ref: '#/components/examples/Error404ResponseExample' 4XX_example: $ref: '#/components/examples/Error4XXResponseExample' security: @@ -5279,62 +5393,62 @@ paths: lang: PHP label: PHP source: - $ref: examples/TeamUpdate.php + $ref: examples/TeamAddMember.php - lang: 'C#' label: 'C#' source: - $ref: examples/TeamUpdate.cs + $ref: examples/TeamAddMember.cs - lang: JavaScript label: JavaScript source: - $ref: examples/TeamUpdate.js + $ref: examples/TeamAddMember.js - lang: TypeScript label: TypeScript source: - $ref: examples/TeamUpdate.ts + $ref: examples/TeamAddMember.ts - lang: Java label: Java source: - $ref: examples/TeamUpdate.java + $ref: examples/TeamAddMember.java - lang: Ruby label: Ruby source: - $ref: examples/TeamUpdate.rb + $ref: examples/TeamAddMember.rb - lang: Python label: Python source: - $ref: examples/TeamUpdate.py + $ref: examples/TeamAddMember.py - lang: cURL label: cURL source: - $ref: examples/TeamUpdate.sh + $ref: examples/TeamAddMember.sh x-meta: seo: - title: 'Update Team | API Documentation | Dropbox Sign for Developers' - description: 'The RESTful Dropbox Sign API easily allows you to build custom eSign integrations. To find out how to update the name of your team, click here.' - /team/info: - get: + title: 'Add User to Team | API Documentation | Dropbox Sign for Developers' + description: 'The RESTful Dropbox Sign API easily allows you to build custom eSign integrations. To find out how to invite a specified user to your Team, click here.' + /team/create: + post: tags: - Team - summary: 'Get Team Info' - description: 'Provides information about a team.' - operationId: teamInfo - parameters: - - - name: team_id - in: query - description: 'The id of the team.' - required: false - schema: - type: string - example: 4fea99bfcf2b26bfccf6cea3e127fb8bb74d8d9c + summary: 'Create Team' + description: 'Creates a new Team and makes you a member. You must not currently belong to a Team to invoke.' + operationId: teamCreate + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/TeamCreateRequest' + examples: + default_example: + $ref: '#/components/examples/TeamCreateRequestDefaultExample' responses: '200': description: 'successful operation' @@ -5348,10 +5462,10 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/TeamGetInfoResponse' + $ref: '#/components/schemas/TeamGetResponse' examples: default_example: - $ref: '#/components/examples/TeamGetInfoResponseExample' + $ref: '#/components/examples/TeamCreateResponseExample' '4XX': description: failed_operation content: @@ -5367,10 +5481,6 @@ paths: $ref: '#/components/examples/Error402ResponseExample' 403_example: $ref: '#/components/examples/Error403ResponseExample' - 409_example: - $ref: '#/components/examples/Error409ResponseExample' - 429_example: - $ref: '#/components/examples/Error429ResponseExample' 4XX_example: $ref: '#/components/examples/Error4XXResponseExample' security: @@ -5384,61 +5494,53 @@ paths: lang: PHP label: PHP source: - $ref: examples/TeamInfo.php + $ref: examples/TeamCreate.php - lang: 'C#' label: 'C#' source: - $ref: examples/TeamInfo.cs + $ref: examples/TeamCreate.cs - lang: JavaScript label: JavaScript source: - $ref: examples/TeamInfo.js + $ref: examples/TeamCreate.js - lang: TypeScript label: TypeScript source: - $ref: examples/TeamInfo.ts + $ref: examples/TeamCreate.ts - lang: Java label: Java source: - $ref: examples/TeamInfo.java + $ref: examples/TeamCreate.java - lang: Ruby label: Ruby source: - $ref: examples/TeamInfo.rb + $ref: examples/TeamCreate.rb - lang: Python label: Python source: - $ref: examples/TeamInfo.py + $ref: examples/TeamCreate.py - lang: cURL label: cURL source: - $ref: examples/TeamInfo.sh + $ref: examples/TeamCreate.sh x-meta: seo: - title: 'Get Team Info | Dropbox Sign for Developers' - description: 'The Dropbox Sign API allows you automate your team management. To find out how to get information about a specific team, click here.' - /team/invites: - get: + title: 'Create Team | REST API Documentation | Dropbox Sign for Developers' + description: 'The RESTful Dropbox Sign API allows you to build custom eSign integrations. To find out how to create a new team and make yourself a member, click here.' + /team/destroy: + delete: tags: - Team - summary: 'List Team Invites' - description: 'Provides a list of team invites (and their roles).' - operationId: teamInvites - parameters: - - - name: email_address - in: query - description: 'The email address for which to display the team invites.' - required: false - schema: - type: string + summary: 'Delete Team' + description: 'Deletes your Team. Can only be invoked when you have a Team with only one member (yourself).' + operationId: teamDelete responses: '200': description: 'successful operation' @@ -5449,13 +5551,6 @@ paths: $ref: '#/components/headers/X-RateLimit-Remaining' X-Ratelimit-Reset: $ref: '#/components/headers/X-Ratelimit-Reset' - content: - application/json: - schema: - $ref: '#/components/schemas/TeamInvitesResponse' - examples: - default_example: - $ref: '#/components/examples/TeamInvitesResponseExample' '4XX': description: failed_operation content: @@ -5478,85 +5573,59 @@ paths: api_key: [] - oauth2: - - account_access - - basic_account_info + - team_access x-codeSamples: - lang: PHP label: PHP source: - $ref: examples/TeamInvites.php + $ref: examples/TeamDelete.php - lang: 'C#' label: 'C#' source: - $ref: examples/TeamInvites.cs + $ref: examples/TeamDelete.cs - lang: JavaScript label: JavaScript source: - $ref: examples/TeamInvites.js + $ref: examples/TeamDelete.js - lang: TypeScript label: TypeScript source: - $ref: examples/TeamInvites.ts + $ref: examples/TeamDelete.ts - lang: Java label: Java source: - $ref: examples/TeamInvites.java + $ref: examples/TeamDelete.java - lang: Ruby label: Ruby source: - $ref: examples/TeamInvites.rb + $ref: examples/TeamDelete.rb - lang: Python label: Python source: - $ref: examples/TeamInvites.py + $ref: examples/TeamDelete.py - lang: cURL label: cURL source: - $ref: examples/TeamInvites.sh + $ref: examples/TeamDelete.sh x-meta: seo: - title: 'List Team Invites | Dropbox Sign for Developers' - description: 'The Dropbox Sign API allows you automate your team management. To find out how to get a list of team invites (and their roles), click here.' - '/team/members/{team_id}': + title: 'Delete Team | REST API Documentation | Dropbox Sign for Developers' + description: 'The RESTful Dropbox Sign API easily allows you to build custom eSign integrations. To find out how to delete a team you are a member of, click here.' + /team: get: tags: - Team - summary: 'List Team Members' - description: 'Provides a paginated list of members (and their roles) that belong to a given team.' - operationId: teamMembers - parameters: - - - name: team_id - in: path - description: 'The id of the team that a member list is being requested from.' - required: true - schema: - type: string - example: 4fea99bfcf2b26bfccf6cea3e127fb8bb74d8d9c - - - name: page - in: query - description: 'Which page number of the team member list to return. Defaults to `1`.' - schema: - type: integer - default: 1 - - - name: page_size - in: query - description: 'Number of objects to be returned per page. Must be between `1` and `100`. Default is `20`.' - schema: - type: integer - default: 20 - maximum: 100 - minimum: 1 + summary: 'Get Team' + description: 'Returns information about your Team as well as a list of its members. If you do not belong to a Team, a 404 error with an error_name of "not_found" will be returned.' + operationId: teamGet responses: '200': description: 'successful operation' @@ -5570,10 +5639,10 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/TeamMembersResponse' + $ref: '#/components/schemas/TeamGetResponse' examples: default_example: - $ref: '#/components/examples/TeamMembersResponseExample' + $ref: '#/components/examples/TeamGetResponseExample' '4XX': description: failed_operation content: @@ -5589,10 +5658,8 @@ paths: $ref: '#/components/examples/Error402ResponseExample' 403_example: $ref: '#/components/examples/Error403ResponseExample' - 409_example: - $ref: '#/components/examples/Error409ResponseExample' - 429_example: - $ref: '#/components/examples/Error429ResponseExample' + 404_example: + $ref: '#/components/examples/Error404ResponseExample' 4XX_example: $ref: '#/components/examples/Error4XXResponseExample' security: @@ -5606,66 +5673,63 @@ paths: lang: PHP label: PHP source: - $ref: examples/TeamMembers.php + $ref: examples/TeamGet.php - lang: 'C#' label: 'C#' source: - $ref: examples/TeamMembers.cs + $ref: examples/TeamGet.cs - lang: JavaScript label: JavaScript source: - $ref: examples/TeamMembers.js + $ref: examples/TeamGet.js - lang: TypeScript label: TypeScript source: - $ref: examples/TeamMembers.ts + $ref: examples/TeamGet.ts - lang: Java label: Java source: - $ref: examples/TeamMembers.java + $ref: examples/TeamGet.java - lang: Ruby label: Ruby source: - $ref: examples/TeamMembers.rb + $ref: examples/TeamGet.rb - lang: Python label: Python source: - $ref: examples/TeamMembers.py + $ref: examples/TeamGet.py - lang: cURL label: cURL source: - $ref: examples/TeamMembers.sh + $ref: examples/TeamGet.sh x-meta: seo: - title: 'List Team Members | Dropbox Sign for Developers' - description: 'The Dropbox Sign API allows you automate your team management. To find out how to get a list of team members and their roles for a specific team, click here.' - /team/remove_member: - post: + title: 'Get Team | REST API Documentation | Dropbox Sign for Developers' + description: 'The RESTful Dropbox Sign API easily allows you to build custom eSign integrations. To find out how to return information about your Team, click here.' + put: tags: - Team - summary: 'Remove User from Team' - description: 'Removes the provided user Account from your Team. If the Account had an outstanding invitation to your Team, the invitation will be expired. If you choose to transfer documents from the removed Account to an Account provided in the `new_owner_email_address` parameter (available only for Enterprise plans), the response status code will be 201, which indicates that your request has been queued but not fully executed.' - operationId: teamRemoveMember + summary: 'Update Team' + description: 'Updates the name of your Team.' + operationId: teamUpdate requestBody: required: true content: application/json: schema: - $ref: '#/components/schemas/TeamRemoveMemberRequest' + $ref: '#/components/schemas/TeamUpdateRequest' examples: - email_address: - $ref: '#/components/examples/TeamRemoveMemberRequestEmailAddressExample' - account_id: - $ref: '#/components/examples/TeamRemoveMemberRequestAccountIdExample' + default_example: + $ref: '#/components/examples/TeamUpdateRequestDefaultExample' responses: - '201': + '200': description: 'successful operation' headers: X-RateLimit-Limit: @@ -5680,7 +5744,7 @@ paths: $ref: '#/components/schemas/TeamGetResponse' examples: default_example: - $ref: '#/components/examples/TeamRemoveMemberResponseExample' + $ref: '#/components/examples/TeamUpdateResponseExample' '4XX': description: failed_operation content: @@ -5696,8 +5760,6 @@ paths: $ref: '#/components/examples/Error402ResponseExample' 403_example: $ref: '#/components/examples/Error403ResponseExample' - 404_example: - $ref: '#/components/examples/Error404ResponseExample' 4XX_example: $ref: '#/components/examples/Error4XXResponseExample' security: @@ -5711,78 +5773,62 @@ paths: lang: PHP label: PHP source: - $ref: examples/TeamRemoveMember.php + $ref: examples/TeamUpdate.php - lang: 'C#' label: 'C#' source: - $ref: examples/TeamRemoveMember.cs + $ref: examples/TeamUpdate.cs - lang: JavaScript label: JavaScript source: - $ref: examples/TeamRemoveMember.js + $ref: examples/TeamUpdate.js - lang: TypeScript label: TypeScript source: - $ref: examples/TeamRemoveMember.ts + $ref: examples/TeamUpdate.ts - lang: Java label: Java source: - $ref: examples/TeamRemoveMember.java + $ref: examples/TeamUpdate.java - lang: Ruby label: Ruby source: - $ref: examples/TeamRemoveMember.rb + $ref: examples/TeamUpdate.rb - lang: Python label: Python source: - $ref: examples/TeamRemoveMember.py + $ref: examples/TeamUpdate.py - lang: cURL label: cURL source: - $ref: examples/TeamRemoveMember.sh + $ref: examples/TeamUpdate.sh x-meta: seo: - title: 'Remove User from Team | REST API | Dropbox Sign for Developers' - description: 'The RESTful Dropbox Sign API easily allows you to build custom eSign integrations. To find out how to remove a user Account from your Team, click here.' - '/team/sub_teams/{team_id}': + title: 'Update Team | API Documentation | Dropbox Sign for Developers' + description: 'The RESTful Dropbox Sign API easily allows you to build custom eSign integrations. To find out how to update the name of your team, click here.' + /team/info: get: tags: - Team - summary: 'List Sub Teams' - description: 'Provides a paginated list of sub teams that belong to a given team.' - operationId: teamSubTeams + summary: 'Get Team Info' + description: 'Provides information about a team.' + operationId: teamInfo parameters: - name: team_id - in: path - description: 'The id of the parent Team.' - required: true + in: query + description: 'The id of the team.' + required: false schema: type: string example: 4fea99bfcf2b26bfccf6cea3e127fb8bb74d8d9c - - - name: page - in: query - description: 'Which page number of the SubTeam List to return. Defaults to `1`.' - schema: - type: integer - default: 1 - - - name: page_size - in: query - description: 'Number of objects to be returned per page. Must be between `1` and `100`. Default is `20`.' - schema: - type: integer - default: 20 - maximum: 100 - minimum: 1 responses: '200': description: 'successful operation' @@ -5796,10 +5842,10 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/TeamSubTeamsResponse' + $ref: '#/components/schemas/TeamGetInfoResponse' examples: default_example: - $ref: '#/components/examples/TeamSubTeamsResponseExample' + $ref: '#/components/examples/TeamGetInfoResponseExample' '4XX': description: failed_operation content: @@ -5832,71 +5878,61 @@ paths: lang: PHP label: PHP source: - $ref: examples/TeamSubTeams.php + $ref: examples/TeamInfo.php - lang: 'C#' label: 'C#' source: - $ref: examples/TeamSubTeams.cs + $ref: examples/TeamInfo.cs - lang: JavaScript label: JavaScript source: - $ref: examples/TeamSubTeams.js + $ref: examples/TeamInfo.js - lang: TypeScript label: TypeScript source: - $ref: examples/TeamSubTeams.ts + $ref: examples/TeamInfo.ts - lang: Java label: Java source: - $ref: examples/TeamSubTeams.java + $ref: examples/TeamInfo.java - lang: Ruby label: Ruby source: - $ref: examples/TeamSubTeams.rb + $ref: examples/TeamInfo.rb - lang: Python label: Python source: - $ref: examples/TeamSubTeams.py + $ref: examples/TeamInfo.py - lang: cURL label: cURL source: - $ref: examples/TeamSubTeams.sh + $ref: examples/TeamInfo.sh x-meta: seo: - title: 'List Sub Teams | Dropbox Sign for Developers' - description: 'The Dropbox Sign API allows you automate your team management. To find out how to get a list of sub teams that exist for a given team, click here.' - '/template/add_user/{template_id}': - post: + title: 'Get Team Info | Dropbox Sign for Developers' + description: 'The Dropbox Sign API allows you automate your team management. To find out how to get information about a specific team, click here.' + /team/invites: + get: tags: - - Template - summary: 'Add User to Template' - description: 'Gives the specified Account access to the specified Template. The specified Account must be a part of your Team.' - operationId: templateAddUser + - Team + summary: 'List Team Invites' + description: 'Provides a list of team invites (and their roles).' + operationId: teamInvites parameters: - - name: template_id - in: path - description: 'The id of the Template to give the Account access to.' - required: true + name: email_address + in: query + description: 'The email address for which to display the team invites.' + required: false schema: type: string - example: f57db65d3f933b5316d398057a36176831451a35 - requestBody: - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/TemplateAddUserRequest' - examples: - default_example: - $ref: '#/components/examples/TemplateAddUserRequestDefaultExample' responses: '200': description: 'successful operation' @@ -5910,10 +5946,10 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/TemplateGetResponse' + $ref: '#/components/schemas/TeamInvitesResponse' examples: default_example: - $ref: '#/components/examples/TemplateAddUserResponseExample' + $ref: '#/components/examples/TeamInvitesResponseExample' '4XX': description: failed_operation content: @@ -5929,8 +5965,6 @@ paths: $ref: '#/components/examples/Error402ResponseExample' 403_example: $ref: '#/components/examples/Error403ResponseExample' - 404_example: - $ref: '#/components/examples/Error404ResponseExample' 4XX_example: $ref: '#/components/examples/Error4XXResponseExample' security: @@ -5938,77 +5972,85 @@ paths: api_key: [] - oauth2: - - template_access + - account_access + - basic_account_info x-codeSamples: - lang: PHP label: PHP source: - $ref: examples/TemplateAddUser.php + $ref: examples/TeamInvites.php - lang: 'C#' label: 'C#' source: - $ref: examples/TemplateAddUser.cs + $ref: examples/TeamInvites.cs - lang: JavaScript label: JavaScript source: - $ref: examples/TemplateAddUser.js + $ref: examples/TeamInvites.js - lang: TypeScript label: TypeScript source: - $ref: examples/TemplateAddUser.ts + $ref: examples/TeamInvites.ts - lang: Java label: Java source: - $ref: examples/TemplateAddUser.java + $ref: examples/TeamInvites.java - lang: Ruby label: Ruby source: - $ref: examples/TemplateAddUser.rb + $ref: examples/TeamInvites.rb - lang: Python label: Python source: - $ref: examples/TemplateAddUser.py + $ref: examples/TeamInvites.py - lang: cURL label: cURL source: - $ref: examples/TemplateAddUser.sh + $ref: examples/TeamInvites.sh x-meta: seo: - title: 'Add User to Template | REST API | Dropbox Sign for Developers' - description: 'The RESTful Dropbox Sign API easily allows you to build custom eSign integrations. To find out how to give an Account access to a Template, click here.' - /template/create: - post: + title: 'List Team Invites | Dropbox Sign for Developers' + description: 'The Dropbox Sign API allows you automate your team management. To find out how to get a list of team invites (and their roles), click here.' + '/team/members/{team_id}': + get: tags: - - Template - summary: 'Create Template' - description: 'Creates a template that can then be used.' - operationId: templateCreate - requestBody: - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/TemplateCreateRequest' - examples: - default_example: - $ref: '#/components/examples/TemplateCreateRequestDefaultExample' - form_fields_per_document: - $ref: '#/components/examples/TemplateCreateRequestFormFieldsPerDocumentExample' - form_field_groups: - $ref: '#/components/examples/TemplateCreateRequestFormFieldGroupsExample' - form_field_rules: - $ref: '#/components/examples/TemplateCreateRequestFormFieldRulesExample' - multipart/form-data: - schema: - $ref: '#/components/schemas/TemplateCreateRequest' + - Team + summary: 'List Team Members' + description: 'Provides a paginated list of members (and their roles) that belong to a given team.' + operationId: teamMembers + parameters: + - + name: team_id + in: path + description: 'The id of the team that a member list is being requested from.' + required: true + schema: + type: string + example: 4fea99bfcf2b26bfccf6cea3e127fb8bb74d8d9c + - + name: page + in: query + description: 'Which page number of the team member list to return. Defaults to `1`.' + schema: + type: integer + default: 1 + - + name: page_size + in: query + description: 'Number of objects to be returned per page. Must be between `1` and `100`. Default is `20`.' + schema: + type: integer + default: 20 + maximum: 100 + minimum: 1 responses: '200': description: 'successful operation' @@ -6022,10 +6064,10 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/TemplateCreateResponse' + $ref: '#/components/schemas/TeamMembersResponse' examples: default_example: - $ref: '#/components/examples/TemplateCreateResponseExample' + $ref: '#/components/examples/TeamMembersResponseExample' '4XX': description: failed_operation content: @@ -6041,10 +6083,10 @@ paths: $ref: '#/components/examples/Error402ResponseExample' 403_example: $ref: '#/components/examples/Error403ResponseExample' - 404_example: - $ref: '#/components/examples/Error404ResponseExample' 409_example: $ref: '#/components/examples/Error409ResponseExample' + 429_example: + $ref: '#/components/examples/Error429ResponseExample' 4XX_example: $ref: '#/components/examples/Error4XXResponseExample' security: @@ -6052,79 +6094,72 @@ paths: api_key: [] - oauth2: - - template_access + - team_access x-codeSamples: - lang: PHP label: PHP source: - $ref: examples/TemplateCreate.php + $ref: examples/TeamMembers.php - lang: 'C#' label: 'C#' source: - $ref: examples/TemplateCreate.cs + $ref: examples/TeamMembers.cs - lang: JavaScript label: JavaScript source: - $ref: examples/TemplateCreate.js + $ref: examples/TeamMembers.js - lang: TypeScript label: TypeScript source: - $ref: examples/TemplateCreate.ts + $ref: examples/TeamMembers.ts - lang: Java label: Java source: - $ref: examples/TemplateCreate.java + $ref: examples/TeamMembers.java - lang: Ruby label: Ruby source: - $ref: examples/TemplateCreate.rb + $ref: examples/TeamMembers.rb - lang: Python label: Python source: - $ref: examples/TemplateCreate.py + $ref: examples/TeamMembers.py - lang: cURL label: cURL source: - $ref: examples/TemplateCreate.sh + $ref: examples/TeamMembers.sh x-meta: seo: - title: 'Create Template | Dropbox Sign for Developers' - description: 'The RESTful Dropbox Sign API easily allows you to build custom eSign integrations. To find out how to create an template, click here.' - /template/create_embedded_draft: + title: 'List Team Members | Dropbox Sign for Developers' + description: 'The Dropbox Sign API allows you automate your team management. To find out how to get a list of team members and their roles for a specific team, click here.' + /team/remove_member: post: tags: - - Template - summary: 'Create Embedded Template Draft' - description: 'The first step in an embedded template workflow. Creates a draft template that can then be further set up in the template ''edit'' stage.' - operationId: templateCreateEmbeddedDraft + - Team + summary: 'Remove User from Team' + description: 'Removes the provided user Account from your Team. If the Account had an outstanding invitation to your Team, the invitation will be expired. If you choose to transfer documents from the removed Account to an Account provided in the `new_owner_email_address` parameter (available only for Enterprise plans), the response status code will be 201, which indicates that your request has been queued but not fully executed.' + operationId: teamRemoveMember requestBody: required: true content: application/json: schema: - $ref: '#/components/schemas/TemplateCreateEmbeddedDraftRequest' + $ref: '#/components/schemas/TeamRemoveMemberRequest' examples: - default_example: - $ref: '#/components/examples/TemplateCreateEmbeddedDraftRequestDefaultExample' - form_fields_per_document: - $ref: '#/components/examples/TemplateCreateEmbeddedDraftRequestFormFieldsPerDocumentExample' - form_field_groups: - $ref: '#/components/examples/TemplateCreateEmbeddedDraftRequestFormFieldGroupsExample' - form_field_rules: - $ref: '#/components/examples/TemplateCreateEmbeddedDraftRequestFormFieldRulesExample' - multipart/form-data: - schema: - $ref: '#/components/schemas/TemplateCreateEmbeddedDraftRequest' + email_address: + $ref: '#/components/examples/TeamRemoveMemberRequestEmailAddressExample' + account_id: + $ref: '#/components/examples/TeamRemoveMemberRequestAccountIdExample' responses: - '200': + '201': description: 'successful operation' headers: X-RateLimit-Limit: @@ -6136,10 +6171,10 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/TemplateCreateEmbeddedDraftResponse' + $ref: '#/components/schemas/TeamGetResponse' examples: default_example: - $ref: '#/components/examples/TemplateCreateEmbeddedDraftResponseExample' + $ref: '#/components/examples/TeamRemoveMemberResponseExample' '4XX': description: failed_operation content: @@ -6157,8 +6192,6 @@ paths: $ref: '#/components/examples/Error403ResponseExample' 404_example: $ref: '#/components/examples/Error404ResponseExample' - 409_example: - $ref: '#/components/examples/Error409ResponseExample' 4XX_example: $ref: '#/components/examples/Error4XXResponseExample' security: @@ -6166,68 +6199,84 @@ paths: api_key: [] - oauth2: - - template_access + - team_access x-codeSamples: - lang: PHP label: PHP source: - $ref: examples/TemplateCreateEmbeddedDraft.php + $ref: examples/TeamRemoveMember.php - lang: 'C#' label: 'C#' source: - $ref: examples/TemplateCreateEmbeddedDraft.cs + $ref: examples/TeamRemoveMember.cs - lang: JavaScript label: JavaScript source: - $ref: examples/TemplateCreateEmbeddedDraft.js + $ref: examples/TeamRemoveMember.js - lang: TypeScript label: TypeScript source: - $ref: examples/TemplateCreateEmbeddedDraft.ts + $ref: examples/TeamRemoveMember.ts - lang: Java label: Java source: - $ref: examples/TemplateCreateEmbeddedDraft.java + $ref: examples/TeamRemoveMember.java - lang: Ruby label: Ruby source: - $ref: examples/TemplateCreateEmbeddedDraft.rb + $ref: examples/TeamRemoveMember.rb - lang: Python label: Python source: - $ref: examples/TemplateCreateEmbeddedDraft.py + $ref: examples/TeamRemoveMember.py - lang: cURL label: cURL source: - $ref: examples/TemplateCreateEmbeddedDraft.sh + $ref: examples/TeamRemoveMember.sh x-meta: seo: - title: 'Create Embedded Template Draft | Dropbox Sign for Developers' - description: 'The RESTful Dropbox Sign API easily allows you to build custom eSign integrations. To find out how to create an embedded draft template, click here.' - '/template/delete/{template_id}': - post: + title: 'Remove User from Team | REST API | Dropbox Sign for Developers' + description: 'The RESTful Dropbox Sign API easily allows you to build custom eSign integrations. To find out how to remove a user Account from your Team, click here.' + '/team/sub_teams/{team_id}': + get: tags: - - Template - summary: 'Delete Template' - description: 'Completely deletes the template specified from the account.' - operationId: templateDelete + - Team + summary: 'List Sub Teams' + description: 'Provides a paginated list of sub teams that belong to a given team.' + operationId: teamSubTeams parameters: - - name: template_id + name: team_id in: path - description: 'The id of the Template to delete.' + description: 'The id of the parent Team.' required: true schema: type: string - example: f57db65d3f933b5316d398057a36176831451a35 + example: 4fea99bfcf2b26bfccf6cea3e127fb8bb74d8d9c + - + name: page + in: query + description: 'Which page number of the SubTeam List to return. Defaults to `1`.' + schema: + type: integer + default: 1 + - + name: page_size + in: query + description: 'Number of objects to be returned per page. Must be between `1` and `100`. Default is `20`.' + schema: + type: integer + default: 20 + maximum: 100 + minimum: 1 responses: '200': description: 'successful operation' @@ -6239,7 +6288,12 @@ paths: X-Ratelimit-Reset: $ref: '#/components/headers/X-Ratelimit-Reset' content: - application/json: {} + application/json: + schema: + $ref: '#/components/schemas/TeamSubTeamsResponse' + examples: + default_example: + $ref: '#/components/examples/TeamSubTeamsResponseExample' '4XX': description: failed_operation content: @@ -6255,10 +6309,10 @@ paths: $ref: '#/components/examples/Error402ResponseExample' 403_example: $ref: '#/components/examples/Error403ResponseExample' - 404_example: - $ref: '#/components/examples/Error404ResponseExample' 409_example: $ref: '#/components/examples/Error409ResponseExample' + 429_example: + $ref: '#/components/examples/Error429ResponseExample' 4XX_example: $ref: '#/components/examples/Error4XXResponseExample' security: @@ -6266,80 +6320,77 @@ paths: api_key: [] - oauth2: - - template_access + - team_access x-codeSamples: - lang: PHP label: PHP source: - $ref: examples/TemplateDelete.php + $ref: examples/TeamSubTeams.php - lang: 'C#' label: 'C#' source: - $ref: examples/TemplateDelete.cs + $ref: examples/TeamSubTeams.cs - lang: JavaScript label: JavaScript source: - $ref: examples/TemplateDelete.js + $ref: examples/TeamSubTeams.js - lang: TypeScript label: TypeScript source: - $ref: examples/TemplateDelete.ts + $ref: examples/TeamSubTeams.ts - lang: Java label: Java source: - $ref: examples/TemplateDelete.java + $ref: examples/TeamSubTeams.java - lang: Ruby label: Ruby source: - $ref: examples/TemplateDelete.rb + $ref: examples/TeamSubTeams.rb - lang: Python label: Python source: - $ref: examples/TemplateDelete.py + $ref: examples/TeamSubTeams.py - lang: cURL label: cURL source: - $ref: examples/TemplateDelete.sh + $ref: examples/TeamSubTeams.sh x-meta: seo: - title: 'Delete Template | API Documentation | Dropbox Sign for Developers' - description: 'The RESTful Dropbox Sign API easily allows you to build custom integrations. To find out how to completely delete a template from the account, click here.' - '/template/files/{template_id}': - get: + title: 'List Sub Teams | Dropbox Sign for Developers' + description: 'The Dropbox Sign API allows you automate your team management. To find out how to get a list of sub teams that exist for a given team, click here.' + '/template/add_user/{template_id}': + post: tags: - Template - summary: 'Get Template Files' - description: |- - Obtain a copy of the current documents specified by the `template_id` parameter. Returns a PDF or ZIP file. - - If the files are currently being prepared, a status code of `409` will be returned instead. In this case please wait for the `template_created` callback event. - operationId: templateFiles + summary: 'Add User to Template' + description: 'Gives the specified Account access to the specified Template. The specified Account must be a part of your Team.' + operationId: templateAddUser parameters: - name: template_id in: path - description: 'The id of the template files to retrieve.' + description: 'The id of the Template to give the Account access to.' required: true schema: type: string example: f57db65d3f933b5316d398057a36176831451a35 - - - name: file_type - in: query - description: 'Set to `pdf` for a single merged document or `zip` for a collection of individual documents.' - schema: - type: string - enum: - - pdf - - zip + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/TemplateAddUserRequest' + examples: + default_example: + $ref: '#/components/examples/TemplateAddUserRequestDefaultExample' responses: '200': description: 'successful operation' @@ -6351,14 +6402,12 @@ paths: X-Ratelimit-Reset: $ref: '#/components/headers/X-Ratelimit-Reset' content: - application/pdf: - schema: - type: string - format: binary - application/zip: + application/json: schema: - type: string - format: binary + $ref: '#/components/schemas/TemplateGetResponse' + examples: + default_example: + $ref: '#/components/examples/TemplateAddUserResponseExample' '4XX': description: failed_operation content: @@ -6376,12 +6425,6 @@ paths: $ref: '#/components/examples/Error403ResponseExample' 404_example: $ref: '#/components/examples/Error404ResponseExample' - 409_example: - $ref: '#/components/examples/Error409ResponseExample' - 422_example: - $ref: '#/components/examples/Error422ResponseExample' - 429_example: - $ref: '#/components/examples/Error429ResponseExample' 4XX_example: $ref: '#/components/examples/Error4XXResponseExample' security: @@ -6395,65 +6438,71 @@ paths: lang: PHP label: PHP source: - $ref: examples/TemplateFiles.php + $ref: examples/TemplateAddUser.php - lang: 'C#' label: 'C#' source: - $ref: examples/TemplateFiles.cs + $ref: examples/TemplateAddUser.cs - lang: JavaScript label: JavaScript source: - $ref: examples/TemplateFiles.js + $ref: examples/TemplateAddUser.js - lang: TypeScript label: TypeScript source: - $ref: examples/TemplateFiles.ts + $ref: examples/TemplateAddUser.ts - lang: Java label: Java source: - $ref: examples/TemplateFiles.java + $ref: examples/TemplateAddUser.java - lang: Ruby label: Ruby source: - $ref: examples/TemplateFiles.rb + $ref: examples/TemplateAddUser.rb - lang: Python label: Python source: - $ref: examples/TemplateFiles.py + $ref: examples/TemplateAddUser.py - lang: cURL label: cURL source: - $ref: examples/TemplateFiles.sh + $ref: examples/TemplateAddUser.sh x-meta: seo: - title: 'Get Template Files | API Documentation | Dropbox Sign for Developers' - description: 'The RESTful Dropbox Sign API easily allows you to build custom integrations. To find out how to get a copy of the current specified documents, click here.' - '/template/files_as_data_uri/{template_id}': - get: + title: 'Add User to Template | REST API | Dropbox Sign for Developers' + description: 'The RESTful Dropbox Sign API easily allows you to build custom eSign integrations. To find out how to give an Account access to a Template, click here.' + /template/create: + post: tags: - Template - summary: 'Get Template Files as Data Uri' - description: |- - Obtain a copy of the current documents specified by the `template_id` parameter. Returns a JSON object with a `data_uri` representing the base64 encoded file (PDFs only). - - If the files are currently being prepared, a status code of `409` will be returned instead. In this case please wait for the `template_created` callback event. - operationId: templateFilesAsDataUri - parameters: - - - name: template_id - in: path - description: 'The id of the template files to retrieve.' - required: true - schema: - type: string - example: f57db65d3f933b5316d398057a36176831451a35 + summary: 'Create Template' + description: 'Creates a template that can then be used.' + operationId: templateCreate + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/TemplateCreateRequest' + examples: + default_example: + $ref: '#/components/examples/TemplateCreateRequestDefaultExample' + form_fields_per_document: + $ref: '#/components/examples/TemplateCreateRequestFormFieldsPerDocumentExample' + form_field_groups: + $ref: '#/components/examples/TemplateCreateRequestFormFieldGroupsExample' + form_field_rules: + $ref: '#/components/examples/TemplateCreateRequestFormFieldRulesExample' + multipart/form-data: + schema: + $ref: '#/components/schemas/TemplateCreateRequest' responses: '200': description: 'successful operation' @@ -6467,10 +6516,10 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/FileResponseDataUri' + $ref: '#/components/schemas/TemplateCreateResponse' examples: default_example: - $ref: '#/components/examples/TemplateFilesResponseExample' + $ref: '#/components/examples/TemplateCreateResponseExample' '4XX': description: failed_operation content: @@ -6490,10 +6539,6 @@ paths: $ref: '#/components/examples/Error404ResponseExample' 409_example: $ref: '#/components/examples/Error409ResponseExample' - 422_example: - $ref: '#/components/examples/Error422ResponseExample' - 429_example: - $ref: '#/components/examples/Error429ResponseExample' 4XX_example: $ref: '#/components/examples/Error4XXResponseExample' security: @@ -6507,72 +6552,71 @@ paths: lang: PHP label: PHP source: - $ref: examples/TemplateFilesAsDataUri.php + $ref: examples/TemplateCreate.php - lang: 'C#' label: 'C#' source: - $ref: examples/TemplateFilesAsDataUri.cs + $ref: examples/TemplateCreate.cs - lang: JavaScript label: JavaScript source: - $ref: examples/TemplateFilesAsDataUri.js + $ref: examples/TemplateCreate.js - lang: TypeScript label: TypeScript source: - $ref: examples/TemplateFilesAsDataUri.ts + $ref: examples/TemplateCreate.ts - lang: Java label: Java source: - $ref: examples/TemplateFilesAsDataUri.java + $ref: examples/TemplateCreate.java - lang: Ruby label: Ruby source: - $ref: examples/TemplateFilesAsDataUri.rb + $ref: examples/TemplateCreate.rb - lang: Python label: Python source: - $ref: examples/TemplateFilesAsDataUri.py + $ref: examples/TemplateCreate.py - lang: cURL label: cURL source: - $ref: examples/TemplateFilesAsDataUri.sh + $ref: examples/TemplateCreate.sh x-meta: seo: - title: 'Get Template Files | API Documentation | Dropbox Sign for Developers' - description: 'The RESTful Dropbox Sign API easily allows you to build custom integrations. To find out how to get a copy of the current specified documents, click here.' - '/template/files_as_file_url/{template_id}': - get: + title: 'Create Template | Dropbox Sign for Developers' + description: 'The RESTful Dropbox Sign API easily allows you to build custom eSign integrations. To find out how to create an template, click here.' + /template/create_embedded_draft: + post: tags: - Template - summary: 'Get Template Files as File Url' - description: |- - Obtain a copy of the current documents specified by the `template_id` parameter. Returns a JSON object with a url to the file (PDFs only). - - If the files are currently being prepared, a status code of `409` will be returned instead. In this case please wait for the `template_created` callback event. - operationId: templateFilesAsFileUrl - parameters: - - - name: template_id - in: path - description: 'The id of the template files to retrieve.' - required: true - schema: - type: string - example: f57db65d3f933b5316d398057a36176831451a35 - - - name: force_download - in: query - description: 'By default when opening the `file_url` a browser will download the PDF and save it locally. When set to `0` the PDF file will be displayed in the browser.' - schema: - type: integer - default: 1 + summary: 'Create Embedded Template Draft' + description: 'The first step in an embedded template workflow. Creates a draft template that can then be further set up in the template ''edit'' stage.' + operationId: templateCreateEmbeddedDraft + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/TemplateCreateEmbeddedDraftRequest' + examples: + default_example: + $ref: '#/components/examples/TemplateCreateEmbeddedDraftRequestDefaultExample' + form_fields_per_document: + $ref: '#/components/examples/TemplateCreateEmbeddedDraftRequestFormFieldsPerDocumentExample' + form_field_groups: + $ref: '#/components/examples/TemplateCreateEmbeddedDraftRequestFormFieldGroupsExample' + form_field_rules: + $ref: '#/components/examples/TemplateCreateEmbeddedDraftRequestFormFieldRulesExample' + multipart/form-data: + schema: + $ref: '#/components/schemas/TemplateCreateEmbeddedDraftRequest' responses: '200': description: 'successful operation' @@ -6586,10 +6630,10 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/FileResponse' + $ref: '#/components/schemas/TemplateCreateEmbeddedDraftResponse' examples: default_example: - $ref: '#/components/examples/TemplateFilesResponseExample' + $ref: '#/components/examples/TemplateCreateEmbeddedDraftResponseExample' '4XX': description: failed_operation content: @@ -6609,10 +6653,6 @@ paths: $ref: '#/components/examples/Error404ResponseExample' 409_example: $ref: '#/components/examples/Error409ResponseExample' - 422_example: - $ref: '#/components/examples/Error422ResponseExample' - 429_example: - $ref: '#/components/examples/Error429ResponseExample' 4XX_example: $ref: '#/components/examples/Error4XXResponseExample' security: @@ -6626,58 +6666,58 @@ paths: lang: PHP label: PHP source: - $ref: examples/TemplateFilesAsFileUrl.php + $ref: examples/TemplateCreateEmbeddedDraft.php - lang: 'C#' label: 'C#' source: - $ref: examples/TemplateFilesAsFileUrl.cs + $ref: examples/TemplateCreateEmbeddedDraft.cs - lang: JavaScript label: JavaScript source: - $ref: examples/TemplateFilesAsFileUrl.js + $ref: examples/TemplateCreateEmbeddedDraft.js - lang: TypeScript label: TypeScript source: - $ref: examples/TemplateFilesAsFileUrl.ts + $ref: examples/TemplateCreateEmbeddedDraft.ts - lang: Java label: Java source: - $ref: examples/TemplateFilesAsFileUrl.java + $ref: examples/TemplateCreateEmbeddedDraft.java - lang: Ruby label: Ruby source: - $ref: examples/TemplateFilesAsFileUrl.rb + $ref: examples/TemplateCreateEmbeddedDraft.rb - lang: Python label: Python source: - $ref: examples/TemplateFilesAsFileUrl.py + $ref: examples/TemplateCreateEmbeddedDraft.py - lang: cURL label: cURL source: - $ref: examples/TemplateFilesAsFileUrl.sh + $ref: examples/TemplateCreateEmbeddedDraft.sh x-meta: seo: - title: 'Get Template Files | API Documentation | Dropbox Sign for Developers' - description: 'The RESTful Dropbox Sign API easily allows you to build custom integrations. To find out how to get a copy of the current specified documents, click here.' - '/template/{template_id}': - get: + title: 'Create Embedded Template Draft | Dropbox Sign for Developers' + description: 'The RESTful Dropbox Sign API easily allows you to build custom eSign integrations. To find out how to create an embedded draft template, click here.' + '/template/delete/{template_id}': + post: tags: - Template - summary: 'Get Template' - description: 'Returns the Template specified by the `template_id` parameter.' - operationId: templateGet + summary: 'Delete Template' + description: 'Completely deletes the template specified from the account.' + operationId: templateDelete parameters: - name: template_id in: path - description: 'The id of the Template to retrieve.' + description: 'The id of the Template to delete.' required: true schema: type: string @@ -6693,12 +6733,7 @@ paths: X-Ratelimit-Reset: $ref: '#/components/headers/X-Ratelimit-Reset' content: - application/json: - schema: - $ref: '#/components/schemas/TemplateGetResponse' - examples: - default_example: - $ref: '#/components/examples/TemplateGetResponseExample' + application/json: {} '4XX': description: failed_operation content: @@ -6716,8 +6751,8 @@ paths: $ref: '#/components/examples/Error403ResponseExample' 404_example: $ref: '#/components/examples/Error404ResponseExample' - 429_example: - $ref: '#/components/examples/Error429ResponseExample' + 409_example: + $ref: '#/components/examples/Error409ResponseExample' 4XX_example: $ref: '#/components/examples/Error4XXResponseExample' security: @@ -6731,85 +6766,74 @@ paths: lang: PHP label: PHP source: - $ref: examples/TemplateGet.php + $ref: examples/TemplateDelete.php - lang: 'C#' label: 'C#' source: - $ref: examples/TemplateGet.cs + $ref: examples/TemplateDelete.cs - lang: JavaScript label: JavaScript source: - $ref: examples/TemplateGet.js + $ref: examples/TemplateDelete.js - lang: TypeScript label: TypeScript source: - $ref: examples/TemplateGet.ts + $ref: examples/TemplateDelete.ts - lang: Java label: Java source: - $ref: examples/TemplateGet.java + $ref: examples/TemplateDelete.java - lang: Ruby label: Ruby source: - $ref: examples/TemplateGet.rb + $ref: examples/TemplateDelete.rb - lang: Python label: Python source: - $ref: examples/TemplateGet.py + $ref: examples/TemplateDelete.py - lang: cURL label: cURL source: - $ref: examples/TemplateGet.sh + $ref: examples/TemplateDelete.sh x-meta: seo: - title: 'Get Template | API Documentation | Dropbox Sign for Developers' - description: 'The RESTful Dropbox Sign API easily allows you to build custom integrations. To find out how to return the Template specified by the `template_id` parameter, click here.' - /template/list: + title: 'Delete Template | API Documentation | Dropbox Sign for Developers' + description: 'The RESTful Dropbox Sign API easily allows you to build custom integrations. To find out how to completely delete a template from the account, click here.' + '/template/files/{template_id}': get: tags: - Template - summary: 'List Templates' + summary: 'Get Template Files' description: |- - Returns a list of the Templates that are accessible by you. + Obtain a copy of the current documents specified by the `template_id` parameter. Returns a PDF or ZIP file. - Take a look at our [search guide](/api/reference/search/) to learn more about querying templates. - operationId: templateList + If the files are currently being prepared, a status code of `409` will be returned instead. In this case please wait for the `template_created` callback event. + operationId: templateFiles parameters: - - name: account_id - in: query - description: 'Which account to return Templates for. Must be a team member. Use `all` to indicate all team members. Defaults to your account.' + name: template_id + in: path + description: 'The id of the template files to retrieve.' + required: true schema: type: string + example: f57db65d3f933b5316d398057a36176831451a35 - - name: page - in: query - description: 'Which page number of the Template List to return. Defaults to `1`.' - schema: - type: integer - default: 1 - - - name: page_size - in: query - description: 'Number of objects to be returned per page. Must be between `1` and `100`. Default is `20`.' - schema: - type: integer - default: 20 - maximum: 100 - minimum: 1 - - - name: query + name: file_type in: query - description: 'String that includes search terms and/or fields to be used to filter the Template objects.' + description: 'Set to `pdf` for a single merged document or `zip` for a collection of individual documents.' schema: type: string + enum: + - pdf + - zip responses: '200': description: 'successful operation' @@ -6821,12 +6845,14 @@ paths: X-Ratelimit-Reset: $ref: '#/components/headers/X-Ratelimit-Reset' content: - application/json: + application/pdf: schema: - $ref: '#/components/schemas/TemplateListResponse' - examples: - default_example: - $ref: '#/components/examples/TemplateListResponseExample' + type: string + format: binary + application/zip: + schema: + type: string + format: binary '4XX': description: failed_operation content: @@ -6842,8 +6868,12 @@ paths: $ref: '#/components/examples/Error402ResponseExample' 403_example: $ref: '#/components/examples/Error403ResponseExample' + 404_example: + $ref: '#/components/examples/Error404ResponseExample' 409_example: $ref: '#/components/examples/Error409ResponseExample' + 422_example: + $ref: '#/components/examples/Error422ResponseExample' 429_example: $ref: '#/components/examples/Error429ResponseExample' 4XX_example: @@ -6859,71 +6889,65 @@ paths: lang: PHP label: PHP source: - $ref: examples/TemplateList.php + $ref: examples/TemplateFiles.php - lang: 'C#' label: 'C#' source: - $ref: examples/TemplateList.cs + $ref: examples/TemplateFiles.cs - lang: JavaScript label: JavaScript source: - $ref: examples/TemplateList.js + $ref: examples/TemplateFiles.js - lang: TypeScript label: TypeScript source: - $ref: examples/TemplateList.ts + $ref: examples/TemplateFiles.ts - lang: Java label: Java source: - $ref: examples/TemplateList.java + $ref: examples/TemplateFiles.java - lang: Ruby label: Ruby source: - $ref: examples/TemplateList.rb + $ref: examples/TemplateFiles.rb - lang: Python label: Python source: - $ref: examples/TemplateList.py + $ref: examples/TemplateFiles.py - lang: cURL label: cURL source: - $ref: examples/TemplateList.sh + $ref: examples/TemplateFiles.sh x-meta: seo: - title: 'List Templates | API Documentation | Dropbox Sign for Developers' - description: 'The Dropbox Sign API easily allows you to build custom integrations. To find out how to return a list of the Templates that can be accessed by you, click here.' - '/template/remove_user/{template_id}': - post: + title: 'Get Template Files | API Documentation | Dropbox Sign for Developers' + description: 'The RESTful Dropbox Sign API easily allows you to build custom integrations. To find out how to get a copy of the current specified documents, click here.' + '/template/files_as_data_uri/{template_id}': + get: tags: - Template - summary: 'Remove User from Template' - description: 'Removes the specified Account''s access to the specified Template.' - operationId: templateRemoveUser + summary: 'Get Template Files as Data Uri' + description: |- + Obtain a copy of the current documents specified by the `template_id` parameter. Returns a JSON object with a `data_uri` representing the base64 encoded file (PDFs only). + + If the files are currently being prepared, a status code of `409` will be returned instead. In this case please wait for the `template_created` callback event. + operationId: templateFilesAsDataUri parameters: - name: template_id in: path - description: 'The id of the Template to remove the Account''s access to.' + description: 'The id of the template files to retrieve.' required: true schema: type: string example: f57db65d3f933b5316d398057a36176831451a35 - requestBody: - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/TemplateRemoveUserRequest' - examples: - default_example: - $ref: '#/components/examples/TemplateRemoveUserRequestDefaultExample' responses: '200': description: 'successful operation' @@ -6937,10 +6961,10 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/TemplateGetResponse' + $ref: '#/components/schemas/FileResponseDataUri' examples: default_example: - $ref: '#/components/examples/TemplateRemoveUserResponseExample' + $ref: '#/components/examples/TemplateFilesResponseExample' '4XX': description: failed_operation content: @@ -6958,6 +6982,12 @@ paths: $ref: '#/components/examples/Error403ResponseExample' 404_example: $ref: '#/components/examples/Error404ResponseExample' + 409_example: + $ref: '#/components/examples/Error409ResponseExample' + 422_example: + $ref: '#/components/examples/Error422ResponseExample' + 429_example: + $ref: '#/components/examples/Error429ResponseExample' 4XX_example: $ref: '#/components/examples/Error4XXResponseExample' security: @@ -6971,86 +7001,72 @@ paths: lang: PHP label: PHP source: - $ref: examples/TemplateRemoveUser.php + $ref: examples/TemplateFilesAsDataUri.php - lang: 'C#' label: 'C#' source: - $ref: examples/TemplateRemoveUser.cs + $ref: examples/TemplateFilesAsDataUri.cs - lang: JavaScript label: JavaScript source: - $ref: examples/TemplateRemoveUser.js + $ref: examples/TemplateFilesAsDataUri.js - lang: TypeScript label: TypeScript source: - $ref: examples/TemplateRemoveUser.ts + $ref: examples/TemplateFilesAsDataUri.ts - lang: Java label: Java source: - $ref: examples/TemplateRemoveUser.java + $ref: examples/TemplateFilesAsDataUri.java - lang: Ruby label: Ruby source: - $ref: examples/TemplateRemoveUser.rb + $ref: examples/TemplateFilesAsDataUri.rb - lang: Python label: Python source: - $ref: examples/TemplateRemoveUser.py + $ref: examples/TemplateFilesAsDataUri.py - lang: cURL label: cURL source: - $ref: examples/TemplateRemoveUser.sh + $ref: examples/TemplateFilesAsDataUri.sh x-meta: seo: - title: 'Remove User from Template | REST API | Dropbox Sign for Developers' - description: 'The Dropbox Sign API easily allows you to build custom integrations. To find out how to remove a specified Account''s access to a Template, click here.' - '/template/update_files/{template_id}': - post: + title: 'Get Template Files | API Documentation | Dropbox Sign for Developers' + description: 'The RESTful Dropbox Sign API easily allows you to build custom integrations. To find out how to get a copy of the current specified documents, click here.' + '/template/files_as_file_url/{template_id}': + get: tags: - Template - summary: 'Update Template Files' + summary: 'Get Template Files as File Url' description: |- - Overlays a new file with the overlay of an existing template. The new file(s) must: - - 1. have the same or higher page count - 2. the same orientation as the file(s) being replaced. - - This will not overwrite or in any way affect the existing template. Both the existing template and new template will be available for use after executing this endpoint. Also note that this will decrement your template quota. - - Overlaying new files is asynchronous and a successful call to this endpoint will return 200 OK response if the request passes initial validation checks. - - It is recommended that a callback be implemented to listen for the callback event. A `template_created` event will be sent when the files are updated or a `template_error` event will be sent if there was a problem while updating the files. If a callback handler has been configured and the event has not been received within 60 minutes of making the call, check the status of the request in the API dashboard and retry the request if necessary. + Obtain a copy of the current documents specified by the `template_id` parameter. Returns a JSON object with a url to the file (PDFs only). - If the page orientation or page count is different from the original template document, we will notify you with a `template_error` [callback event](https://app.hellosign.com/api/eventsAndCallbacksWalkthrough). - operationId: templateUpdateFiles + If the files are currently being prepared, a status code of `409` will be returned instead. In this case please wait for the `template_created` callback event. + operationId: templateFilesAsFileUrl parameters: - name: template_id in: path - description: 'The ID of the template whose files to update.' + description: 'The id of the template files to retrieve.' required: true schema: type: string example: f57db65d3f933b5316d398057a36176831451a35 - requestBody: - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/TemplateUpdateFilesRequest' - examples: - default_example: - $ref: '#/components/examples/TemplateUpdateFilesRequestDefaultExample' - multipart/form-data: - schema: - $ref: '#/components/schemas/TemplateUpdateFilesRequest' + - + name: force_download + in: query + description: 'By default when opening the `file_url` a browser will download the PDF and save it locally. When set to `0` the PDF file will be displayed in the browser.' + schema: + type: integer + default: 1 responses: '200': description: 'successful operation' @@ -7064,10 +7080,10 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/TemplateUpdateFilesResponse' + $ref: '#/components/schemas/FileResponse' examples: default_example: - $ref: '#/components/examples/TemplateUpdateFilesResponseExample' + $ref: '#/components/examples/TemplateFilesResponseExample' '4XX': description: failed_operation content: @@ -7087,6 +7103,8 @@ paths: $ref: '#/components/examples/Error404ResponseExample' 409_example: $ref: '#/components/examples/Error409ResponseExample' + 422_example: + $ref: '#/components/examples/Error422ResponseExample' 429_example: $ref: '#/components/examples/Error429ResponseExample' 4XX_example: @@ -7102,71 +7120,62 @@ paths: lang: PHP label: PHP source: - $ref: examples/TemplateUpdateFiles.php + $ref: examples/TemplateFilesAsFileUrl.php - lang: 'C#' label: 'C#' source: - $ref: examples/TemplateUpdateFiles.cs + $ref: examples/TemplateFilesAsFileUrl.cs - lang: JavaScript label: JavaScript source: - $ref: examples/TemplateUpdateFiles.js + $ref: examples/TemplateFilesAsFileUrl.js - lang: TypeScript label: TypeScript source: - $ref: examples/TemplateUpdateFiles.ts + $ref: examples/TemplateFilesAsFileUrl.ts - lang: Java label: Java source: - $ref: examples/TemplateUpdateFiles.java + $ref: examples/TemplateFilesAsFileUrl.java - lang: Ruby label: Ruby source: - $ref: examples/TemplateUpdateFiles.rb + $ref: examples/TemplateFilesAsFileUrl.rb - lang: Python label: Python source: - $ref: examples/TemplateUpdateFiles.py + $ref: examples/TemplateFilesAsFileUrl.py - lang: cURL label: cURL source: - $ref: examples/TemplateUpdateFiles.sh + $ref: examples/TemplateFilesAsFileUrl.sh x-meta: seo: - title: 'Update Template Files | REST API | Dropbox Sign for Developers' - description: 'Overlays a new file with the overlay of an existing template' - /unclaimed_draft/create: - post: + title: 'Get Template Files | API Documentation | Dropbox Sign for Developers' + description: 'The RESTful Dropbox Sign API easily allows you to build custom integrations. To find out how to get a copy of the current specified documents, click here.' + '/template/{template_id}': + get: tags: - - 'Unclaimed Draft' - summary: 'Create Unclaimed Draft' - description: 'Creates a new Draft that can be claimed using the claim URL. The first authenticated user to access the URL will claim the Draft and will be shown either the "Sign and send" or the "Request signature" page with the Draft loaded. Subsequent access to the claim URL will result in a 404.' - operationId: unclaimedDraftCreate - requestBody: - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/UnclaimedDraftCreateRequest' - examples: - default_example: - $ref: '#/components/examples/UnclaimedDraftCreateRequestDefaultExample' - form_fields_per_document: - $ref: '#/components/examples/UnclaimedDraftCreateRequestFormFieldsPerDocumentExample' - form_field_groups: - $ref: '#/components/examples/UnclaimedDraftCreateRequestFormFieldGroupsExample' - form_field_rules: - $ref: '#/components/examples/UnclaimedDraftCreateRequestFormFieldRulesExample' - multipart/form-data: - schema: - $ref: '#/components/schemas/UnclaimedDraftCreateRequest' + - Template + summary: 'Get Template' + description: 'Returns the Template specified by the `template_id` parameter.' + operationId: templateGet + parameters: + - + name: template_id + in: path + description: 'The id of the Template to retrieve.' + required: true + schema: + type: string + example: f57db65d3f933b5316d398057a36176831451a35 responses: '200': description: 'successful operation' @@ -7180,10 +7189,10 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/UnclaimedDraftCreateResponse' + $ref: '#/components/schemas/TemplateGetResponse' examples: default_example: - $ref: '#/components/examples/UnclaimedDraftCreateResponseExample' + $ref: '#/components/examples/TemplateGetResponseExample' '4XX': description: failed_operation content: @@ -7199,6 +7208,10 @@ paths: $ref: '#/components/examples/Error402ResponseExample' 403_example: $ref: '#/components/examples/Error403ResponseExample' + 404_example: + $ref: '#/components/examples/Error404ResponseExample' + 429_example: + $ref: '#/components/examples/Error429ResponseExample' 4XX_example: $ref: '#/components/examples/Error4XXResponseExample' security: @@ -7206,80 +7219,91 @@ paths: api_key: [] - oauth2: - - signature_request_access + - template_access x-codeSamples: - lang: PHP label: PHP source: - $ref: examples/UnclaimedDraftCreate.php + $ref: examples/TemplateGet.php - lang: 'C#' label: 'C#' source: - $ref: examples/UnclaimedDraftCreate.cs + $ref: examples/TemplateGet.cs - lang: JavaScript label: JavaScript source: - $ref: examples/UnclaimedDraftCreate.js + $ref: examples/TemplateGet.js - lang: TypeScript label: TypeScript source: - $ref: examples/UnclaimedDraftCreate.ts + $ref: examples/TemplateGet.ts - lang: Java label: Java source: - $ref: examples/UnclaimedDraftCreate.java + $ref: examples/TemplateGet.java - lang: Ruby label: Ruby source: - $ref: examples/UnclaimedDraftCreate.rb + $ref: examples/TemplateGet.rb - lang: Python label: Python source: - $ref: examples/UnclaimedDraftCreate.py + $ref: examples/TemplateGet.py - lang: cURL label: cURL source: - $ref: examples/UnclaimedDraftCreate.sh + $ref: examples/TemplateGet.sh x-meta: seo: - title: 'Create Unclaimed Draft | REST API | Dropbox Sign for Developers' - description: 'The Dropbox Sign API allows you to build eSign integrations. To find out how to create a new Signature Request Draft that can be claimed using the claim URL, click here.' - /unclaimed_draft/create_embedded: - post: + title: 'Get Template | API Documentation | Dropbox Sign for Developers' + description: 'The RESTful Dropbox Sign API easily allows you to build custom integrations. To find out how to return the Template specified by the `template_id` parameter, click here.' + /template/list: + get: tags: - - 'Unclaimed Draft' - summary: 'Create Embedded Unclaimed Draft' + - Template + summary: 'List Templates' description: |- - Creates a new Draft that can be claimed and used in an embedded iFrame. The first authenticated user to access the URL will claim the Draft and will be shown the "Request signature" page with the Draft loaded. Subsequent access to the claim URL will result in a `404`. For this embedded endpoint the `requester_email_address` parameter is required. + Returns a list of the Templates that are accessible by you. - **NOTE:** Embedded unclaimed drafts can only be accessed in embedded iFrames whereas normal drafts can be used and accessed on Dropbox Sign. - operationId: unclaimedDraftCreateEmbedded - requestBody: - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/UnclaimedDraftCreateEmbeddedRequest' - examples: - default_example: - $ref: '#/components/examples/UnclaimedDraftCreateEmbeddedRequestDefaultExample' - form_fields_per_document: - $ref: '#/components/examples/UnclaimedDraftCreateEmbeddedRequestFormFieldsPerDocumentExample' - form_field_groups: - $ref: '#/components/examples/UnclaimedDraftCreateEmbeddedRequestFormFieldGroupsExample' - form_field_rules: - $ref: '#/components/examples/UnclaimedDraftCreateEmbeddedRequestFormFieldRulesExample' - multipart/form-data: - schema: - $ref: '#/components/schemas/UnclaimedDraftCreateEmbeddedRequest' + Take a look at our [search guide](/api/reference/search/) to learn more about querying templates. + operationId: templateList + parameters: + - + name: account_id + in: query + description: 'Which account to return Templates for. Must be a team member. Use `all` to indicate all team members. Defaults to your account.' + schema: + type: string + - + name: page + in: query + description: 'Which page number of the Template List to return. Defaults to `1`.' + schema: + type: integer + default: 1 + - + name: page_size + in: query + description: 'Number of objects to be returned per page. Must be between `1` and `100`. Default is `20`.' + schema: + type: integer + default: 20 + maximum: 100 + minimum: 1 + - + name: query + in: query + description: 'String that includes search terms and/or fields to be used to filter the Template objects.' + schema: + type: string responses: '200': description: 'successful operation' @@ -7293,10 +7317,10 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/UnclaimedDraftCreateResponse' + $ref: '#/components/schemas/TemplateListResponse' examples: default_example: - $ref: '#/components/examples/UnclaimedDraftCreateEmbeddedResponseExample' + $ref: '#/components/examples/TemplateListResponseExample' '4XX': description: failed_operation content: @@ -7312,10 +7336,10 @@ paths: $ref: '#/components/examples/Error402ResponseExample' 403_example: $ref: '#/components/examples/Error403ResponseExample' - 404_example: - $ref: '#/components/examples/Error404ResponseExample' 409_example: $ref: '#/components/examples/Error409ResponseExample' + 429_example: + $ref: '#/components/examples/Error429ResponseExample' 4XX_example: $ref: '#/components/examples/Error4XXResponseExample' security: @@ -7323,75 +7347,77 @@ paths: api_key: [] - oauth2: - - request_signature - - signature_request_access + - template_access x-codeSamples: - lang: PHP label: PHP source: - $ref: examples/UnclaimedDraftCreateEmbedded.php + $ref: examples/TemplateList.php - lang: 'C#' label: 'C#' source: - $ref: examples/UnclaimedDraftCreateEmbedded.cs + $ref: examples/TemplateList.cs - lang: JavaScript label: JavaScript source: - $ref: examples/UnclaimedDraftCreateEmbedded.js + $ref: examples/TemplateList.js - lang: TypeScript label: TypeScript source: - $ref: examples/UnclaimedDraftCreateEmbedded.ts + $ref: examples/TemplateList.ts - lang: Java label: Java source: - $ref: examples/UnclaimedDraftCreateEmbedded.java + $ref: examples/TemplateList.java - lang: Ruby label: Ruby source: - $ref: examples/UnclaimedDraftCreateEmbedded.rb + $ref: examples/TemplateList.rb - lang: Python label: Python source: - $ref: examples/UnclaimedDraftCreateEmbedded.py + $ref: examples/TemplateList.py - lang: cURL label: cURL source: - $ref: examples/UnclaimedDraftCreateEmbedded.sh + $ref: examples/TemplateList.sh x-meta: seo: - title: 'Create Embedded Unclaimed Draft | Dropbox Sign for Developers' - description: 'The Dropbox Sign API allows you to build custom integrations. To find out how to create and embed a the creation of a Signature Request in an iFrame, click here.' - /unclaimed_draft/create_embedded_with_template: + title: 'List Templates | API Documentation | Dropbox Sign for Developers' + description: 'The Dropbox Sign API easily allows you to build custom integrations. To find out how to return a list of the Templates that can be accessed by you, click here.' + '/template/remove_user/{template_id}': post: tags: - - 'Unclaimed Draft' - summary: 'Create Embedded Unclaimed Draft with Template' - description: |- - Creates a new Draft with a previously saved template(s) that can be claimed and used in an embedded iFrame. The first authenticated user to access the URL will claim the Draft and will be shown the "Request signature" page with the Draft loaded. Subsequent access to the claim URL will result in a `404`. For this embedded endpoint the `requester_email_address` parameter is required. - - **NOTE:** Embedded unclaimed drafts can only be accessed in embedded iFrames whereas normal drafts can be used and accessed on Dropbox Sign. - operationId: unclaimedDraftCreateEmbeddedWithTemplate + - Template + summary: 'Remove User from Template' + description: 'Removes the specified Account''s access to the specified Template.' + operationId: templateRemoveUser + parameters: + - + name: template_id + in: path + description: 'The id of the Template to remove the Account''s access to.' + required: true + schema: + type: string + example: f57db65d3f933b5316d398057a36176831451a35 requestBody: required: true content: application/json: schema: - $ref: '#/components/schemas/UnclaimedDraftCreateEmbeddedWithTemplateRequest' + $ref: '#/components/schemas/TemplateRemoveUserRequest' examples: default_example: - $ref: '#/components/examples/UnclaimedDraftCreateEmbeddedWithTemplateRequestDefaultExample' - multipart/form-data: - schema: - $ref: '#/components/schemas/UnclaimedDraftCreateEmbeddedWithTemplateRequest' + $ref: '#/components/examples/TemplateRemoveUserRequestDefaultExample' responses: '200': description: 'successful operation' @@ -7405,10 +7431,10 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/UnclaimedDraftCreateResponse' + $ref: '#/components/schemas/TemplateGetResponse' examples: default_example: - $ref: '#/components/examples/UnclaimedDraftCreateEmbeddedWithTemplateResponseExample' + $ref: '#/components/examples/TemplateRemoveUserResponseExample' '4XX': description: failed_operation content: @@ -7426,10 +7452,6 @@ paths: $ref: '#/components/examples/Error403ResponseExample' 404_example: $ref: '#/components/examples/Error404ResponseExample' - 409_example: - $ref: '#/components/examples/Error409ResponseExample' - 429_example: - $ref: '#/components/examples/Error429ResponseExample' 4XX_example: $ref: '#/components/examples/Error4XXResponseExample' security: @@ -7437,80 +7459,92 @@ paths: api_key: [] - oauth2: - - signature_request_access + - template_access x-codeSamples: - lang: PHP label: PHP source: - $ref: examples/UnclaimedDraftCreateEmbeddedWithTemplate.php + $ref: examples/TemplateRemoveUser.php - lang: 'C#' label: 'C#' source: - $ref: examples/UnclaimedDraftCreateEmbeddedWithTemplate.cs + $ref: examples/TemplateRemoveUser.cs - lang: JavaScript label: JavaScript source: - $ref: examples/UnclaimedDraftCreateEmbeddedWithTemplate.js + $ref: examples/TemplateRemoveUser.js - lang: TypeScript label: TypeScript source: - $ref: examples/UnclaimedDraftCreateEmbeddedWithTemplate.ts + $ref: examples/TemplateRemoveUser.ts - lang: Java label: Java source: - $ref: examples/UnclaimedDraftCreateEmbeddedWithTemplate.java + $ref: examples/TemplateRemoveUser.java - lang: Ruby label: Ruby source: - $ref: examples/UnclaimedDraftCreateEmbeddedWithTemplate.rb + $ref: examples/TemplateRemoveUser.rb - lang: Python label: Python source: - $ref: examples/UnclaimedDraftCreateEmbeddedWithTemplate.py + $ref: examples/TemplateRemoveUser.py - lang: cURL label: cURL source: - $ref: examples/UnclaimedDraftCreateEmbeddedWithTemplate.sh + $ref: examples/TemplateRemoveUser.sh x-meta: seo: - title: 'Embed Unclaimed Draft with Template | Dropbox Sign for Developers' - description: 'The Dropbox Sign API easily allows you to build custom integrations. To find out how to create a new Draft with a previously saved template, click here.' - '/unclaimed_draft/edit_and_resend/{signature_request_id}': + title: 'Remove User from Template | REST API | Dropbox Sign for Developers' + description: 'The Dropbox Sign API easily allows you to build custom integrations. To find out how to remove a specified Account''s access to a Template, click here.' + '/template/update_files/{template_id}': post: tags: - - 'Unclaimed Draft' - summary: 'Edit and Resend Unclaimed Draft' + - Template + summary: 'Update Template Files' description: |- - Creates a new signature request from an embedded request that can be edited prior to being sent to the recipients. Parameter `test_mode` can be edited prior to request. Signers can be edited in embedded editor. Requester's email address will remain unchanged if `requester_email_address` parameter is not set. + Overlays a new file with the overlay of an existing template. The new file(s) must: - **NOTE:** Embedded unclaimed drafts can only be accessed in embedded iFrames whereas normal drafts can be used and accessed on Dropbox Sign. - operationId: unclaimedDraftEditAndResend + 1. have the same or higher page count + 2. the same orientation as the file(s) being replaced. + + This will not overwrite or in any way affect the existing template. Both the existing template and new template will be available for use after executing this endpoint. Also note that this will decrement your template quota. + + Overlaying new files is asynchronous and a successful call to this endpoint will return 200 OK response if the request passes initial validation checks. + + It is recommended that a callback be implemented to listen for the callback event. A `template_created` event will be sent when the files are updated or a `template_error` event will be sent if there was a problem while updating the files. If a callback handler has been configured and the event has not been received within 60 minutes of making the call, check the status of the request in the API dashboard and retry the request if necessary. + + If the page orientation or page count is different from the original template document, we will notify you with a `template_error` [callback event](https://app.hellosign.com/api/eventsAndCallbacksWalkthrough). + operationId: templateUpdateFiles parameters: - - name: signature_request_id + name: template_id in: path - description: 'The ID of the signature request to edit and resend.' + description: 'The ID of the template whose files to update.' required: true schema: type: string - example: fa5c8a0b0f492d768749333ad6fcc214c111e967 + example: f57db65d3f933b5316d398057a36176831451a35 requestBody: required: true content: application/json: schema: - $ref: '#/components/schemas/UnclaimedDraftEditAndResendRequest' + $ref: '#/components/schemas/TemplateUpdateFilesRequest' examples: default_example: - $ref: '#/components/examples/UnclaimedDraftEditAndResendRequestDefaultExample' + $ref: '#/components/examples/TemplateUpdateFilesRequestDefaultExample' + multipart/form-data: + schema: + $ref: '#/components/schemas/TemplateUpdateFilesRequest' responses: '200': description: 'successful operation' @@ -7524,10 +7558,10 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/UnclaimedDraftCreateResponse' + $ref: '#/components/schemas/TemplateUpdateFilesResponse' examples: default_example: - $ref: '#/components/examples/UnclaimedDraftEditAndResendExample' + $ref: '#/components/examples/TemplateUpdateFilesResponseExample' '4XX': description: failed_operation content: @@ -7547,8 +7581,118 @@ paths: $ref: '#/components/examples/Error404ResponseExample' 409_example: $ref: '#/components/examples/Error409ResponseExample' - 410_example: - $ref: '#/components/examples/Error410ResponseExample' + 429_example: + $ref: '#/components/examples/Error429ResponseExample' + 4XX_example: + $ref: '#/components/examples/Error4XXResponseExample' + security: + - + api_key: [] + - + oauth2: + - template_access + x-codeSamples: + - + lang: PHP + label: PHP + source: + $ref: examples/TemplateUpdateFiles.php + - + lang: 'C#' + label: 'C#' + source: + $ref: examples/TemplateUpdateFiles.cs + - + lang: JavaScript + label: JavaScript + source: + $ref: examples/TemplateUpdateFiles.js + - + lang: TypeScript + label: TypeScript + source: + $ref: examples/TemplateUpdateFiles.ts + - + lang: Java + label: Java + source: + $ref: examples/TemplateUpdateFiles.java + - + lang: Ruby + label: Ruby + source: + $ref: examples/TemplateUpdateFiles.rb + - + lang: Python + label: Python + source: + $ref: examples/TemplateUpdateFiles.py + - + lang: cURL + label: cURL + source: + $ref: examples/TemplateUpdateFiles.sh + x-meta: + seo: + title: 'Update Template Files | REST API | Dropbox Sign for Developers' + description: 'Overlays a new file with the overlay of an existing template' + /unclaimed_draft/create: + post: + tags: + - 'Unclaimed Draft' + summary: 'Create Unclaimed Draft' + description: 'Creates a new Draft that can be claimed using the claim URL. The first authenticated user to access the URL will claim the Draft and will be shown either the "Sign and send" or the "Request signature" page with the Draft loaded. Subsequent access to the claim URL will result in a 404.' + operationId: unclaimedDraftCreate + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/UnclaimedDraftCreateRequest' + examples: + default_example: + $ref: '#/components/examples/UnclaimedDraftCreateRequestDefaultExample' + form_fields_per_document: + $ref: '#/components/examples/UnclaimedDraftCreateRequestFormFieldsPerDocumentExample' + form_field_groups: + $ref: '#/components/examples/UnclaimedDraftCreateRequestFormFieldGroupsExample' + form_field_rules: + $ref: '#/components/examples/UnclaimedDraftCreateRequestFormFieldRulesExample' + multipart/form-data: + schema: + $ref: '#/components/schemas/UnclaimedDraftCreateRequest' + 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/UnclaimedDraftCreateResponse' + examples: + default_example: + $ref: '#/components/examples/UnclaimedDraftCreateResponseExample' + '4XX': + description: failed_operation + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + 400_example: + $ref: '#/components/examples/Error400ResponseExample' + 401_example: + $ref: '#/components/examples/Error401ResponseExample' + 402_example: + $ref: '#/components/examples/Error402ResponseExample' + 403_example: + $ref: '#/components/examples/Error403ResponseExample' 4XX_example: $ref: '#/components/examples/Error4XXResponseExample' security: @@ -7556,97 +7700,447 @@ paths: api_key: [] - oauth2: - - request_signature - signature_request_access x-codeSamples: - lang: PHP label: PHP source: - $ref: examples/UnclaimedDraftEditAndResend.php + $ref: examples/UnclaimedDraftCreate.php - lang: 'C#' label: 'C#' source: - $ref: examples/UnclaimedDraftEditAndResend.cs + $ref: examples/UnclaimedDraftCreate.cs - lang: JavaScript label: JavaScript source: - $ref: examples/UnclaimedDraftEditAndResend.js + $ref: examples/UnclaimedDraftCreate.js - lang: TypeScript label: TypeScript source: - $ref: examples/UnclaimedDraftEditAndResend.ts + $ref: examples/UnclaimedDraftCreate.ts - lang: Java label: Java source: - $ref: examples/UnclaimedDraftEditAndResend.java + $ref: examples/UnclaimedDraftCreate.java - lang: Ruby label: Ruby source: - $ref: examples/UnclaimedDraftEditAndResend.rb + $ref: examples/UnclaimedDraftCreate.rb - lang: Python label: Python source: - $ref: examples/UnclaimedDraftEditAndResend.py + $ref: examples/UnclaimedDraftCreate.py - lang: cURL label: cURL source: - $ref: examples/UnclaimedDraftEditAndResend.sh + $ref: examples/UnclaimedDraftCreate.sh x-meta: seo: - title: 'Edit and Resend Unclaimed Draft | Dropbox Sign for Developers' - description: 'The Dropbox Sign API easily allows you to build custom integrations. To find out how to create a new signature request from an embedded request, click here.' -components: - schemas: - AccountCreateRequest: - required: - - email_address - properties: - client_id: - description: |- - Used when creating a new account with OAuth authorization. - - See [OAuth 2.0 Authorization](https://app.hellosign.com/api/oauthWalkthrough#OAuthAuthorization) - type: string - client_secret: - description: |- - Used when creating a new account with OAuth authorization. + title: 'Create Unclaimed Draft | REST API | Dropbox Sign for Developers' + description: 'The Dropbox Sign API allows you to build eSign integrations. To find out how to create a new Signature Request Draft that can be claimed using the claim URL, click here.' + /unclaimed_draft/create_embedded: + post: + tags: + - 'Unclaimed Draft' + summary: 'Create Embedded Unclaimed Draft' + description: |- + Creates a new Draft that can be claimed and used in an embedded iFrame. The first authenticated user to access the URL will claim the Draft and will be shown the "Request signature" page with the Draft loaded. Subsequent access to the claim URL will result in a `404`. For this embedded endpoint the `requester_email_address` parameter is required. - See [OAuth 2.0 Authorization](https://app.hellosign.com/api/oauthWalkthrough#OAuthAuthorization) - type: string - email_address: - description: 'The email address which will be associated with the new Account.' - type: string - format: email - locale: - description: 'The locale used in this Account. Check out the list of [supported locales](/api/reference/constants/#supported-locales) to learn more about the possible values.' - type: string - type: object - AccountUpdateRequest: - properties: - account_id: - description: 'The ID of the Account' - type: string - nullable: true - callback_url: - description: 'The URL that Dropbox Sign should POST events to.' - type: string - locale: - description: 'The locale used in this Account. Check out the list of [supported locales](/api/reference/constants/#supported-locales) to learn more about the possible values.' - type: string - type: object - AccountVerifyRequest: - required: - - email_address - properties: - email_address: + **NOTE:** Embedded unclaimed drafts can only be accessed in embedded iFrames whereas normal drafts can be used and accessed on Dropbox Sign. + operationId: unclaimedDraftCreateEmbedded + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/UnclaimedDraftCreateEmbeddedRequest' + examples: + default_example: + $ref: '#/components/examples/UnclaimedDraftCreateEmbeddedRequestDefaultExample' + form_fields_per_document: + $ref: '#/components/examples/UnclaimedDraftCreateEmbeddedRequestFormFieldsPerDocumentExample' + form_field_groups: + $ref: '#/components/examples/UnclaimedDraftCreateEmbeddedRequestFormFieldGroupsExample' + form_field_rules: + $ref: '#/components/examples/UnclaimedDraftCreateEmbeddedRequestFormFieldRulesExample' + multipart/form-data: + schema: + $ref: '#/components/schemas/UnclaimedDraftCreateEmbeddedRequest' + 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/UnclaimedDraftCreateResponse' + examples: + default_example: + $ref: '#/components/examples/UnclaimedDraftCreateEmbeddedResponseExample' + '4XX': + description: failed_operation + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + 400_example: + $ref: '#/components/examples/Error400ResponseExample' + 401_example: + $ref: '#/components/examples/Error401ResponseExample' + 402_example: + $ref: '#/components/examples/Error402ResponseExample' + 403_example: + $ref: '#/components/examples/Error403ResponseExample' + 404_example: + $ref: '#/components/examples/Error404ResponseExample' + 409_example: + $ref: '#/components/examples/Error409ResponseExample' + 4XX_example: + $ref: '#/components/examples/Error4XXResponseExample' + security: + - + api_key: [] + - + oauth2: + - request_signature + - signature_request_access + x-codeSamples: + - + lang: PHP + label: PHP + source: + $ref: examples/UnclaimedDraftCreateEmbedded.php + - + lang: 'C#' + label: 'C#' + source: + $ref: examples/UnclaimedDraftCreateEmbedded.cs + - + lang: JavaScript + label: JavaScript + source: + $ref: examples/UnclaimedDraftCreateEmbedded.js + - + lang: TypeScript + label: TypeScript + source: + $ref: examples/UnclaimedDraftCreateEmbedded.ts + - + lang: Java + label: Java + source: + $ref: examples/UnclaimedDraftCreateEmbedded.java + - + lang: Ruby + label: Ruby + source: + $ref: examples/UnclaimedDraftCreateEmbedded.rb + - + lang: Python + label: Python + source: + $ref: examples/UnclaimedDraftCreateEmbedded.py + - + lang: cURL + label: cURL + source: + $ref: examples/UnclaimedDraftCreateEmbedded.sh + x-meta: + seo: + title: 'Create Embedded Unclaimed Draft | Dropbox Sign for Developers' + description: 'The Dropbox Sign API allows you to build custom integrations. To find out how to create and embed a the creation of a Signature Request in an iFrame, click here.' + /unclaimed_draft/create_embedded_with_template: + post: + tags: + - 'Unclaimed Draft' + summary: 'Create Embedded Unclaimed Draft with Template' + description: |- + Creates a new Draft with a previously saved template(s) that can be claimed and used in an embedded iFrame. The first authenticated user to access the URL will claim the Draft and will be shown the "Request signature" page with the Draft loaded. Subsequent access to the claim URL will result in a `404`. For this embedded endpoint the `requester_email_address` parameter is required. + + **NOTE:** Embedded unclaimed drafts can only be accessed in embedded iFrames whereas normal drafts can be used and accessed on Dropbox Sign. + operationId: unclaimedDraftCreateEmbeddedWithTemplate + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/UnclaimedDraftCreateEmbeddedWithTemplateRequest' + examples: + default_example: + $ref: '#/components/examples/UnclaimedDraftCreateEmbeddedWithTemplateRequestDefaultExample' + multipart/form-data: + schema: + $ref: '#/components/schemas/UnclaimedDraftCreateEmbeddedWithTemplateRequest' + 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/UnclaimedDraftCreateResponse' + examples: + default_example: + $ref: '#/components/examples/UnclaimedDraftCreateEmbeddedWithTemplateResponseExample' + '4XX': + description: failed_operation + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + 400_example: + $ref: '#/components/examples/Error400ResponseExample' + 401_example: + $ref: '#/components/examples/Error401ResponseExample' + 402_example: + $ref: '#/components/examples/Error402ResponseExample' + 403_example: + $ref: '#/components/examples/Error403ResponseExample' + 404_example: + $ref: '#/components/examples/Error404ResponseExample' + 409_example: + $ref: '#/components/examples/Error409ResponseExample' + 429_example: + $ref: '#/components/examples/Error429ResponseExample' + 4XX_example: + $ref: '#/components/examples/Error4XXResponseExample' + security: + - + api_key: [] + - + oauth2: + - signature_request_access + x-codeSamples: + - + lang: PHP + label: PHP + source: + $ref: examples/UnclaimedDraftCreateEmbeddedWithTemplate.php + - + lang: 'C#' + label: 'C#' + source: + $ref: examples/UnclaimedDraftCreateEmbeddedWithTemplate.cs + - + lang: JavaScript + label: JavaScript + source: + $ref: examples/UnclaimedDraftCreateEmbeddedWithTemplate.js + - + lang: TypeScript + label: TypeScript + source: + $ref: examples/UnclaimedDraftCreateEmbeddedWithTemplate.ts + - + lang: Java + label: Java + source: + $ref: examples/UnclaimedDraftCreateEmbeddedWithTemplate.java + - + lang: Ruby + label: Ruby + source: + $ref: examples/UnclaimedDraftCreateEmbeddedWithTemplate.rb + - + lang: Python + label: Python + source: + $ref: examples/UnclaimedDraftCreateEmbeddedWithTemplate.py + - + lang: cURL + label: cURL + source: + $ref: examples/UnclaimedDraftCreateEmbeddedWithTemplate.sh + x-meta: + seo: + title: 'Embed Unclaimed Draft with Template | Dropbox Sign for Developers' + description: 'The Dropbox Sign API easily allows you to build custom integrations. To find out how to create a new Draft with a previously saved template, click here.' + '/unclaimed_draft/edit_and_resend/{signature_request_id}': + post: + tags: + - 'Unclaimed Draft' + summary: 'Edit and Resend Unclaimed Draft' + description: |- + Creates a new signature request from an embedded request that can be edited prior to being sent to the recipients. Parameter `test_mode` can be edited prior to request. Signers can be edited in embedded editor. Requester's email address will remain unchanged if `requester_email_address` parameter is not set. + + **NOTE:** Embedded unclaimed drafts can only be accessed in embedded iFrames whereas normal drafts can be used and accessed on Dropbox Sign. + operationId: unclaimedDraftEditAndResend + parameters: + - + name: signature_request_id + in: path + description: 'The ID of the signature request to edit and resend.' + required: true + schema: + type: string + example: fa5c8a0b0f492d768749333ad6fcc214c111e967 + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/UnclaimedDraftEditAndResendRequest' + examples: + default_example: + $ref: '#/components/examples/UnclaimedDraftEditAndResendRequestDefaultExample' + 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/UnclaimedDraftCreateResponse' + examples: + default_example: + $ref: '#/components/examples/UnclaimedDraftEditAndResendExample' + '4XX': + description: failed_operation + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + 400_example: + $ref: '#/components/examples/Error400ResponseExample' + 401_example: + $ref: '#/components/examples/Error401ResponseExample' + 402_example: + $ref: '#/components/examples/Error402ResponseExample' + 403_example: + $ref: '#/components/examples/Error403ResponseExample' + 404_example: + $ref: '#/components/examples/Error404ResponseExample' + 409_example: + $ref: '#/components/examples/Error409ResponseExample' + 410_example: + $ref: '#/components/examples/Error410ResponseExample' + 4XX_example: + $ref: '#/components/examples/Error4XXResponseExample' + security: + - + api_key: [] + - + oauth2: + - request_signature + - signature_request_access + x-codeSamples: + - + lang: PHP + label: PHP + source: + $ref: examples/UnclaimedDraftEditAndResend.php + - + lang: 'C#' + label: 'C#' + source: + $ref: examples/UnclaimedDraftEditAndResend.cs + - + lang: JavaScript + label: JavaScript + source: + $ref: examples/UnclaimedDraftEditAndResend.js + - + lang: TypeScript + label: TypeScript + source: + $ref: examples/UnclaimedDraftEditAndResend.ts + - + lang: Java + label: Java + source: + $ref: examples/UnclaimedDraftEditAndResend.java + - + lang: Ruby + label: Ruby + source: + $ref: examples/UnclaimedDraftEditAndResend.rb + - + lang: Python + label: Python + source: + $ref: examples/UnclaimedDraftEditAndResend.py + - + lang: cURL + label: cURL + source: + $ref: examples/UnclaimedDraftEditAndResend.sh + x-meta: + seo: + title: 'Edit and Resend Unclaimed Draft | Dropbox Sign for Developers' + description: 'The Dropbox Sign API easily allows you to build custom integrations. To find out how to create a new signature request from an embedded request, click here.' +components: + schemas: + AccountCreateRequest: + required: + - email_address + properties: + client_id: + description: |- + Used when creating a new account with OAuth authorization. + + See [OAuth 2.0 Authorization](https://app.hellosign.com/api/oauthWalkthrough#OAuthAuthorization) + type: string + client_secret: + description: |- + Used when creating a new account with OAuth authorization. + + See [OAuth 2.0 Authorization](https://app.hellosign.com/api/oauthWalkthrough#OAuthAuthorization) + type: string + email_address: + description: 'The email address which will be associated with the new Account.' + type: string + format: email + locale: + description: 'The locale used in this Account. Check out the list of [supported locales](/api/reference/constants/#supported-locales) to learn more about the possible values.' + type: string + type: object + AccountUpdateRequest: + properties: + account_id: + description: 'The ID of the Account' + type: string + nullable: true + callback_url: + description: 'The URL that Dropbox Sign should POST events to.' + type: string + locale: + description: 'The locale used in this Account. Check out the list of [supported locales](/api/reference/constants/#supported-locales) to learn more about the possible values.' + type: string + type: object + AccountVerifyRequest: + required: + - email_address + properties: + email_address: description: 'Email address to run the verification for.' type: string format: email @@ -7862,6 +8356,10 @@ components: - US - UK x-enum-varnames-override: + csharp: + - CA + - US + - UK typescript-node: - Ca - Us @@ -7995,23 +8493,112 @@ components: end_date: description: 'The (inclusive) end date for the report data in `MM/DD/YYYY` format.' type: string - report_type: - description: 'The type(s) of the report you are requesting. Allowed values are `user_activity` and `document_status`. User activity reports contain list of all users and their activity during the specified date range. Document status report contain a list of signature requests created in the specified time range (and their status).' - type: array - items: - type: string - enum: - - user_activity - - document_status - maxItems: 2 - minItems: 1 - start_date: - description: 'The (inclusive) start date for the report data in `MM/DD/YYYY` format.' + report_type: + description: 'The type(s) of the report you are requesting. Allowed values are `user_activity` and `document_status`. User activity reports contain list of all users and their activity during the specified date range. Document status report contain a list of signature requests created in the specified time range (and their status).' + type: array + items: + type: string + enum: + - user_activity + - document_status + maxItems: 2 + minItems: 1 + start_date: + description: 'The (inclusive) start date for the report data in `MM/DD/YYYY` format.' + type: string + type: object + SignatureRequestBulkCreateEmbeddedWithTemplateRequest: + required: + - client_id + - template_ids + properties: + template_ids: + description: 'Use `template_ids` to create a SignatureRequest from one or more templates, in the order in which the template will be used.' + type: array + items: + type: string + signer_file: + description: |- + `signer_file` is a CSV file defining values and options for signer fields. Required unless a `signer_list` is used, you may not use both. The CSV can have the following columns: + + - `name`: the name of the signer filling the role of RoleName + - `email_address`: email address of the signer filling the role of RoleName + - `pin`: the 4- to 12-character access code that will secure this signer's signature page (optional) + - `sms_phone_number`: An E.164 formatted phone number that will receive a code via SMS to access this signer's signature page. (optional) + + By using the feature, you agree you are responsible for obtaining a signer's consent to receive text messages from Dropbox Sign related to this signature request and confirm you have obtained such consent from all signers prior to enabling SMS delivery for this signature request. [Learn more](https://faq.hellosign.com/hc/en-us/articles/15815316468877-Dropbox-Sign-SMS-tools-add-on). + + **NOTE:** Not available in test mode and requires a Standard plan or higher. + - `*_field`: any column with a _field" suffix will be treated as a custom field (optional) + + You may only specify field values here, any other options should be set in the custom_fields request parameter. + + Example CSV: + + ``` + name, email_address, pin, company_field + George, george@example.com, d79a3td, ABC Corp + Mary, mary@example.com, gd9as5b, 123 LLC + ``` + type: string + format: binary + signer_list: + description: '`signer_list` is an array defining values and options for signer fields. Required unless a `signer_file` is used, you may not use both.' + type: array + items: + $ref: '#/components/schemas/SubBulkSignerList' + allow_decline: + description: 'Allows signers to decline to sign a document if `true`. Defaults to `false`.' + type: boolean + default: false + ccs: + description: 'Add CC email recipients. Required when a CC role exists for the Template.' + type: array + items: + $ref: '#/components/schemas/SubCC' + client_id: + description: 'Client id of the app you''re using to create this embedded signature request. Used for security purposes.' + type: string + custom_fields: + description: |- + When used together with merge fields, `custom_fields` allows users to add pre-filled data to their signature requests. + + Pre-filled data can be used with "send-once" signature requests by adding merge fields with `form_fields_per_document` or [Text Tags](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) while passing values back with `custom_fields` together in one API call. + + For using pre-filled on repeatable signature requests, merge fields are added to templates in the Dropbox Sign UI or by calling [/template/create_embedded_draft](/api/reference/operation/templateCreateEmbeddedDraft) and then passing `custom_fields` on subsequent signature requests referencing that template. + type: array + items: + $ref: '#/components/schemas/SubCustomField' + message: + description: 'The custom message in the email that will be sent to the signers.' + type: string + maxLength: 5000 + metadata: + description: |- + Key-value data that should be attached to the signature request. This metadata is included in all API responses and events involving the signature request. For example, use the metadata field to store a signer's order number for look up when receiving events for the signature request. + + Each request can include up to 10 metadata keys (or 50 nested metadata keys), with key names up to 40 characters long and values up to 1000 characters long. + type: object + maxItems: 10 + additionalProperties: {} + signing_redirect_url: + description: 'The URL you want signers redirected to after they successfully sign.' + type: string + subject: + description: 'The subject in the email that will be sent to the signers.' + type: string + maxLength: 255 + test_mode: + description: 'Whether this is a test, the signature request will not be legally binding if set to `true`. Defaults to `false`.' + type: boolean + default: false + title: + description: 'The title you want to assign to the SignatureRequest.' type: string + maxLength: 255 type: object - SignatureRequestBulkCreateEmbeddedWithTemplateRequest: + SignatureRequestBulkSendWithTemplateRequest: required: - - client_id - template_ids properties: template_ids: @@ -8058,19 +8645,244 @@ components: type: array items: $ref: '#/components/schemas/SubCC' + client_id: + description: 'The client id of the API App you want to associate with this request. Used to apply the branding and callback url defined for the app.' + type: string + custom_fields: + description: |- + When used together with merge fields, `custom_fields` allows users to add pre-filled data to their signature requests. + + Pre-filled data can be used with "send-once" signature requests by adding merge fields with `form_fields_per_document` or [Text Tags](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) while passing values back with `custom_fields` together in one API call. + + For using pre-filled on repeatable signature requests, merge fields are added to templates in the Dropbox Sign UI or by calling [/template/create_embedded_draft](/api/reference/operation/templateCreateEmbeddedDraft) and then passing `custom_fields` on subsequent signature requests referencing that template. + type: array + items: + $ref: '#/components/schemas/SubCustomField' + message: + description: 'The custom message in the email that will be sent to the signers.' + type: string + maxLength: 5000 + metadata: + description: |- + Key-value data that should be attached to the signature request. This metadata is included in all API responses and events involving the signature request. For example, use the metadata field to store a signer's order number for look up when receiving events for the signature request. + + Each request can include up to 10 metadata keys (or 50 nested metadata keys), with key names up to 40 characters long and values up to 1000 characters long. + type: object + maxItems: 10 + additionalProperties: {} + signing_redirect_url: + description: 'The URL you want signers redirected to after they successfully sign.' + type: string + subject: + description: 'The subject in the email that will be sent to the signers.' + type: string + maxLength: 255 + test_mode: + description: 'Whether this is a test, the signature request will not be legally binding if set to `true`. Defaults to `false`.' + type: boolean + default: false + title: + description: 'The title you want to assign to the SignatureRequest.' + type: string + maxLength: 255 + type: object + SignatureRequestCreateEmbeddedRequest: + required: + - client_id + properties: + files: + description: |- + Use `files[]` to indicate the uploaded file(s) to send for signature. + + This endpoint requires either **files** or **file_urls[]**, but not both. + type: array + items: + type: string + format: binary + file_urls: + description: |- + Use `file_urls[]` to have Dropbox Sign download the file(s) to send for signature. + + This endpoint requires either **files** or **file_urls[]**, but not both. + type: array + items: + type: string + signers: + description: |- + Add Signers to your Signature Request. + + This endpoint requires either **signers** or **grouped_signers**, but not both. + type: array + items: + $ref: '#/components/schemas/SubSignatureRequestSigner' + grouped_signers: + description: |- + Add Grouped Signers to your Signature Request. + + This endpoint requires either **signers** or **grouped_signers**, but not both. + type: array + items: + $ref: '#/components/schemas/SubSignatureRequestGroupedSigners' + allow_decline: + description: 'Allows signers to decline to sign a document if `true`. Defaults to `false`.' + type: boolean + default: false + allow_reassign: + description: |- + Allows signers to reassign their signature requests to other signers if set to `true`. Defaults to `false`. + + **NOTE:** Only available for Premium plan. + type: boolean + default: false + attachments: + description: 'A list describing the attachments' + type: array + items: + $ref: '#/components/schemas/SubAttachment' + cc_email_addresses: + description: 'The email addresses that should be CCed.' + type: array + items: + type: string + format: email + client_id: + description: 'Client id of the app you''re using to create this embedded signature request. Used for security purposes.' + type: string + custom_fields: + description: |- + When used together with merge fields, `custom_fields` allows users to add pre-filled data to their signature requests. + + Pre-filled data can be used with "send-once" signature requests by adding merge fields with `form_fields_per_document` or [Text Tags](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) while passing values back with `custom_fields` together in one API call. + + For using pre-filled on repeatable signature requests, merge fields are added to templates in the Dropbox Sign UI or by calling [/template/create_embedded_draft](/api/reference/operation/templateCreateEmbeddedDraft) and then passing `custom_fields` on subsequent signature requests referencing that template. + type: array + items: + $ref: '#/components/schemas/SubCustomField' + field_options: + $ref: '#/components/schemas/SubFieldOptions' + 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' + form_field_rules: + description: 'Conditional Logic rules for fields defined in `form_fields_per_document`.' + type: array + items: + $ref: '#/components/schemas/SubFormFieldRule' + 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' + hide_text_tags: + description: |- + Enables automatic Text Tag removal when set to true. + + **NOTE:** Removing text tags this way can cause unwanted clipping. We recommend leaving this setting on `false` and instead hiding your text tags using white text or a similar approach. See the [Text Tags Walkthrough](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) for more information. + type: boolean + default: false + message: + description: 'The custom message in the email that will be sent to the signers.' + type: string + maxLength: 5000 + metadata: + description: |- + Key-value data that should be attached to the signature request. This metadata is included in all API responses and events involving the signature request. For example, use the metadata field to store a signer's order number for look up when receiving events for the signature request. + + Each request can include up to 10 metadata keys (or 50 nested metadata keys), with key names up to 40 characters long and values up to 1000 characters long. + type: object + maxItems: 10 + additionalProperties: {} + signing_options: + $ref: '#/components/schemas/SubSigningOptions' + subject: + description: 'The subject in the email that will be sent to the signers.' + type: string + maxLength: 255 + test_mode: + description: 'Whether this is a test, the signature request will not be legally binding if set to `true`. Defaults to `false`.' + type: boolean + default: false + title: + description: 'The title you want to assign to the SignatureRequest.' + type: string + maxLength: 255 + use_text_tags: + description: 'Send with a value of `true` if you wish to enable [Text Tags](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) parsing in your document. Defaults to disabled, or `false`.' + type: boolean + default: false + populate_auto_fill_fields: + description: |- + Controls whether [auto fill fields](https://faq.hellosign.com/hc/en-us/articles/360051467511-Auto-Fill-Fields) can automatically populate a signer's information during signing. + + **NOTE:** Keep your signer's information safe by ensuring that the _signer on your signature request is the intended party_ before using this feature. + 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 + SignatureRequestCreateEmbeddedWithTemplateRequest: + required: + - client_id + - template_ids + - signers + properties: + template_ids: + description: 'Use `template_ids` to create a SignatureRequest from one or more templates, in the order in which the template will be used.' + type: array + items: + type: string + allow_decline: + description: 'Allows signers to decline to sign a document if `true`. Defaults to `false`.' + type: boolean + default: false + ccs: + description: 'Add CC email recipients. Required when a CC role exists for the Template.' + type: array + items: + $ref: '#/components/schemas/SubCC' client_id: description: 'Client id of the app you''re using to create this embedded signature request. Used for security purposes.' type: string custom_fields: + description: 'An array defining values and options for custom fields. Required when a custom field exists in the Template.' + type: array + items: + $ref: '#/components/schemas/SubCustomField' + files: + description: |- + Use `files[]` to indicate the uploaded file(s) to send for signature. + + This endpoint requires either **files** or **file_urls[]**, but not both. + type: array + items: + type: string + format: binary + file_urls: description: |- - When used together with merge fields, `custom_fields` allows users to add pre-filled data to their signature requests. - - Pre-filled data can be used with "send-once" signature requests by adding merge fields with `form_fields_per_document` or [Text Tags](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) while passing values back with `custom_fields` together in one API call. + Use `file_urls[]` to have Dropbox Sign download the file(s) to send for signature. - For using pre-filled on repeatable signature requests, merge fields are added to templates in the Dropbox Sign UI or by calling [/template/create_embedded_draft](/api/reference/operation/templateCreateEmbeddedDraft) and then passing `custom_fields` on subsequent signature requests referencing that template. + This endpoint requires either **files** or **file_urls[]**, but not both. type: array items: - $ref: '#/components/schemas/SubCustomField' + type: string message: description: 'The custom message in the email that will be sent to the signers.' type: string @@ -8083,9 +8895,13 @@ components: type: object maxItems: 10 additionalProperties: {} - signing_redirect_url: - description: 'The URL you want signers redirected to after they successfully sign.' - type: string + signers: + description: 'Add Signers to your Templated-based Signature Request.' + type: array + items: + $ref: '#/components/schemas/SubSignatureRequestTemplateSigner' + signing_options: + $ref: '#/components/schemas/SubSigningOptions' subject: description: 'The subject in the email that will be sent to the signers.' type: string @@ -8098,55 +8914,71 @@ components: description: 'The title you want to assign to the SignatureRequest.' type: string maxLength: 255 + populate_auto_fill_fields: + description: |- + Controls whether [auto fill fields](https://faq.hellosign.com/hc/en-us/articles/360051467511-Auto-Fill-Fields) can automatically populate a signer's information during signing. + + **NOTE:** Keep your signer's information safe by ensuring that the _signer on your signature request is the intended party_ before using this feature. + type: boolean + default: false type: object - SignatureRequestBulkSendWithTemplateRequest: - required: - - template_ids + SignatureRequestEditRequest: properties: - template_ids: - description: 'Use `template_ids` to create a SignatureRequest from one or more templates, in the order in which the template will be used.' + files: + description: |- + Use `files[]` to indicate the uploaded file(s) to send for signature. + + This endpoint requires either **files** or **file_urls[]**, but not both. type: array items: type: string - signer_file: + format: binary + file_urls: description: |- - `signer_file` is a CSV file defining values and options for signer fields. Required unless a `signer_list` is used, you may not use both. The CSV can have the following columns: - - - `name`: the name of the signer filling the role of RoleName - - `email_address`: email address of the signer filling the role of RoleName - - `pin`: the 4- to 12-character access code that will secure this signer's signature page (optional) - - `sms_phone_number`: An E.164 formatted phone number that will receive a code via SMS to access this signer's signature page. (optional) - - By using the feature, you agree you are responsible for obtaining a signer's consent to receive text messages from Dropbox Sign related to this signature request and confirm you have obtained such consent from all signers prior to enabling SMS delivery for this signature request. [Learn more](https://faq.hellosign.com/hc/en-us/articles/15815316468877-Dropbox-Sign-SMS-tools-add-on). - - **NOTE:** Not available in test mode and requires a Standard plan or higher. - - `*_field`: any column with a _field" suffix will be treated as a custom field (optional) + Use `file_urls[]` to have Dropbox Sign download the file(s) to send for signature. - You may only specify field values here, any other options should be set in the custom_fields request parameter. + This endpoint requires either **files** or **file_urls[]**, but not both. + type: array + items: + type: string + signers: + description: |- + Add Signers to your Signature Request. - Example CSV: + This endpoint requires either **signers** or **grouped_signers**, but not both. + type: array + items: + $ref: '#/components/schemas/SubSignatureRequestSigner' + grouped_signers: + description: |- + Add Grouped Signers to your Signature Request. - ``` - name, email_address, pin, company_field - George, george@example.com, d79a3td, ABC Corp - Mary, mary@example.com, gd9as5b, 123 LLC - ``` - type: string - format: binary - signer_list: - description: '`signer_list` is an array defining values and options for signer fields. Required unless a `signer_file` is used, you may not use both.' + This endpoint requires either **signers** or **grouped_signers**, but not both. type: array items: - $ref: '#/components/schemas/SubBulkSignerList' + $ref: '#/components/schemas/SubSignatureRequestGroupedSigners' allow_decline: description: 'Allows signers to decline to sign a document if `true`. Defaults to `false`.' type: boolean default: false - ccs: - description: 'Add CC email recipients. Required when a CC role exists for the Template.' + allow_reassign: + description: |- + Allows signers to reassign their signature requests to other signers if set to `true`. Defaults to `false`. + + **NOTE:** Only available for Premium plan and higher. + type: boolean + default: false + attachments: + description: 'A list describing the attachments' type: array items: - $ref: '#/components/schemas/SubCC' + $ref: '#/components/schemas/SubAttachment' + cc_email_addresses: + description: 'The email addresses that should be CCed.' + type: array + items: + type: string + format: email client_id: description: 'The client id of the API App you want to associate with this request. Used to apply the branding and callback url defined for the app.' type: string @@ -8160,6 +8992,52 @@ components: type: array items: $ref: '#/components/schemas/SubCustomField' + field_options: + $ref: '#/components/schemas/SubFieldOptions' + 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' + form_field_rules: + description: 'Conditional Logic rules for fields defined in `form_fields_per_document`.' + type: array + items: + $ref: '#/components/schemas/SubFormFieldRule' + 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' + hide_text_tags: + description: |- + Enables automatic Text Tag removal when set to true. + + **NOTE:** Removing text tags this way can cause unwanted clipping. We recommend leaving this setting on `false` and instead hiding your text tags using white text or a similar approach. See the [Text Tags Walkthrough](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) for more information. + type: boolean + default: false + is_eid: + description: |- + Send with a value of `true` if you wish to enable + [electronic identification (eID)](https://www.hellosign.com/features/electronic-id), + which requires the signer to verify their identity with an eID provider to sign a document.
+ **NOTE:** eID is only available on the Premium API plan. Cannot be used in `test_mode`. Only works on requests with one signer. + type: boolean + default: false message: description: 'The custom message in the email that will be sent to the signers.' type: string @@ -8172,6 +9050,8 @@ components: type: object maxItems: 10 additionalProperties: {} + signing_options: + $ref: '#/components/schemas/SubSigningOptions' signing_redirect_url: description: 'The URL you want signers redirected to after they successfully sign.' type: string @@ -8187,8 +9067,16 @@ components: description: 'The title you want to assign to the SignatureRequest.' type: string maxLength: 255 + use_text_tags: + description: 'Send with a value of `true` if you wish to enable [Text Tags](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) parsing in your document. Defaults to disabled, or `false`.' + 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 - SignatureRequestCreateEmbeddedRequest: + SignatureRequestEditEmbeddedRequest: required: - client_id properties: @@ -8340,7 +9228,7 @@ components: type: integer nullable: true type: object - SignatureRequestCreateEmbeddedWithTemplateRequest: + SignatureRequestEditEmbeddedWithTemplateRequest: required: - client_id - template_ids @@ -8424,6 +9312,94 @@ components: type: boolean default: false type: object + SignatureRequestEditWithTemplateRequest: + description: '' + required: + - signers + - template_ids + properties: + template_ids: + description: 'Use `template_ids` to create a SignatureRequest from one or more templates, in the order in which the template will be used.' + type: array + items: + type: string + allow_decline: + description: 'Allows signers to decline to sign a document if `true`. Defaults to `false`.' + type: boolean + default: false + ccs: + description: 'Add CC email recipients. Required when a CC role exists for the Template.' + type: array + items: + $ref: '#/components/schemas/SubCC' + client_id: + description: 'Client id of the app to associate with the signature request. Used to apply the branding and callback url defined for the app.' + type: string + custom_fields: + description: 'An array defining values and options for custom fields. Required when a custom field exists in the Template.' + type: array + items: + $ref: '#/components/schemas/SubCustomField' + files: + description: |- + Use `files[]` to indicate the uploaded file(s) to send for signature. + + This endpoint requires either **files** or **file_urls[]**, but not both. + type: array + items: + type: string + format: binary + file_urls: + description: |- + Use `file_urls[]` to have Dropbox Sign download the file(s) to send for signature. + + This endpoint requires either **files** or **file_urls[]**, but not both. + type: array + items: + type: string + is_eid: + description: |- + Send with a value of `true` if you wish to enable + [electronic identification (eID)](https://www.hellosign.com/features/electronic-id), + which requires the signer to verify their identity with an eID provider to sign a document.
+ **NOTE:** eID is only available on the Premium API plan. Cannot be used in `test_mode`. Only works on requests with one signer. + type: boolean + default: false + message: + description: 'The custom message in the email that will be sent to the signers.' + type: string + maxLength: 5000 + metadata: + description: |- + Key-value data that should be attached to the signature request. This metadata is included in all API responses and events involving the signature request. For example, use the metadata field to store a signer's order number for look up when receiving events for the signature request. + + Each request can include up to 10 metadata keys (or 50 nested metadata keys), with key names up to 40 characters long and values up to 1000 characters long. + type: object + maxItems: 10 + additionalProperties: {} + signers: + description: 'Add Signers to your Templated-based Signature Request.' + type: array + items: + $ref: '#/components/schemas/SubSignatureRequestTemplateSigner' + signing_options: + $ref: '#/components/schemas/SubSigningOptions' + signing_redirect_url: + description: 'The URL you want signers redirected to after they successfully sign.' + type: string + subject: + description: 'The subject in the email that will be sent to the signers.' + type: string + maxLength: 255 + test_mode: + description: 'Whether this is a test, the signature request will not be legally binding if set to `true`. Defaults to `false`.' + type: boolean + default: false + title: + description: 'The title you want to assign to the SignatureRequest.' + type: string + maxLength: 255 + type: object SignatureRequestRemindRequest: required: - email_address @@ -8937,6 +9913,9 @@ components: csharp: - FieldVisibility - GroupVisibility + java: + - FIELD_VISIBILITY + - GROUP_VISIBILITY php: - TYPE_FIELD_VISIBILITY - TYPE_GROUP_VISIBILITY @@ -13182,6 +14161,30 @@ components: summary: 'Default Example' value: $ref: examples/json/SignatureRequestCreateEmbeddedWithTemplateRequestDefaultExample.json + SignatureRequestEditRequestDefaultExample: + summary: 'Default Example' + value: + $ref: examples/json/SignatureRequestEditRequestDefaultExample.json + SignatureRequestEditRequestGroupedSignersExample: + summary: 'Grouped Signers Example' + value: + $ref: examples/json/SignatureRequestEditRequestGroupedSignersExample.json + SignatureRequestEditEmbeddedRequestDefaultExample: + summary: 'Default Example' + value: + $ref: examples/json/SignatureRequestEditEmbeddedRequestDefaultExample.json + SignatureRequestEditEmbeddedRequestGroupedSignersExample: + summary: 'Grouped Signers Example' + value: + $ref: examples/json/SignatureRequestEditEmbeddedRequestGroupedSignersExample.json + SignatureRequestEditEmbeddedWithTemplateRequestDefaultExample: + summary: 'Default Example' + value: + $ref: examples/json/SignatureRequestEditEmbeddedWithTemplateRequestDefaultExample.json + SignatureRequestEditWithTemplateRequestDefaultExample: + summary: 'Default Example' + value: + $ref: examples/json/SignatureRequestEditWithTemplateRequestDefaultExample.json SignatureRequestRemindRequestDefaultExample: summary: 'Default Example' value: diff --git a/openapi.yaml b/openapi.yaml index d0dbb629b..e70ba676c 100644 --- a/openapi.yaml +++ b/openapi.yaml @@ -1826,7 +1826,6 @@ paths: - CA - US - UK - example: US - name: state in: query @@ -2108,7 +2107,6 @@ paths: required: true schema: type: string - example: '[FAX_NUMBER]' responses: '200': description: 'successful operation' @@ -7862,6 +7860,10 @@ components: - US - UK x-enum-varnames-override: + csharp: + - CA + - US + - UK typescript-node: - Ca - Us @@ -8424,6 +8426,484 @@ components: type: boolean default: false type: object + SignatureRequestEditRequest: + properties: + files: + description: |- + Use `files[]` to indicate the uploaded file(s) to send for signature. + + This endpoint requires either **files** or **file_urls[]**, but not both. + type: array + items: + type: string + format: binary + file_urls: + description: |- + Use `file_urls[]` to have Dropbox Sign download the file(s) to send for signature. + + This endpoint requires either **files** or **file_urls[]**, but not both. + type: array + items: + type: string + signers: + description: |- + Add Signers to your Signature Request. + + This endpoint requires either **signers** or **grouped_signers**, but not both. + type: array + items: + $ref: '#/components/schemas/SubSignatureRequestSigner' + grouped_signers: + description: |- + Add Grouped Signers to your Signature Request. + + This endpoint requires either **signers** or **grouped_signers**, but not both. + type: array + items: + $ref: '#/components/schemas/SubSignatureRequestGroupedSigners' + allow_decline: + description: 'Allows signers to decline to sign a document if `true`. Defaults to `false`.' + type: boolean + default: false + allow_reassign: + description: |- + Allows signers to reassign their signature requests to other signers if set to `true`. Defaults to `false`. + + **NOTE:** Only available for Premium plan and higher. + type: boolean + default: false + attachments: + description: 'A list describing the attachments' + type: array + items: + $ref: '#/components/schemas/SubAttachment' + cc_email_addresses: + description: 'The email addresses that should be CCed.' + type: array + items: + type: string + format: email + client_id: + description: 'The client id of the API App you want to associate with this request. Used to apply the branding and callback url defined for the app.' + type: string + custom_fields: + description: |- + When used together with merge fields, `custom_fields` allows users to add pre-filled data to their signature requests. + + Pre-filled data can be used with "send-once" signature requests by adding merge fields with `form_fields_per_document` or [Text Tags](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) while passing values back with `custom_fields` together in one API call. + + For using pre-filled on repeatable signature requests, merge fields are added to templates in the Dropbox Sign UI or by calling [/template/create_embedded_draft](/api/reference/operation/templateCreateEmbeddedDraft) and then passing `custom_fields` on subsequent signature requests referencing that template. + type: array + items: + $ref: '#/components/schemas/SubCustomField' + field_options: + $ref: '#/components/schemas/SubFieldOptions' + 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' + form_field_rules: + description: 'Conditional Logic rules for fields defined in `form_fields_per_document`.' + type: array + items: + $ref: '#/components/schemas/SubFormFieldRule' + 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' + hide_text_tags: + description: |- + Enables automatic Text Tag removal when set to true. + + **NOTE:** Removing text tags this way can cause unwanted clipping. We recommend leaving this setting on `false` and instead hiding your text tags using white text or a similar approach. See the [Text Tags Walkthrough](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) for more information. + type: boolean + default: false + is_eid: + description: |- + Send with a value of `true` if you wish to enable + [electronic identification (eID)](https://www.hellosign.com/features/electronic-id), + which requires the signer to verify their identity with an eID provider to sign a document.
+ **NOTE:** eID is only available on the Premium API plan. Cannot be used in `test_mode`. Only works on requests with one signer. + type: boolean + default: false + message: + description: 'The custom message in the email that will be sent to the signers.' + type: string + maxLength: 5000 + metadata: + description: |- + Key-value data that should be attached to the signature request. This metadata is included in all API responses and events involving the signature request. For example, use the metadata field to store a signer's order number for look up when receiving events for the signature request. + + Each request can include up to 10 metadata keys (or 50 nested metadata keys), with key names up to 40 characters long and values up to 1000 characters long. + type: object + maxItems: 10 + additionalProperties: {} + signing_options: + $ref: '#/components/schemas/SubSigningOptions' + signing_redirect_url: + description: 'The URL you want signers redirected to after they successfully sign.' + type: string + subject: + description: 'The subject in the email that will be sent to the signers.' + type: string + maxLength: 255 + test_mode: + description: 'Whether this is a test, the signature request will not be legally binding if set to `true`. Defaults to `false`.' + type: boolean + default: false + title: + description: 'The title you want to assign to the SignatureRequest.' + type: string + maxLength: 255 + use_text_tags: + description: 'Send with a value of `true` if you wish to enable [Text Tags](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) parsing in your document. Defaults to disabled, or `false`.' + 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 + SignatureRequestEditEmbeddedRequest: + required: + - client_id + properties: + files: + description: |- + Use `files[]` to indicate the uploaded file(s) to send for signature. + + This endpoint requires either **files** or **file_urls[]**, but not both. + type: array + items: + type: string + format: binary + file_urls: + description: |- + Use `file_urls[]` to have Dropbox Sign download the file(s) to send for signature. + + This endpoint requires either **files** or **file_urls[]**, but not both. + type: array + items: + type: string + signers: + description: |- + Add Signers to your Signature Request. + + This endpoint requires either **signers** or **grouped_signers**, but not both. + type: array + items: + $ref: '#/components/schemas/SubSignatureRequestSigner' + grouped_signers: + description: |- + Add Grouped Signers to your Signature Request. + + This endpoint requires either **signers** or **grouped_signers**, but not both. + type: array + items: + $ref: '#/components/schemas/SubSignatureRequestGroupedSigners' + allow_decline: + description: 'Allows signers to decline to sign a document if `true`. Defaults to `false`.' + type: boolean + default: false + allow_reassign: + description: |- + Allows signers to reassign their signature requests to other signers if set to `true`. Defaults to `false`. + + **NOTE:** Only available for Premium plan. + type: boolean + default: false + attachments: + description: 'A list describing the attachments' + type: array + items: + $ref: '#/components/schemas/SubAttachment' + cc_email_addresses: + description: 'The email addresses that should be CCed.' + type: array + items: + type: string + format: email + client_id: + description: 'Client id of the app you''re using to create this embedded signature request. Used for security purposes.' + type: string + custom_fields: + description: |- + When used together with merge fields, `custom_fields` allows users to add pre-filled data to their signature requests. + + Pre-filled data can be used with "send-once" signature requests by adding merge fields with `form_fields_per_document` or [Text Tags](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) while passing values back with `custom_fields` together in one API call. + + For using pre-filled on repeatable signature requests, merge fields are added to templates in the Dropbox Sign UI or by calling [/template/create_embedded_draft](/api/reference/operation/templateCreateEmbeddedDraft) and then passing `custom_fields` on subsequent signature requests referencing that template. + type: array + items: + $ref: '#/components/schemas/SubCustomField' + field_options: + $ref: '#/components/schemas/SubFieldOptions' + 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' + form_field_rules: + description: 'Conditional Logic rules for fields defined in `form_fields_per_document`.' + type: array + items: + $ref: '#/components/schemas/SubFormFieldRule' + 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' + hide_text_tags: + description: |- + Enables automatic Text Tag removal when set to true. + + **NOTE:** Removing text tags this way can cause unwanted clipping. We recommend leaving this setting on `false` and instead hiding your text tags using white text or a similar approach. See the [Text Tags Walkthrough](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) for more information. + type: boolean + default: false + message: + description: 'The custom message in the email that will be sent to the signers.' + type: string + maxLength: 5000 + metadata: + description: |- + Key-value data that should be attached to the signature request. This metadata is included in all API responses and events involving the signature request. For example, use the metadata field to store a signer's order number for look up when receiving events for the signature request. + + Each request can include up to 10 metadata keys (or 50 nested metadata keys), with key names up to 40 characters long and values up to 1000 characters long. + type: object + maxItems: 10 + additionalProperties: {} + signing_options: + $ref: '#/components/schemas/SubSigningOptions' + subject: + description: 'The subject in the email that will be sent to the signers.' + type: string + maxLength: 255 + test_mode: + description: 'Whether this is a test, the signature request will not be legally binding if set to `true`. Defaults to `false`.' + type: boolean + default: false + title: + description: 'The title you want to assign to the SignatureRequest.' + type: string + maxLength: 255 + use_text_tags: + description: 'Send with a value of `true` if you wish to enable [Text Tags](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) parsing in your document. Defaults to disabled, or `false`.' + type: boolean + default: false + populate_auto_fill_fields: + description: |- + Controls whether [auto fill fields](https://faq.hellosign.com/hc/en-us/articles/360051467511-Auto-Fill-Fields) can automatically populate a signer's information during signing. + + **NOTE:** Keep your signer's information safe by ensuring that the _signer on your signature request is the intended party_ before using this feature. + 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 + SignatureRequestEditEmbeddedWithTemplateRequest: + required: + - client_id + - template_ids + - signers + properties: + template_ids: + description: 'Use `template_ids` to create a SignatureRequest from one or more templates, in the order in which the template will be used.' + type: array + items: + type: string + allow_decline: + description: 'Allows signers to decline to sign a document if `true`. Defaults to `false`.' + type: boolean + default: false + ccs: + description: 'Add CC email recipients. Required when a CC role exists for the Template.' + type: array + items: + $ref: '#/components/schemas/SubCC' + client_id: + description: 'Client id of the app you''re using to create this embedded signature request. Used for security purposes.' + type: string + custom_fields: + description: 'An array defining values and options for custom fields. Required when a custom field exists in the Template.' + type: array + items: + $ref: '#/components/schemas/SubCustomField' + files: + description: |- + Use `files[]` to indicate the uploaded file(s) to send for signature. + + This endpoint requires either **files** or **file_urls[]**, but not both. + type: array + items: + type: string + format: binary + file_urls: + description: |- + Use `file_urls[]` to have Dropbox Sign download the file(s) to send for signature. + + This endpoint requires either **files** or **file_urls[]**, but not both. + type: array + items: + type: string + message: + description: 'The custom message in the email that will be sent to the signers.' + type: string + maxLength: 5000 + metadata: + description: |- + Key-value data that should be attached to the signature request. This metadata is included in all API responses and events involving the signature request. For example, use the metadata field to store a signer's order number for look up when receiving events for the signature request. + + Each request can include up to 10 metadata keys (or 50 nested metadata keys), with key names up to 40 characters long and values up to 1000 characters long. + type: object + maxItems: 10 + additionalProperties: {} + signers: + description: 'Add Signers to your Templated-based Signature Request.' + type: array + items: + $ref: '#/components/schemas/SubSignatureRequestTemplateSigner' + signing_options: + $ref: '#/components/schemas/SubSigningOptions' + subject: + description: 'The subject in the email that will be sent to the signers.' + type: string + maxLength: 255 + test_mode: + description: 'Whether this is a test, the signature request will not be legally binding if set to `true`. Defaults to `false`.' + type: boolean + default: false + title: + description: 'The title you want to assign to the SignatureRequest.' + type: string + maxLength: 255 + populate_auto_fill_fields: + description: |- + Controls whether [auto fill fields](https://faq.hellosign.com/hc/en-us/articles/360051467511-Auto-Fill-Fields) can automatically populate a signer's information during signing. + + **NOTE:** Keep your signer's information safe by ensuring that the _signer on your signature request is the intended party_ before using this feature. + type: boolean + default: false + type: object + SignatureRequestEditWithTemplateRequest: + description: '' + required: + - signers + - template_ids + properties: + template_ids: + description: 'Use `template_ids` to create a SignatureRequest from one or more templates, in the order in which the template will be used.' + type: array + items: + type: string + allow_decline: + description: 'Allows signers to decline to sign a document if `true`. Defaults to `false`.' + type: boolean + default: false + ccs: + description: 'Add CC email recipients. Required when a CC role exists for the Template.' + type: array + items: + $ref: '#/components/schemas/SubCC' + client_id: + description: 'Client id of the app to associate with the signature request. Used to apply the branding and callback url defined for the app.' + type: string + custom_fields: + description: 'An array defining values and options for custom fields. Required when a custom field exists in the Template.' + type: array + items: + $ref: '#/components/schemas/SubCustomField' + files: + description: |- + Use `files[]` to indicate the uploaded file(s) to send for signature. + + This endpoint requires either **files** or **file_urls[]**, but not both. + type: array + items: + type: string + format: binary + file_urls: + description: |- + Use `file_urls[]` to have Dropbox Sign download the file(s) to send for signature. + + This endpoint requires either **files** or **file_urls[]**, but not both. + type: array + items: + type: string + is_eid: + description: |- + Send with a value of `true` if you wish to enable + [electronic identification (eID)](https://www.hellosign.com/features/electronic-id), + which requires the signer to verify their identity with an eID provider to sign a document.
+ **NOTE:** eID is only available on the Premium API plan. Cannot be used in `test_mode`. Only works on requests with one signer. + type: boolean + default: false + message: + description: 'The custom message in the email that will be sent to the signers.' + type: string + maxLength: 5000 + metadata: + description: |- + Key-value data that should be attached to the signature request. This metadata is included in all API responses and events involving the signature request. For example, use the metadata field to store a signer's order number for look up when receiving events for the signature request. + + Each request can include up to 10 metadata keys (or 50 nested metadata keys), with key names up to 40 characters long and values up to 1000 characters long. + type: object + maxItems: 10 + additionalProperties: {} + signers: + description: 'Add Signers to your Templated-based Signature Request.' + type: array + items: + $ref: '#/components/schemas/SubSignatureRequestTemplateSigner' + signing_options: + $ref: '#/components/schemas/SubSigningOptions' + signing_redirect_url: + description: 'The URL you want signers redirected to after they successfully sign.' + type: string + subject: + description: 'The subject in the email that will be sent to the signers.' + type: string + maxLength: 255 + test_mode: + description: 'Whether this is a test, the signature request will not be legally binding if set to `true`. Defaults to `false`.' + type: boolean + default: false + title: + description: 'The title you want to assign to the SignatureRequest.' + type: string + maxLength: 255 + type: object SignatureRequestRemindRequest: required: - email_address @@ -8915,6 +9395,9 @@ components: csharp: - FieldVisibility - GroupVisibility + java: + - FIELD_VISIBILITY + - GROUP_VISIBILITY php: - TYPE_FIELD_VISIBILITY - TYPE_GROUP_VISIBILITY @@ -13160,6 +13643,30 @@ components: summary: 'Default Example' value: $ref: examples/json/SignatureRequestCreateEmbeddedWithTemplateRequestDefaultExample.json + SignatureRequestEditRequestDefaultExample: + summary: 'Default Example' + value: + $ref: examples/json/SignatureRequestEditRequestDefaultExample.json + SignatureRequestEditRequestGroupedSignersExample: + summary: 'Grouped Signers Example' + value: + $ref: examples/json/SignatureRequestEditRequestGroupedSignersExample.json + SignatureRequestEditEmbeddedRequestDefaultExample: + summary: 'Default Example' + value: + $ref: examples/json/SignatureRequestEditEmbeddedRequestDefaultExample.json + SignatureRequestEditEmbeddedRequestGroupedSignersExample: + summary: 'Grouped Signers Example' + value: + $ref: examples/json/SignatureRequestEditEmbeddedRequestGroupedSignersExample.json + SignatureRequestEditEmbeddedWithTemplateRequestDefaultExample: + summary: 'Default Example' + value: + $ref: examples/json/SignatureRequestEditEmbeddedWithTemplateRequestDefaultExample.json + SignatureRequestEditWithTemplateRequestDefaultExample: + summary: 'Default Example' + value: + $ref: examples/json/SignatureRequestEditWithTemplateRequestDefaultExample.json SignatureRequestRemindRequestDefaultExample: summary: 'Default Example' value: diff --git a/sdks/dotnet/README.md b/sdks/dotnet/README.md index 104db3486..fcea11bde 100644 --- a/sdks/dotnet/README.md +++ b/sdks/dotnet/README.md @@ -161,6 +161,10 @@ Class | Method | HTTP request | Description *SignatureRequestApi* | [**SignatureRequestCancel**](docs/SignatureRequestApi.md#signaturerequestcancel) | **POST** /signature_request/cancel/{signature_request_id} | Cancel Incomplete Signature Request *SignatureRequestApi* | [**SignatureRequestCreateEmbedded**](docs/SignatureRequestApi.md#signaturerequestcreateembedded) | **POST** /signature_request/create_embedded | Create Embedded Signature Request *SignatureRequestApi* | [**SignatureRequestCreateEmbeddedWithTemplate**](docs/SignatureRequestApi.md#signaturerequestcreateembeddedwithtemplate) | **POST** /signature_request/create_embedded_with_template | Create Embedded Signature Request with Template +*SignatureRequestApi* | [**SignatureRequestEdit**](docs/SignatureRequestApi.md#signaturerequestedit) | **PUT** /signature_request/edit/{signature_request_id} | Edit Signature Request +*SignatureRequestApi* | [**SignatureRequestEditEmbedded**](docs/SignatureRequestApi.md#signaturerequesteditembedded) | **PUT** /signature_request/edit_embedded/{signature_request_id} | Edit Embedded Signature Request +*SignatureRequestApi* | [**SignatureRequestEditEmbeddedWithTemplate**](docs/SignatureRequestApi.md#signaturerequesteditembeddedwithtemplate) | **PUT** /signature_request/edit_embedded_with_template/{signature_request_id} | Edit Embedded Signature Request with Template +*SignatureRequestApi* | [**SignatureRequestEditWithTemplate**](docs/SignatureRequestApi.md#signaturerequesteditwithtemplate) | **PUT** /signature_request/edit_with_template/{signature_request_id} | Edit Signature Request With Template *SignatureRequestApi* | [**SignatureRequestFiles**](docs/SignatureRequestApi.md#signaturerequestfiles) | **GET** /signature_request/files/{signature_request_id} | Download Files *SignatureRequestApi* | [**SignatureRequestFilesAsDataUri**](docs/SignatureRequestApi.md#signaturerequestfilesasdatauri) | **GET** /signature_request/files_as_data_uri/{signature_request_id} | Download Files as Data Uri *SignatureRequestApi* | [**SignatureRequestFilesAsFileUrl**](docs/SignatureRequestApi.md#signaturerequestfilesasfileurl) | **GET** /signature_request/files_as_file_url/{signature_request_id} | Download Files as File Url @@ -265,6 +269,10 @@ Class | Method | HTTP request | Description - [Model.SignatureRequestBulkSendWithTemplateRequest](docs/SignatureRequestBulkSendWithTemplateRequest.md) - [Model.SignatureRequestCreateEmbeddedRequest](docs/SignatureRequestCreateEmbeddedRequest.md) - [Model.SignatureRequestCreateEmbeddedWithTemplateRequest](docs/SignatureRequestCreateEmbeddedWithTemplateRequest.md) + - [Model.SignatureRequestEditEmbeddedRequest](docs/SignatureRequestEditEmbeddedRequest.md) + - [Model.SignatureRequestEditEmbeddedWithTemplateRequest](docs/SignatureRequestEditEmbeddedWithTemplateRequest.md) + - [Model.SignatureRequestEditRequest](docs/SignatureRequestEditRequest.md) + - [Model.SignatureRequestEditWithTemplateRequest](docs/SignatureRequestEditWithTemplateRequest.md) - [Model.SignatureRequestGetResponse](docs/SignatureRequestGetResponse.md) - [Model.SignatureRequestListResponse](docs/SignatureRequestListResponse.md) - [Model.SignatureRequestRemindRequest](docs/SignatureRequestRemindRequest.md) diff --git a/sdks/dotnet/docs/SignatureRequestApi.md b/sdks/dotnet/docs/SignatureRequestApi.md index a507cc08f..4e5f19d8e 100644 --- a/sdks/dotnet/docs/SignatureRequestApi.md +++ b/sdks/dotnet/docs/SignatureRequestApi.md @@ -9,6 +9,10 @@ All URIs are relative to *https://api.hellosign.com/v3* | [**SignatureRequestCancel**](SignatureRequestApi.md#signaturerequestcancel) | **POST** /signature_request/cancel/{signature_request_id} | Cancel Incomplete Signature Request | | [**SignatureRequestCreateEmbedded**](SignatureRequestApi.md#signaturerequestcreateembedded) | **POST** /signature_request/create_embedded | Create Embedded Signature Request | | [**SignatureRequestCreateEmbeddedWithTemplate**](SignatureRequestApi.md#signaturerequestcreateembeddedwithtemplate) | **POST** /signature_request/create_embedded_with_template | Create Embedded Signature Request with Template | +| [**SignatureRequestEdit**](SignatureRequestApi.md#signaturerequestedit) | **PUT** /signature_request/edit/{signature_request_id} | Edit Signature Request | +| [**SignatureRequestEditEmbedded**](SignatureRequestApi.md#signaturerequesteditembedded) | **PUT** /signature_request/edit_embedded/{signature_request_id} | Edit Embedded Signature Request | +| [**SignatureRequestEditEmbeddedWithTemplate**](SignatureRequestApi.md#signaturerequesteditembeddedwithtemplate) | **PUT** /signature_request/edit_embedded_with_template/{signature_request_id} | Edit Embedded Signature Request with Template | +| [**SignatureRequestEditWithTemplate**](SignatureRequestApi.md#signaturerequesteditwithtemplate) | **PUT** /signature_request/edit_with_template/{signature_request_id} | Edit Signature Request With Template | | [**SignatureRequestFiles**](SignatureRequestApi.md#signaturerequestfiles) | **GET** /signature_request/files/{signature_request_id} | Download Files | | [**SignatureRequestFilesAsDataUri**](SignatureRequestApi.md#signaturerequestfilesasdatauri) | **GET** /signature_request/files_as_data_uri/{signature_request_id} | Download Files as Data Uri | | [**SignatureRequestFilesAsFileUrl**](SignatureRequestApi.md#signaturerequestfilesasfileurl) | **GET** /signature_request/files_as_file_url/{signature_request_id} | Download Files as File Url | @@ -641,6 +645,551 @@ catch (ApiException e) - **Accept**: application/json +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
| +| **4XX** | failed_operation | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +# **SignatureRequestEdit** +> SignatureRequestGetResponse SignatureRequestEdit (string signatureRequestId, SignatureRequestEditRequest signatureRequestEditRequest) + +Edit Signature Request + +Edits and sends a SignatureRequest with the submitted documents. If `form_fields_per_document` is not specified, a signature page will be affixed where all signers will be required to add their signature, signifying their agreement to all contained documents. **NOTE:** Edit and resend will not deduct your signature request quota. + +### Example +```csharp +using System; +using System.Collections.Generic; +using System.IO; +using Dropbox.Sign.Api; +using Dropbox.Sign.Client; +using Dropbox.Sign.Model; + +public class Example +{ + public static void Main() + { + var config = new Configuration(); + // Configure HTTP basic authorization: api_key + config.Username = "YOUR_API_KEY"; + + // or, configure Bearer (JWT) authorization: oauth2 + // config.AccessToken = "YOUR_BEARER_TOKEN"; + + var signatureRequestApi = new SignatureRequestApi(config); + + var signer1 = new SubSignatureRequestSigner( + emailAddress: "jack@example.com", + name: "Jack", + order: 0 + ); + + var signer2 = new SubSignatureRequestSigner( + emailAddress: "jill@example.com", + name: "Jill", + order: 1 + ); + + var signingOptions = new SubSigningOptions( + draw: true, + type: true, + upload: true, + phone: true, + defaultType: SubSigningOptions.DefaultTypeEnum.Draw + ); + + var subFieldOptions = new SubFieldOptions( + dateFormat: SubFieldOptions.DateFormatEnum.DDMMYYYY + ); + + var metadata = new Dictionary() + { + ["custom_id"] = 1234, + ["custom_text"] = "NDA #9" + }; + + var files = new List { + new FileStream( + "./example_signature_request.pdf", + FileMode.Open, + FileAccess.Read, + FileShare.Read + ) + }; + + var data = new SignatureRequestEditRequest( + title: "NDA with Acme Co.", + subject: "The NDA we talked about", + message: "Please sign this NDA and then we can discuss more. Let me know if you have any questions.", + signers: new List(){signer1, signer2}, + ccEmailAddresses: new List(){"lawyer1@dropboxsign.com", "lawyer2@dropboxsign.com"}, + files: files, + metadata: metadata, + signingOptions: signingOptions, + fieldOptions: subFieldOptions, + testMode: true + ); + + var signatureRequestId = "2f9781e1a8e2045224d808c153c2e1d3df6f8f2f"; + + try + { + var result = signatureRequestApi.SignatureRequestEdit(signatureRequestId, data); + Console.WriteLine(result); + } + catch (ApiException e) + { + Console.WriteLine("Exception when calling Dropbox Sign API: " + e.Message); + Console.WriteLine("Status Code: " + e.ErrorCode); + Console.WriteLine(e.StackTrace); + } + } +} + +``` + +#### Using the SignatureRequestEditWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // Edit Signature Request + ApiResponse response = apiInstance.SignatureRequestEditWithHttpInfo(signatureRequestId, signatureRequestEditRequest); + Debug.Write("Status Code: " + response.StatusCode); + Debug.Write("Response Headers: " + response.Headers); + Debug.Write("Response Body: " + response.Data); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling SignatureRequestApi.SignatureRequestEditWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **signatureRequestId** | **string** | The id of the SignatureRequest to edit. | | +| **signatureRequestEditRequest** | [**SignatureRequestEditRequest**](SignatureRequestEditRequest.md) | | | + +### Return type + +[**SignatureRequestGetResponse**](SignatureRequestGetResponse.md) + +### Authorization + +[api_key](../README.md#api_key), [oauth2](../README.md#oauth2) + +### HTTP request headers + + - **Content-Type**: application/json, multipart/form-data + - **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
| +| **4XX** | failed_operation | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +# **SignatureRequestEditEmbedded** +> SignatureRequestGetResponse SignatureRequestEditEmbedded (string signatureRequestId, SignatureRequestEditEmbeddedRequest signatureRequestEditEmbeddedRequest) + +Edit Embedded Signature Request + +Edits a SignatureRequest with the submitted documents to be signed in an embedded iFrame. If form_fields_per_document is not specified, a signature page will be affixed where all signers will be required to add their signature, signifying their agreement to all contained documents. Note that embedded signature requests can only be signed in embedded iFrames whereas normal signature requests can only be signed on Dropbox Sign. + +### Example +```csharp +using System; +using System.Collections.Generic; +using System.IO; +using Dropbox.Sign.Api; +using Dropbox.Sign.Client; +using Dropbox.Sign.Model; + +public class Example +{ + public static void Main() + { + var config = new Configuration(); + // Configure HTTP basic authorization: api_key + config.Username = "YOUR_API_KEY"; + + // or, configure Bearer (JWT) authorization: oauth2 + // config.AccessToken = "YOUR_BEARER_TOKEN"; + + var signatureRequestApi = new SignatureRequestApi(config); + + var signer1 = new SubSignatureRequestSigner( + emailAddress: "jack@example.com", + name: "Jack", + order: 0 + ); + + var signer2 = new SubSignatureRequestSigner( + emailAddress: "jill@example.com", + name: "Jill", + order: 1 + ); + + var signingOptions = new SubSigningOptions( + draw: true, + type: true, + upload: true, + phone: true, + defaultType: SubSigningOptions.DefaultTypeEnum.Draw + ); + + var files = new List { + new FileStream( + "./example_signature_request.pdf", + FileMode.Open, + FileAccess.Read, + FileShare.Read + ) + }; + + var data = new SignatureRequestEditEmbeddedRequest( + clientId: "ec64a202072370a737edf4a0eb7f4437", + title: "NDA with Acme Co.", + subject: "The NDA we talked about", + message: "Please sign this NDA and then we can discuss more. Let me know if you have any questions.", + signers: new List(){signer1, signer2}, + ccEmailAddresses: new List(){"lawyer1@dropboxsign.com", "lawyer2@dropboxsign.com"}, + files: files, + signingOptions: signingOptions, + testMode: true + ); + + var signatureRequestId = "2f9781e1a8e2045224d808c153c2e1d3df6f8f2f"; + + try + { + var result = signatureRequestApi.SignatureRequestEditEmbedded( + signatureRequestId, + data + ); + Console.WriteLine(result); + } + catch (ApiException e) + { + Console.WriteLine("Exception when calling Dropbox Sign API: " + e.Message); + Console.WriteLine("Status Code: " + e.ErrorCode); + Console.WriteLine(e.StackTrace); + } + } +} + +``` + +#### Using the SignatureRequestEditEmbeddedWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // Edit Embedded Signature Request + ApiResponse response = apiInstance.SignatureRequestEditEmbeddedWithHttpInfo(signatureRequestId, signatureRequestEditEmbeddedRequest); + Debug.Write("Status Code: " + response.StatusCode); + Debug.Write("Response Headers: " + response.Headers); + Debug.Write("Response Body: " + response.Data); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling SignatureRequestApi.SignatureRequestEditEmbeddedWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **signatureRequestId** | **string** | The id of the SignatureRequest to edit. | | +| **signatureRequestEditEmbeddedRequest** | [**SignatureRequestEditEmbeddedRequest**](SignatureRequestEditEmbeddedRequest.md) | | | + +### Return type + +[**SignatureRequestGetResponse**](SignatureRequestGetResponse.md) + +### Authorization + +[api_key](../README.md#api_key), [oauth2](../README.md#oauth2) + +### HTTP request headers + + - **Content-Type**: application/json, multipart/form-data + - **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
| +| **4XX** | failed_operation | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +# **SignatureRequestEditEmbeddedWithTemplate** +> SignatureRequestGetResponse SignatureRequestEditEmbeddedWithTemplate (string signatureRequestId, SignatureRequestEditEmbeddedWithTemplateRequest signatureRequestEditEmbeddedWithTemplateRequest) + +Edit Embedded Signature Request with Template + +Edits a SignatureRequest based on the given Template(s) to be signed in an embedded iFrame. Note that embedded signature requests can only be signed in embedded iFrames whereas normal signature requests can only be signed on Dropbox Sign. + +### Example +```csharp +using System; +using System.Collections.Generic; +using Dropbox.Sign.Api; +using Dropbox.Sign.Client; +using Dropbox.Sign.Model; + +public class Example +{ + public static void Main() + { + var config = new Configuration(); + // Configure HTTP basic authorization: api_key + config.Username = "YOUR_API_KEY"; + + // or, configure Bearer (JWT) authorization: oauth2 + // config.AccessToken = "YOUR_BEARER_TOKEN"; + + var signatureRequestApi = new SignatureRequestApi(config); + + var signer1 = new SubSignatureRequestTemplateSigner( + role: "Client", + name: "George" + ); + + var subSigningOptions = new SubSigningOptions( + draw: true, + type: true, + upload: true, + phone: false, + defaultType: SubSigningOptions.DefaultTypeEnum.Draw + ); + + var data = new SignatureRequestEditEmbeddedWithTemplateRequest( + clientId: "ec64a202072370a737edf4a0eb7f4437", + templateIds: new List(){"c26b8a16784a872da37ea946b9ddec7c1e11dff6"}, + subject: "Purchase Order", + message: "Glad we could come to an agreement.", + signers: new List(){signer1}, + signingOptions: subSigningOptions, + testMode: true + ); + + var signatureRequestId = "2f9781e1a8e2045224d808c153c2e1d3df6f8f2f"; + + try + { + var result = signatureRequestApi.SignatureRequestEditEmbeddedWithTemplate( + signatureRequestId, + data + ); + Console.WriteLine(result); + } + catch (ApiException e) + { + Console.WriteLine("Exception when calling Dropbox Sign API: " + e.Message); + Console.WriteLine("Status Code: " + e.ErrorCode); + Console.WriteLine(e.StackTrace); + } + } +} + +``` + +#### Using the SignatureRequestEditEmbeddedWithTemplateWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // Edit Embedded Signature Request with Template + ApiResponse response = apiInstance.SignatureRequestEditEmbeddedWithTemplateWithHttpInfo(signatureRequestId, signatureRequestEditEmbeddedWithTemplateRequest); + Debug.Write("Status Code: " + response.StatusCode); + Debug.Write("Response Headers: " + response.Headers); + Debug.Write("Response Body: " + response.Data); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling SignatureRequestApi.SignatureRequestEditEmbeddedWithTemplateWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **signatureRequestId** | **string** | The id of the SignatureRequest to edit. | | +| **signatureRequestEditEmbeddedWithTemplateRequest** | [**SignatureRequestEditEmbeddedWithTemplateRequest**](SignatureRequestEditEmbeddedWithTemplateRequest.md) | | | + +### Return type + +[**SignatureRequestGetResponse**](SignatureRequestGetResponse.md) + +### Authorization + +[api_key](../README.md#api_key), [oauth2](../README.md#oauth2) + +### HTTP request headers + + - **Content-Type**: application/json, multipart/form-data + - **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
| +| **4XX** | failed_operation | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +# **SignatureRequestEditWithTemplate** +> SignatureRequestGetResponse SignatureRequestEditWithTemplate (string signatureRequestId, SignatureRequestEditWithTemplateRequest signatureRequestEditWithTemplateRequest) + +Edit Signature Request With Template + +Edits and sends a SignatureRequest based off of the Template(s) specified with the template_ids parameter. **NOTE:** Edit and resend will not deduct your signature request quota. + +### Example +```csharp +using System; +using System.Collections.Generic; +using Dropbox.Sign.Api; +using Dropbox.Sign.Client; +using Dropbox.Sign.Model; + +public class Example +{ + public static void Main() + { + var config = new Configuration(); + // Configure HTTP basic authorization: api_key + config.Username = "YOUR_API_KEY"; + + // or, configure Bearer (JWT) authorization: oauth2 + // config.AccessToken = "YOUR_BEARER_TOKEN"; + + var signatureRequestApi = new SignatureRequestApi(config); + + var signer1 = new SubSignatureRequestTemplateSigner( + role: "Client", + emailAddress: "george@example.com", + name: "George" + ); + + var cc1 = new SubCC( + role: "Accounting", + emailAddress: "accouting@emaple.com" + ); + + var customField1 = new SubCustomField( + name: "Cost", + value: "$20,000", + editor: "Client", + required: true + ); + + var signingOptions = new SubSigningOptions( + draw: true, + type: true, + upload: true, + phone: false, + defaultType: SubSigningOptions.DefaultTypeEnum.Draw + ); + + var data = new SignatureRequestEditWithTemplateRequest( + templateIds: new List(){"c26b8a16784a872da37ea946b9ddec7c1e11dff6"}, + subject: "Purchase Order", + message: "Glad we could come to an agreement.", + signers: new List(){signer1}, + ccs: new List(){cc1}, + customFields: new List(){customField1}, + signingOptions: signingOptions, + testMode: true + ); + + var signatureRequestId = "2f9781e1a8e2045224d808c153c2e1d3df6f8f2f"; + + try + { + var result = signatureRequestApi.SignatureRequestEditWithTemplate(signatureRequestId, data); + Console.WriteLine(result); + } + catch (ApiException e) + { + Console.WriteLine("Exception when calling Dropbox Sign API: " + e.Message); + Console.WriteLine("Status Code: " + e.ErrorCode); + Console.WriteLine(e.StackTrace); + } + } +} + +``` + +#### Using the SignatureRequestEditWithTemplateWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // Edit Signature Request With Template + ApiResponse response = apiInstance.SignatureRequestEditWithTemplateWithHttpInfo(signatureRequestId, signatureRequestEditWithTemplateRequest); + Debug.Write("Status Code: " + response.StatusCode); + Debug.Write("Response Headers: " + response.Headers); + Debug.Write("Response Body: " + response.Data); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling SignatureRequestApi.SignatureRequestEditWithTemplateWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **signatureRequestId** | **string** | The id of the SignatureRequest to edit. | | +| **signatureRequestEditWithTemplateRequest** | [**SignatureRequestEditWithTemplateRequest**](SignatureRequestEditWithTemplateRequest.md) | | | + +### Return type + +[**SignatureRequestGetResponse**](SignatureRequestGetResponse.md) + +### Authorization + +[api_key](../README.md#api_key), [oauth2](../README.md#oauth2) + +### HTTP request headers + + - **Content-Type**: application/json, multipart/form-data + - **Accept**: application/json + + ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| diff --git a/sdks/dotnet/docs/SignatureRequestEditEmbeddedRequest.md b/sdks/dotnet/docs/SignatureRequestEditEmbeddedRequest.md new file mode 100644 index 000000000..3d7e41773 --- /dev/null +++ b/sdks/dotnet/docs/SignatureRequestEditEmbeddedRequest.md @@ -0,0 +1,10 @@ +# Dropbox.Sign.Model.SignatureRequestEditEmbeddedRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ClientId** | **string** | Client id of the app you're using to create this embedded signature request. Used for security purposes. | **Files** | **List<System.IO.Stream>** | Use `files[]` to indicate the uploaded file(s) to send for signature.

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

This endpoint requires either **files** or **file_urls[]**, but not both. | [optional] **Signers** | [**List<SubSignatureRequestSigner>**](SubSignatureRequestSigner.md) | Add Signers to your Signature Request.

This endpoint requires either **signers** or **grouped_signers**, but not both. | [optional] **GroupedSigners** | [**List<SubSignatureRequestGroupedSigners>**](SubSignatureRequestGroupedSigners.md) | Add Grouped Signers to your Signature Request.

This endpoint requires either **signers** or **grouped_signers**, but not both. | [optional] **AllowDecline** | **bool** | Allows signers to decline to sign a document if `true`. Defaults to `false`. | [optional] [default to false]**AllowReassign** | **bool** | Allows signers to reassign their signature requests to other signers if set to `true`. Defaults to `false`.

**NOTE:** Only available for Premium plan. | [optional] [default to false]**Attachments** | [**List<SubAttachment>**](SubAttachment.md) | A list describing the attachments | [optional] **CcEmailAddresses** | **List<string>** | The email addresses that should be CCed. | [optional] **CustomFields** | [**List<SubCustomField>**](SubCustomField.md) | When used together with merge fields, `custom_fields` allows users to add pre-filled data to their signature requests.

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

For using pre-filled on repeatable signature requests, merge fields are added to templates in the Dropbox Sign UI or by calling [/template/create_embedded_draft](/api/reference/operation/templateCreateEmbeddedDraft) and then passing `custom_fields` on subsequent signature requests referencing that template. | [optional] **FieldOptions** | [**SubFieldOptions**](SubFieldOptions.md) | | [optional] **FormFieldGroups** | [**List<SubFormFieldGroup>**](SubFormFieldGroup.md) | Group information for fields defined in `form_fields_per_document`. String-indexed JSON array with `group_label` and `requirement` keys. `form_fields_per_document` must contain fields referencing a group defined in `form_field_groups`. | [optional] **FormFieldRules** | [**List<SubFormFieldRule>**](SubFormFieldRule.md) | Conditional Logic rules for fields defined in `form_fields_per_document`. | [optional] **FormFieldsPerDocument** | [**List<SubFormFieldsPerDocumentBase>**](SubFormFieldsPerDocumentBase.md) | The fields that should appear on the document, expressed as an array of objects. (For more details you can read about it here: [Using Form Fields per Document](/docs/openapi/form-fields-per-document).)

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

* Text Field use `SubFormFieldsPerDocumentText`
* Dropdown Field use `SubFormFieldsPerDocumentDropdown`
* Hyperlink Field use `SubFormFieldsPerDocumentHyperlink`
* Checkbox Field use `SubFormFieldsPerDocumentCheckbox`
* Radio Field use `SubFormFieldsPerDocumentRadio`
* Signature Field use `SubFormFieldsPerDocumentSignature`
* Date Signed Field use `SubFormFieldsPerDocumentDateSigned`
* Initials Field use `SubFormFieldsPerDocumentInitials`
* Text Merge Field use `SubFormFieldsPerDocumentTextMerge`
* Checkbox Merge Field use `SubFormFieldsPerDocumentCheckboxMerge` | [optional] **HideTextTags** | **bool** | Enables automatic Text Tag removal when set to true.

**NOTE:** Removing text tags this way can cause unwanted clipping. We recommend leaving this setting on `false` and instead hiding your text tags using white text or a similar approach. See the [Text Tags Walkthrough](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) for more information. | [optional] [default to false]**Message** | **string** | The custom message in the email that will be sent to the signers. | [optional] **Metadata** | **Dictionary<string, Object>** | Key-value data that should be attached to the signature request. This metadata is included in all API responses and events involving the signature request. For example, use the metadata field to store a signer's order number for look up when receiving events for the signature request.

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

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

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

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

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

**NOTE:** Keep your signer's information safe by ensuring that the _signer on your signature request is the intended party_ before using this feature. | [optional] [default to false] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/sdks/dotnet/docs/SignatureRequestEditRequest.md b/sdks/dotnet/docs/SignatureRequestEditRequest.md new file mode 100644 index 000000000..20f216403 --- /dev/null +++ b/sdks/dotnet/docs/SignatureRequestEditRequest.md @@ -0,0 +1,10 @@ +# Dropbox.Sign.Model.SignatureRequestEditRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Files** | **List<System.IO.Stream>** | Use `files[]` to indicate the uploaded file(s) to send for signature.

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

This endpoint requires either **files** or **file_urls[]**, but not both. | [optional] **Signers** | [**List<SubSignatureRequestSigner>**](SubSignatureRequestSigner.md) | Add Signers to your Signature Request.

This endpoint requires either **signers** or **grouped_signers**, but not both. | [optional] **GroupedSigners** | [**List<SubSignatureRequestGroupedSigners>**](SubSignatureRequestGroupedSigners.md) | Add Grouped Signers to your Signature Request.

This endpoint requires either **signers** or **grouped_signers**, but not both. | [optional] **AllowDecline** | **bool** | Allows signers to decline to sign a document if `true`. Defaults to `false`. | [optional] [default to false]**AllowReassign** | **bool** | Allows signers to reassign their signature requests to other signers if set to `true`. Defaults to `false`.

**NOTE:** Only available for Premium plan and higher. | [optional] [default to false]**Attachments** | [**List<SubAttachment>**](SubAttachment.md) | A list describing the attachments | [optional] **CcEmailAddresses** | **List<string>** | The email addresses that should be CCed. | [optional] **ClientId** | **string** | The client id of the API App you want to associate with this request. Used to apply the branding and callback url defined for the app. | [optional] **CustomFields** | [**List<SubCustomField>**](SubCustomField.md) | When used together with merge fields, `custom_fields` allows users to add pre-filled data to their signature requests.

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

For using pre-filled on repeatable signature requests, merge fields are added to templates in the Dropbox Sign UI or by calling [/template/create_embedded_draft](/api/reference/operation/templateCreateEmbeddedDraft) and then passing `custom_fields` on subsequent signature requests referencing that template. | [optional] **FieldOptions** | [**SubFieldOptions**](SubFieldOptions.md) | | [optional] **FormFieldGroups** | [**List<SubFormFieldGroup>**](SubFormFieldGroup.md) | Group information for fields defined in `form_fields_per_document`. String-indexed JSON array with `group_label` and `requirement` keys. `form_fields_per_document` must contain fields referencing a group defined in `form_field_groups`. | [optional] **FormFieldRules** | [**List<SubFormFieldRule>**](SubFormFieldRule.md) | Conditional Logic rules for fields defined in `form_fields_per_document`. | [optional] **FormFieldsPerDocument** | [**List<SubFormFieldsPerDocumentBase>**](SubFormFieldsPerDocumentBase.md) | The fields that should appear on the document, expressed as an array of objects. (For more details you can read about it here: [Using Form Fields per Document](/docs/openapi/form-fields-per-document).)

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

* Text Field use `SubFormFieldsPerDocumentText`
* Dropdown Field use `SubFormFieldsPerDocumentDropdown`
* Hyperlink Field use `SubFormFieldsPerDocumentHyperlink`
* Checkbox Field use `SubFormFieldsPerDocumentCheckbox`
* Radio Field use `SubFormFieldsPerDocumentRadio`
* Signature Field use `SubFormFieldsPerDocumentSignature`
* Date Signed Field use `SubFormFieldsPerDocumentDateSigned`
* Initials Field use `SubFormFieldsPerDocumentInitials`
* Text Merge Field use `SubFormFieldsPerDocumentTextMerge`
* Checkbox Merge Field use `SubFormFieldsPerDocumentCheckboxMerge` | [optional] **HideTextTags** | **bool** | Enables automatic Text Tag removal when set to true.

**NOTE:** Removing text tags this way can cause unwanted clipping. We recommend leaving this setting on `false` and instead hiding your text tags using white text or a similar approach. See the [Text Tags Walkthrough](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) for more information. | [optional] [default to false]**IsEid** | **bool** | Send with a value of `true` if you wish to enable [electronic identification (eID)](https://www.hellosign.com/features/electronic-id), which requires the signer to verify their identity with an eID provider to sign a document.<br>
**NOTE:** eID is only available on the Premium API plan. Cannot be used in `test_mode`. Only works on requests with one signer. | [optional] [default to false]**Message** | **string** | The custom message in the email that will be sent to the signers. | [optional] **Metadata** | **Dictionary<string, Object>** | Key-value data that should be attached to the signature request. This metadata is included in all API responses and events involving the signature request. For example, use the metadata field to store a signer's order number for look up when receiving events for the signature request.

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

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

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

Each request can include up to 10 metadata keys (or 50 nested metadata keys), with key names up to 40 characters long and values up to 1000 characters long. | [optional] **SigningOptions** | [**SubSigningOptions**](SubSigningOptions.md) | | [optional] **SigningRedirectUrl** | **string** | The URL you want signers redirected to after they successfully sign. | [optional] **Subject** | **string** | The subject in the email that will be sent to the signers. | [optional] **TestMode** | **bool** | Whether this is a test, the signature request will not be legally binding if set to `true`. Defaults to `false`. | [optional] [default to false]**Title** | **string** | The title you want to assign to the SignatureRequest. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/sdks/dotnet/src/Dropbox.Sign/Api/SignatureRequestApi.cs b/sdks/dotnet/src/Dropbox.Sign/Api/SignatureRequestApi.cs index 7671b5780..71c7ec8b1 100644 --- a/sdks/dotnet/src/Dropbox.Sign/Api/SignatureRequestApi.cs +++ b/sdks/dotnet/src/Dropbox.Sign/Api/SignatureRequestApi.cs @@ -143,6 +143,106 @@ public interface ISignatureRequestApiSync : IApiAccessor /// ApiResponse of SignatureRequestGetResponse ApiResponse SignatureRequestCreateEmbeddedWithTemplateWithHttpInfo(SignatureRequestCreateEmbeddedWithTemplateRequest signatureRequestCreateEmbeddedWithTemplateRequest, int operationIndex = 0); /// + /// Edit Signature Request + /// + /// + /// Edits and sends a SignatureRequest with the submitted documents. If `form_fields_per_document` is not specified, a signature page will be affixed where all signers will be required to add their signature, signifying their agreement to all contained documents. **NOTE:** Edit and resend will not deduct your signature request quota. + /// + /// Thrown when fails to make API call + /// The id of the SignatureRequest to edit. + /// + /// Index associated with the operation. + /// SignatureRequestGetResponse + SignatureRequestGetResponse SignatureRequestEdit(string signatureRequestId, SignatureRequestEditRequest signatureRequestEditRequest, int operationIndex = 0); + + /// + /// Edit Signature Request + /// + /// + /// Edits and sends a SignatureRequest with the submitted documents. If `form_fields_per_document` is not specified, a signature page will be affixed where all signers will be required to add their signature, signifying their agreement to all contained documents. **NOTE:** Edit and resend will not deduct your signature request quota. + /// + /// Thrown when fails to make API call + /// The id of the SignatureRequest to edit. + /// + /// Index associated with the operation. + /// ApiResponse of SignatureRequestGetResponse + ApiResponse SignatureRequestEditWithHttpInfo(string signatureRequestId, SignatureRequestEditRequest signatureRequestEditRequest, int operationIndex = 0); + /// + /// Edit Embedded Signature Request + /// + /// + /// Edits a SignatureRequest with the submitted documents to be signed in an embedded iFrame. If form_fields_per_document is not specified, a signature page will be affixed where all signers will be required to add their signature, signifying their agreement to all contained documents. Note that embedded signature requests can only be signed in embedded iFrames whereas normal signature requests can only be signed on Dropbox Sign. + /// + /// Thrown when fails to make API call + /// The id of the SignatureRequest to edit. + /// + /// Index associated with the operation. + /// SignatureRequestGetResponse + SignatureRequestGetResponse SignatureRequestEditEmbedded(string signatureRequestId, SignatureRequestEditEmbeddedRequest signatureRequestEditEmbeddedRequest, int operationIndex = 0); + + /// + /// Edit Embedded Signature Request + /// + /// + /// Edits a SignatureRequest with the submitted documents to be signed in an embedded iFrame. If form_fields_per_document is not specified, a signature page will be affixed where all signers will be required to add their signature, signifying their agreement to all contained documents. Note that embedded signature requests can only be signed in embedded iFrames whereas normal signature requests can only be signed on Dropbox Sign. + /// + /// Thrown when fails to make API call + /// The id of the SignatureRequest to edit. + /// + /// Index associated with the operation. + /// ApiResponse of SignatureRequestGetResponse + ApiResponse SignatureRequestEditEmbeddedWithHttpInfo(string signatureRequestId, SignatureRequestEditEmbeddedRequest signatureRequestEditEmbeddedRequest, int operationIndex = 0); + /// + /// Edit Embedded Signature Request with Template + /// + /// + /// Edits a SignatureRequest based on the given Template(s) to be signed in an embedded iFrame. Note that embedded signature requests can only be signed in embedded iFrames whereas normal signature requests can only be signed on Dropbox Sign. + /// + /// Thrown when fails to make API call + /// The id of the SignatureRequest to edit. + /// + /// Index associated with the operation. + /// SignatureRequestGetResponse + SignatureRequestGetResponse SignatureRequestEditEmbeddedWithTemplate(string signatureRequestId, SignatureRequestEditEmbeddedWithTemplateRequest signatureRequestEditEmbeddedWithTemplateRequest, int operationIndex = 0); + + /// + /// Edit Embedded Signature Request with Template + /// + /// + /// Edits a SignatureRequest based on the given Template(s) to be signed in an embedded iFrame. Note that embedded signature requests can only be signed in embedded iFrames whereas normal signature requests can only be signed on Dropbox Sign. + /// + /// Thrown when fails to make API call + /// The id of the SignatureRequest to edit. + /// + /// Index associated with the operation. + /// ApiResponse of SignatureRequestGetResponse + ApiResponse SignatureRequestEditEmbeddedWithTemplateWithHttpInfo(string signatureRequestId, SignatureRequestEditEmbeddedWithTemplateRequest signatureRequestEditEmbeddedWithTemplateRequest, int operationIndex = 0); + /// + /// Edit Signature Request With Template + /// + /// + /// Edits and sends a SignatureRequest based off of the Template(s) specified with the template_ids parameter. **NOTE:** Edit and resend will not deduct your signature request quota. + /// + /// Thrown when fails to make API call + /// The id of the SignatureRequest to edit. + /// + /// Index associated with the operation. + /// SignatureRequestGetResponse + SignatureRequestGetResponse SignatureRequestEditWithTemplate(string signatureRequestId, SignatureRequestEditWithTemplateRequest signatureRequestEditWithTemplateRequest, int operationIndex = 0); + + /// + /// Edit Signature Request With Template + /// + /// + /// Edits and sends a SignatureRequest based off of the Template(s) specified with the template_ids parameter. **NOTE:** Edit and resend will not deduct your signature request quota. + /// + /// Thrown when fails to make API call + /// The id of the SignatureRequest to edit. + /// + /// Index associated with the operation. + /// ApiResponse of SignatureRequestGetResponse + ApiResponse SignatureRequestEditWithTemplateWithHttpInfo(string signatureRequestId, SignatureRequestEditWithTemplateRequest signatureRequestEditWithTemplateRequest, int operationIndex = 0); + /// /// Download Files /// /// @@ -544,6 +644,114 @@ public interface ISignatureRequestApiAsync : IApiAccessor /// Task of ApiResponse (SignatureRequestGetResponse) System.Threading.Tasks.Task> SignatureRequestCreateEmbeddedWithTemplateWithHttpInfoAsync(SignatureRequestCreateEmbeddedWithTemplateRequest signatureRequestCreateEmbeddedWithTemplateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); /// + /// Edit Signature Request + /// + /// + /// Edits and sends a SignatureRequest with the submitted documents. If `form_fields_per_document` is not specified, a signature page will be affixed where all signers will be required to add their signature, signifying their agreement to all contained documents. **NOTE:** Edit and resend will not deduct your signature request quota. + /// + /// Thrown when fails to make API call + /// The id of the SignatureRequest to edit. + /// + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of SignatureRequestGetResponse + System.Threading.Tasks.Task SignatureRequestEditAsync(string signatureRequestId, SignatureRequestEditRequest signatureRequestEditRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + + /// + /// Edit Signature Request + /// + /// + /// Edits and sends a SignatureRequest with the submitted documents. If `form_fields_per_document` is not specified, a signature page will be affixed where all signers will be required to add their signature, signifying their agreement to all contained documents. **NOTE:** Edit and resend will not deduct your signature request quota. + /// + /// Thrown when fails to make API call + /// The id of the SignatureRequest to edit. + /// + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (SignatureRequestGetResponse) + System.Threading.Tasks.Task> SignatureRequestEditWithHttpInfoAsync(string signatureRequestId, SignatureRequestEditRequest signatureRequestEditRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + /// + /// Edit Embedded Signature Request + /// + /// + /// Edits a SignatureRequest with the submitted documents to be signed in an embedded iFrame. If form_fields_per_document is not specified, a signature page will be affixed where all signers will be required to add their signature, signifying their agreement to all contained documents. Note that embedded signature requests can only be signed in embedded iFrames whereas normal signature requests can only be signed on Dropbox Sign. + /// + /// Thrown when fails to make API call + /// The id of the SignatureRequest to edit. + /// + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of SignatureRequestGetResponse + System.Threading.Tasks.Task SignatureRequestEditEmbeddedAsync(string signatureRequestId, SignatureRequestEditEmbeddedRequest signatureRequestEditEmbeddedRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + + /// + /// Edit Embedded Signature Request + /// + /// + /// Edits a SignatureRequest with the submitted documents to be signed in an embedded iFrame. If form_fields_per_document is not specified, a signature page will be affixed where all signers will be required to add their signature, signifying their agreement to all contained documents. Note that embedded signature requests can only be signed in embedded iFrames whereas normal signature requests can only be signed on Dropbox Sign. + /// + /// Thrown when fails to make API call + /// The id of the SignatureRequest to edit. + /// + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (SignatureRequestGetResponse) + System.Threading.Tasks.Task> SignatureRequestEditEmbeddedWithHttpInfoAsync(string signatureRequestId, SignatureRequestEditEmbeddedRequest signatureRequestEditEmbeddedRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + /// + /// Edit Embedded Signature Request with Template + /// + /// + /// Edits a SignatureRequest based on the given Template(s) to be signed in an embedded iFrame. Note that embedded signature requests can only be signed in embedded iFrames whereas normal signature requests can only be signed on Dropbox Sign. + /// + /// Thrown when fails to make API call + /// The id of the SignatureRequest to edit. + /// + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of SignatureRequestGetResponse + System.Threading.Tasks.Task SignatureRequestEditEmbeddedWithTemplateAsync(string signatureRequestId, SignatureRequestEditEmbeddedWithTemplateRequest signatureRequestEditEmbeddedWithTemplateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + + /// + /// Edit Embedded Signature Request with Template + /// + /// + /// Edits a SignatureRequest based on the given Template(s) to be signed in an embedded iFrame. Note that embedded signature requests can only be signed in embedded iFrames whereas normal signature requests can only be signed on Dropbox Sign. + /// + /// Thrown when fails to make API call + /// The id of the SignatureRequest to edit. + /// + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (SignatureRequestGetResponse) + System.Threading.Tasks.Task> SignatureRequestEditEmbeddedWithTemplateWithHttpInfoAsync(string signatureRequestId, SignatureRequestEditEmbeddedWithTemplateRequest signatureRequestEditEmbeddedWithTemplateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + /// + /// Edit Signature Request With Template + /// + /// + /// Edits and sends a SignatureRequest based off of the Template(s) specified with the template_ids parameter. **NOTE:** Edit and resend will not deduct your signature request quota. + /// + /// Thrown when fails to make API call + /// The id of the SignatureRequest to edit. + /// + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of SignatureRequestGetResponse + System.Threading.Tasks.Task SignatureRequestEditWithTemplateAsync(string signatureRequestId, SignatureRequestEditWithTemplateRequest signatureRequestEditWithTemplateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + + /// + /// Edit Signature Request With Template + /// + /// + /// Edits and sends a SignatureRequest based off of the Template(s) specified with the template_ids parameter. **NOTE:** Edit and resend will not deduct your signature request quota. + /// + /// Thrown when fails to make API call + /// The id of the SignatureRequest to edit. + /// + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (SignatureRequestGetResponse) + System.Threading.Tasks.Task> SignatureRequestEditWithTemplateWithHttpInfoAsync(string signatureRequestId, SignatureRequestEditWithTemplateRequest signatureRequestEditWithTemplateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + /// /// Download Files /// /// @@ -1842,6 +2050,814 @@ public Dropbox.Sign.Client.ApiResponse SignatureReq return localVarResponse; } + /// + /// Edit Signature Request Edits and sends a SignatureRequest with the submitted documents. If `form_fields_per_document` is not specified, a signature page will be affixed where all signers will be required to add their signature, signifying their agreement to all contained documents. **NOTE:** Edit and resend will not deduct your signature request quota. + /// + /// Thrown when fails to make API call + /// The id of the SignatureRequest to edit. + /// + /// Index associated with the operation. + /// SignatureRequestGetResponse + public SignatureRequestGetResponse SignatureRequestEdit(string signatureRequestId, SignatureRequestEditRequest signatureRequestEditRequest, int operationIndex = 0) + { + Dropbox.Sign.Client.ApiResponse localVarResponse = SignatureRequestEditWithHttpInfo(signatureRequestId, signatureRequestEditRequest); + return localVarResponse.Data; + } + + /// + /// Edit Signature Request Edits and sends a SignatureRequest with the submitted documents. If `form_fields_per_document` is not specified, a signature page will be affixed where all signers will be required to add their signature, signifying their agreement to all contained documents. **NOTE:** Edit and resend will not deduct your signature request quota. + /// + /// Thrown when fails to make API call + /// The id of the SignatureRequest to edit. + /// + /// Index associated with the operation. + /// ApiResponse of SignatureRequestGetResponse + public Dropbox.Sign.Client.ApiResponse SignatureRequestEditWithHttpInfo(string signatureRequestId, SignatureRequestEditRequest signatureRequestEditRequest, int operationIndex = 0) + { + // verify the required parameter 'signatureRequestId' is set + if (signatureRequestId == null) + { + throw new Dropbox.Sign.Client.ApiException(400, "Missing required parameter 'signatureRequestId' when calling SignatureRequestApi->SignatureRequestEdit"); + } + + // verify the required parameter 'signatureRequestEditRequest' is set + if (signatureRequestEditRequest == null) + { + throw new Dropbox.Sign.Client.ApiException(400, "Missing required parameter 'signatureRequestEditRequest' when calling SignatureRequestApi->SignatureRequestEdit"); + } + + Dropbox.Sign.Client.RequestOptions localVarRequestOptions = new Dropbox.Sign.Client.RequestOptions(); + + var localVarContentType = ""; + var openApiTypes = signatureRequestEditRequest.GetOpenApiTypes(); + if (ClientUtils.HasFileType(openApiTypes)) + { + ClientUtils.SetFormData(localVarRequestOptions, openApiTypes); + localVarContentType = "multipart/form-data"; + } + else + { + localVarContentType = "application/json"; + localVarRequestOptions.Data = signatureRequestEditRequest; + } + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } + + var localVarAccept = Dropbox.Sign.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } + + localVarRequestOptions.PathParameters.Add("signature_request_id", Dropbox.Sign.Client.ClientUtils.ParameterToString(signatureRequestId)); // path parameter + + localVarRequestOptions.Operation = "SignatureRequestApi.SignatureRequestEdit"; + localVarRequestOptions.OperationIndex = operationIndex; + + // authentication (api_key) required + // http basic authentication required + if (!string.IsNullOrEmpty(this.Configuration.Username) || !string.IsNullOrEmpty(this.Configuration.Password) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Basic " + Dropbox.Sign.Client.ClientUtils.Base64Encode(this.Configuration.Username + ":" + this.Configuration.Password)); + } + // authentication (oauth2) required + // bearer authentication required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + + // make the HTTP request + var localVarResponse = this.Client.Put("/signature_request/edit/{signature_request_id}", localVarRequestOptions, this.Configuration); + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("SignatureRequestEdit", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + + /// + /// Edit Signature Request Edits and sends a SignatureRequest with the submitted documents. If `form_fields_per_document` is not specified, a signature page will be affixed where all signers will be required to add their signature, signifying their agreement to all contained documents. **NOTE:** Edit and resend will not deduct your signature request quota. + /// + /// Thrown when fails to make API call + /// The id of the SignatureRequest to edit. + /// + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of SignatureRequestGetResponse + public async System.Threading.Tasks.Task SignatureRequestEditAsync(string signatureRequestId, SignatureRequestEditRequest signatureRequestEditRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + { + Dropbox.Sign.Client.ApiResponse localVarResponse = await SignatureRequestEditWithHttpInfoAsync(signatureRequestId, signatureRequestEditRequest, operationIndex, cancellationToken).ConfigureAwait(false); + return localVarResponse.Data; + } + + /// + /// Edit Signature Request Edits and sends a SignatureRequest with the submitted documents. If `form_fields_per_document` is not specified, a signature page will be affixed where all signers will be required to add their signature, signifying their agreement to all contained documents. **NOTE:** Edit and resend will not deduct your signature request quota. + /// + /// Thrown when fails to make API call + /// The id of the SignatureRequest to edit. + /// + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (SignatureRequestGetResponse) + public async System.Threading.Tasks.Task> SignatureRequestEditWithHttpInfoAsync(string signatureRequestId, SignatureRequestEditRequest signatureRequestEditRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + { + // verify the required parameter 'signatureRequestId' is set + if (signatureRequestId == null) + { + throw new Dropbox.Sign.Client.ApiException(400, "Missing required parameter 'signatureRequestId' when calling SignatureRequestApi->SignatureRequestEdit"); + } + + // verify the required parameter 'signatureRequestEditRequest' is set + if (signatureRequestEditRequest == null) + { + throw new Dropbox.Sign.Client.ApiException(400, "Missing required parameter 'signatureRequestEditRequest' when calling SignatureRequestApi->SignatureRequestEdit"); + } + + + Dropbox.Sign.Client.RequestOptions localVarRequestOptions = new Dropbox.Sign.Client.RequestOptions(); + + var localVarContentType = ""; + var openApiTypes = signatureRequestEditRequest.GetOpenApiTypes(); + if (ClientUtils.HasFileType(openApiTypes)) + { + ClientUtils.SetFormData(localVarRequestOptions, openApiTypes); + localVarContentType = "multipart/form-data"; + } + else + { + localVarContentType = "application/json"; + localVarRequestOptions.Data = signatureRequestEditRequest; + } + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } + + var localVarAccept = Dropbox.Sign.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } + + localVarRequestOptions.PathParameters.Add("signature_request_id", Dropbox.Sign.Client.ClientUtils.ParameterToString(signatureRequestId)); // path parameter + + localVarRequestOptions.Operation = "SignatureRequestApi.SignatureRequestEdit"; + localVarRequestOptions.OperationIndex = operationIndex; + + // authentication (api_key) required + // http basic authentication required + if (!string.IsNullOrEmpty(this.Configuration.Username) || !string.IsNullOrEmpty(this.Configuration.Password) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Basic " + Dropbox.Sign.Client.ClientUtils.Base64Encode(this.Configuration.Username + ":" + this.Configuration.Password)); + } + // authentication (oauth2) required + // bearer authentication required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + + // make the HTTP request + var localVarResponse = await this.AsynchronousClient.PutAsync("/signature_request/edit/{signature_request_id}", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("SignatureRequestEdit", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + + /// + /// Edit Embedded Signature Request Edits a SignatureRequest with the submitted documents to be signed in an embedded iFrame. If form_fields_per_document is not specified, a signature page will be affixed where all signers will be required to add their signature, signifying their agreement to all contained documents. Note that embedded signature requests can only be signed in embedded iFrames whereas normal signature requests can only be signed on Dropbox Sign. + /// + /// Thrown when fails to make API call + /// The id of the SignatureRequest to edit. + /// + /// Index associated with the operation. + /// SignatureRequestGetResponse + public SignatureRequestGetResponse SignatureRequestEditEmbedded(string signatureRequestId, SignatureRequestEditEmbeddedRequest signatureRequestEditEmbeddedRequest, int operationIndex = 0) + { + Dropbox.Sign.Client.ApiResponse localVarResponse = SignatureRequestEditEmbeddedWithHttpInfo(signatureRequestId, signatureRequestEditEmbeddedRequest); + return localVarResponse.Data; + } + + /// + /// Edit Embedded Signature Request Edits a SignatureRequest with the submitted documents to be signed in an embedded iFrame. If form_fields_per_document is not specified, a signature page will be affixed where all signers will be required to add their signature, signifying their agreement to all contained documents. Note that embedded signature requests can only be signed in embedded iFrames whereas normal signature requests can only be signed on Dropbox Sign. + /// + /// Thrown when fails to make API call + /// The id of the SignatureRequest to edit. + /// + /// Index associated with the operation. + /// ApiResponse of SignatureRequestGetResponse + public Dropbox.Sign.Client.ApiResponse SignatureRequestEditEmbeddedWithHttpInfo(string signatureRequestId, SignatureRequestEditEmbeddedRequest signatureRequestEditEmbeddedRequest, int operationIndex = 0) + { + // verify the required parameter 'signatureRequestId' is set + if (signatureRequestId == null) + { + throw new Dropbox.Sign.Client.ApiException(400, "Missing required parameter 'signatureRequestId' when calling SignatureRequestApi->SignatureRequestEditEmbedded"); + } + + // verify the required parameter 'signatureRequestEditEmbeddedRequest' is set + if (signatureRequestEditEmbeddedRequest == null) + { + throw new Dropbox.Sign.Client.ApiException(400, "Missing required parameter 'signatureRequestEditEmbeddedRequest' when calling SignatureRequestApi->SignatureRequestEditEmbedded"); + } + + Dropbox.Sign.Client.RequestOptions localVarRequestOptions = new Dropbox.Sign.Client.RequestOptions(); + + var localVarContentType = ""; + var openApiTypes = signatureRequestEditEmbeddedRequest.GetOpenApiTypes(); + if (ClientUtils.HasFileType(openApiTypes)) + { + ClientUtils.SetFormData(localVarRequestOptions, openApiTypes); + localVarContentType = "multipart/form-data"; + } + else + { + localVarContentType = "application/json"; + localVarRequestOptions.Data = signatureRequestEditEmbeddedRequest; + } + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } + + var localVarAccept = Dropbox.Sign.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } + + localVarRequestOptions.PathParameters.Add("signature_request_id", Dropbox.Sign.Client.ClientUtils.ParameterToString(signatureRequestId)); // path parameter + + localVarRequestOptions.Operation = "SignatureRequestApi.SignatureRequestEditEmbedded"; + localVarRequestOptions.OperationIndex = operationIndex; + + // authentication (api_key) required + // http basic authentication required + if (!string.IsNullOrEmpty(this.Configuration.Username) || !string.IsNullOrEmpty(this.Configuration.Password) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Basic " + Dropbox.Sign.Client.ClientUtils.Base64Encode(this.Configuration.Username + ":" + this.Configuration.Password)); + } + // authentication (oauth2) required + // bearer authentication required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + + // make the HTTP request + var localVarResponse = this.Client.Put("/signature_request/edit_embedded/{signature_request_id}", localVarRequestOptions, this.Configuration); + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("SignatureRequestEditEmbedded", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + + /// + /// Edit Embedded Signature Request Edits a SignatureRequest with the submitted documents to be signed in an embedded iFrame. If form_fields_per_document is not specified, a signature page will be affixed where all signers will be required to add their signature, signifying their agreement to all contained documents. Note that embedded signature requests can only be signed in embedded iFrames whereas normal signature requests can only be signed on Dropbox Sign. + /// + /// Thrown when fails to make API call + /// The id of the SignatureRequest to edit. + /// + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of SignatureRequestGetResponse + public async System.Threading.Tasks.Task SignatureRequestEditEmbeddedAsync(string signatureRequestId, SignatureRequestEditEmbeddedRequest signatureRequestEditEmbeddedRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + { + Dropbox.Sign.Client.ApiResponse localVarResponse = await SignatureRequestEditEmbeddedWithHttpInfoAsync(signatureRequestId, signatureRequestEditEmbeddedRequest, operationIndex, cancellationToken).ConfigureAwait(false); + return localVarResponse.Data; + } + + /// + /// Edit Embedded Signature Request Edits a SignatureRequest with the submitted documents to be signed in an embedded iFrame. If form_fields_per_document is not specified, a signature page will be affixed where all signers will be required to add their signature, signifying their agreement to all contained documents. Note that embedded signature requests can only be signed in embedded iFrames whereas normal signature requests can only be signed on Dropbox Sign. + /// + /// Thrown when fails to make API call + /// The id of the SignatureRequest to edit. + /// + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (SignatureRequestGetResponse) + public async System.Threading.Tasks.Task> SignatureRequestEditEmbeddedWithHttpInfoAsync(string signatureRequestId, SignatureRequestEditEmbeddedRequest signatureRequestEditEmbeddedRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + { + // verify the required parameter 'signatureRequestId' is set + if (signatureRequestId == null) + { + throw new Dropbox.Sign.Client.ApiException(400, "Missing required parameter 'signatureRequestId' when calling SignatureRequestApi->SignatureRequestEditEmbedded"); + } + + // verify the required parameter 'signatureRequestEditEmbeddedRequest' is set + if (signatureRequestEditEmbeddedRequest == null) + { + throw new Dropbox.Sign.Client.ApiException(400, "Missing required parameter 'signatureRequestEditEmbeddedRequest' when calling SignatureRequestApi->SignatureRequestEditEmbedded"); + } + + + Dropbox.Sign.Client.RequestOptions localVarRequestOptions = new Dropbox.Sign.Client.RequestOptions(); + + var localVarContentType = ""; + var openApiTypes = signatureRequestEditEmbeddedRequest.GetOpenApiTypes(); + if (ClientUtils.HasFileType(openApiTypes)) + { + ClientUtils.SetFormData(localVarRequestOptions, openApiTypes); + localVarContentType = "multipart/form-data"; + } + else + { + localVarContentType = "application/json"; + localVarRequestOptions.Data = signatureRequestEditEmbeddedRequest; + } + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } + + var localVarAccept = Dropbox.Sign.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } + + localVarRequestOptions.PathParameters.Add("signature_request_id", Dropbox.Sign.Client.ClientUtils.ParameterToString(signatureRequestId)); // path parameter + + localVarRequestOptions.Operation = "SignatureRequestApi.SignatureRequestEditEmbedded"; + localVarRequestOptions.OperationIndex = operationIndex; + + // authentication (api_key) required + // http basic authentication required + if (!string.IsNullOrEmpty(this.Configuration.Username) || !string.IsNullOrEmpty(this.Configuration.Password) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Basic " + Dropbox.Sign.Client.ClientUtils.Base64Encode(this.Configuration.Username + ":" + this.Configuration.Password)); + } + // authentication (oauth2) required + // bearer authentication required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + + // make the HTTP request + var localVarResponse = await this.AsynchronousClient.PutAsync("/signature_request/edit_embedded/{signature_request_id}", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("SignatureRequestEditEmbedded", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + + /// + /// Edit Embedded Signature Request with Template Edits a SignatureRequest based on the given Template(s) to be signed in an embedded iFrame. Note that embedded signature requests can only be signed in embedded iFrames whereas normal signature requests can only be signed on Dropbox Sign. + /// + /// Thrown when fails to make API call + /// The id of the SignatureRequest to edit. + /// + /// Index associated with the operation. + /// SignatureRequestGetResponse + public SignatureRequestGetResponse SignatureRequestEditEmbeddedWithTemplate(string signatureRequestId, SignatureRequestEditEmbeddedWithTemplateRequest signatureRequestEditEmbeddedWithTemplateRequest, int operationIndex = 0) + { + Dropbox.Sign.Client.ApiResponse localVarResponse = SignatureRequestEditEmbeddedWithTemplateWithHttpInfo(signatureRequestId, signatureRequestEditEmbeddedWithTemplateRequest); + return localVarResponse.Data; + } + + /// + /// Edit Embedded Signature Request with Template Edits a SignatureRequest based on the given Template(s) to be signed in an embedded iFrame. Note that embedded signature requests can only be signed in embedded iFrames whereas normal signature requests can only be signed on Dropbox Sign. + /// + /// Thrown when fails to make API call + /// The id of the SignatureRequest to edit. + /// + /// Index associated with the operation. + /// ApiResponse of SignatureRequestGetResponse + public Dropbox.Sign.Client.ApiResponse SignatureRequestEditEmbeddedWithTemplateWithHttpInfo(string signatureRequestId, SignatureRequestEditEmbeddedWithTemplateRequest signatureRequestEditEmbeddedWithTemplateRequest, int operationIndex = 0) + { + // verify the required parameter 'signatureRequestId' is set + if (signatureRequestId == null) + { + throw new Dropbox.Sign.Client.ApiException(400, "Missing required parameter 'signatureRequestId' when calling SignatureRequestApi->SignatureRequestEditEmbeddedWithTemplate"); + } + + // verify the required parameter 'signatureRequestEditEmbeddedWithTemplateRequest' is set + if (signatureRequestEditEmbeddedWithTemplateRequest == null) + { + throw new Dropbox.Sign.Client.ApiException(400, "Missing required parameter 'signatureRequestEditEmbeddedWithTemplateRequest' when calling SignatureRequestApi->SignatureRequestEditEmbeddedWithTemplate"); + } + + Dropbox.Sign.Client.RequestOptions localVarRequestOptions = new Dropbox.Sign.Client.RequestOptions(); + + var localVarContentType = ""; + var openApiTypes = signatureRequestEditEmbeddedWithTemplateRequest.GetOpenApiTypes(); + if (ClientUtils.HasFileType(openApiTypes)) + { + ClientUtils.SetFormData(localVarRequestOptions, openApiTypes); + localVarContentType = "multipart/form-data"; + } + else + { + localVarContentType = "application/json"; + localVarRequestOptions.Data = signatureRequestEditEmbeddedWithTemplateRequest; + } + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } + + var localVarAccept = Dropbox.Sign.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } + + localVarRequestOptions.PathParameters.Add("signature_request_id", Dropbox.Sign.Client.ClientUtils.ParameterToString(signatureRequestId)); // path parameter + + localVarRequestOptions.Operation = "SignatureRequestApi.SignatureRequestEditEmbeddedWithTemplate"; + localVarRequestOptions.OperationIndex = operationIndex; + + // authentication (api_key) required + // http basic authentication required + if (!string.IsNullOrEmpty(this.Configuration.Username) || !string.IsNullOrEmpty(this.Configuration.Password) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Basic " + Dropbox.Sign.Client.ClientUtils.Base64Encode(this.Configuration.Username + ":" + this.Configuration.Password)); + } + // authentication (oauth2) required + // bearer authentication required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + + // make the HTTP request + var localVarResponse = this.Client.Put("/signature_request/edit_embedded_with_template/{signature_request_id}", localVarRequestOptions, this.Configuration); + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("SignatureRequestEditEmbeddedWithTemplate", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + + /// + /// Edit Embedded Signature Request with Template Edits a SignatureRequest based on the given Template(s) to be signed in an embedded iFrame. Note that embedded signature requests can only be signed in embedded iFrames whereas normal signature requests can only be signed on Dropbox Sign. + /// + /// Thrown when fails to make API call + /// The id of the SignatureRequest to edit. + /// + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of SignatureRequestGetResponse + public async System.Threading.Tasks.Task SignatureRequestEditEmbeddedWithTemplateAsync(string signatureRequestId, SignatureRequestEditEmbeddedWithTemplateRequest signatureRequestEditEmbeddedWithTemplateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + { + Dropbox.Sign.Client.ApiResponse localVarResponse = await SignatureRequestEditEmbeddedWithTemplateWithHttpInfoAsync(signatureRequestId, signatureRequestEditEmbeddedWithTemplateRequest, operationIndex, cancellationToken).ConfigureAwait(false); + return localVarResponse.Data; + } + + /// + /// Edit Embedded Signature Request with Template Edits a SignatureRequest based on the given Template(s) to be signed in an embedded iFrame. Note that embedded signature requests can only be signed in embedded iFrames whereas normal signature requests can only be signed on Dropbox Sign. + /// + /// Thrown when fails to make API call + /// The id of the SignatureRequest to edit. + /// + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (SignatureRequestGetResponse) + public async System.Threading.Tasks.Task> SignatureRequestEditEmbeddedWithTemplateWithHttpInfoAsync(string signatureRequestId, SignatureRequestEditEmbeddedWithTemplateRequest signatureRequestEditEmbeddedWithTemplateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + { + // verify the required parameter 'signatureRequestId' is set + if (signatureRequestId == null) + { + throw new Dropbox.Sign.Client.ApiException(400, "Missing required parameter 'signatureRequestId' when calling SignatureRequestApi->SignatureRequestEditEmbeddedWithTemplate"); + } + + // verify the required parameter 'signatureRequestEditEmbeddedWithTemplateRequest' is set + if (signatureRequestEditEmbeddedWithTemplateRequest == null) + { + throw new Dropbox.Sign.Client.ApiException(400, "Missing required parameter 'signatureRequestEditEmbeddedWithTemplateRequest' when calling SignatureRequestApi->SignatureRequestEditEmbeddedWithTemplate"); + } + + + Dropbox.Sign.Client.RequestOptions localVarRequestOptions = new Dropbox.Sign.Client.RequestOptions(); + + var localVarContentType = ""; + var openApiTypes = signatureRequestEditEmbeddedWithTemplateRequest.GetOpenApiTypes(); + if (ClientUtils.HasFileType(openApiTypes)) + { + ClientUtils.SetFormData(localVarRequestOptions, openApiTypes); + localVarContentType = "multipart/form-data"; + } + else + { + localVarContentType = "application/json"; + localVarRequestOptions.Data = signatureRequestEditEmbeddedWithTemplateRequest; + } + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } + + var localVarAccept = Dropbox.Sign.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } + + localVarRequestOptions.PathParameters.Add("signature_request_id", Dropbox.Sign.Client.ClientUtils.ParameterToString(signatureRequestId)); // path parameter + + localVarRequestOptions.Operation = "SignatureRequestApi.SignatureRequestEditEmbeddedWithTemplate"; + localVarRequestOptions.OperationIndex = operationIndex; + + // authentication (api_key) required + // http basic authentication required + if (!string.IsNullOrEmpty(this.Configuration.Username) || !string.IsNullOrEmpty(this.Configuration.Password) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Basic " + Dropbox.Sign.Client.ClientUtils.Base64Encode(this.Configuration.Username + ":" + this.Configuration.Password)); + } + // authentication (oauth2) required + // bearer authentication required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + + // make the HTTP request + var localVarResponse = await this.AsynchronousClient.PutAsync("/signature_request/edit_embedded_with_template/{signature_request_id}", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("SignatureRequestEditEmbeddedWithTemplate", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + + /// + /// Edit Signature Request With Template Edits and sends a SignatureRequest based off of the Template(s) specified with the template_ids parameter. **NOTE:** Edit and resend will not deduct your signature request quota. + /// + /// Thrown when fails to make API call + /// The id of the SignatureRequest to edit. + /// + /// Index associated with the operation. + /// SignatureRequestGetResponse + public SignatureRequestGetResponse SignatureRequestEditWithTemplate(string signatureRequestId, SignatureRequestEditWithTemplateRequest signatureRequestEditWithTemplateRequest, int operationIndex = 0) + { + Dropbox.Sign.Client.ApiResponse localVarResponse = SignatureRequestEditWithTemplateWithHttpInfo(signatureRequestId, signatureRequestEditWithTemplateRequest); + return localVarResponse.Data; + } + + /// + /// Edit Signature Request With Template Edits and sends a SignatureRequest based off of the Template(s) specified with the template_ids parameter. **NOTE:** Edit and resend will not deduct your signature request quota. + /// + /// Thrown when fails to make API call + /// The id of the SignatureRequest to edit. + /// + /// Index associated with the operation. + /// ApiResponse of SignatureRequestGetResponse + public Dropbox.Sign.Client.ApiResponse SignatureRequestEditWithTemplateWithHttpInfo(string signatureRequestId, SignatureRequestEditWithTemplateRequest signatureRequestEditWithTemplateRequest, int operationIndex = 0) + { + // verify the required parameter 'signatureRequestId' is set + if (signatureRequestId == null) + { + throw new Dropbox.Sign.Client.ApiException(400, "Missing required parameter 'signatureRequestId' when calling SignatureRequestApi->SignatureRequestEditWithTemplate"); + } + + // verify the required parameter 'signatureRequestEditWithTemplateRequest' is set + if (signatureRequestEditWithTemplateRequest == null) + { + throw new Dropbox.Sign.Client.ApiException(400, "Missing required parameter 'signatureRequestEditWithTemplateRequest' when calling SignatureRequestApi->SignatureRequestEditWithTemplate"); + } + + Dropbox.Sign.Client.RequestOptions localVarRequestOptions = new Dropbox.Sign.Client.RequestOptions(); + + var localVarContentType = ""; + var openApiTypes = signatureRequestEditWithTemplateRequest.GetOpenApiTypes(); + if (ClientUtils.HasFileType(openApiTypes)) + { + ClientUtils.SetFormData(localVarRequestOptions, openApiTypes); + localVarContentType = "multipart/form-data"; + } + else + { + localVarContentType = "application/json"; + localVarRequestOptions.Data = signatureRequestEditWithTemplateRequest; + } + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } + + var localVarAccept = Dropbox.Sign.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } + + localVarRequestOptions.PathParameters.Add("signature_request_id", Dropbox.Sign.Client.ClientUtils.ParameterToString(signatureRequestId)); // path parameter + + localVarRequestOptions.Operation = "SignatureRequestApi.SignatureRequestEditWithTemplate"; + localVarRequestOptions.OperationIndex = operationIndex; + + // authentication (api_key) required + // http basic authentication required + if (!string.IsNullOrEmpty(this.Configuration.Username) || !string.IsNullOrEmpty(this.Configuration.Password) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Basic " + Dropbox.Sign.Client.ClientUtils.Base64Encode(this.Configuration.Username + ":" + this.Configuration.Password)); + } + // authentication (oauth2) required + // bearer authentication required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + + // make the HTTP request + var localVarResponse = this.Client.Put("/signature_request/edit_with_template/{signature_request_id}", localVarRequestOptions, this.Configuration); + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("SignatureRequestEditWithTemplate", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + + /// + /// Edit Signature Request With Template Edits and sends a SignatureRequest based off of the Template(s) specified with the template_ids parameter. **NOTE:** Edit and resend will not deduct your signature request quota. + /// + /// Thrown when fails to make API call + /// The id of the SignatureRequest to edit. + /// + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of SignatureRequestGetResponse + public async System.Threading.Tasks.Task SignatureRequestEditWithTemplateAsync(string signatureRequestId, SignatureRequestEditWithTemplateRequest signatureRequestEditWithTemplateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + { + Dropbox.Sign.Client.ApiResponse localVarResponse = await SignatureRequestEditWithTemplateWithHttpInfoAsync(signatureRequestId, signatureRequestEditWithTemplateRequest, operationIndex, cancellationToken).ConfigureAwait(false); + return localVarResponse.Data; + } + + /// + /// Edit Signature Request With Template Edits and sends a SignatureRequest based off of the Template(s) specified with the template_ids parameter. **NOTE:** Edit and resend will not deduct your signature request quota. + /// + /// Thrown when fails to make API call + /// The id of the SignatureRequest to edit. + /// + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (SignatureRequestGetResponse) + public async System.Threading.Tasks.Task> SignatureRequestEditWithTemplateWithHttpInfoAsync(string signatureRequestId, SignatureRequestEditWithTemplateRequest signatureRequestEditWithTemplateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + { + // verify the required parameter 'signatureRequestId' is set + if (signatureRequestId == null) + { + throw new Dropbox.Sign.Client.ApiException(400, "Missing required parameter 'signatureRequestId' when calling SignatureRequestApi->SignatureRequestEditWithTemplate"); + } + + // verify the required parameter 'signatureRequestEditWithTemplateRequest' is set + if (signatureRequestEditWithTemplateRequest == null) + { + throw new Dropbox.Sign.Client.ApiException(400, "Missing required parameter 'signatureRequestEditWithTemplateRequest' when calling SignatureRequestApi->SignatureRequestEditWithTemplate"); + } + + + Dropbox.Sign.Client.RequestOptions localVarRequestOptions = new Dropbox.Sign.Client.RequestOptions(); + + var localVarContentType = ""; + var openApiTypes = signatureRequestEditWithTemplateRequest.GetOpenApiTypes(); + if (ClientUtils.HasFileType(openApiTypes)) + { + ClientUtils.SetFormData(localVarRequestOptions, openApiTypes); + localVarContentType = "multipart/form-data"; + } + else + { + localVarContentType = "application/json"; + localVarRequestOptions.Data = signatureRequestEditWithTemplateRequest; + } + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } + + var localVarAccept = Dropbox.Sign.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } + + localVarRequestOptions.PathParameters.Add("signature_request_id", Dropbox.Sign.Client.ClientUtils.ParameterToString(signatureRequestId)); // path parameter + + localVarRequestOptions.Operation = "SignatureRequestApi.SignatureRequestEditWithTemplate"; + localVarRequestOptions.OperationIndex = operationIndex; + + // authentication (api_key) required + // http basic authentication required + if (!string.IsNullOrEmpty(this.Configuration.Username) || !string.IsNullOrEmpty(this.Configuration.Password) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Basic " + Dropbox.Sign.Client.ClientUtils.Base64Encode(this.Configuration.Username + ":" + this.Configuration.Password)); + } + // authentication (oauth2) required + // bearer authentication required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + + // make the HTTP request + var localVarResponse = await this.AsynchronousClient.PutAsync("/signature_request/edit_with_template/{signature_request_id}", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("SignatureRequestEditWithTemplate", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + /// /// Download Files Obtain a copy of the current documents specified by the `signature_request_id` parameter. Returns a PDF or ZIP file. If the files are currently being prepared, a status code of `409` will be returned instead. /// diff --git a/sdks/dotnet/src/Dropbox.Sign/Model/SignatureRequestEditEmbeddedRequest.cs b/sdks/dotnet/src/Dropbox.Sign/Model/SignatureRequestEditEmbeddedRequest.cs new file mode 100644 index 000000000..68a03290b --- /dev/null +++ b/sdks/dotnet/src/Dropbox.Sign/Model/SignatureRequestEditEmbeddedRequest.cs @@ -0,0 +1,772 @@ +/* + * Dropbox Sign API + * + * Dropbox Sign v3 API + * + * The version of the OpenAPI document: 3.0.0 + * Contact: apisupport@hellosign.com + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using System.ComponentModel.DataAnnotations; +using OpenAPIDateConverter = Dropbox.Sign.Client.OpenAPIDateConverter; + +namespace Dropbox.Sign.Model +{ + /// + /// SignatureRequestEditEmbeddedRequest + /// + [DataContract(Name = "SignatureRequestEditEmbeddedRequest")] + [JsonObject(ItemNullValueHandling = NullValueHandling.Ignore)] + public partial class SignatureRequestEditEmbeddedRequest : IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + [JsonConstructorAttribute] + protected SignatureRequestEditEmbeddedRequest() { } + /// + /// Initializes a new instance of the class. + /// + /// Use `files[]` to indicate the uploaded file(s) to send for signature. This endpoint requires either **files** or **file_urls[]**, but not both.. + /// Use `file_urls[]` to have Dropbox Sign download the file(s) to send for signature. This endpoint requires either **files** or **file_urls[]**, but not both.. + /// Add Signers to your Signature Request. This endpoint requires either **signers** or **grouped_signers**, but not both.. + /// Add Grouped Signers to your Signature Request. This endpoint requires either **signers** or **grouped_signers**, but not both.. + /// Allows signers to decline to sign a document if `true`. Defaults to `false`. (default to false). + /// Allows signers to reassign their signature requests to other signers if set to `true`. Defaults to `false`. **NOTE:** Only available for Premium plan. (default to false). + /// A list describing the attachments. + /// The email addresses that should be CCed.. + /// Client id of the app you're using to create this embedded signature request. Used for security purposes. (required). + /// When used together with merge fields, `custom_fields` allows users to add pre-filled data to their signature requests. Pre-filled data can be used with \"send-once\" signature requests by adding merge fields with `form_fields_per_document` or [Text Tags](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) while passing values back with `custom_fields` together in one API call. For using pre-filled on repeatable signature requests, merge fields are added to templates in the Dropbox Sign UI or by calling [/template/create_embedded_draft](/api/reference/operation/templateCreateEmbeddedDraft) and then passing `custom_fields` on subsequent signature requests referencing that template.. + /// fieldOptions. + /// 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`.. + /// Conditional Logic rules for fields defined in `form_fields_per_document`.. + /// The fields that should appear on the document, expressed as an array of objects. (For more details you can read about it here: [Using Form Fields per Document](/docs/openapi/form-fields-per-document).) **NOTE:** Fields like **text**, **dropdown**, **checkbox**, **radio**, and **hyperlink** have additional required and optional parameters. Check out the list of [additional parameters](/api/reference/constants/#form-fields-per-document) for these field types. * Text Field use `SubFormFieldsPerDocumentText` * Dropdown Field use `SubFormFieldsPerDocumentDropdown` * Hyperlink Field use `SubFormFieldsPerDocumentHyperlink` * Checkbox Field use `SubFormFieldsPerDocumentCheckbox` * Radio Field use `SubFormFieldsPerDocumentRadio` * Signature Field use `SubFormFieldsPerDocumentSignature` * Date Signed Field use `SubFormFieldsPerDocumentDateSigned` * Initials Field use `SubFormFieldsPerDocumentInitials` * Text Merge Field use `SubFormFieldsPerDocumentTextMerge` * Checkbox Merge Field use `SubFormFieldsPerDocumentCheckboxMerge`. + /// Enables automatic Text Tag removal when set to true. **NOTE:** Removing text tags this way can cause unwanted clipping. We recommend leaving this setting on `false` and instead hiding your text tags using white text or a similar approach. See the [Text Tags Walkthrough](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) for more information. (default to false). + /// The custom message in the email that will be sent to the signers.. + /// Key-value data that should be attached to the signature request. This metadata is included in all API responses and events involving the signature request. For example, use the metadata field to store a signer's order number for look up when receiving events for the signature request. Each request can include up to 10 metadata keys (or 50 nested metadata keys), with key names up to 40 characters long and values up to 1000 characters long.. + /// signingOptions. + /// The subject in the email that will be sent to the signers.. + /// Whether this is a test, the signature request will not be legally binding if set to `true`. Defaults to `false`. (default to false). + /// The title you want to assign to the SignatureRequest.. + /// Send with a value of `true` if you wish to enable [Text Tags](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) parsing in your document. Defaults to disabled, or `false`. (default to false). + /// Controls whether [auto fill fields](https://faq.hellosign.com/hc/en-us/articles/360051467511-Auto-Fill-Fields) can automatically populate a signer's information during signing. **NOTE:** Keep your signer's information safe by ensuring that the _signer on your signature request is the intended party_ before using this feature. (default to false). + /// When the signature request will expire. Unsigned signatures will be moved to the expired status, and no longer signable. See [Signature Request Expiration Date](https://developers.hellosign.com/docs/signature-request/expiration/) for details.. + public SignatureRequestEditEmbeddedRequest(List files = default(List), List fileUrls = default(List), List signers = default(List), List groupedSigners = default(List), bool allowDecline = false, bool allowReassign = false, List attachments = default(List), List ccEmailAddresses = default(List), string clientId = default(string), List customFields = default(List), SubFieldOptions fieldOptions = default(SubFieldOptions), List formFieldGroups = default(List), List formFieldRules = default(List), List formFieldsPerDocument = default(List), bool hideTextTags = false, string message = default(string), Dictionary metadata = default(Dictionary), SubSigningOptions signingOptions = default(SubSigningOptions), string subject = default(string), bool testMode = false, string title = default(string), bool useTextTags = false, bool populateAutoFillFields = false, int? expiresAt = default(int?)) + { + + // to ensure "clientId" is required (not null) + if (clientId == null) + { + throw new ArgumentNullException("clientId is a required property for SignatureRequestEditEmbeddedRequest and cannot be null"); + } + this.ClientId = clientId; + this.Files = files; + this.FileUrls = fileUrls; + this.Signers = signers; + this.GroupedSigners = groupedSigners; + this.AllowDecline = allowDecline; + this.AllowReassign = allowReassign; + this.Attachments = attachments; + this.CcEmailAddresses = ccEmailAddresses; + this.CustomFields = customFields; + this.FieldOptions = fieldOptions; + this.FormFieldGroups = formFieldGroups; + this.FormFieldRules = formFieldRules; + this.FormFieldsPerDocument = formFieldsPerDocument; + this.HideTextTags = hideTextTags; + this.Message = message; + this.Metadata = metadata; + this.SigningOptions = signingOptions; + this.Subject = subject; + this.TestMode = testMode; + this.Title = title; + this.UseTextTags = useTextTags; + this.PopulateAutoFillFields = populateAutoFillFields; + this.ExpiresAt = expiresAt; + } + + /// + /// Attempt to instantiate and hydrate a new instance of this class + /// + /// String of JSON data representing target object + public static SignatureRequestEditEmbeddedRequest Init(string jsonData) + { + var obj = JsonConvert.DeserializeObject(jsonData); + + if (obj == null) + { + throw new Exception("Unable to deserialize JSON to instance of SignatureRequestEditEmbeddedRequest"); + } + + return obj; + } + + /// + /// Client id of the app you're using to create this embedded signature request. Used for security purposes. + /// + /// Client id of the app you're using to create this embedded signature request. Used for security purposes. + [DataMember(Name = "client_id", IsRequired = true, EmitDefaultValue = true)] + public string ClientId { get; set; } + + /// + /// Use `files[]` to indicate the uploaded file(s) to send for signature. This endpoint requires either **files** or **file_urls[]**, but not both. + /// + /// Use `files[]` to indicate the uploaded file(s) to send for signature. This endpoint requires either **files** or **file_urls[]**, but not both. + [DataMember(Name = "files", EmitDefaultValue = true)] + public List Files { get; set; } + + /// + /// Use `file_urls[]` to have Dropbox Sign download the file(s) to send for signature. This endpoint requires either **files** or **file_urls[]**, but not both. + /// + /// Use `file_urls[]` to have Dropbox Sign download the file(s) to send for signature. This endpoint requires either **files** or **file_urls[]**, but not both. + [DataMember(Name = "file_urls", EmitDefaultValue = true)] + public List FileUrls { get; set; } + + /// + /// Add Signers to your Signature Request. This endpoint requires either **signers** or **grouped_signers**, but not both. + /// + /// Add Signers to your Signature Request. This endpoint requires either **signers** or **grouped_signers**, but not both. + [DataMember(Name = "signers", EmitDefaultValue = true)] + public List Signers { get; set; } + + /// + /// Add Grouped Signers to your Signature Request. This endpoint requires either **signers** or **grouped_signers**, but not both. + /// + /// Add Grouped Signers to your Signature Request. This endpoint requires either **signers** or **grouped_signers**, but not both. + [DataMember(Name = "grouped_signers", EmitDefaultValue = true)] + public List GroupedSigners { get; set; } + + /// + /// Allows signers to decline to sign a document if `true`. Defaults to `false`. + /// + /// Allows signers to decline to sign a document if `true`. Defaults to `false`. + [DataMember(Name = "allow_decline", EmitDefaultValue = true)] + public bool AllowDecline { get; set; } + + /// + /// Allows signers to reassign their signature requests to other signers if set to `true`. Defaults to `false`. **NOTE:** Only available for Premium plan. + /// + /// Allows signers to reassign their signature requests to other signers if set to `true`. Defaults to `false`. **NOTE:** Only available for Premium plan. + [DataMember(Name = "allow_reassign", EmitDefaultValue = true)] + public bool AllowReassign { get; set; } + + /// + /// A list describing the attachments + /// + /// A list describing the attachments + [DataMember(Name = "attachments", EmitDefaultValue = true)] + public List Attachments { get; set; } + + /// + /// The email addresses that should be CCed. + /// + /// The email addresses that should be CCed. + [DataMember(Name = "cc_email_addresses", EmitDefaultValue = true)] + public List CcEmailAddresses { get; set; } + + /// + /// When used together with merge fields, `custom_fields` allows users to add pre-filled data to their signature requests. Pre-filled data can be used with \"send-once\" signature requests by adding merge fields with `form_fields_per_document` or [Text Tags](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) while passing values back with `custom_fields` together in one API call. For using pre-filled on repeatable signature requests, merge fields are added to templates in the Dropbox Sign UI or by calling [/template/create_embedded_draft](/api/reference/operation/templateCreateEmbeddedDraft) and then passing `custom_fields` on subsequent signature requests referencing that template. + /// + /// When used together with merge fields, `custom_fields` allows users to add pre-filled data to their signature requests. Pre-filled data can be used with \"send-once\" signature requests by adding merge fields with `form_fields_per_document` or [Text Tags](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) while passing values back with `custom_fields` together in one API call. For using pre-filled on repeatable signature requests, merge fields are added to templates in the Dropbox Sign UI or by calling [/template/create_embedded_draft](/api/reference/operation/templateCreateEmbeddedDraft) and then passing `custom_fields` on subsequent signature requests referencing that template. + [DataMember(Name = "custom_fields", EmitDefaultValue = true)] + public List CustomFields { get; set; } + + /// + /// Gets or Sets FieldOptions + /// + [DataMember(Name = "field_options", EmitDefaultValue = true)] + public SubFieldOptions FieldOptions { get; set; } + + /// + /// Group information for fields defined in `form_fields_per_document`. String-indexed JSON array with `group_label` and `requirement` keys. `form_fields_per_document` must contain fields referencing a group defined in `form_field_groups`. + /// + /// Group information for fields defined in `form_fields_per_document`. String-indexed JSON array with `group_label` and `requirement` keys. `form_fields_per_document` must contain fields referencing a group defined in `form_field_groups`. + [DataMember(Name = "form_field_groups", EmitDefaultValue = true)] + public List FormFieldGroups { get; set; } + + /// + /// Conditional Logic rules for fields defined in `form_fields_per_document`. + /// + /// Conditional Logic rules for fields defined in `form_fields_per_document`. + [DataMember(Name = "form_field_rules", EmitDefaultValue = true)] + public List FormFieldRules { get; set; } + + /// + /// The fields that should appear on the document, expressed as an array of objects. (For more details you can read about it here: [Using Form Fields per Document](/docs/openapi/form-fields-per-document).) **NOTE:** Fields like **text**, **dropdown**, **checkbox**, **radio**, and **hyperlink** have additional required and optional parameters. Check out the list of [additional parameters](/api/reference/constants/#form-fields-per-document) for these field types. * Text Field use `SubFormFieldsPerDocumentText` * Dropdown Field use `SubFormFieldsPerDocumentDropdown` * Hyperlink Field use `SubFormFieldsPerDocumentHyperlink` * Checkbox Field use `SubFormFieldsPerDocumentCheckbox` * Radio Field use `SubFormFieldsPerDocumentRadio` * Signature Field use `SubFormFieldsPerDocumentSignature` * Date Signed Field use `SubFormFieldsPerDocumentDateSigned` * Initials Field use `SubFormFieldsPerDocumentInitials` * Text Merge Field use `SubFormFieldsPerDocumentTextMerge` * Checkbox Merge Field use `SubFormFieldsPerDocumentCheckboxMerge` + /// + /// The fields that should appear on the document, expressed as an array of objects. (For more details you can read about it here: [Using Form Fields per Document](/docs/openapi/form-fields-per-document).) **NOTE:** Fields like **text**, **dropdown**, **checkbox**, **radio**, and **hyperlink** have additional required and optional parameters. Check out the list of [additional parameters](/api/reference/constants/#form-fields-per-document) for these field types. * Text Field use `SubFormFieldsPerDocumentText` * Dropdown Field use `SubFormFieldsPerDocumentDropdown` * Hyperlink Field use `SubFormFieldsPerDocumentHyperlink` * Checkbox Field use `SubFormFieldsPerDocumentCheckbox` * Radio Field use `SubFormFieldsPerDocumentRadio` * Signature Field use `SubFormFieldsPerDocumentSignature` * Date Signed Field use `SubFormFieldsPerDocumentDateSigned` * Initials Field use `SubFormFieldsPerDocumentInitials` * Text Merge Field use `SubFormFieldsPerDocumentTextMerge` * Checkbox Merge Field use `SubFormFieldsPerDocumentCheckboxMerge` + [DataMember(Name = "form_fields_per_document", EmitDefaultValue = true)] + public List FormFieldsPerDocument { get; set; } + + /// + /// Enables automatic Text Tag removal when set to true. **NOTE:** Removing text tags this way can cause unwanted clipping. We recommend leaving this setting on `false` and instead hiding your text tags using white text or a similar approach. See the [Text Tags Walkthrough](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) for more information. + /// + /// Enables automatic Text Tag removal when set to true. **NOTE:** Removing text tags this way can cause unwanted clipping. We recommend leaving this setting on `false` and instead hiding your text tags using white text or a similar approach. See the [Text Tags Walkthrough](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) for more information. + [DataMember(Name = "hide_text_tags", EmitDefaultValue = true)] + public bool HideTextTags { get; set; } + + /// + /// The custom message in the email that will be sent to the signers. + /// + /// The custom message in the email that will be sent to the signers. + [DataMember(Name = "message", EmitDefaultValue = true)] + public string Message { get; set; } + + /// + /// Key-value data that should be attached to the signature request. This metadata is included in all API responses and events involving the signature request. For example, use the metadata field to store a signer's order number for look up when receiving events for the signature request. Each request can include up to 10 metadata keys (or 50 nested metadata keys), with key names up to 40 characters long and values up to 1000 characters long. + /// + /// Key-value data that should be attached to the signature request. This metadata is included in all API responses and events involving the signature request. For example, use the metadata field to store a signer's order number for look up when receiving events for the signature request. Each request can include up to 10 metadata keys (or 50 nested metadata keys), with key names up to 40 characters long and values up to 1000 characters long. + [DataMember(Name = "metadata", EmitDefaultValue = true)] + public Dictionary Metadata { get; set; } + + /// + /// Gets or Sets SigningOptions + /// + [DataMember(Name = "signing_options", EmitDefaultValue = true)] + public SubSigningOptions SigningOptions { get; set; } + + /// + /// The subject in the email that will be sent to the signers. + /// + /// The subject in the email that will be sent to the signers. + [DataMember(Name = "subject", EmitDefaultValue = true)] + public string Subject { get; set; } + + /// + /// Whether this is a test, the signature request will not be legally binding if set to `true`. Defaults to `false`. + /// + /// Whether this is a test, the signature request will not be legally binding if set to `true`. Defaults to `false`. + [DataMember(Name = "test_mode", EmitDefaultValue = true)] + public bool TestMode { get; set; } + + /// + /// The title you want to assign to the SignatureRequest. + /// + /// The title you want to assign to the SignatureRequest. + [DataMember(Name = "title", EmitDefaultValue = true)] + public string Title { get; set; } + + /// + /// Send with a value of `true` if you wish to enable [Text Tags](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) parsing in your document. Defaults to disabled, or `false`. + /// + /// Send with a value of `true` if you wish to enable [Text Tags](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) parsing in your document. Defaults to disabled, or `false`. + [DataMember(Name = "use_text_tags", EmitDefaultValue = true)] + public bool UseTextTags { get; set; } + + /// + /// 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. + /// + /// 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. + [DataMember(Name = "populate_auto_fill_fields", EmitDefaultValue = true)] + public bool PopulateAutoFillFields { get; set; } + + /// + /// When the signature request will expire. Unsigned signatures will be moved to the expired status, and no longer signable. See [Signature Request Expiration Date](https://developers.hellosign.com/docs/signature-request/expiration/) for details. + /// + /// When the signature request will expire. Unsigned signatures will be moved to the expired status, and no longer signable. See [Signature Request Expiration Date](https://developers.hellosign.com/docs/signature-request/expiration/) for details. + [DataMember(Name = "expires_at", EmitDefaultValue = true)] + public int? ExpiresAt { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class SignatureRequestEditEmbeddedRequest {\n"); + sb.Append(" ClientId: ").Append(ClientId).Append("\n"); + sb.Append(" Files: ").Append(Files).Append("\n"); + sb.Append(" FileUrls: ").Append(FileUrls).Append("\n"); + sb.Append(" Signers: ").Append(Signers).Append("\n"); + sb.Append(" GroupedSigners: ").Append(GroupedSigners).Append("\n"); + sb.Append(" AllowDecline: ").Append(AllowDecline).Append("\n"); + sb.Append(" AllowReassign: ").Append(AllowReassign).Append("\n"); + sb.Append(" Attachments: ").Append(Attachments).Append("\n"); + sb.Append(" CcEmailAddresses: ").Append(CcEmailAddresses).Append("\n"); + sb.Append(" CustomFields: ").Append(CustomFields).Append("\n"); + sb.Append(" FieldOptions: ").Append(FieldOptions).Append("\n"); + sb.Append(" FormFieldGroups: ").Append(FormFieldGroups).Append("\n"); + sb.Append(" FormFieldRules: ").Append(FormFieldRules).Append("\n"); + sb.Append(" FormFieldsPerDocument: ").Append(FormFieldsPerDocument).Append("\n"); + sb.Append(" HideTextTags: ").Append(HideTextTags).Append("\n"); + sb.Append(" Message: ").Append(Message).Append("\n"); + sb.Append(" Metadata: ").Append(Metadata).Append("\n"); + sb.Append(" SigningOptions: ").Append(SigningOptions).Append("\n"); + sb.Append(" Subject: ").Append(Subject).Append("\n"); + sb.Append(" TestMode: ").Append(TestMode).Append("\n"); + sb.Append(" Title: ").Append(Title).Append("\n"); + sb.Append(" UseTextTags: ").Append(UseTextTags).Append("\n"); + sb.Append(" PopulateAutoFillFields: ").Append(PopulateAutoFillFields).Append("\n"); + sb.Append(" ExpiresAt: ").Append(ExpiresAt).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return this.Equals(input as SignatureRequestEditEmbeddedRequest); + } + + /// + /// Returns true if SignatureRequestEditEmbeddedRequest instances are equal + /// + /// Instance of SignatureRequestEditEmbeddedRequest to be compared + /// Boolean + public bool Equals(SignatureRequestEditEmbeddedRequest input) + { + if (input == null) + { + return false; + } + return + ( + this.ClientId == input.ClientId || + (this.ClientId != null && + this.ClientId.Equals(input.ClientId)) + ) && + ( + this.Files == input.Files || + this.Files != null && + input.Files != null && + this.Files.SequenceEqual(input.Files) + ) && + ( + this.FileUrls == input.FileUrls || + this.FileUrls != null && + input.FileUrls != null && + this.FileUrls.SequenceEqual(input.FileUrls) + ) && + ( + this.Signers == input.Signers || + this.Signers != null && + input.Signers != null && + this.Signers.SequenceEqual(input.Signers) + ) && + ( + this.GroupedSigners == input.GroupedSigners || + this.GroupedSigners != null && + input.GroupedSigners != null && + this.GroupedSigners.SequenceEqual(input.GroupedSigners) + ) && + ( + this.AllowDecline == input.AllowDecline || + this.AllowDecline.Equals(input.AllowDecline) + ) && + ( + this.AllowReassign == input.AllowReassign || + this.AllowReassign.Equals(input.AllowReassign) + ) && + ( + this.Attachments == input.Attachments || + this.Attachments != null && + input.Attachments != null && + this.Attachments.SequenceEqual(input.Attachments) + ) && + ( + this.CcEmailAddresses == input.CcEmailAddresses || + this.CcEmailAddresses != null && + input.CcEmailAddresses != null && + this.CcEmailAddresses.SequenceEqual(input.CcEmailAddresses) + ) && + ( + this.CustomFields == input.CustomFields || + this.CustomFields != null && + input.CustomFields != null && + this.CustomFields.SequenceEqual(input.CustomFields) + ) && + ( + this.FieldOptions == input.FieldOptions || + (this.FieldOptions != null && + this.FieldOptions.Equals(input.FieldOptions)) + ) && + ( + this.FormFieldGroups == input.FormFieldGroups || + this.FormFieldGroups != null && + input.FormFieldGroups != null && + this.FormFieldGroups.SequenceEqual(input.FormFieldGroups) + ) && + ( + this.FormFieldRules == input.FormFieldRules || + this.FormFieldRules != null && + input.FormFieldRules != null && + this.FormFieldRules.SequenceEqual(input.FormFieldRules) + ) && + ( + this.FormFieldsPerDocument == input.FormFieldsPerDocument || + this.FormFieldsPerDocument != null && + input.FormFieldsPerDocument != null && + this.FormFieldsPerDocument.SequenceEqual(input.FormFieldsPerDocument) + ) && + ( + this.HideTextTags == input.HideTextTags || + this.HideTextTags.Equals(input.HideTextTags) + ) && + ( + this.Message == input.Message || + (this.Message != null && + this.Message.Equals(input.Message)) + ) && + ( + this.Metadata == input.Metadata || + this.Metadata != null && + input.Metadata != null && + this.Metadata.SequenceEqual(input.Metadata) + ) && + ( + this.SigningOptions == input.SigningOptions || + (this.SigningOptions != null && + this.SigningOptions.Equals(input.SigningOptions)) + ) && + ( + this.Subject == input.Subject || + (this.Subject != null && + this.Subject.Equals(input.Subject)) + ) && + ( + this.TestMode == input.TestMode || + this.TestMode.Equals(input.TestMode) + ) && + ( + this.Title == input.Title || + (this.Title != null && + this.Title.Equals(input.Title)) + ) && + ( + this.UseTextTags == input.UseTextTags || + this.UseTextTags.Equals(input.UseTextTags) + ) && + ( + this.PopulateAutoFillFields == input.PopulateAutoFillFields || + this.PopulateAutoFillFields.Equals(input.PopulateAutoFillFields) + ) && + ( + this.ExpiresAt == input.ExpiresAt || + (this.ExpiresAt != null && + this.ExpiresAt.Equals(input.ExpiresAt)) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.ClientId != null) + { + hashCode = (hashCode * 59) + this.ClientId.GetHashCode(); + } + if (this.Files != null) + { + hashCode = (hashCode * 59) + this.Files.GetHashCode(); + } + if (this.FileUrls != null) + { + hashCode = (hashCode * 59) + this.FileUrls.GetHashCode(); + } + if (this.Signers != null) + { + hashCode = (hashCode * 59) + this.Signers.GetHashCode(); + } + if (this.GroupedSigners != null) + { + hashCode = (hashCode * 59) + this.GroupedSigners.GetHashCode(); + } + hashCode = (hashCode * 59) + this.AllowDecline.GetHashCode(); + hashCode = (hashCode * 59) + this.AllowReassign.GetHashCode(); + if (this.Attachments != null) + { + hashCode = (hashCode * 59) + this.Attachments.GetHashCode(); + } + if (this.CcEmailAddresses != null) + { + hashCode = (hashCode * 59) + this.CcEmailAddresses.GetHashCode(); + } + if (this.CustomFields != null) + { + hashCode = (hashCode * 59) + this.CustomFields.GetHashCode(); + } + if (this.FieldOptions != null) + { + hashCode = (hashCode * 59) + this.FieldOptions.GetHashCode(); + } + if (this.FormFieldGroups != null) + { + hashCode = (hashCode * 59) + this.FormFieldGroups.GetHashCode(); + } + if (this.FormFieldRules != null) + { + hashCode = (hashCode * 59) + this.FormFieldRules.GetHashCode(); + } + if (this.FormFieldsPerDocument != null) + { + hashCode = (hashCode * 59) + this.FormFieldsPerDocument.GetHashCode(); + } + hashCode = (hashCode * 59) + this.HideTextTags.GetHashCode(); + if (this.Message != null) + { + hashCode = (hashCode * 59) + this.Message.GetHashCode(); + } + if (this.Metadata != null) + { + hashCode = (hashCode * 59) + this.Metadata.GetHashCode(); + } + if (this.SigningOptions != null) + { + hashCode = (hashCode * 59) + this.SigningOptions.GetHashCode(); + } + if (this.Subject != null) + { + hashCode = (hashCode * 59) + this.Subject.GetHashCode(); + } + hashCode = (hashCode * 59) + this.TestMode.GetHashCode(); + if (this.Title != null) + { + hashCode = (hashCode * 59) + this.Title.GetHashCode(); + } + hashCode = (hashCode * 59) + this.UseTextTags.GetHashCode(); + hashCode = (hashCode * 59) + this.PopulateAutoFillFields.GetHashCode(); + if (this.ExpiresAt != null) + { + hashCode = (hashCode * 59) + this.ExpiresAt.GetHashCode(); + } + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + // Message (string) maxLength + if (this.Message != null && this.Message.Length > 5000) + { + yield return new ValidationResult("Invalid value for Message, length must be less than 5000.", new[] { "Message" }); + } + + // Subject (string) maxLength + if (this.Subject != null && this.Subject.Length > 255) + { + yield return new ValidationResult("Invalid value for Subject, length must be less than 255.", new[] { "Subject" }); + } + + // Title (string) maxLength + if (this.Title != null && this.Title.Length > 255) + { + yield return new ValidationResult("Invalid value for Title, length must be less than 255.", new[] { "Title" }); + } + + yield break; + } + public List GetOpenApiTypes() + { + var types = new List(); + types.Add(new OpenApiType() + { + Name = "client_id", + Property = "ClientId", + Type = "string", + Value = ClientId, + }); + types.Add(new OpenApiType() + { + Name = "files", + Property = "Files", + Type = "List", + Value = Files, + }); + types.Add(new OpenApiType() + { + Name = "file_urls", + Property = "FileUrls", + Type = "List", + Value = FileUrls, + }); + types.Add(new OpenApiType() + { + Name = "signers", + Property = "Signers", + Type = "List", + Value = Signers, + }); + types.Add(new OpenApiType() + { + Name = "grouped_signers", + Property = "GroupedSigners", + Type = "List", + Value = GroupedSigners, + }); + types.Add(new OpenApiType() + { + Name = "allow_decline", + Property = "AllowDecline", + Type = "bool", + Value = AllowDecline, + }); + types.Add(new OpenApiType() + { + Name = "allow_reassign", + Property = "AllowReassign", + Type = "bool", + Value = AllowReassign, + }); + types.Add(new OpenApiType() + { + Name = "attachments", + Property = "Attachments", + Type = "List", + Value = Attachments, + }); + types.Add(new OpenApiType() + { + Name = "cc_email_addresses", + Property = "CcEmailAddresses", + Type = "List", + Value = CcEmailAddresses, + }); + types.Add(new OpenApiType() + { + Name = "custom_fields", + Property = "CustomFields", + Type = "List", + Value = CustomFields, + }); + types.Add(new OpenApiType() + { + Name = "field_options", + Property = "FieldOptions", + Type = "SubFieldOptions", + Value = FieldOptions, + }); + types.Add(new OpenApiType() + { + Name = "form_field_groups", + Property = "FormFieldGroups", + Type = "List", + Value = FormFieldGroups, + }); + types.Add(new OpenApiType() + { + Name = "form_field_rules", + Property = "FormFieldRules", + Type = "List", + Value = FormFieldRules, + }); + types.Add(new OpenApiType() + { + Name = "form_fields_per_document", + Property = "FormFieldsPerDocument", + Type = "List", + Value = FormFieldsPerDocument, + }); + types.Add(new OpenApiType() + { + Name = "hide_text_tags", + Property = "HideTextTags", + Type = "bool", + Value = HideTextTags, + }); + types.Add(new OpenApiType() + { + Name = "message", + Property = "Message", + Type = "string", + Value = Message, + }); + types.Add(new OpenApiType() + { + Name = "metadata", + Property = "Metadata", + Type = "Dictionary", + Value = Metadata, + }); + types.Add(new OpenApiType() + { + Name = "signing_options", + Property = "SigningOptions", + Type = "SubSigningOptions", + Value = SigningOptions, + }); + types.Add(new OpenApiType() + { + Name = "subject", + Property = "Subject", + Type = "string", + Value = Subject, + }); + types.Add(new OpenApiType() + { + Name = "test_mode", + Property = "TestMode", + Type = "bool", + Value = TestMode, + }); + types.Add(new OpenApiType() + { + Name = "title", + Property = "Title", + Type = "string", + Value = Title, + }); + types.Add(new OpenApiType() + { + Name = "use_text_tags", + Property = "UseTextTags", + Type = "bool", + Value = UseTextTags, + }); + types.Add(new OpenApiType() + { + Name = "populate_auto_fill_fields", + Property = "PopulateAutoFillFields", + Type = "bool", + Value = PopulateAutoFillFields, + }); + types.Add(new OpenApiType() + { + Name = "expires_at", + Property = "ExpiresAt", + Type = "int?", + Value = ExpiresAt, + }); + + return types; + } + } + +} diff --git a/sdks/dotnet/src/Dropbox.Sign/Model/SignatureRequestEditEmbeddedWithTemplateRequest.cs b/sdks/dotnet/src/Dropbox.Sign/Model/SignatureRequestEditEmbeddedWithTemplateRequest.cs new file mode 100644 index 000000000..fcf32fa66 --- /dev/null +++ b/sdks/dotnet/src/Dropbox.Sign/Model/SignatureRequestEditEmbeddedWithTemplateRequest.cs @@ -0,0 +1,557 @@ +/* + * Dropbox Sign API + * + * Dropbox Sign v3 API + * + * The version of the OpenAPI document: 3.0.0 + * Contact: apisupport@hellosign.com + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using System.ComponentModel.DataAnnotations; +using OpenAPIDateConverter = Dropbox.Sign.Client.OpenAPIDateConverter; + +namespace Dropbox.Sign.Model +{ + /// + /// SignatureRequestEditEmbeddedWithTemplateRequest + /// + [DataContract(Name = "SignatureRequestEditEmbeddedWithTemplateRequest")] + [JsonObject(ItemNullValueHandling = NullValueHandling.Ignore)] + public partial class SignatureRequestEditEmbeddedWithTemplateRequest : IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + [JsonConstructorAttribute] + protected SignatureRequestEditEmbeddedWithTemplateRequest() { } + /// + /// Initializes a new instance of the class. + /// + /// Use `template_ids` to create a SignatureRequest from one or more templates, in the order in which the template will be used. (required). + /// Allows signers to decline to sign a document if `true`. Defaults to `false`. (default to false). + /// Add CC email recipients. Required when a CC role exists for the Template.. + /// Client id of the app you're using to create this embedded signature request. Used for security purposes. (required). + /// An array defining values and options for custom fields. Required when a custom field exists in the Template.. + /// Use `files[]` to indicate the uploaded file(s) to send for signature. This endpoint requires either **files** or **file_urls[]**, but not both.. + /// Use `file_urls[]` to have Dropbox Sign download the file(s) to send for signature. This endpoint requires either **files** or **file_urls[]**, but not both.. + /// The custom message in the email that will be sent to the signers.. + /// Key-value data that should be attached to the signature request. This metadata is included in all API responses and events involving the signature request. For example, use the metadata field to store a signer's order number for look up when receiving events for the signature request. Each request can include up to 10 metadata keys (or 50 nested metadata keys), with key names up to 40 characters long and values up to 1000 characters long.. + /// Add Signers to your Templated-based Signature Request. (required). + /// signingOptions. + /// The subject in the email that will be sent to the signers.. + /// Whether this is a test, the signature request will not be legally binding if set to `true`. Defaults to `false`. (default to false). + /// The title you want to assign to the SignatureRequest.. + /// Controls whether [auto fill fields](https://faq.hellosign.com/hc/en-us/articles/360051467511-Auto-Fill-Fields) can automatically populate a signer's information during signing. **NOTE:** Keep your signer's information safe by ensuring that the _signer on your signature request is the intended party_ before using this feature. (default to false). + public SignatureRequestEditEmbeddedWithTemplateRequest(List templateIds = default(List), bool allowDecline = false, List ccs = default(List), string clientId = default(string), List customFields = default(List), List files = default(List), List fileUrls = default(List), string message = default(string), Dictionary metadata = default(Dictionary), List signers = default(List), SubSigningOptions signingOptions = default(SubSigningOptions), string subject = default(string), bool testMode = false, string title = default(string), bool populateAutoFillFields = false) + { + + // to ensure "templateIds" is required (not null) + if (templateIds == null) + { + throw new ArgumentNullException("templateIds is a required property for SignatureRequestEditEmbeddedWithTemplateRequest and cannot be null"); + } + this.TemplateIds = templateIds; + // to ensure "clientId" is required (not null) + if (clientId == null) + { + throw new ArgumentNullException("clientId is a required property for SignatureRequestEditEmbeddedWithTemplateRequest and cannot be null"); + } + this.ClientId = clientId; + // to ensure "signers" is required (not null) + if (signers == null) + { + throw new ArgumentNullException("signers is a required property for SignatureRequestEditEmbeddedWithTemplateRequest and cannot be null"); + } + this.Signers = signers; + this.AllowDecline = allowDecline; + this.Ccs = ccs; + this.CustomFields = customFields; + this.Files = files; + this.FileUrls = fileUrls; + this.Message = message; + this.Metadata = metadata; + this.SigningOptions = signingOptions; + this.Subject = subject; + this.TestMode = testMode; + this.Title = title; + this.PopulateAutoFillFields = populateAutoFillFields; + } + + /// + /// Attempt to instantiate and hydrate a new instance of this class + /// + /// String of JSON data representing target object + public static SignatureRequestEditEmbeddedWithTemplateRequest Init(string jsonData) + { + var obj = JsonConvert.DeserializeObject(jsonData); + + if (obj == null) + { + throw new Exception("Unable to deserialize JSON to instance of SignatureRequestEditEmbeddedWithTemplateRequest"); + } + + return obj; + } + + /// + /// Use `template_ids` to create a SignatureRequest from one or more templates, in the order in which the template will be used. + /// + /// Use `template_ids` to create a SignatureRequest from one or more templates, in the order in which the template will be used. + [DataMember(Name = "template_ids", IsRequired = true, EmitDefaultValue = true)] + public List TemplateIds { get; set; } + + /// + /// Client id of the app you're using to create this embedded signature request. Used for security purposes. + /// + /// Client id of the app you're using to create this embedded signature request. Used for security purposes. + [DataMember(Name = "client_id", IsRequired = true, EmitDefaultValue = true)] + public string ClientId { get; set; } + + /// + /// Add Signers to your Templated-based Signature Request. + /// + /// Add Signers to your Templated-based Signature Request. + [DataMember(Name = "signers", IsRequired = true, EmitDefaultValue = true)] + public List Signers { get; set; } + + /// + /// Allows signers to decline to sign a document if `true`. Defaults to `false`. + /// + /// Allows signers to decline to sign a document if `true`. Defaults to `false`. + [DataMember(Name = "allow_decline", EmitDefaultValue = true)] + public bool AllowDecline { get; set; } + + /// + /// Add CC email recipients. Required when a CC role exists for the Template. + /// + /// Add CC email recipients. Required when a CC role exists for the Template. + [DataMember(Name = "ccs", EmitDefaultValue = true)] + public List Ccs { get; set; } + + /// + /// An array defining values and options for custom fields. Required when a custom field exists in the Template. + /// + /// An array defining values and options for custom fields. Required when a custom field exists in the Template. + [DataMember(Name = "custom_fields", EmitDefaultValue = true)] + public List CustomFields { get; set; } + + /// + /// Use `files[]` to indicate the uploaded file(s) to send for signature. This endpoint requires either **files** or **file_urls[]**, but not both. + /// + /// Use `files[]` to indicate the uploaded file(s) to send for signature. This endpoint requires either **files** or **file_urls[]**, but not both. + [DataMember(Name = "files", EmitDefaultValue = true)] + public List Files { get; set; } + + /// + /// Use `file_urls[]` to have Dropbox Sign download the file(s) to send for signature. This endpoint requires either **files** or **file_urls[]**, but not both. + /// + /// Use `file_urls[]` to have Dropbox Sign download the file(s) to send for signature. This endpoint requires either **files** or **file_urls[]**, but not both. + [DataMember(Name = "file_urls", EmitDefaultValue = true)] + public List FileUrls { get; set; } + + /// + /// The custom message in the email that will be sent to the signers. + /// + /// The custom message in the email that will be sent to the signers. + [DataMember(Name = "message", EmitDefaultValue = true)] + public string Message { get; set; } + + /// + /// Key-value data that should be attached to the signature request. This metadata is included in all API responses and events involving the signature request. For example, use the metadata field to store a signer's order number for look up when receiving events for the signature request. Each request can include up to 10 metadata keys (or 50 nested metadata keys), with key names up to 40 characters long and values up to 1000 characters long. + /// + /// Key-value data that should be attached to the signature request. This metadata is included in all API responses and events involving the signature request. For example, use the metadata field to store a signer's order number for look up when receiving events for the signature request. Each request can include up to 10 metadata keys (or 50 nested metadata keys), with key names up to 40 characters long and values up to 1000 characters long. + [DataMember(Name = "metadata", EmitDefaultValue = true)] + public Dictionary Metadata { get; set; } + + /// + /// Gets or Sets SigningOptions + /// + [DataMember(Name = "signing_options", EmitDefaultValue = true)] + public SubSigningOptions SigningOptions { get; set; } + + /// + /// The subject in the email that will be sent to the signers. + /// + /// The subject in the email that will be sent to the signers. + [DataMember(Name = "subject", EmitDefaultValue = true)] + public string Subject { get; set; } + + /// + /// Whether this is a test, the signature request will not be legally binding if set to `true`. Defaults to `false`. + /// + /// Whether this is a test, the signature request will not be legally binding if set to `true`. Defaults to `false`. + [DataMember(Name = "test_mode", EmitDefaultValue = true)] + public bool TestMode { get; set; } + + /// + /// The title you want to assign to the SignatureRequest. + /// + /// The title you want to assign to the SignatureRequest. + [DataMember(Name = "title", EmitDefaultValue = true)] + public string Title { get; set; } + + /// + /// 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. + /// + /// 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. + [DataMember(Name = "populate_auto_fill_fields", EmitDefaultValue = true)] + public bool PopulateAutoFillFields { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class SignatureRequestEditEmbeddedWithTemplateRequest {\n"); + sb.Append(" TemplateIds: ").Append(TemplateIds).Append("\n"); + sb.Append(" ClientId: ").Append(ClientId).Append("\n"); + sb.Append(" Signers: ").Append(Signers).Append("\n"); + sb.Append(" AllowDecline: ").Append(AllowDecline).Append("\n"); + sb.Append(" Ccs: ").Append(Ccs).Append("\n"); + sb.Append(" CustomFields: ").Append(CustomFields).Append("\n"); + sb.Append(" Files: ").Append(Files).Append("\n"); + sb.Append(" FileUrls: ").Append(FileUrls).Append("\n"); + sb.Append(" Message: ").Append(Message).Append("\n"); + sb.Append(" Metadata: ").Append(Metadata).Append("\n"); + sb.Append(" SigningOptions: ").Append(SigningOptions).Append("\n"); + sb.Append(" Subject: ").Append(Subject).Append("\n"); + sb.Append(" TestMode: ").Append(TestMode).Append("\n"); + sb.Append(" Title: ").Append(Title).Append("\n"); + sb.Append(" PopulateAutoFillFields: ").Append(PopulateAutoFillFields).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return this.Equals(input as SignatureRequestEditEmbeddedWithTemplateRequest); + } + + /// + /// Returns true if SignatureRequestEditEmbeddedWithTemplateRequest instances are equal + /// + /// Instance of SignatureRequestEditEmbeddedWithTemplateRequest to be compared + /// Boolean + public bool Equals(SignatureRequestEditEmbeddedWithTemplateRequest input) + { + if (input == null) + { + return false; + } + return + ( + this.TemplateIds == input.TemplateIds || + this.TemplateIds != null && + input.TemplateIds != null && + this.TemplateIds.SequenceEqual(input.TemplateIds) + ) && + ( + this.ClientId == input.ClientId || + (this.ClientId != null && + this.ClientId.Equals(input.ClientId)) + ) && + ( + this.Signers == input.Signers || + this.Signers != null && + input.Signers != null && + this.Signers.SequenceEqual(input.Signers) + ) && + ( + this.AllowDecline == input.AllowDecline || + this.AllowDecline.Equals(input.AllowDecline) + ) && + ( + this.Ccs == input.Ccs || + this.Ccs != null && + input.Ccs != null && + this.Ccs.SequenceEqual(input.Ccs) + ) && + ( + this.CustomFields == input.CustomFields || + this.CustomFields != null && + input.CustomFields != null && + this.CustomFields.SequenceEqual(input.CustomFields) + ) && + ( + this.Files == input.Files || + this.Files != null && + input.Files != null && + this.Files.SequenceEqual(input.Files) + ) && + ( + this.FileUrls == input.FileUrls || + this.FileUrls != null && + input.FileUrls != null && + this.FileUrls.SequenceEqual(input.FileUrls) + ) && + ( + this.Message == input.Message || + (this.Message != null && + this.Message.Equals(input.Message)) + ) && + ( + this.Metadata == input.Metadata || + this.Metadata != null && + input.Metadata != null && + this.Metadata.SequenceEqual(input.Metadata) + ) && + ( + this.SigningOptions == input.SigningOptions || + (this.SigningOptions != null && + this.SigningOptions.Equals(input.SigningOptions)) + ) && + ( + this.Subject == input.Subject || + (this.Subject != null && + this.Subject.Equals(input.Subject)) + ) && + ( + this.TestMode == input.TestMode || + this.TestMode.Equals(input.TestMode) + ) && + ( + this.Title == input.Title || + (this.Title != null && + this.Title.Equals(input.Title)) + ) && + ( + this.PopulateAutoFillFields == input.PopulateAutoFillFields || + this.PopulateAutoFillFields.Equals(input.PopulateAutoFillFields) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.TemplateIds != null) + { + hashCode = (hashCode * 59) + this.TemplateIds.GetHashCode(); + } + if (this.ClientId != null) + { + hashCode = (hashCode * 59) + this.ClientId.GetHashCode(); + } + if (this.Signers != null) + { + hashCode = (hashCode * 59) + this.Signers.GetHashCode(); + } + hashCode = (hashCode * 59) + this.AllowDecline.GetHashCode(); + if (this.Ccs != null) + { + hashCode = (hashCode * 59) + this.Ccs.GetHashCode(); + } + if (this.CustomFields != null) + { + hashCode = (hashCode * 59) + this.CustomFields.GetHashCode(); + } + if (this.Files != null) + { + hashCode = (hashCode * 59) + this.Files.GetHashCode(); + } + if (this.FileUrls != null) + { + hashCode = (hashCode * 59) + this.FileUrls.GetHashCode(); + } + if (this.Message != null) + { + hashCode = (hashCode * 59) + this.Message.GetHashCode(); + } + if (this.Metadata != null) + { + hashCode = (hashCode * 59) + this.Metadata.GetHashCode(); + } + if (this.SigningOptions != null) + { + hashCode = (hashCode * 59) + this.SigningOptions.GetHashCode(); + } + if (this.Subject != null) + { + hashCode = (hashCode * 59) + this.Subject.GetHashCode(); + } + hashCode = (hashCode * 59) + this.TestMode.GetHashCode(); + if (this.Title != null) + { + hashCode = (hashCode * 59) + this.Title.GetHashCode(); + } + hashCode = (hashCode * 59) + this.PopulateAutoFillFields.GetHashCode(); + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + // Message (string) maxLength + if (this.Message != null && this.Message.Length > 5000) + { + yield return new ValidationResult("Invalid value for Message, length must be less than 5000.", new[] { "Message" }); + } + + // Subject (string) maxLength + if (this.Subject != null && this.Subject.Length > 255) + { + yield return new ValidationResult("Invalid value for Subject, length must be less than 255.", new[] { "Subject" }); + } + + // Title (string) maxLength + if (this.Title != null && this.Title.Length > 255) + { + yield return new ValidationResult("Invalid value for Title, length must be less than 255.", new[] { "Title" }); + } + + yield break; + } + public List GetOpenApiTypes() + { + var types = new List(); + types.Add(new OpenApiType() + { + Name = "template_ids", + Property = "TemplateIds", + Type = "List", + Value = TemplateIds, + }); + types.Add(new OpenApiType() + { + Name = "client_id", + Property = "ClientId", + Type = "string", + Value = ClientId, + }); + types.Add(new OpenApiType() + { + Name = "signers", + Property = "Signers", + Type = "List", + Value = Signers, + }); + types.Add(new OpenApiType() + { + Name = "allow_decline", + Property = "AllowDecline", + Type = "bool", + Value = AllowDecline, + }); + types.Add(new OpenApiType() + { + Name = "ccs", + Property = "Ccs", + Type = "List", + Value = Ccs, + }); + types.Add(new OpenApiType() + { + Name = "custom_fields", + Property = "CustomFields", + Type = "List", + Value = CustomFields, + }); + types.Add(new OpenApiType() + { + Name = "files", + Property = "Files", + Type = "List", + Value = Files, + }); + types.Add(new OpenApiType() + { + Name = "file_urls", + Property = "FileUrls", + Type = "List", + Value = FileUrls, + }); + types.Add(new OpenApiType() + { + Name = "message", + Property = "Message", + Type = "string", + Value = Message, + }); + types.Add(new OpenApiType() + { + Name = "metadata", + Property = "Metadata", + Type = "Dictionary", + Value = Metadata, + }); + types.Add(new OpenApiType() + { + Name = "signing_options", + Property = "SigningOptions", + Type = "SubSigningOptions", + Value = SigningOptions, + }); + types.Add(new OpenApiType() + { + Name = "subject", + Property = "Subject", + Type = "string", + Value = Subject, + }); + types.Add(new OpenApiType() + { + Name = "test_mode", + Property = "TestMode", + Type = "bool", + Value = TestMode, + }); + types.Add(new OpenApiType() + { + Name = "title", + Property = "Title", + Type = "string", + Value = Title, + }); + types.Add(new OpenApiType() + { + Name = "populate_auto_fill_fields", + Property = "PopulateAutoFillFields", + Type = "bool", + Value = PopulateAutoFillFields, + }); + + return types; + } + } + +} diff --git a/sdks/dotnet/src/Dropbox.Sign/Model/SignatureRequestEditRequest.cs b/sdks/dotnet/src/Dropbox.Sign/Model/SignatureRequestEditRequest.cs new file mode 100644 index 000000000..f239fcf60 --- /dev/null +++ b/sdks/dotnet/src/Dropbox.Sign/Model/SignatureRequestEditRequest.cs @@ -0,0 +1,793 @@ +/* + * Dropbox Sign API + * + * Dropbox Sign v3 API + * + * The version of the OpenAPI document: 3.0.0 + * Contact: apisupport@hellosign.com + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using System.ComponentModel.DataAnnotations; +using OpenAPIDateConverter = Dropbox.Sign.Client.OpenAPIDateConverter; + +namespace Dropbox.Sign.Model +{ + /// + /// SignatureRequestEditRequest + /// + [DataContract(Name = "SignatureRequestEditRequest")] + [JsonObject(ItemNullValueHandling = NullValueHandling.Ignore)] + public partial class SignatureRequestEditRequest : IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + [JsonConstructorAttribute] + protected SignatureRequestEditRequest() { } + /// + /// Initializes a new instance of the class. + /// + /// Use `files[]` to indicate the uploaded file(s) to send for signature. This endpoint requires either **files** or **file_urls[]**, but not both.. + /// Use `file_urls[]` to have Dropbox Sign download the file(s) to send for signature. This endpoint requires either **files** or **file_urls[]**, but not both.. + /// Add Signers to your Signature Request. This endpoint requires either **signers** or **grouped_signers**, but not both.. + /// Add Grouped Signers to your Signature Request. This endpoint requires either **signers** or **grouped_signers**, but not both.. + /// Allows signers to decline to sign a document if `true`. Defaults to `false`. (default to false). + /// Allows signers to reassign their signature requests to other signers if set to `true`. Defaults to `false`. **NOTE:** Only available for Premium plan and higher. (default to false). + /// A list describing the attachments. + /// The email addresses that should be CCed.. + /// The client id of the API App you want to associate with this request. Used to apply the branding and callback url defined for the app.. + /// When used together with merge fields, `custom_fields` allows users to add pre-filled data to their signature requests. Pre-filled data can be used with \"send-once\" signature requests by adding merge fields with `form_fields_per_document` or [Text Tags](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) while passing values back with `custom_fields` together in one API call. For using pre-filled on repeatable signature requests, merge fields are added to templates in the Dropbox Sign UI or by calling [/template/create_embedded_draft](/api/reference/operation/templateCreateEmbeddedDraft) and then passing `custom_fields` on subsequent signature requests referencing that template.. + /// fieldOptions. + /// 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`.. + /// Conditional Logic rules for fields defined in `form_fields_per_document`.. + /// The fields that should appear on the document, expressed as an array of objects. (For more details you can read about it here: [Using Form Fields per Document](/docs/openapi/form-fields-per-document).) **NOTE:** Fields like **text**, **dropdown**, **checkbox**, **radio**, and **hyperlink** have additional required and optional parameters. Check out the list of [additional parameters](/api/reference/constants/#form-fields-per-document) for these field types. * Text Field use `SubFormFieldsPerDocumentText` * Dropdown Field use `SubFormFieldsPerDocumentDropdown` * Hyperlink Field use `SubFormFieldsPerDocumentHyperlink` * Checkbox Field use `SubFormFieldsPerDocumentCheckbox` * Radio Field use `SubFormFieldsPerDocumentRadio` * Signature Field use `SubFormFieldsPerDocumentSignature` * Date Signed Field use `SubFormFieldsPerDocumentDateSigned` * Initials Field use `SubFormFieldsPerDocumentInitials` * Text Merge Field use `SubFormFieldsPerDocumentTextMerge` * Checkbox Merge Field use `SubFormFieldsPerDocumentCheckboxMerge`. + /// Enables automatic Text Tag removal when set to true. **NOTE:** Removing text tags this way can cause unwanted clipping. We recommend leaving this setting on `false` and instead hiding your text tags using white text or a similar approach. See the [Text Tags Walkthrough](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) for more information. (default to false). + /// Send with a value of `true` if you wish to enable [electronic identification (eID)](https://www.hellosign.com/features/electronic-id), which requires the signer to verify their identity with an eID provider to sign a document.<br> **NOTE:** eID is only available on the Premium API plan. Cannot be used in `test_mode`. Only works on requests with one signer. (default to false). + /// The custom message in the email that will be sent to the signers.. + /// Key-value data that should be attached to the signature request. This metadata is included in all API responses and events involving the signature request. For example, use the metadata field to store a signer's order number for look up when receiving events for the signature request. Each request can include up to 10 metadata keys (or 50 nested metadata keys), with key names up to 40 characters long and values up to 1000 characters long.. + /// signingOptions. + /// The URL you want signers redirected to after they successfully sign.. + /// The subject in the email that will be sent to the signers.. + /// Whether this is a test, the signature request will not be legally binding if set to `true`. Defaults to `false`. (default to false). + /// The title you want to assign to the SignatureRequest.. + /// Send with a value of `true` if you wish to enable [Text Tags](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) parsing in your document. Defaults to disabled, or `false`. (default to false). + /// When the signature request will expire. Unsigned signatures will be moved to the expired status, and no longer signable. See [Signature Request Expiration Date](https://developers.hellosign.com/docs/signature-request/expiration/) for details.. + public SignatureRequestEditRequest(List files = default(List), List fileUrls = default(List), List signers = default(List), List groupedSigners = default(List), bool allowDecline = false, bool allowReassign = false, List attachments = default(List), List ccEmailAddresses = default(List), string clientId = default(string), List customFields = default(List), SubFieldOptions fieldOptions = default(SubFieldOptions), List formFieldGroups = default(List), List formFieldRules = default(List), List formFieldsPerDocument = default(List), bool hideTextTags = false, bool isEid = false, string message = default(string), Dictionary metadata = default(Dictionary), SubSigningOptions signingOptions = default(SubSigningOptions), string signingRedirectUrl = default(string), string subject = default(string), bool testMode = false, string title = default(string), bool useTextTags = false, int? expiresAt = default(int?)) + { + + this.Files = files; + this.FileUrls = fileUrls; + this.Signers = signers; + this.GroupedSigners = groupedSigners; + this.AllowDecline = allowDecline; + this.AllowReassign = allowReassign; + this.Attachments = attachments; + this.CcEmailAddresses = ccEmailAddresses; + this.ClientId = clientId; + this.CustomFields = customFields; + this.FieldOptions = fieldOptions; + this.FormFieldGroups = formFieldGroups; + this.FormFieldRules = formFieldRules; + this.FormFieldsPerDocument = formFieldsPerDocument; + this.HideTextTags = hideTextTags; + this.IsEid = isEid; + this.Message = message; + this.Metadata = metadata; + this.SigningOptions = signingOptions; + this.SigningRedirectUrl = signingRedirectUrl; + this.Subject = subject; + this.TestMode = testMode; + this.Title = title; + this.UseTextTags = useTextTags; + this.ExpiresAt = expiresAt; + } + + /// + /// Attempt to instantiate and hydrate a new instance of this class + /// + /// String of JSON data representing target object + public static SignatureRequestEditRequest Init(string jsonData) + { + var obj = JsonConvert.DeserializeObject(jsonData); + + if (obj == null) + { + throw new Exception("Unable to deserialize JSON to instance of SignatureRequestEditRequest"); + } + + return obj; + } + + /// + /// Use `files[]` to indicate the uploaded file(s) to send for signature. This endpoint requires either **files** or **file_urls[]**, but not both. + /// + /// Use `files[]` to indicate the uploaded file(s) to send for signature. This endpoint requires either **files** or **file_urls[]**, but not both. + [DataMember(Name = "files", EmitDefaultValue = true)] + public List Files { get; set; } + + /// + /// Use `file_urls[]` to have Dropbox Sign download the file(s) to send for signature. This endpoint requires either **files** or **file_urls[]**, but not both. + /// + /// Use `file_urls[]` to have Dropbox Sign download the file(s) to send for signature. This endpoint requires either **files** or **file_urls[]**, but not both. + [DataMember(Name = "file_urls", EmitDefaultValue = true)] + public List FileUrls { get; set; } + + /// + /// Add Signers to your Signature Request. This endpoint requires either **signers** or **grouped_signers**, but not both. + /// + /// Add Signers to your Signature Request. This endpoint requires either **signers** or **grouped_signers**, but not both. + [DataMember(Name = "signers", EmitDefaultValue = true)] + public List Signers { get; set; } + + /// + /// Add Grouped Signers to your Signature Request. This endpoint requires either **signers** or **grouped_signers**, but not both. + /// + /// Add Grouped Signers to your Signature Request. This endpoint requires either **signers** or **grouped_signers**, but not both. + [DataMember(Name = "grouped_signers", EmitDefaultValue = true)] + public List GroupedSigners { get; set; } + + /// + /// Allows signers to decline to sign a document if `true`. Defaults to `false`. + /// + /// Allows signers to decline to sign a document if `true`. Defaults to `false`. + [DataMember(Name = "allow_decline", EmitDefaultValue = true)] + public bool AllowDecline { get; set; } + + /// + /// Allows signers to reassign their signature requests to other signers if set to `true`. Defaults to `false`. **NOTE:** Only available for Premium plan and higher. + /// + /// Allows signers to reassign their signature requests to other signers if set to `true`. Defaults to `false`. **NOTE:** Only available for Premium plan and higher. + [DataMember(Name = "allow_reassign", EmitDefaultValue = true)] + public bool AllowReassign { get; set; } + + /// + /// A list describing the attachments + /// + /// A list describing the attachments + [DataMember(Name = "attachments", EmitDefaultValue = true)] + public List Attachments { get; set; } + + /// + /// The email addresses that should be CCed. + /// + /// The email addresses that should be CCed. + [DataMember(Name = "cc_email_addresses", EmitDefaultValue = true)] + public List CcEmailAddresses { get; set; } + + /// + /// The client id of the API App you want to associate with this request. Used to apply the branding and callback url defined for the app. + /// + /// The client id of the API App you want to associate with this request. Used to apply the branding and callback url defined for the app. + [DataMember(Name = "client_id", EmitDefaultValue = true)] + public string ClientId { get; set; } + + /// + /// When used together with merge fields, `custom_fields` allows users to add pre-filled data to their signature requests. Pre-filled data can be used with \"send-once\" signature requests by adding merge fields with `form_fields_per_document` or [Text Tags](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) while passing values back with `custom_fields` together in one API call. For using pre-filled on repeatable signature requests, merge fields are added to templates in the Dropbox Sign UI or by calling [/template/create_embedded_draft](/api/reference/operation/templateCreateEmbeddedDraft) and then passing `custom_fields` on subsequent signature requests referencing that template. + /// + /// When used together with merge fields, `custom_fields` allows users to add pre-filled data to their signature requests. Pre-filled data can be used with \"send-once\" signature requests by adding merge fields with `form_fields_per_document` or [Text Tags](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) while passing values back with `custom_fields` together in one API call. For using pre-filled on repeatable signature requests, merge fields are added to templates in the Dropbox Sign UI or by calling [/template/create_embedded_draft](/api/reference/operation/templateCreateEmbeddedDraft) and then passing `custom_fields` on subsequent signature requests referencing that template. + [DataMember(Name = "custom_fields", EmitDefaultValue = true)] + public List CustomFields { get; set; } + + /// + /// Gets or Sets FieldOptions + /// + [DataMember(Name = "field_options", EmitDefaultValue = true)] + public SubFieldOptions FieldOptions { get; set; } + + /// + /// Group information for fields defined in `form_fields_per_document`. String-indexed JSON array with `group_label` and `requirement` keys. `form_fields_per_document` must contain fields referencing a group defined in `form_field_groups`. + /// + /// Group information for fields defined in `form_fields_per_document`. String-indexed JSON array with `group_label` and `requirement` keys. `form_fields_per_document` must contain fields referencing a group defined in `form_field_groups`. + [DataMember(Name = "form_field_groups", EmitDefaultValue = true)] + public List FormFieldGroups { get; set; } + + /// + /// Conditional Logic rules for fields defined in `form_fields_per_document`. + /// + /// Conditional Logic rules for fields defined in `form_fields_per_document`. + [DataMember(Name = "form_field_rules", EmitDefaultValue = true)] + public List FormFieldRules { get; set; } + + /// + /// The fields that should appear on the document, expressed as an array of objects. (For more details you can read about it here: [Using Form Fields per Document](/docs/openapi/form-fields-per-document).) **NOTE:** Fields like **text**, **dropdown**, **checkbox**, **radio**, and **hyperlink** have additional required and optional parameters. Check out the list of [additional parameters](/api/reference/constants/#form-fields-per-document) for these field types. * Text Field use `SubFormFieldsPerDocumentText` * Dropdown Field use `SubFormFieldsPerDocumentDropdown` * Hyperlink Field use `SubFormFieldsPerDocumentHyperlink` * Checkbox Field use `SubFormFieldsPerDocumentCheckbox` * Radio Field use `SubFormFieldsPerDocumentRadio` * Signature Field use `SubFormFieldsPerDocumentSignature` * Date Signed Field use `SubFormFieldsPerDocumentDateSigned` * Initials Field use `SubFormFieldsPerDocumentInitials` * Text Merge Field use `SubFormFieldsPerDocumentTextMerge` * Checkbox Merge Field use `SubFormFieldsPerDocumentCheckboxMerge` + /// + /// The fields that should appear on the document, expressed as an array of objects. (For more details you can read about it here: [Using Form Fields per Document](/docs/openapi/form-fields-per-document).) **NOTE:** Fields like **text**, **dropdown**, **checkbox**, **radio**, and **hyperlink** have additional required and optional parameters. Check out the list of [additional parameters](/api/reference/constants/#form-fields-per-document) for these field types. * Text Field use `SubFormFieldsPerDocumentText` * Dropdown Field use `SubFormFieldsPerDocumentDropdown` * Hyperlink Field use `SubFormFieldsPerDocumentHyperlink` * Checkbox Field use `SubFormFieldsPerDocumentCheckbox` * Radio Field use `SubFormFieldsPerDocumentRadio` * Signature Field use `SubFormFieldsPerDocumentSignature` * Date Signed Field use `SubFormFieldsPerDocumentDateSigned` * Initials Field use `SubFormFieldsPerDocumentInitials` * Text Merge Field use `SubFormFieldsPerDocumentTextMerge` * Checkbox Merge Field use `SubFormFieldsPerDocumentCheckboxMerge` + [DataMember(Name = "form_fields_per_document", EmitDefaultValue = true)] + public List FormFieldsPerDocument { get; set; } + + /// + /// Enables automatic Text Tag removal when set to true. **NOTE:** Removing text tags this way can cause unwanted clipping. We recommend leaving this setting on `false` and instead hiding your text tags using white text or a similar approach. See the [Text Tags Walkthrough](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) for more information. + /// + /// Enables automatic Text Tag removal when set to true. **NOTE:** Removing text tags this way can cause unwanted clipping. We recommend leaving this setting on `false` and instead hiding your text tags using white text or a similar approach. See the [Text Tags Walkthrough](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) for more information. + [DataMember(Name = "hide_text_tags", EmitDefaultValue = true)] + public bool HideTextTags { get; set; } + + /// + /// Send with a value of `true` if you wish to enable [electronic identification (eID)](https://www.hellosign.com/features/electronic-id), which requires the signer to verify their identity with an eID provider to sign a document.<br> **NOTE:** eID is only available on the Premium API plan. Cannot be used in `test_mode`. Only works on requests with one signer. + /// + /// Send with a value of `true` if you wish to enable [electronic identification (eID)](https://www.hellosign.com/features/electronic-id), which requires the signer to verify their identity with an eID provider to sign a document.<br> **NOTE:** eID is only available on the Premium API plan. Cannot be used in `test_mode`. Only works on requests with one signer. + [DataMember(Name = "is_eid", EmitDefaultValue = true)] + public bool IsEid { get; set; } + + /// + /// The custom message in the email that will be sent to the signers. + /// + /// The custom message in the email that will be sent to the signers. + [DataMember(Name = "message", EmitDefaultValue = true)] + public string Message { get; set; } + + /// + /// Key-value data that should be attached to the signature request. This metadata is included in all API responses and events involving the signature request. For example, use the metadata field to store a signer's order number for look up when receiving events for the signature request. Each request can include up to 10 metadata keys (or 50 nested metadata keys), with key names up to 40 characters long and values up to 1000 characters long. + /// + /// Key-value data that should be attached to the signature request. This metadata is included in all API responses and events involving the signature request. For example, use the metadata field to store a signer's order number for look up when receiving events for the signature request. Each request can include up to 10 metadata keys (or 50 nested metadata keys), with key names up to 40 characters long and values up to 1000 characters long. + [DataMember(Name = "metadata", EmitDefaultValue = true)] + public Dictionary Metadata { get; set; } + + /// + /// Gets or Sets SigningOptions + /// + [DataMember(Name = "signing_options", EmitDefaultValue = true)] + public SubSigningOptions SigningOptions { get; set; } + + /// + /// The URL you want signers redirected to after they successfully sign. + /// + /// The URL you want signers redirected to after they successfully sign. + [DataMember(Name = "signing_redirect_url", EmitDefaultValue = true)] + public string SigningRedirectUrl { get; set; } + + /// + /// The subject in the email that will be sent to the signers. + /// + /// The subject in the email that will be sent to the signers. + [DataMember(Name = "subject", EmitDefaultValue = true)] + public string Subject { get; set; } + + /// + /// Whether this is a test, the signature request will not be legally binding if set to `true`. Defaults to `false`. + /// + /// Whether this is a test, the signature request will not be legally binding if set to `true`. Defaults to `false`. + [DataMember(Name = "test_mode", EmitDefaultValue = true)] + public bool TestMode { get; set; } + + /// + /// The title you want to assign to the SignatureRequest. + /// + /// The title you want to assign to the SignatureRequest. + [DataMember(Name = "title", EmitDefaultValue = true)] + public string Title { get; set; } + + /// + /// Send with a value of `true` if you wish to enable [Text Tags](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) parsing in your document. Defaults to disabled, or `false`. + /// + /// Send with a value of `true` if you wish to enable [Text Tags](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) parsing in your document. Defaults to disabled, or `false`. + [DataMember(Name = "use_text_tags", EmitDefaultValue = true)] + public bool UseTextTags { get; set; } + + /// + /// When the signature request will expire. Unsigned signatures will be moved to the expired status, and no longer signable. See [Signature Request Expiration Date](https://developers.hellosign.com/docs/signature-request/expiration/) for details. + /// + /// When the signature request will expire. Unsigned signatures will be moved to the expired status, and no longer signable. See [Signature Request Expiration Date](https://developers.hellosign.com/docs/signature-request/expiration/) for details. + [DataMember(Name = "expires_at", EmitDefaultValue = true)] + public int? ExpiresAt { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class SignatureRequestEditRequest {\n"); + sb.Append(" Files: ").Append(Files).Append("\n"); + sb.Append(" FileUrls: ").Append(FileUrls).Append("\n"); + sb.Append(" Signers: ").Append(Signers).Append("\n"); + sb.Append(" GroupedSigners: ").Append(GroupedSigners).Append("\n"); + sb.Append(" AllowDecline: ").Append(AllowDecline).Append("\n"); + sb.Append(" AllowReassign: ").Append(AllowReassign).Append("\n"); + sb.Append(" Attachments: ").Append(Attachments).Append("\n"); + sb.Append(" CcEmailAddresses: ").Append(CcEmailAddresses).Append("\n"); + sb.Append(" ClientId: ").Append(ClientId).Append("\n"); + sb.Append(" CustomFields: ").Append(CustomFields).Append("\n"); + sb.Append(" FieldOptions: ").Append(FieldOptions).Append("\n"); + sb.Append(" FormFieldGroups: ").Append(FormFieldGroups).Append("\n"); + sb.Append(" FormFieldRules: ").Append(FormFieldRules).Append("\n"); + sb.Append(" FormFieldsPerDocument: ").Append(FormFieldsPerDocument).Append("\n"); + sb.Append(" HideTextTags: ").Append(HideTextTags).Append("\n"); + sb.Append(" IsEid: ").Append(IsEid).Append("\n"); + sb.Append(" Message: ").Append(Message).Append("\n"); + sb.Append(" Metadata: ").Append(Metadata).Append("\n"); + sb.Append(" SigningOptions: ").Append(SigningOptions).Append("\n"); + sb.Append(" SigningRedirectUrl: ").Append(SigningRedirectUrl).Append("\n"); + sb.Append(" Subject: ").Append(Subject).Append("\n"); + sb.Append(" TestMode: ").Append(TestMode).Append("\n"); + sb.Append(" Title: ").Append(Title).Append("\n"); + sb.Append(" UseTextTags: ").Append(UseTextTags).Append("\n"); + sb.Append(" ExpiresAt: ").Append(ExpiresAt).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return this.Equals(input as SignatureRequestEditRequest); + } + + /// + /// Returns true if SignatureRequestEditRequest instances are equal + /// + /// Instance of SignatureRequestEditRequest to be compared + /// Boolean + public bool Equals(SignatureRequestEditRequest input) + { + if (input == null) + { + return false; + } + return + ( + this.Files == input.Files || + this.Files != null && + input.Files != null && + this.Files.SequenceEqual(input.Files) + ) && + ( + this.FileUrls == input.FileUrls || + this.FileUrls != null && + input.FileUrls != null && + this.FileUrls.SequenceEqual(input.FileUrls) + ) && + ( + this.Signers == input.Signers || + this.Signers != null && + input.Signers != null && + this.Signers.SequenceEqual(input.Signers) + ) && + ( + this.GroupedSigners == input.GroupedSigners || + this.GroupedSigners != null && + input.GroupedSigners != null && + this.GroupedSigners.SequenceEqual(input.GroupedSigners) + ) && + ( + this.AllowDecline == input.AllowDecline || + this.AllowDecline.Equals(input.AllowDecline) + ) && + ( + this.AllowReassign == input.AllowReassign || + this.AllowReassign.Equals(input.AllowReassign) + ) && + ( + this.Attachments == input.Attachments || + this.Attachments != null && + input.Attachments != null && + this.Attachments.SequenceEqual(input.Attachments) + ) && + ( + this.CcEmailAddresses == input.CcEmailAddresses || + this.CcEmailAddresses != null && + input.CcEmailAddresses != null && + this.CcEmailAddresses.SequenceEqual(input.CcEmailAddresses) + ) && + ( + this.ClientId == input.ClientId || + (this.ClientId != null && + this.ClientId.Equals(input.ClientId)) + ) && + ( + this.CustomFields == input.CustomFields || + this.CustomFields != null && + input.CustomFields != null && + this.CustomFields.SequenceEqual(input.CustomFields) + ) && + ( + this.FieldOptions == input.FieldOptions || + (this.FieldOptions != null && + this.FieldOptions.Equals(input.FieldOptions)) + ) && + ( + this.FormFieldGroups == input.FormFieldGroups || + this.FormFieldGroups != null && + input.FormFieldGroups != null && + this.FormFieldGroups.SequenceEqual(input.FormFieldGroups) + ) && + ( + this.FormFieldRules == input.FormFieldRules || + this.FormFieldRules != null && + input.FormFieldRules != null && + this.FormFieldRules.SequenceEqual(input.FormFieldRules) + ) && + ( + this.FormFieldsPerDocument == input.FormFieldsPerDocument || + this.FormFieldsPerDocument != null && + input.FormFieldsPerDocument != null && + this.FormFieldsPerDocument.SequenceEqual(input.FormFieldsPerDocument) + ) && + ( + this.HideTextTags == input.HideTextTags || + this.HideTextTags.Equals(input.HideTextTags) + ) && + ( + this.IsEid == input.IsEid || + this.IsEid.Equals(input.IsEid) + ) && + ( + this.Message == input.Message || + (this.Message != null && + this.Message.Equals(input.Message)) + ) && + ( + this.Metadata == input.Metadata || + this.Metadata != null && + input.Metadata != null && + this.Metadata.SequenceEqual(input.Metadata) + ) && + ( + this.SigningOptions == input.SigningOptions || + (this.SigningOptions != null && + this.SigningOptions.Equals(input.SigningOptions)) + ) && + ( + this.SigningRedirectUrl == input.SigningRedirectUrl || + (this.SigningRedirectUrl != null && + this.SigningRedirectUrl.Equals(input.SigningRedirectUrl)) + ) && + ( + this.Subject == input.Subject || + (this.Subject != null && + this.Subject.Equals(input.Subject)) + ) && + ( + this.TestMode == input.TestMode || + this.TestMode.Equals(input.TestMode) + ) && + ( + this.Title == input.Title || + (this.Title != null && + this.Title.Equals(input.Title)) + ) && + ( + this.UseTextTags == input.UseTextTags || + this.UseTextTags.Equals(input.UseTextTags) + ) && + ( + this.ExpiresAt == input.ExpiresAt || + (this.ExpiresAt != null && + this.ExpiresAt.Equals(input.ExpiresAt)) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.Files != null) + { + hashCode = (hashCode * 59) + this.Files.GetHashCode(); + } + if (this.FileUrls != null) + { + hashCode = (hashCode * 59) + this.FileUrls.GetHashCode(); + } + if (this.Signers != null) + { + hashCode = (hashCode * 59) + this.Signers.GetHashCode(); + } + if (this.GroupedSigners != null) + { + hashCode = (hashCode * 59) + this.GroupedSigners.GetHashCode(); + } + hashCode = (hashCode * 59) + this.AllowDecline.GetHashCode(); + hashCode = (hashCode * 59) + this.AllowReassign.GetHashCode(); + if (this.Attachments != null) + { + hashCode = (hashCode * 59) + this.Attachments.GetHashCode(); + } + if (this.CcEmailAddresses != null) + { + hashCode = (hashCode * 59) + this.CcEmailAddresses.GetHashCode(); + } + if (this.ClientId != null) + { + hashCode = (hashCode * 59) + this.ClientId.GetHashCode(); + } + if (this.CustomFields != null) + { + hashCode = (hashCode * 59) + this.CustomFields.GetHashCode(); + } + if (this.FieldOptions != null) + { + hashCode = (hashCode * 59) + this.FieldOptions.GetHashCode(); + } + if (this.FormFieldGroups != null) + { + hashCode = (hashCode * 59) + this.FormFieldGroups.GetHashCode(); + } + if (this.FormFieldRules != null) + { + hashCode = (hashCode * 59) + this.FormFieldRules.GetHashCode(); + } + if (this.FormFieldsPerDocument != null) + { + hashCode = (hashCode * 59) + this.FormFieldsPerDocument.GetHashCode(); + } + hashCode = (hashCode * 59) + this.HideTextTags.GetHashCode(); + hashCode = (hashCode * 59) + this.IsEid.GetHashCode(); + if (this.Message != null) + { + hashCode = (hashCode * 59) + this.Message.GetHashCode(); + } + if (this.Metadata != null) + { + hashCode = (hashCode * 59) + this.Metadata.GetHashCode(); + } + if (this.SigningOptions != null) + { + hashCode = (hashCode * 59) + this.SigningOptions.GetHashCode(); + } + if (this.SigningRedirectUrl != null) + { + hashCode = (hashCode * 59) + this.SigningRedirectUrl.GetHashCode(); + } + if (this.Subject != null) + { + hashCode = (hashCode * 59) + this.Subject.GetHashCode(); + } + hashCode = (hashCode * 59) + this.TestMode.GetHashCode(); + if (this.Title != null) + { + hashCode = (hashCode * 59) + this.Title.GetHashCode(); + } + hashCode = (hashCode * 59) + this.UseTextTags.GetHashCode(); + if (this.ExpiresAt != null) + { + hashCode = (hashCode * 59) + this.ExpiresAt.GetHashCode(); + } + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + // Message (string) maxLength + if (this.Message != null && this.Message.Length > 5000) + { + yield return new ValidationResult("Invalid value for Message, length must be less than 5000.", new[] { "Message" }); + } + + // Subject (string) maxLength + if (this.Subject != null && this.Subject.Length > 255) + { + yield return new ValidationResult("Invalid value for Subject, length must be less than 255.", new[] { "Subject" }); + } + + // Title (string) maxLength + if (this.Title != null && this.Title.Length > 255) + { + yield return new ValidationResult("Invalid value for Title, length must be less than 255.", new[] { "Title" }); + } + + yield break; + } + public List GetOpenApiTypes() + { + var types = new List(); + types.Add(new OpenApiType() + { + Name = "files", + Property = "Files", + Type = "List", + Value = Files, + }); + types.Add(new OpenApiType() + { + Name = "file_urls", + Property = "FileUrls", + Type = "List", + Value = FileUrls, + }); + types.Add(new OpenApiType() + { + Name = "signers", + Property = "Signers", + Type = "List", + Value = Signers, + }); + types.Add(new OpenApiType() + { + Name = "grouped_signers", + Property = "GroupedSigners", + Type = "List", + Value = GroupedSigners, + }); + types.Add(new OpenApiType() + { + Name = "allow_decline", + Property = "AllowDecline", + Type = "bool", + Value = AllowDecline, + }); + types.Add(new OpenApiType() + { + Name = "allow_reassign", + Property = "AllowReassign", + Type = "bool", + Value = AllowReassign, + }); + types.Add(new OpenApiType() + { + Name = "attachments", + Property = "Attachments", + Type = "List", + Value = Attachments, + }); + types.Add(new OpenApiType() + { + Name = "cc_email_addresses", + Property = "CcEmailAddresses", + Type = "List", + Value = CcEmailAddresses, + }); + types.Add(new OpenApiType() + { + Name = "client_id", + Property = "ClientId", + Type = "string", + Value = ClientId, + }); + types.Add(new OpenApiType() + { + Name = "custom_fields", + Property = "CustomFields", + Type = "List", + Value = CustomFields, + }); + types.Add(new OpenApiType() + { + Name = "field_options", + Property = "FieldOptions", + Type = "SubFieldOptions", + Value = FieldOptions, + }); + types.Add(new OpenApiType() + { + Name = "form_field_groups", + Property = "FormFieldGroups", + Type = "List", + Value = FormFieldGroups, + }); + types.Add(new OpenApiType() + { + Name = "form_field_rules", + Property = "FormFieldRules", + Type = "List", + Value = FormFieldRules, + }); + types.Add(new OpenApiType() + { + Name = "form_fields_per_document", + Property = "FormFieldsPerDocument", + Type = "List", + Value = FormFieldsPerDocument, + }); + types.Add(new OpenApiType() + { + Name = "hide_text_tags", + Property = "HideTextTags", + Type = "bool", + Value = HideTextTags, + }); + types.Add(new OpenApiType() + { + Name = "is_eid", + Property = "IsEid", + Type = "bool", + Value = IsEid, + }); + types.Add(new OpenApiType() + { + Name = "message", + Property = "Message", + Type = "string", + Value = Message, + }); + types.Add(new OpenApiType() + { + Name = "metadata", + Property = "Metadata", + Type = "Dictionary", + Value = Metadata, + }); + types.Add(new OpenApiType() + { + Name = "signing_options", + Property = "SigningOptions", + Type = "SubSigningOptions", + Value = SigningOptions, + }); + types.Add(new OpenApiType() + { + Name = "signing_redirect_url", + Property = "SigningRedirectUrl", + Type = "string", + Value = SigningRedirectUrl, + }); + types.Add(new OpenApiType() + { + Name = "subject", + Property = "Subject", + Type = "string", + Value = Subject, + }); + types.Add(new OpenApiType() + { + Name = "test_mode", + Property = "TestMode", + Type = "bool", + Value = TestMode, + }); + types.Add(new OpenApiType() + { + Name = "title", + Property = "Title", + Type = "string", + Value = Title, + }); + types.Add(new OpenApiType() + { + Name = "use_text_tags", + Property = "UseTextTags", + Type = "bool", + Value = UseTextTags, + }); + types.Add(new OpenApiType() + { + Name = "expires_at", + Property = "ExpiresAt", + Type = "int?", + Value = ExpiresAt, + }); + + return types; + } + } + +} diff --git a/sdks/dotnet/src/Dropbox.Sign/Model/SignatureRequestEditWithTemplateRequest.cs b/sdks/dotnet/src/Dropbox.Sign/Model/SignatureRequestEditWithTemplateRequest.cs new file mode 100644 index 000000000..84990b8ff --- /dev/null +++ b/sdks/dotnet/src/Dropbox.Sign/Model/SignatureRequestEditWithTemplateRequest.cs @@ -0,0 +1,578 @@ +/* + * Dropbox Sign API + * + * Dropbox Sign v3 API + * + * The version of the OpenAPI document: 3.0.0 + * Contact: apisupport@hellosign.com + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using System.ComponentModel.DataAnnotations; +using OpenAPIDateConverter = Dropbox.Sign.Client.OpenAPIDateConverter; + +namespace Dropbox.Sign.Model +{ + /// + /// SignatureRequestEditWithTemplateRequest + /// + [DataContract(Name = "SignatureRequestEditWithTemplateRequest")] + [JsonObject(ItemNullValueHandling = NullValueHandling.Ignore)] + public partial class SignatureRequestEditWithTemplateRequest : IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + [JsonConstructorAttribute] + protected SignatureRequestEditWithTemplateRequest() { } + /// + /// Initializes a new instance of the class. + /// + /// Use `template_ids` to create a SignatureRequest from one or more templates, in the order in which the template will be used. (required). + /// Allows signers to decline to sign a document if `true`. Defaults to `false`. (default to false). + /// Add CC email recipients. Required when a CC role exists for the Template.. + /// Client id of the app to associate with the signature request. Used to apply the branding and callback url defined for the app.. + /// An array defining values and options for custom fields. Required when a custom field exists in the Template.. + /// Use `files[]` to indicate the uploaded file(s) to send for signature. This endpoint requires either **files** or **file_urls[]**, but not both.. + /// Use `file_urls[]` to have Dropbox Sign download the file(s) to send for signature. This endpoint requires either **files** or **file_urls[]**, but not both.. + /// Send with a value of `true` if you wish to enable [electronic identification (eID)](https://www.hellosign.com/features/electronic-id), which requires the signer to verify their identity with an eID provider to sign a document.<br> **NOTE:** eID is only available on the Premium API plan. Cannot be used in `test_mode`. Only works on requests with one signer. (default to false). + /// The custom message in the email that will be sent to the signers.. + /// Key-value data that should be attached to the signature request. This metadata is included in all API responses and events involving the signature request. For example, use the metadata field to store a signer's order number for look up when receiving events for the signature request. Each request can include up to 10 metadata keys (or 50 nested metadata keys), with key names up to 40 characters long and values up to 1000 characters long.. + /// Add Signers to your Templated-based Signature Request. (required). + /// signingOptions. + /// The URL you want signers redirected to after they successfully sign.. + /// The subject in the email that will be sent to the signers.. + /// Whether this is a test, the signature request will not be legally binding if set to `true`. Defaults to `false`. (default to false). + /// The title you want to assign to the SignatureRequest.. + public SignatureRequestEditWithTemplateRequest(List templateIds = default(List), bool allowDecline = false, List ccs = default(List), string clientId = default(string), List customFields = default(List), List files = default(List), List fileUrls = default(List), bool isEid = false, string message = default(string), Dictionary metadata = default(Dictionary), List signers = default(List), SubSigningOptions signingOptions = default(SubSigningOptions), string signingRedirectUrl = default(string), string subject = default(string), bool testMode = false, string title = default(string)) + { + + // to ensure "templateIds" is required (not null) + if (templateIds == null) + { + throw new ArgumentNullException("templateIds is a required property for SignatureRequestEditWithTemplateRequest and cannot be null"); + } + this.TemplateIds = templateIds; + // to ensure "signers" is required (not null) + if (signers == null) + { + throw new ArgumentNullException("signers is a required property for SignatureRequestEditWithTemplateRequest and cannot be null"); + } + this.Signers = signers; + this.AllowDecline = allowDecline; + this.Ccs = ccs; + this.ClientId = clientId; + this.CustomFields = customFields; + this.Files = files; + this.FileUrls = fileUrls; + this.IsEid = isEid; + this.Message = message; + this.Metadata = metadata; + this.SigningOptions = signingOptions; + this.SigningRedirectUrl = signingRedirectUrl; + this.Subject = subject; + this.TestMode = testMode; + this.Title = title; + } + + /// + /// Attempt to instantiate and hydrate a new instance of this class + /// + /// String of JSON data representing target object + public static SignatureRequestEditWithTemplateRequest Init(string jsonData) + { + var obj = JsonConvert.DeserializeObject(jsonData); + + if (obj == null) + { + throw new Exception("Unable to deserialize JSON to instance of SignatureRequestEditWithTemplateRequest"); + } + + return obj; + } + + /// + /// Use `template_ids` to create a SignatureRequest from one or more templates, in the order in which the template will be used. + /// + /// Use `template_ids` to create a SignatureRequest from one or more templates, in the order in which the template will be used. + [DataMember(Name = "template_ids", IsRequired = true, EmitDefaultValue = true)] + public List TemplateIds { get; set; } + + /// + /// Add Signers to your Templated-based Signature Request. + /// + /// Add Signers to your Templated-based Signature Request. + [DataMember(Name = "signers", IsRequired = true, EmitDefaultValue = true)] + public List Signers { get; set; } + + /// + /// Allows signers to decline to sign a document if `true`. Defaults to `false`. + /// + /// Allows signers to decline to sign a document if `true`. Defaults to `false`. + [DataMember(Name = "allow_decline", EmitDefaultValue = true)] + public bool AllowDecline { get; set; } + + /// + /// Add CC email recipients. Required when a CC role exists for the Template. + /// + /// Add CC email recipients. Required when a CC role exists for the Template. + [DataMember(Name = "ccs", EmitDefaultValue = true)] + public List Ccs { get; set; } + + /// + /// Client id of the app to associate with the signature request. Used to apply the branding and callback url defined for the app. + /// + /// Client id of the app to associate with the signature request. Used to apply the branding and callback url defined for the app. + [DataMember(Name = "client_id", EmitDefaultValue = true)] + public string ClientId { get; set; } + + /// + /// An array defining values and options for custom fields. Required when a custom field exists in the Template. + /// + /// An array defining values and options for custom fields. Required when a custom field exists in the Template. + [DataMember(Name = "custom_fields", EmitDefaultValue = true)] + public List CustomFields { get; set; } + + /// + /// Use `files[]` to indicate the uploaded file(s) to send for signature. This endpoint requires either **files** or **file_urls[]**, but not both. + /// + /// Use `files[]` to indicate the uploaded file(s) to send for signature. This endpoint requires either **files** or **file_urls[]**, but not both. + [DataMember(Name = "files", EmitDefaultValue = true)] + public List Files { get; set; } + + /// + /// Use `file_urls[]` to have Dropbox Sign download the file(s) to send for signature. This endpoint requires either **files** or **file_urls[]**, but not both. + /// + /// Use `file_urls[]` to have Dropbox Sign download the file(s) to send for signature. This endpoint requires either **files** or **file_urls[]**, but not both. + [DataMember(Name = "file_urls", EmitDefaultValue = true)] + public List FileUrls { get; set; } + + /// + /// Send with a value of `true` if you wish to enable [electronic identification (eID)](https://www.hellosign.com/features/electronic-id), which requires the signer to verify their identity with an eID provider to sign a document.<br> **NOTE:** eID is only available on the Premium API plan. Cannot be used in `test_mode`. Only works on requests with one signer. + /// + /// Send with a value of `true` if you wish to enable [electronic identification (eID)](https://www.hellosign.com/features/electronic-id), which requires the signer to verify their identity with an eID provider to sign a document.<br> **NOTE:** eID is only available on the Premium API plan. Cannot be used in `test_mode`. Only works on requests with one signer. + [DataMember(Name = "is_eid", EmitDefaultValue = true)] + public bool IsEid { get; set; } + + /// + /// The custom message in the email that will be sent to the signers. + /// + /// The custom message in the email that will be sent to the signers. + [DataMember(Name = "message", EmitDefaultValue = true)] + public string Message { get; set; } + + /// + /// Key-value data that should be attached to the signature request. This metadata is included in all API responses and events involving the signature request. For example, use the metadata field to store a signer's order number for look up when receiving events for the signature request. Each request can include up to 10 metadata keys (or 50 nested metadata keys), with key names up to 40 characters long and values up to 1000 characters long. + /// + /// Key-value data that should be attached to the signature request. This metadata is included in all API responses and events involving the signature request. For example, use the metadata field to store a signer's order number for look up when receiving events for the signature request. Each request can include up to 10 metadata keys (or 50 nested metadata keys), with key names up to 40 characters long and values up to 1000 characters long. + [DataMember(Name = "metadata", EmitDefaultValue = true)] + public Dictionary Metadata { get; set; } + + /// + /// Gets or Sets SigningOptions + /// + [DataMember(Name = "signing_options", EmitDefaultValue = true)] + public SubSigningOptions SigningOptions { get; set; } + + /// + /// The URL you want signers redirected to after they successfully sign. + /// + /// The URL you want signers redirected to after they successfully sign. + [DataMember(Name = "signing_redirect_url", EmitDefaultValue = true)] + public string SigningRedirectUrl { get; set; } + + /// + /// The subject in the email that will be sent to the signers. + /// + /// The subject in the email that will be sent to the signers. + [DataMember(Name = "subject", EmitDefaultValue = true)] + public string Subject { get; set; } + + /// + /// Whether this is a test, the signature request will not be legally binding if set to `true`. Defaults to `false`. + /// + /// Whether this is a test, the signature request will not be legally binding if set to `true`. Defaults to `false`. + [DataMember(Name = "test_mode", EmitDefaultValue = true)] + public bool TestMode { get; set; } + + /// + /// The title you want to assign to the SignatureRequest. + /// + /// The title you want to assign to the SignatureRequest. + [DataMember(Name = "title", EmitDefaultValue = true)] + public string Title { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class SignatureRequestEditWithTemplateRequest {\n"); + sb.Append(" TemplateIds: ").Append(TemplateIds).Append("\n"); + sb.Append(" Signers: ").Append(Signers).Append("\n"); + sb.Append(" AllowDecline: ").Append(AllowDecline).Append("\n"); + sb.Append(" Ccs: ").Append(Ccs).Append("\n"); + sb.Append(" ClientId: ").Append(ClientId).Append("\n"); + sb.Append(" CustomFields: ").Append(CustomFields).Append("\n"); + sb.Append(" Files: ").Append(Files).Append("\n"); + sb.Append(" FileUrls: ").Append(FileUrls).Append("\n"); + sb.Append(" IsEid: ").Append(IsEid).Append("\n"); + sb.Append(" Message: ").Append(Message).Append("\n"); + sb.Append(" Metadata: ").Append(Metadata).Append("\n"); + sb.Append(" SigningOptions: ").Append(SigningOptions).Append("\n"); + sb.Append(" SigningRedirectUrl: ").Append(SigningRedirectUrl).Append("\n"); + sb.Append(" Subject: ").Append(Subject).Append("\n"); + sb.Append(" TestMode: ").Append(TestMode).Append("\n"); + sb.Append(" Title: ").Append(Title).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return this.Equals(input as SignatureRequestEditWithTemplateRequest); + } + + /// + /// Returns true if SignatureRequestEditWithTemplateRequest instances are equal + /// + /// Instance of SignatureRequestEditWithTemplateRequest to be compared + /// Boolean + public bool Equals(SignatureRequestEditWithTemplateRequest input) + { + if (input == null) + { + return false; + } + return + ( + this.TemplateIds == input.TemplateIds || + this.TemplateIds != null && + input.TemplateIds != null && + this.TemplateIds.SequenceEqual(input.TemplateIds) + ) && + ( + this.Signers == input.Signers || + this.Signers != null && + input.Signers != null && + this.Signers.SequenceEqual(input.Signers) + ) && + ( + this.AllowDecline == input.AllowDecline || + this.AllowDecline.Equals(input.AllowDecline) + ) && + ( + this.Ccs == input.Ccs || + this.Ccs != null && + input.Ccs != null && + this.Ccs.SequenceEqual(input.Ccs) + ) && + ( + this.ClientId == input.ClientId || + (this.ClientId != null && + this.ClientId.Equals(input.ClientId)) + ) && + ( + this.CustomFields == input.CustomFields || + this.CustomFields != null && + input.CustomFields != null && + this.CustomFields.SequenceEqual(input.CustomFields) + ) && + ( + this.Files == input.Files || + this.Files != null && + input.Files != null && + this.Files.SequenceEqual(input.Files) + ) && + ( + this.FileUrls == input.FileUrls || + this.FileUrls != null && + input.FileUrls != null && + this.FileUrls.SequenceEqual(input.FileUrls) + ) && + ( + this.IsEid == input.IsEid || + this.IsEid.Equals(input.IsEid) + ) && + ( + this.Message == input.Message || + (this.Message != null && + this.Message.Equals(input.Message)) + ) && + ( + this.Metadata == input.Metadata || + this.Metadata != null && + input.Metadata != null && + this.Metadata.SequenceEqual(input.Metadata) + ) && + ( + this.SigningOptions == input.SigningOptions || + (this.SigningOptions != null && + this.SigningOptions.Equals(input.SigningOptions)) + ) && + ( + this.SigningRedirectUrl == input.SigningRedirectUrl || + (this.SigningRedirectUrl != null && + this.SigningRedirectUrl.Equals(input.SigningRedirectUrl)) + ) && + ( + this.Subject == input.Subject || + (this.Subject != null && + this.Subject.Equals(input.Subject)) + ) && + ( + this.TestMode == input.TestMode || + this.TestMode.Equals(input.TestMode) + ) && + ( + this.Title == input.Title || + (this.Title != null && + this.Title.Equals(input.Title)) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.TemplateIds != null) + { + hashCode = (hashCode * 59) + this.TemplateIds.GetHashCode(); + } + if (this.Signers != null) + { + hashCode = (hashCode * 59) + this.Signers.GetHashCode(); + } + hashCode = (hashCode * 59) + this.AllowDecline.GetHashCode(); + if (this.Ccs != null) + { + hashCode = (hashCode * 59) + this.Ccs.GetHashCode(); + } + if (this.ClientId != null) + { + hashCode = (hashCode * 59) + this.ClientId.GetHashCode(); + } + if (this.CustomFields != null) + { + hashCode = (hashCode * 59) + this.CustomFields.GetHashCode(); + } + if (this.Files != null) + { + hashCode = (hashCode * 59) + this.Files.GetHashCode(); + } + if (this.FileUrls != null) + { + hashCode = (hashCode * 59) + this.FileUrls.GetHashCode(); + } + hashCode = (hashCode * 59) + this.IsEid.GetHashCode(); + if (this.Message != null) + { + hashCode = (hashCode * 59) + this.Message.GetHashCode(); + } + if (this.Metadata != null) + { + hashCode = (hashCode * 59) + this.Metadata.GetHashCode(); + } + if (this.SigningOptions != null) + { + hashCode = (hashCode * 59) + this.SigningOptions.GetHashCode(); + } + if (this.SigningRedirectUrl != null) + { + hashCode = (hashCode * 59) + this.SigningRedirectUrl.GetHashCode(); + } + if (this.Subject != null) + { + hashCode = (hashCode * 59) + this.Subject.GetHashCode(); + } + hashCode = (hashCode * 59) + this.TestMode.GetHashCode(); + if (this.Title != null) + { + hashCode = (hashCode * 59) + this.Title.GetHashCode(); + } + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + // Message (string) maxLength + if (this.Message != null && this.Message.Length > 5000) + { + yield return new ValidationResult("Invalid value for Message, length must be less than 5000.", new[] { "Message" }); + } + + // Subject (string) maxLength + if (this.Subject != null && this.Subject.Length > 255) + { + yield return new ValidationResult("Invalid value for Subject, length must be less than 255.", new[] { "Subject" }); + } + + // Title (string) maxLength + if (this.Title != null && this.Title.Length > 255) + { + yield return new ValidationResult("Invalid value for Title, length must be less than 255.", new[] { "Title" }); + } + + yield break; + } + public List GetOpenApiTypes() + { + var types = new List(); + types.Add(new OpenApiType() + { + Name = "template_ids", + Property = "TemplateIds", + Type = "List", + Value = TemplateIds, + }); + types.Add(new OpenApiType() + { + Name = "signers", + Property = "Signers", + Type = "List", + Value = Signers, + }); + types.Add(new OpenApiType() + { + Name = "allow_decline", + Property = "AllowDecline", + Type = "bool", + Value = AllowDecline, + }); + types.Add(new OpenApiType() + { + Name = "ccs", + Property = "Ccs", + Type = "List", + Value = Ccs, + }); + types.Add(new OpenApiType() + { + Name = "client_id", + Property = "ClientId", + Type = "string", + Value = ClientId, + }); + types.Add(new OpenApiType() + { + Name = "custom_fields", + Property = "CustomFields", + Type = "List", + Value = CustomFields, + }); + types.Add(new OpenApiType() + { + Name = "files", + Property = "Files", + Type = "List", + Value = Files, + }); + types.Add(new OpenApiType() + { + Name = "file_urls", + Property = "FileUrls", + Type = "List", + Value = FileUrls, + }); + types.Add(new OpenApiType() + { + Name = "is_eid", + Property = "IsEid", + Type = "bool", + Value = IsEid, + }); + types.Add(new OpenApiType() + { + Name = "message", + Property = "Message", + Type = "string", + Value = Message, + }); + types.Add(new OpenApiType() + { + Name = "metadata", + Property = "Metadata", + Type = "Dictionary", + Value = Metadata, + }); + types.Add(new OpenApiType() + { + Name = "signing_options", + Property = "SigningOptions", + Type = "SubSigningOptions", + Value = SigningOptions, + }); + types.Add(new OpenApiType() + { + Name = "signing_redirect_url", + Property = "SigningRedirectUrl", + Type = "string", + Value = SigningRedirectUrl, + }); + types.Add(new OpenApiType() + { + Name = "subject", + Property = "Subject", + Type = "string", + Value = Subject, + }); + types.Add(new OpenApiType() + { + Name = "test_mode", + Property = "TestMode", + Type = "bool", + Value = TestMode, + }); + types.Add(new OpenApiType() + { + Name = "title", + Property = "Title", + Type = "string", + Value = Title, + }); + + return types; + } + } + +} diff --git a/sdks/java-v1/README.md b/sdks/java-v1/README.md index d5f7354bc..5a19d8db9 100644 --- a/sdks/java-v1/README.md +++ b/sdks/java-v1/README.md @@ -197,6 +197,10 @@ Class | Method | HTTP request | Description *SignatureRequestApi* | [**signatureRequestCancel**](docs/SignatureRequestApi.md#signatureRequestCancel) | **POST** /signature_request/cancel/{signature_request_id} | Cancel Incomplete Signature Request *SignatureRequestApi* | [**signatureRequestCreateEmbedded**](docs/SignatureRequestApi.md#signatureRequestCreateEmbedded) | **POST** /signature_request/create_embedded | Create Embedded Signature Request *SignatureRequestApi* | [**signatureRequestCreateEmbeddedWithTemplate**](docs/SignatureRequestApi.md#signatureRequestCreateEmbeddedWithTemplate) | **POST** /signature_request/create_embedded_with_template | Create Embedded Signature Request with Template +*SignatureRequestApi* | [**signatureRequestEdit**](docs/SignatureRequestApi.md#signatureRequestEdit) | **PUT** /signature_request/edit/{signature_request_id} | Edit Signature Request +*SignatureRequestApi* | [**signatureRequestEditEmbedded**](docs/SignatureRequestApi.md#signatureRequestEditEmbedded) | **PUT** /signature_request/edit_embedded/{signature_request_id} | Edit Embedded Signature Request +*SignatureRequestApi* | [**signatureRequestEditEmbeddedWithTemplate**](docs/SignatureRequestApi.md#signatureRequestEditEmbeddedWithTemplate) | **PUT** /signature_request/edit_embedded_with_template/{signature_request_id} | Edit Embedded Signature Request with Template +*SignatureRequestApi* | [**signatureRequestEditWithTemplate**](docs/SignatureRequestApi.md#signatureRequestEditWithTemplate) | **PUT** /signature_request/edit_with_template/{signature_request_id} | Edit Signature Request With Template *SignatureRequestApi* | [**signatureRequestFiles**](docs/SignatureRequestApi.md#signatureRequestFiles) | **GET** /signature_request/files/{signature_request_id} | Download Files *SignatureRequestApi* | [**signatureRequestFilesAsDataUri**](docs/SignatureRequestApi.md#signatureRequestFilesAsDataUri) | **GET** /signature_request/files_as_data_uri/{signature_request_id} | Download Files as Data Uri *SignatureRequestApi* | [**signatureRequestFilesAsFileUrl**](docs/SignatureRequestApi.md#signatureRequestFilesAsFileUrl) | **GET** /signature_request/files_as_file_url/{signature_request_id} | Download Files as File Url @@ -300,6 +304,10 @@ Class | Method | HTTP request | Description - [SignatureRequestBulkSendWithTemplateRequest](docs/SignatureRequestBulkSendWithTemplateRequest.md) - [SignatureRequestCreateEmbeddedRequest](docs/SignatureRequestCreateEmbeddedRequest.md) - [SignatureRequestCreateEmbeddedWithTemplateRequest](docs/SignatureRequestCreateEmbeddedWithTemplateRequest.md) + - [SignatureRequestEditEmbeddedRequest](docs/SignatureRequestEditEmbeddedRequest.md) + - [SignatureRequestEditEmbeddedWithTemplateRequest](docs/SignatureRequestEditEmbeddedWithTemplateRequest.md) + - [SignatureRequestEditRequest](docs/SignatureRequestEditRequest.md) + - [SignatureRequestEditWithTemplateRequest](docs/SignatureRequestEditWithTemplateRequest.md) - [SignatureRequestGetResponse](docs/SignatureRequestGetResponse.md) - [SignatureRequestListResponse](docs/SignatureRequestListResponse.md) - [SignatureRequestRemindRequest](docs/SignatureRequestRemindRequest.md) diff --git a/sdks/java-v1/docs/SignatureRequestApi.md b/sdks/java-v1/docs/SignatureRequestApi.md index 60e02426f..4a9a22b75 100644 --- a/sdks/java-v1/docs/SignatureRequestApi.md +++ b/sdks/java-v1/docs/SignatureRequestApi.md @@ -9,6 +9,10 @@ All URIs are relative to *https://api.hellosign.com/v3* [**signatureRequestCancel**](SignatureRequestApi.md#signatureRequestCancel) | **POST** /signature_request/cancel/{signature_request_id} | Cancel Incomplete Signature Request [**signatureRequestCreateEmbedded**](SignatureRequestApi.md#signatureRequestCreateEmbedded) | **POST** /signature_request/create_embedded | Create Embedded Signature Request [**signatureRequestCreateEmbeddedWithTemplate**](SignatureRequestApi.md#signatureRequestCreateEmbeddedWithTemplate) | **POST** /signature_request/create_embedded_with_template | Create Embedded Signature Request with Template +[**signatureRequestEdit**](SignatureRequestApi.md#signatureRequestEdit) | **PUT** /signature_request/edit/{signature_request_id} | Edit Signature Request +[**signatureRequestEditEmbedded**](SignatureRequestApi.md#signatureRequestEditEmbedded) | **PUT** /signature_request/edit_embedded/{signature_request_id} | Edit Embedded Signature Request +[**signatureRequestEditEmbeddedWithTemplate**](SignatureRequestApi.md#signatureRequestEditEmbeddedWithTemplate) | **PUT** /signature_request/edit_embedded_with_template/{signature_request_id} | Edit Embedded Signature Request with Template +[**signatureRequestEditWithTemplate**](SignatureRequestApi.md#signatureRequestEditWithTemplate) | **PUT** /signature_request/edit_with_template/{signature_request_id} | Edit Signature Request With Template [**signatureRequestFiles**](SignatureRequestApi.md#signatureRequestFiles) | **GET** /signature_request/files/{signature_request_id} | Download Files [**signatureRequestFilesAsDataUri**](SignatureRequestApi.md#signatureRequestFilesAsDataUri) | **GET** /signature_request/files_as_data_uri/{signature_request_id} | Download Files as Data Uri [**signatureRequestFilesAsFileUrl**](SignatureRequestApi.md#signatureRequestFilesAsFileUrl) | **GET** /signature_request/files_as_file_url/{signature_request_id} | Download Files as File Url @@ -532,6 +536,442 @@ public class Example { | **4XX** | failed_operation | - | +## signatureRequestEdit + +> SignatureRequestGetResponse signatureRequestEdit(signatureRequestId, signatureRequestEditRequest) + +Edit Signature Request + +Edits and sends a SignatureRequest with the submitted documents. If `form_fields_per_document` is not specified, a signature page will be affixed where all signers will be required to add their signature, signifying their agreement to all contained documents. + +**NOTE:** Edit and resend will not deduct your signature request quota. + +### Example + +```java +import com.dropbox.sign.ApiException; +import com.dropbox.sign.Configuration; +import com.dropbox.sign.api.*; +import com.dropbox.sign.auth.*; +import com.dropbox.sign.model.*; + +import java.io.File; +import java.util.List; +import java.util.Map; + +public class Example { + public static void main(String[] args) { + var apiClient = Configuration.getDefaultApiClient() + .setApiKey("YOUR_API_KEY"); + + // or, configure Bearer (JWT) authorization: oauth2 + /* + var apiClient = Configuration.getDefaultApiClient() + .setBearerToken("YOUR_ACCESS_TOKEN"); + */ + + var signatureRequestApi = new SignatureRequestApi(apiClient); + + var signer1 = new SubSignatureRequestSigner() + .emailAddress("jack@example.com") + .name("Jack") + .order(0); + + var signer2 = new SubSignatureRequestSigner() + .emailAddress("jill@example.com") + .name("Jill") + .order(1); + + var signingOptions = new SubSigningOptions() + .draw(true) + .type(true) + .upload(true) + .phone(true) + .defaultType(SubSigningOptions.DefaultTypeEnum.DRAW); + + var subFieldOptions = new SubFieldOptions() + .dateFormat(SubFieldOptions.DateFormatEnum.DDMMYYYY); + + var signatureRequestId = "2f9781e1a8e2045224d808c153c2e1d3df6f8f2f"; + + var data = new SignatureRequestEditRequest() + .title("NDA with Acme Co.") + .subject("The NDA we talked about") + .message("Please sign this NDA and then we can discuss more. Let me know if you have any questions.") + .signers(List.of(signer1, signer2)) + .ccEmailAddresses(List.of("lawyer1@dropboxsign.com", "lawyer2@dropboxsign.com")) + .addFilesItem(new File("example_signature_request.pdf")) + .metadata(Map.of("custom_id", 1234, "custom_text", "NDA #9")) + .signingOptions(signingOptions) + .fieldOptions(subFieldOptions) + .testMode(true); + + try { + SignatureRequestGetResponse result = signatureRequestApi.signatureRequestEdit(signatureRequestId, data); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling AccountApi#accountCreate"); + 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 | +|------------- | ------------- | ------------- | -------------| + **signatureRequestId** | **String**| The id of the SignatureRequest to edit. | + **signatureRequestEditRequest** | [**SignatureRequestEditRequest**](SignatureRequestEditRequest.md)| | + +### Return type + +[**SignatureRequestGetResponse**](SignatureRequestGetResponse.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 | - | + + +## signatureRequestEditEmbedded + +> SignatureRequestGetResponse signatureRequestEditEmbedded(signatureRequestId, signatureRequestEditEmbeddedRequest) + +Edit Embedded Signature Request + +Edits a SignatureRequest with the submitted documents to be signed in an embedded iFrame. If form_fields_per_document is not specified, a signature page will be affixed where all signers will be required to add their signature, signifying their agreement to all contained documents. Note that embedded signature requests can only be signed in embedded iFrames whereas normal signature requests can only be signed on Dropbox Sign. + +### Example + +```java +import com.dropbox.sign.ApiException; +import com.dropbox.sign.Configuration; +import com.dropbox.sign.api.*; +import com.dropbox.sign.auth.*; +import com.dropbox.sign.model.*; + +import java.io.File; +import java.util.List; + +public class Example { + public static void main(String[] args) { + var apiClient = Configuration.getDefaultApiClient() + .setApiKey("YOUR_API_KEY"); + + // or, configure Bearer (JWT) authorization: oauth2 + /* + var apiClient = Configuration.getDefaultApiClient() + .setBearerToken("YOUR_ACCESS_TOKEN"); + */ + + var signatureRequestApi = new SignatureRequestApi(apiClient); + + var signer1 = new SubSignatureRequestSigner() + .emailAddress("jack@example.com") + .name("Jack") + .order(0); + + var signer2 = new SubSignatureRequestSigner() + .emailAddress("jill@example.com") + .name("Jill") + .order(1); + + var signingOptions = new SubSigningOptions() + .draw(true) + .type(true) + .upload(true) + .phone(true) + .defaultType(SubSigningOptions.DefaultTypeEnum.DRAW); + + var signatureRequestId = "2f9781e1a8e2045224d808c153c2e1d3df6f8f2f"; + + var data = new SignatureRequestEditEmbeddedRequest() + .clientId("ec64a202072370a737edf4a0eb7f4437") + .title("NDA with Acme Co.") + .subject("The NDA we talked about") + .message("Please sign this NDA and then we can discuss more. Let me know if you have any questions.") + .signers(List.of(signer1, signer2)) + .ccEmailAddresses(List.of("lawyer1@dropboxsign.com", "lawyer2@dropboxsign.com")) + .addFilesItem(new File("example_signature_request.pdf")) + .signingOptions(signingOptions) + .testMode(true); + + try { + SignatureRequestGetResponse result = signatureRequestApi.signatureRequestEditEmbedded( + signatureRequestId, + data + ); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling SignatureRequestApi#signatureRequestEditEmbedded"); + 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 | +|------------- | ------------- | ------------- | -------------| + **signatureRequestId** | **String**| The id of the SignatureRequest to edit. | + **signatureRequestEditEmbeddedRequest** | [**SignatureRequestEditEmbeddedRequest**](SignatureRequestEditEmbeddedRequest.md)| | + +### Return type + +[**SignatureRequestGetResponse**](SignatureRequestGetResponse.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 | - | + + +## signatureRequestEditEmbeddedWithTemplate + +> SignatureRequestGetResponse signatureRequestEditEmbeddedWithTemplate(signatureRequestId, signatureRequestEditEmbeddedWithTemplateRequest) + +Edit Embedded Signature Request with Template + +Edits a SignatureRequest based on the given Template(s) to be signed in an embedded iFrame. Note that embedded signature requests can only be signed in embedded iFrames whereas normal signature requests can only be signed on Dropbox Sign. + +### Example + +```java +import com.dropbox.sign.ApiException; +import com.dropbox.sign.Configuration; +import com.dropbox.sign.api.*; +import com.dropbox.sign.auth.*; +import com.dropbox.sign.model.*; + +import java.util.List; + +public class Example { + public static void main(String[] args) { + var apiClient = Configuration.getDefaultApiClient() + .setApiKey("YOUR_API_KEY"); + + // or, configure Bearer (JWT) authorization: oauth2 + /* + var apiClient = Configuration.getDefaultApiClient() + .setBearerToken("YOUR_ACCESS_TOKEN"); + */ + + var signatureRequestApi = new SignatureRequestApi(apiClient); + + var signer1 = new SubSignatureRequestTemplateSigner() + .role("Client") + .name("George"); + + var subSigningOptions = new SubSigningOptions() + .draw(true) + .type(true) + .upload(true) + .phone(false) + .defaultType(SubSigningOptions.DefaultTypeEnum.DRAW); + + var signatureRequestId = "2f9781e1a8e2045224d808c153c2e1d3df6f8f2f"; + + var data = new SignatureRequestEditEmbeddedWithTemplateRequest() + .clientId("ec64a202072370a737edf4a0eb7f4437") + .templateIds(List.of("c26b8a16784a872da37ea946b9ddec7c1e11dff6")) + .subject("Purchase Order") + .message("Glad we could come to an agreement.") + .signers(List.of(signer1)) + .signingOptions(subSigningOptions) + .testMode(true); + + try { + SignatureRequestGetResponse result = signatureRequestApi.signatureRequestEditEmbeddedWithTemplate( + signatureRequestId, + data + ); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling SignatureRequestApi#editEmbeddedWithTemplate"); + 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 | +|------------- | ------------- | ------------- | -------------| + **signatureRequestId** | **String**| The id of the SignatureRequest to edit. | + **signatureRequestEditEmbeddedWithTemplateRequest** | [**SignatureRequestEditEmbeddedWithTemplateRequest**](SignatureRequestEditEmbeddedWithTemplateRequest.md)| | + +### Return type + +[**SignatureRequestGetResponse**](SignatureRequestGetResponse.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 | - | + + +## signatureRequestEditWithTemplate + +> SignatureRequestGetResponse signatureRequestEditWithTemplate(signatureRequestId, signatureRequestEditWithTemplateRequest) + +Edit Signature Request With Template + +Edits and sends a SignatureRequest based off of the Template(s) specified with the template_ids parameter. + +**NOTE:** Edit and resend will not deduct your signature request quota. + +### Example + +```java +import com.dropbox.sign.ApiException; +import com.dropbox.sign.Configuration; +import com.dropbox.sign.api.*; +import com.dropbox.sign.auth.*; +import com.dropbox.sign.model.*; + +import java.util.List; + +public class Example { + public static void main(String[] args) { + var apiClient = Configuration.getDefaultApiClient() + .setApiKey("YOUR_API_KEY"); + + // or, configure Bearer (JWT) authorization: oauth2 + /* + var apiClient = Configuration.getDefaultApiClient() + .setBearerToken("YOUR_ACCESS_TOKEN"); + */ + + var signatureRequestApi = new SignatureRequestApi(apiClient); + + var signer1 = new SubSignatureRequestTemplateSigner() + .role("Client") + .emailAddress("george@example.com") + .name("George"); + + var cc1 = new SubCC() + .role("Accounting") + .emailAddress("accouting@emaple.com"); + + var customField1 = new SubCustomField() + .name("Cost") + .value("$20,000") + .editor("Client") + .required(true); + + var signingOptions = new SubSigningOptions() + .draw(true) + .type(true) + .upload(true) + .phone(false) + .defaultType(SubSigningOptions.DefaultTypeEnum.DRAW); + + var signatureRequestId = "2f9781e1a8e2045224d808c153c2e1d3df6f8f2f"; + + var data = new SignatureRequestEditWithTemplateRequest() + .templateIds(List.of("c26b8a16784a872da37ea946b9ddec7c1e11dff6")) + .subject("Purchase Order") + .message("Glad we could come to an agreement.") + .signers(List.of(signer1)) + .ccs(List.of(cc1)) + .customFields(List.of(customField1)) + .signingOptions(signingOptions) + .testMode(true); + + try { + SignatureRequestGetResponse result = signatureRequestApi.signatureRequestEditWithTemplate( + signatureRequestId, + data + ); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling AccountApi#accountCreate"); + 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 | +|------------- | ------------- | ------------- | -------------| + **signatureRequestId** | **String**| The id of the SignatureRequest to edit. | + **signatureRequestEditWithTemplateRequest** | [**SignatureRequestEditWithTemplateRequest**](SignatureRequestEditWithTemplateRequest.md)| | + +### Return type + +[**SignatureRequestGetResponse**](SignatureRequestGetResponse.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 | - | + + ## signatureRequestFiles > File signatureRequestFiles(signatureRequestId, fileType) diff --git a/sdks/java-v1/docs/SignatureRequestEditEmbeddedRequest.md b/sdks/java-v1/docs/SignatureRequestEditEmbeddedRequest.md new file mode 100644 index 000000000..dd8b06061 --- /dev/null +++ b/sdks/java-v1/docs/SignatureRequestEditEmbeddedRequest.md @@ -0,0 +1,37 @@ + + +# SignatureRequestEditEmbeddedRequest + + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +| `clientId`*_required_ | ```String``` | Client id of the app you're using to create this embedded signature request. Used for security purposes. | | +| `files` | ```List``` | Use `files[]` to indicate the uploaded file(s) to send for signature.

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

This endpoint requires either **files** or **file_urls[]**, but not both. | | +| `signers` | [```List```](SubSignatureRequestSigner.md) | Add Signers to your Signature Request.

This endpoint requires either **signers** or **grouped_signers**, but not both. | | +| `groupedSigners` | [```List```](SubSignatureRequestGroupedSigners.md) | Add Grouped Signers to your Signature Request.

This endpoint requires either **signers** or **grouped_signers**, but not both. | | +| `allowDecline` | ```Boolean``` | Allows signers to decline to sign a document if `true`. Defaults to `false`. | | +| `allowReassign` | ```Boolean``` | Allows signers to reassign their signature requests to other signers if set to `true`. Defaults to `false`.

**NOTE:** Only available for Premium plan. | | +| `attachments` | [```List```](SubAttachment.md) | A list describing the attachments | | +| `ccEmailAddresses` | ```List``` | The email addresses that should be CCed. | | +| `customFields` | [```List```](SubCustomField.md) | When used together with merge fields, `custom_fields` allows users to add pre-filled data to their signature requests.

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

For using pre-filled on repeatable signature requests, merge fields are added to templates in the Dropbox Sign UI or by calling [/template/create_embedded_draft](/api/reference/operation/templateCreateEmbeddedDraft) and then passing `custom_fields` on subsequent signature requests referencing that template. | | +| `fieldOptions` | [```SubFieldOptions```](SubFieldOptions.md) | | | +| `formFieldGroups` | [```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`. | | +| `formFieldRules` | [```List```](SubFormFieldRule.md) | Conditional Logic rules for fields defined in `form_fields_per_document`. | | +| `formFieldsPerDocument` | [```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` | | +| `hideTextTags` | ```Boolean``` | Enables automatic Text Tag removal when set to true.

**NOTE:** Removing text tags this way can cause unwanted clipping. We recommend leaving this setting on `false` and instead hiding your text tags using white text or a similar approach. See the [Text Tags Walkthrough](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) for more information. | | +| `message` | ```String``` | The custom message in the email that will be sent to the signers. | | +| `metadata` | ```Map``` | Key-value data that should be attached to the signature request. This metadata is included in all API responses and events involving the signature request. For example, use the metadata field to store a signer's order number for look up when receiving events for the signature request.

Each request can include up to 10 metadata keys (or 50 nested metadata keys), with key names up to 40 characters long and values up to 1000 characters long. | | +| `signingOptions` | [```SubSigningOptions```](SubSigningOptions.md) | | | +| `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. | | +| `useTextTags` | ```Boolean``` | Send with a value of `true` if you wish to enable [Text Tags](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) parsing in your document. Defaults to disabled, or `false`. | | +| `populateAutoFillFields` | ```Boolean``` | Controls whether [auto fill fields](https://faq.hellosign.com/hc/en-us/articles/360051467511-Auto-Fill-Fields) can automatically populate a signer's information during signing.

**NOTE:** Keep your signer's information safe by ensuring that the _signer on your signature request is the intended party_ before using this feature. | | +| `expiresAt` | ```Integer``` | When the signature request will expire. Unsigned signatures will be moved to the expired status, and no longer signable. See [Signature Request Expiration Date](https://developers.hellosign.com/docs/signature-request/expiration/) for details. | | + + + diff --git a/sdks/java-v1/docs/SignatureRequestEditEmbeddedWithTemplateRequest.md b/sdks/java-v1/docs/SignatureRequestEditEmbeddedWithTemplateRequest.md new file mode 100644 index 000000000..3cc3dee72 --- /dev/null +++ b/sdks/java-v1/docs/SignatureRequestEditEmbeddedWithTemplateRequest.md @@ -0,0 +1,28 @@ + + +# SignatureRequestEditEmbeddedWithTemplateRequest + + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +| `templateIds`*_required_ | ```List``` | Use `template_ids` to create a SignatureRequest from one or more templates, in the order in which the template will be used. | | +| `clientId`*_required_ | ```String``` | Client id of the app you're using to create this embedded signature request. Used for security purposes. | | +| `signers`*_required_ | [```List```](SubSignatureRequestTemplateSigner.md) | Add Signers to your Templated-based Signature Request. | | +| `allowDecline` | ```Boolean``` | Allows signers to decline to sign a document if `true`. Defaults to `false`. | | +| `ccs` | [```List```](SubCC.md) | Add CC email recipients. Required when a CC role exists for the Template. | | +| `customFields` | [```List```](SubCustomField.md) | An array defining values and options for custom fields. Required when a custom field exists in the Template. | | +| `files` | ```List``` | Use `files[]` to indicate the uploaded file(s) to send for signature.

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

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

Each request can include up to 10 metadata keys (or 50 nested metadata keys), with key names up to 40 characters long and values up to 1000 characters long. | | +| `signingOptions` | [```SubSigningOptions```](SubSigningOptions.md) | | | +| `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. | | +| `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. | | + + + diff --git a/sdks/java-v1/docs/SignatureRequestEditRequest.md b/sdks/java-v1/docs/SignatureRequestEditRequest.md new file mode 100644 index 000000000..7fa3aca65 --- /dev/null +++ b/sdks/java-v1/docs/SignatureRequestEditRequest.md @@ -0,0 +1,38 @@ + + +# SignatureRequestEditRequest + + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +| `files` | ```List``` | Use `files[]` to indicate the uploaded file(s) to send for signature.

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

This endpoint requires either **files** or **file_urls[]**, but not both. | | +| `signers` | [```List```](SubSignatureRequestSigner.md) | Add Signers to your Signature Request.

This endpoint requires either **signers** or **grouped_signers**, but not both. | | +| `groupedSigners` | [```List```](SubSignatureRequestGroupedSigners.md) | Add Grouped Signers to your Signature Request.

This endpoint requires either **signers** or **grouped_signers**, but not both. | | +| `allowDecline` | ```Boolean``` | Allows signers to decline to sign a document if `true`. Defaults to `false`. | | +| `allowReassign` | ```Boolean``` | Allows signers to reassign their signature requests to other signers if set to `true`. Defaults to `false`.

**NOTE:** Only available for Premium plan and higher. | | +| `attachments` | [```List```](SubAttachment.md) | A list describing the attachments | | +| `ccEmailAddresses` | ```List``` | The email addresses that should be CCed. | | +| `clientId` | ```String``` | The client id of the API App you want to associate with this request. Used to apply the branding and callback url defined for the app. | | +| `customFields` | [```List```](SubCustomField.md) | When used together with merge fields, `custom_fields` allows users to add pre-filled data to their signature requests.

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

For using pre-filled on repeatable signature requests, merge fields are added to templates in the Dropbox Sign UI or by calling [/template/create_embedded_draft](/api/reference/operation/templateCreateEmbeddedDraft) and then passing `custom_fields` on subsequent signature requests referencing that template. | | +| `fieldOptions` | [```SubFieldOptions```](SubFieldOptions.md) | | | +| `formFieldGroups` | [```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`. | | +| `formFieldRules` | [```List```](SubFormFieldRule.md) | Conditional Logic rules for fields defined in `form_fields_per_document`. | | +| `formFieldsPerDocument` | [```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` | | +| `hideTextTags` | ```Boolean``` | Enables automatic Text Tag removal when set to true.

**NOTE:** Removing text tags this way can cause unwanted clipping. We recommend leaving this setting on `false` and instead hiding your text tags using white text or a similar approach. See the [Text Tags Walkthrough](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) for more information. | | +| `isEid` | ```Boolean``` | Send with a value of `true` if you wish to enable [electronic identification (eID)](https://www.hellosign.com/features/electronic-id), which requires the signer to verify their identity with an eID provider to sign a document.<br>
**NOTE:** eID is only available on the Premium API plan. Cannot be used in `test_mode`. Only works on requests with one signer. | | +| `message` | ```String``` | The custom message in the email that will be sent to the signers. | | +| `metadata` | ```Map``` | Key-value data that should be attached to the signature request. This metadata is included in all API responses and events involving the signature request. For example, use the metadata field to store a signer's order number for look up when receiving events for the signature request.

Each request can include up to 10 metadata keys (or 50 nested metadata keys), with key names up to 40 characters long and values up to 1000 characters long. | | +| `signingOptions` | [```SubSigningOptions```](SubSigningOptions.md) | | | +| `signingRedirectUrl` | ```String``` | The URL you want signers redirected to after they successfully sign. | | +| `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. | | +| `useTextTags` | ```Boolean``` | Send with a value of `true` if you wish to enable [Text Tags](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) parsing in your document. Defaults to disabled, or `false`. | | +| `expiresAt` | ```Integer``` | When the signature request will expire. Unsigned signatures will be moved to the expired status, and no longer signable. See [Signature Request Expiration Date](https://developers.hellosign.com/docs/signature-request/expiration/) for details. | | + + + diff --git a/sdks/java-v1/docs/SignatureRequestEditWithTemplateRequest.md b/sdks/java-v1/docs/SignatureRequestEditWithTemplateRequest.md new file mode 100644 index 000000000..d079524b1 --- /dev/null +++ b/sdks/java-v1/docs/SignatureRequestEditWithTemplateRequest.md @@ -0,0 +1,29 @@ + + +# SignatureRequestEditWithTemplateRequest + + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +| `templateIds`*_required_ | ```List``` | Use `template_ids` to create a SignatureRequest from one or more templates, in the order in which the template will be used. | | +| `signers`*_required_ | [```List```](SubSignatureRequestTemplateSigner.md) | Add Signers to your Templated-based Signature Request. | | +| `allowDecline` | ```Boolean``` | Allows signers to decline to sign a document if `true`. Defaults to `false`. | | +| `ccs` | [```List```](SubCC.md) | Add CC email recipients. Required when a CC role exists for the Template. | | +| `clientId` | ```String``` | Client id of the app to associate with the signature request. Used to apply the branding and callback url defined for the app. | | +| `customFields` | [```List```](SubCustomField.md) | An array defining values and options for custom fields. Required when a custom field exists in the Template. | | +| `files` | ```List``` | Use `files[]` to indicate the uploaded file(s) to send for signature.

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

This endpoint requires either **files** or **file_urls[]**, but not both. | | +| `isEid` | ```Boolean``` | Send with a value of `true` if you wish to enable [electronic identification (eID)](https://www.hellosign.com/features/electronic-id), which requires the signer to verify their identity with an eID provider to sign a document.<br>
**NOTE:** eID is only available on the Premium API plan. Cannot be used in `test_mode`. Only works on requests with one signer. | | +| `message` | ```String``` | The custom message in the email that will be sent to the signers. | | +| `metadata` | ```Map``` | Key-value data that should be attached to the signature request. This metadata is included in all API responses and events involving the signature request. For example, use the metadata field to store a signer's order number for look up when receiving events for the signature request.

Each request can include up to 10 metadata keys (or 50 nested metadata keys), with key names up to 40 characters long and values up to 1000 characters long. | | +| `signingOptions` | [```SubSigningOptions```](SubSigningOptions.md) | | | +| `signingRedirectUrl` | ```String``` | The URL you want signers redirected to after they successfully sign. | | +| `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. | | + + + diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/api/SignatureRequestApi.java b/sdks/java-v1/src/main/java/com/dropbox/sign/api/SignatureRequestApi.java index 8474ef706..6996e6c02 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/api/SignatureRequestApi.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/api/SignatureRequestApi.java @@ -12,6 +12,10 @@ import com.dropbox.sign.model.SignatureRequestBulkSendWithTemplateRequest; import com.dropbox.sign.model.SignatureRequestCreateEmbeddedRequest; import com.dropbox.sign.model.SignatureRequestCreateEmbeddedWithTemplateRequest; +import com.dropbox.sign.model.SignatureRequestEditEmbeddedRequest; +import com.dropbox.sign.model.SignatureRequestEditEmbeddedWithTemplateRequest; +import com.dropbox.sign.model.SignatureRequestEditRequest; +import com.dropbox.sign.model.SignatureRequestEditWithTemplateRequest; import com.dropbox.sign.model.SignatureRequestGetResponse; import com.dropbox.sign.model.SignatureRequestListResponse; import com.dropbox.sign.model.SignatureRequestRemindRequest; @@ -493,6 +497,397 @@ public SignatureRequestGetResponse signatureRequestCreateEmbeddedWithTemplate( false); } + /** + * Edit Signature Request. Edits and sends a SignatureRequest with the submitted documents. If + * `form_fields_per_document` is not specified, a signature page will be affixed where + * all signers will be required to add their signature, signifying their agreement to all + * contained documents. **NOTE:** Edit and resend will not deduct your signature request quota. + * + * @param signatureRequestId The id of the SignatureRequest to edit. (required) + * @param signatureRequestEditRequest (required) + * @return SignatureRequestGetResponse + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + *
Status Code Description Response Headers
200 successful operation * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
4XX failed_operation -
+ */ + public SignatureRequestGetResponse signatureRequestEdit( + String signatureRequestId, SignatureRequestEditRequest signatureRequestEditRequest) + throws ApiException { + return signatureRequestEditWithHttpInfo(signatureRequestId, signatureRequestEditRequest) + .getData(); + } + + /** + * Edit Signature Request. Edits and sends a SignatureRequest with the submitted documents. If + * `form_fields_per_document` is not specified, a signature page will be affixed where + * all signers will be required to add their signature, signifying their agreement to all + * contained documents. **NOTE:** Edit and resend will not deduct your signature request quota. + * + * @param signatureRequestId The id of the SignatureRequest to edit. (required) + * @param signatureRequestEditRequest (required) + * @return ApiResponse<SignatureRequestGetResponse> + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + *
Status Code Description Response Headers
200 successful operation * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
4XX failed_operation -
+ */ + public ApiResponse signatureRequestEditWithHttpInfo( + String signatureRequestId, SignatureRequestEditRequest signatureRequestEditRequest) + throws ApiException { + + // Check required parameters + if (signatureRequestId == null) { + throw new ApiException( + 400, + "Missing the required parameter 'signatureRequestId' when calling" + + " signatureRequestEdit"); + } + if (signatureRequestEditRequest == null) { + throw new ApiException( + 400, + "Missing the required parameter 'signatureRequestEditRequest' when calling" + + " signatureRequestEdit"); + } + + // Path parameters + String localVarPath = + "/signature_request/edit/{signature_request_id}" + .replaceAll( + "\\{signature_request_id}", + apiClient.escapeString(signatureRequestId.toString())); + + String localVarAccept = apiClient.selectHeaderAccept("application/json"); + Map localVarFormParams = new LinkedHashMap<>(); + localVarFormParams = signatureRequestEditRequest.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( + "SignatureRequestApi.signatureRequestEdit", + localVarPath, + "PUT", + new ArrayList<>(), + isFileTypeFound ? null : signatureRequestEditRequest, + new LinkedHashMap<>(), + new LinkedHashMap<>(), + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType, + false); + } + + /** + * Edit Embedded Signature Request. Edits a SignatureRequest with the submitted documents to be + * signed in an embedded iFrame. If form_fields_per_document is not specified, a signature page + * will be affixed where all signers will be required to add their signature, signifying their + * agreement to all contained documents. Note that embedded signature requests can only be + * signed in embedded iFrames whereas normal signature requests can only be signed on Dropbox + * Sign. + * + * @param signatureRequestId The id of the SignatureRequest to edit. (required) + * @param signatureRequestEditEmbeddedRequest (required) + * @return SignatureRequestGetResponse + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + *
Status Code Description Response Headers
200 successful operation * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
4XX failed_operation -
+ */ + public SignatureRequestGetResponse signatureRequestEditEmbedded( + String signatureRequestId, + SignatureRequestEditEmbeddedRequest signatureRequestEditEmbeddedRequest) + throws ApiException { + return signatureRequestEditEmbeddedWithHttpInfo( + signatureRequestId, signatureRequestEditEmbeddedRequest) + .getData(); + } + + /** + * Edit Embedded Signature Request. Edits a SignatureRequest with the submitted documents to be + * signed in an embedded iFrame. If form_fields_per_document is not specified, a signature page + * will be affixed where all signers will be required to add their signature, signifying their + * agreement to all contained documents. Note that embedded signature requests can only be + * signed in embedded iFrames whereas normal signature requests can only be signed on Dropbox + * Sign. + * + * @param signatureRequestId The id of the SignatureRequest to edit. (required) + * @param signatureRequestEditEmbeddedRequest (required) + * @return ApiResponse<SignatureRequestGetResponse> + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + *
Status Code Description Response Headers
200 successful operation * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
4XX failed_operation -
+ */ + public ApiResponse signatureRequestEditEmbeddedWithHttpInfo( + String signatureRequestId, + SignatureRequestEditEmbeddedRequest signatureRequestEditEmbeddedRequest) + throws ApiException { + + // Check required parameters + if (signatureRequestId == null) { + throw new ApiException( + 400, + "Missing the required parameter 'signatureRequestId' when calling" + + " signatureRequestEditEmbedded"); + } + if (signatureRequestEditEmbeddedRequest == null) { + throw new ApiException( + 400, + "Missing the required parameter 'signatureRequestEditEmbeddedRequest' when" + + " calling signatureRequestEditEmbedded"); + } + + // Path parameters + String localVarPath = + "/signature_request/edit_embedded/{signature_request_id}" + .replaceAll( + "\\{signature_request_id}", + apiClient.escapeString(signatureRequestId.toString())); + + String localVarAccept = apiClient.selectHeaderAccept("application/json"); + Map localVarFormParams = new LinkedHashMap<>(); + localVarFormParams = signatureRequestEditEmbeddedRequest.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( + "SignatureRequestApi.signatureRequestEditEmbedded", + localVarPath, + "PUT", + new ArrayList<>(), + isFileTypeFound ? null : signatureRequestEditEmbeddedRequest, + new LinkedHashMap<>(), + new LinkedHashMap<>(), + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType, + false); + } + + /** + * Edit Embedded Signature Request with Template. Edits a SignatureRequest based on the given + * Template(s) to be signed in an embedded iFrame. Note that embedded signature requests can + * only be signed in embedded iFrames whereas normal signature requests can only be signed on + * Dropbox Sign. + * + * @param signatureRequestId The id of the SignatureRequest to edit. (required) + * @param signatureRequestEditEmbeddedWithTemplateRequest (required) + * @return SignatureRequestGetResponse + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + *
Status Code Description Response Headers
200 successful operation * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
4XX failed_operation -
+ */ + public SignatureRequestGetResponse signatureRequestEditEmbeddedWithTemplate( + String signatureRequestId, + SignatureRequestEditEmbeddedWithTemplateRequest + signatureRequestEditEmbeddedWithTemplateRequest) + throws ApiException { + return signatureRequestEditEmbeddedWithTemplateWithHttpInfo( + signatureRequestId, signatureRequestEditEmbeddedWithTemplateRequest) + .getData(); + } + + /** + * Edit Embedded Signature Request with Template. Edits a SignatureRequest based on the given + * Template(s) to be signed in an embedded iFrame. Note that embedded signature requests can + * only be signed in embedded iFrames whereas normal signature requests can only be signed on + * Dropbox Sign. + * + * @param signatureRequestId The id of the SignatureRequest to edit. (required) + * @param signatureRequestEditEmbeddedWithTemplateRequest (required) + * @return ApiResponse<SignatureRequestGetResponse> + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + *
Status Code Description Response Headers
200 successful operation * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
4XX failed_operation -
+ */ + public ApiResponse + signatureRequestEditEmbeddedWithTemplateWithHttpInfo( + String signatureRequestId, + SignatureRequestEditEmbeddedWithTemplateRequest + signatureRequestEditEmbeddedWithTemplateRequest) + throws ApiException { + + // Check required parameters + if (signatureRequestId == null) { + throw new ApiException( + 400, + "Missing the required parameter 'signatureRequestId' when calling" + + " signatureRequestEditEmbeddedWithTemplate"); + } + if (signatureRequestEditEmbeddedWithTemplateRequest == null) { + throw new ApiException( + 400, + "Missing the required parameter" + + " 'signatureRequestEditEmbeddedWithTemplateRequest' when calling" + + " signatureRequestEditEmbeddedWithTemplate"); + } + + // Path parameters + String localVarPath = + "/signature_request/edit_embedded_with_template/{signature_request_id}" + .replaceAll( + "\\{signature_request_id}", + apiClient.escapeString(signatureRequestId.toString())); + + String localVarAccept = apiClient.selectHeaderAccept("application/json"); + Map localVarFormParams = new LinkedHashMap<>(); + localVarFormParams = signatureRequestEditEmbeddedWithTemplateRequest.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( + "SignatureRequestApi.signatureRequestEditEmbeddedWithTemplate", + localVarPath, + "PUT", + new ArrayList<>(), + isFileTypeFound ? null : signatureRequestEditEmbeddedWithTemplateRequest, + new LinkedHashMap<>(), + new LinkedHashMap<>(), + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType, + false); + } + + /** + * Edit Signature Request With Template. Edits and sends a SignatureRequest based off of the + * Template(s) specified with the template_ids parameter. **NOTE:** Edit and resend will not + * deduct your signature request quota. + * + * @param signatureRequestId The id of the SignatureRequest to edit. (required) + * @param signatureRequestEditWithTemplateRequest (required) + * @return SignatureRequestGetResponse + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + *
Status Code Description Response Headers
200 successful operation * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
4XX failed_operation -
+ */ + public SignatureRequestGetResponse signatureRequestEditWithTemplate( + String signatureRequestId, + SignatureRequestEditWithTemplateRequest signatureRequestEditWithTemplateRequest) + throws ApiException { + return signatureRequestEditWithTemplateWithHttpInfo( + signatureRequestId, signatureRequestEditWithTemplateRequest) + .getData(); + } + + /** + * Edit Signature Request With Template. Edits and sends a SignatureRequest based off of the + * Template(s) specified with the template_ids parameter. **NOTE:** Edit and resend will not + * deduct your signature request quota. + * + * @param signatureRequestId The id of the SignatureRequest to edit. (required) + * @param signatureRequestEditWithTemplateRequest (required) + * @return ApiResponse<SignatureRequestGetResponse> + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + *
Status Code Description Response Headers
200 successful operation * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
4XX failed_operation -
+ */ + public ApiResponse signatureRequestEditWithTemplateWithHttpInfo( + String signatureRequestId, + SignatureRequestEditWithTemplateRequest signatureRequestEditWithTemplateRequest) + throws ApiException { + + // Check required parameters + if (signatureRequestId == null) { + throw new ApiException( + 400, + "Missing the required parameter 'signatureRequestId' when calling" + + " signatureRequestEditWithTemplate"); + } + if (signatureRequestEditWithTemplateRequest == null) { + throw new ApiException( + 400, + "Missing the required parameter 'signatureRequestEditWithTemplateRequest' when" + + " calling signatureRequestEditWithTemplate"); + } + + // Path parameters + String localVarPath = + "/signature_request/edit_with_template/{signature_request_id}" + .replaceAll( + "\\{signature_request_id}", + apiClient.escapeString(signatureRequestId.toString())); + + String localVarAccept = apiClient.selectHeaderAccept("application/json"); + Map localVarFormParams = new LinkedHashMap<>(); + localVarFormParams = signatureRequestEditWithTemplateRequest.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( + "SignatureRequestApi.signatureRequestEditWithTemplate", + localVarPath, + "PUT", + new ArrayList<>(), + isFileTypeFound ? null : signatureRequestEditWithTemplateRequest, + new LinkedHashMap<>(), + new LinkedHashMap<>(), + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType, + false); + } + /** * Download Files. Obtain a copy of the current documents specified by the * `signature_request_id` parameter. Returns a PDF or ZIP file. If the files are diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/model/SignatureRequestEditEmbeddedRequest.java b/sdks/java-v1/src/main/java/com/dropbox/sign/model/SignatureRequestEditEmbeddedRequest.java new file mode 100644 index 000000000..6da72cb0f --- /dev/null +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/model/SignatureRequestEditEmbeddedRequest.java @@ -0,0 +1,1471 @@ +/* + * 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.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; + +/** SignatureRequestEditEmbeddedRequest */ +@JsonPropertyOrder({ + SignatureRequestEditEmbeddedRequest.JSON_PROPERTY_CLIENT_ID, + SignatureRequestEditEmbeddedRequest.JSON_PROPERTY_FILES, + SignatureRequestEditEmbeddedRequest.JSON_PROPERTY_FILE_URLS, + SignatureRequestEditEmbeddedRequest.JSON_PROPERTY_SIGNERS, + SignatureRequestEditEmbeddedRequest.JSON_PROPERTY_GROUPED_SIGNERS, + SignatureRequestEditEmbeddedRequest.JSON_PROPERTY_ALLOW_DECLINE, + SignatureRequestEditEmbeddedRequest.JSON_PROPERTY_ALLOW_REASSIGN, + SignatureRequestEditEmbeddedRequest.JSON_PROPERTY_ATTACHMENTS, + SignatureRequestEditEmbeddedRequest.JSON_PROPERTY_CC_EMAIL_ADDRESSES, + SignatureRequestEditEmbeddedRequest.JSON_PROPERTY_CUSTOM_FIELDS, + SignatureRequestEditEmbeddedRequest.JSON_PROPERTY_FIELD_OPTIONS, + SignatureRequestEditEmbeddedRequest.JSON_PROPERTY_FORM_FIELD_GROUPS, + SignatureRequestEditEmbeddedRequest.JSON_PROPERTY_FORM_FIELD_RULES, + SignatureRequestEditEmbeddedRequest.JSON_PROPERTY_FORM_FIELDS_PER_DOCUMENT, + SignatureRequestEditEmbeddedRequest.JSON_PROPERTY_HIDE_TEXT_TAGS, + SignatureRequestEditEmbeddedRequest.JSON_PROPERTY_MESSAGE, + SignatureRequestEditEmbeddedRequest.JSON_PROPERTY_METADATA, + SignatureRequestEditEmbeddedRequest.JSON_PROPERTY_SIGNING_OPTIONS, + SignatureRequestEditEmbeddedRequest.JSON_PROPERTY_SUBJECT, + SignatureRequestEditEmbeddedRequest.JSON_PROPERTY_TEST_MODE, + SignatureRequestEditEmbeddedRequest.JSON_PROPERTY_TITLE, + SignatureRequestEditEmbeddedRequest.JSON_PROPERTY_USE_TEXT_TAGS, + SignatureRequestEditEmbeddedRequest.JSON_PROPERTY_POPULATE_AUTO_FILL_FIELDS, + SignatureRequestEditEmbeddedRequest.JSON_PROPERTY_EXPIRES_AT +}) +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.8.0") +@JsonIgnoreProperties(ignoreUnknown = true) +public class SignatureRequestEditEmbeddedRequest { + public static final String JSON_PROPERTY_CLIENT_ID = "client_id"; + private String clientId; + + public static final String JSON_PROPERTY_FILES = "files"; + private List files = null; + + public static final String JSON_PROPERTY_FILE_URLS = "file_urls"; + private List fileUrls = null; + + public static final String JSON_PROPERTY_SIGNERS = "signers"; + private List signers = null; + + public static final String JSON_PROPERTY_GROUPED_SIGNERS = "grouped_signers"; + private List groupedSigners = null; + + public static final String JSON_PROPERTY_ALLOW_DECLINE = "allow_decline"; + private Boolean allowDecline = false; + + public static final String JSON_PROPERTY_ALLOW_REASSIGN = "allow_reassign"; + private Boolean allowReassign = false; + + public static final String JSON_PROPERTY_ATTACHMENTS = "attachments"; + private List attachments = null; + + public static final String JSON_PROPERTY_CC_EMAIL_ADDRESSES = "cc_email_addresses"; + private List ccEmailAddresses = null; + + public static final String JSON_PROPERTY_CUSTOM_FIELDS = "custom_fields"; + private List customFields = null; + + public static final String JSON_PROPERTY_FIELD_OPTIONS = "field_options"; + private SubFieldOptions fieldOptions; + + public static final String JSON_PROPERTY_FORM_FIELD_GROUPS = "form_field_groups"; + private List formFieldGroups = null; + + public static final String JSON_PROPERTY_FORM_FIELD_RULES = "form_field_rules"; + private List formFieldRules = null; + + public static final String JSON_PROPERTY_FORM_FIELDS_PER_DOCUMENT = "form_fields_per_document"; + private List formFieldsPerDocument = null; + + public static final String JSON_PROPERTY_HIDE_TEXT_TAGS = "hide_text_tags"; + private Boolean hideTextTags = false; + + public static final String JSON_PROPERTY_MESSAGE = "message"; + private String message; + + public static final String JSON_PROPERTY_METADATA = "metadata"; + private Map metadata = null; + + public static final String JSON_PROPERTY_SIGNING_OPTIONS = "signing_options"; + private SubSigningOptions signingOptions; + + public static final String JSON_PROPERTY_SUBJECT = "subject"; + private String subject; + + public static final String JSON_PROPERTY_TEST_MODE = "test_mode"; + private Boolean testMode = false; + + public static final String JSON_PROPERTY_TITLE = "title"; + private String title; + + public static final String JSON_PROPERTY_USE_TEXT_TAGS = "use_text_tags"; + private Boolean useTextTags = false; + + public static final String JSON_PROPERTY_POPULATE_AUTO_FILL_FIELDS = + "populate_auto_fill_fields"; + private Boolean populateAutoFillFields = false; + + public static final String JSON_PROPERTY_EXPIRES_AT = "expires_at"; + private Integer expiresAt; + + public SignatureRequestEditEmbeddedRequest() {} + + /** + * Attempt to instantiate and hydrate a new instance of this class + * + * @param jsonData String of JSON data representing target object + */ + public static SignatureRequestEditEmbeddedRequest init(String jsonData) throws Exception { + return new ObjectMapper().readValue(jsonData, SignatureRequestEditEmbeddedRequest.class); + } + + public static SignatureRequestEditEmbeddedRequest init(HashMap data) throws Exception { + return new ObjectMapper() + .readValue( + new ObjectMapper().writeValueAsString(data), + SignatureRequestEditEmbeddedRequest.class); + } + + public SignatureRequestEditEmbeddedRequest clientId(String clientId) { + this.clientId = clientId; + return this; + } + + /** + * Client id of the app you're using to create this embedded signature request. Used for + * security purposes. + * + * @return clientId + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_CLIENT_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getClientId() { + return clientId; + } + + @JsonProperty(JSON_PROPERTY_CLIENT_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setClientId(String clientId) { + this.clientId = clientId; + } + + public SignatureRequestEditEmbeddedRequest files(List files) { + this.files = files; + return this; + } + + public SignatureRequestEditEmbeddedRequest addFilesItem(File filesItem) { + if (this.files == null) { + this.files = new ArrayList<>(); + } + this.files.add(filesItem); + return this; + } + + /** + * Use `files[]` to indicate the uploaded file(s) to send for signature. This endpoint + * requires either **files** or **file_urls[]**, but not both. + * + * @return files + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_FILES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getFiles() { + return files; + } + + @JsonProperty(JSON_PROPERTY_FILES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setFiles(List files) { + this.files = files; + } + + public SignatureRequestEditEmbeddedRequest fileUrls(List fileUrls) { + this.fileUrls = fileUrls; + return this; + } + + public SignatureRequestEditEmbeddedRequest addFileUrlsItem(String fileUrlsItem) { + if (this.fileUrls == null) { + this.fileUrls = new ArrayList<>(); + } + this.fileUrls.add(fileUrlsItem); + return this; + } + + /** + * Use `file_urls[]` to have Dropbox Sign download the file(s) to send for signature. + * This endpoint requires either **files** or **file_urls[]**, but not both. + * + * @return fileUrls + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_FILE_URLS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getFileUrls() { + return fileUrls; + } + + @JsonProperty(JSON_PROPERTY_FILE_URLS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setFileUrls(List fileUrls) { + this.fileUrls = fileUrls; + } + + public SignatureRequestEditEmbeddedRequest signers(List signers) { + this.signers = signers; + return this; + } + + public SignatureRequestEditEmbeddedRequest addSignersItem( + SubSignatureRequestSigner signersItem) { + if (this.signers == null) { + this.signers = new ArrayList<>(); + } + this.signers.add(signersItem); + return this; + } + + /** + * Add Signers to your Signature Request. This endpoint requires either **signers** or + * **grouped_signers**, but not both. + * + * @return signers + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_SIGNERS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getSigners() { + return signers; + } + + @JsonProperty(JSON_PROPERTY_SIGNERS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSigners(List signers) { + this.signers = signers; + } + + public SignatureRequestEditEmbeddedRequest groupedSigners( + List groupedSigners) { + this.groupedSigners = groupedSigners; + return this; + } + + public SignatureRequestEditEmbeddedRequest addGroupedSignersItem( + SubSignatureRequestGroupedSigners groupedSignersItem) { + if (this.groupedSigners == null) { + this.groupedSigners = new ArrayList<>(); + } + this.groupedSigners.add(groupedSignersItem); + return this; + } + + /** + * Add Grouped Signers to your Signature Request. This endpoint requires either **signers** or + * **grouped_signers**, but not both. + * + * @return groupedSigners + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_GROUPED_SIGNERS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getGroupedSigners() { + return groupedSigners; + } + + @JsonProperty(JSON_PROPERTY_GROUPED_SIGNERS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setGroupedSigners(List groupedSigners) { + this.groupedSigners = groupedSigners; + } + + public SignatureRequestEditEmbeddedRequest allowDecline(Boolean allowDecline) { + this.allowDecline = allowDecline; + return this; + } + + /** + * Allows signers to decline to sign a document if `true`. Defaults to + * `false`. + * + * @return allowDecline + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ALLOW_DECLINE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getAllowDecline() { + return allowDecline; + } + + @JsonProperty(JSON_PROPERTY_ALLOW_DECLINE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAllowDecline(Boolean allowDecline) { + this.allowDecline = allowDecline; + } + + public SignatureRequestEditEmbeddedRequest allowReassign(Boolean allowReassign) { + this.allowReassign = allowReassign; + return this; + } + + /** + * Allows signers to reassign their signature requests to other signers if set to + * `true`. Defaults to `false`. **NOTE:** Only available for Premium plan. + * + * @return allowReassign + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ALLOW_REASSIGN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getAllowReassign() { + return allowReassign; + } + + @JsonProperty(JSON_PROPERTY_ALLOW_REASSIGN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAllowReassign(Boolean allowReassign) { + this.allowReassign = allowReassign; + } + + public SignatureRequestEditEmbeddedRequest attachments(List attachments) { + this.attachments = attachments; + return this; + } + + public SignatureRequestEditEmbeddedRequest addAttachmentsItem(SubAttachment attachmentsItem) { + if (this.attachments == null) { + this.attachments = new ArrayList<>(); + } + this.attachments.add(attachmentsItem); + return this; + } + + /** + * A list describing the attachments + * + * @return attachments + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ATTACHMENTS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getAttachments() { + return attachments; + } + + @JsonProperty(JSON_PROPERTY_ATTACHMENTS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAttachments(List attachments) { + this.attachments = attachments; + } + + public SignatureRequestEditEmbeddedRequest ccEmailAddresses(List ccEmailAddresses) { + this.ccEmailAddresses = ccEmailAddresses; + return this; + } + + public SignatureRequestEditEmbeddedRequest addCcEmailAddressesItem( + String ccEmailAddressesItem) { + if (this.ccEmailAddresses == null) { + this.ccEmailAddresses = new ArrayList<>(); + } + this.ccEmailAddresses.add(ccEmailAddressesItem); + return this; + } + + /** + * The email addresses that should be CCed. + * + * @return ccEmailAddresses + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_CC_EMAIL_ADDRESSES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getCcEmailAddresses() { + return ccEmailAddresses; + } + + @JsonProperty(JSON_PROPERTY_CC_EMAIL_ADDRESSES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCcEmailAddresses(List ccEmailAddresses) { + this.ccEmailAddresses = ccEmailAddresses; + } + + public SignatureRequestEditEmbeddedRequest customFields(List customFields) { + this.customFields = customFields; + return this; + } + + public SignatureRequestEditEmbeddedRequest addCustomFieldsItem( + SubCustomField customFieldsItem) { + if (this.customFields == null) { + this.customFields = new ArrayList<>(); + } + this.customFields.add(customFieldsItem); + return this; + } + + /** + * When used together with merge fields, `custom_fields` allows users to add + * pre-filled data to their signature requests. Pre-filled data can be used with + * \"send-once\" signature requests by adding merge fields with + * `form_fields_per_document` or [Text + * Tags](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) while passing values + * back with `custom_fields` together in one API call. For using pre-filled on + * repeatable signature requests, merge fields are added to templates in the Dropbox Sign UI or + * by calling + * [/template/create_embedded_draft](/api/reference/operation/templateCreateEmbeddedDraft) and + * then passing `custom_fields` on subsequent signature requests referencing that + * template. + * + * @return customFields + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_CUSTOM_FIELDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getCustomFields() { + return customFields; + } + + @JsonProperty(JSON_PROPERTY_CUSTOM_FIELDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCustomFields(List customFields) { + this.customFields = customFields; + } + + public SignatureRequestEditEmbeddedRequest fieldOptions(SubFieldOptions fieldOptions) { + this.fieldOptions = fieldOptions; + return this; + } + + /** + * Get fieldOptions + * + * @return fieldOptions + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_FIELD_OPTIONS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public SubFieldOptions getFieldOptions() { + return fieldOptions; + } + + @JsonProperty(JSON_PROPERTY_FIELD_OPTIONS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setFieldOptions(SubFieldOptions fieldOptions) { + this.fieldOptions = fieldOptions; + } + + public SignatureRequestEditEmbeddedRequest formFieldGroups( + List formFieldGroups) { + this.formFieldGroups = formFieldGroups; + return this; + } + + public SignatureRequestEditEmbeddedRequest 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.Nullable @JsonProperty(JSON_PROPERTY_FORM_FIELD_GROUPS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getFormFieldGroups() { + return formFieldGroups; + } + + @JsonProperty(JSON_PROPERTY_FORM_FIELD_GROUPS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setFormFieldGroups(List formFieldGroups) { + this.formFieldGroups = formFieldGroups; + } + + public SignatureRequestEditEmbeddedRequest formFieldRules( + List formFieldRules) { + this.formFieldRules = formFieldRules; + return this; + } + + public SignatureRequestEditEmbeddedRequest addFormFieldRulesItem( + SubFormFieldRule formFieldRulesItem) { + if (this.formFieldRules == null) { + this.formFieldRules = new ArrayList<>(); + } + this.formFieldRules.add(formFieldRulesItem); + return this; + } + + /** + * Conditional Logic rules for fields defined in `form_fields_per_document`. + * + * @return formFieldRules + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_FORM_FIELD_RULES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getFormFieldRules() { + return formFieldRules; + } + + @JsonProperty(JSON_PROPERTY_FORM_FIELD_RULES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setFormFieldRules(List formFieldRules) { + this.formFieldRules = formFieldRules; + } + + public SignatureRequestEditEmbeddedRequest formFieldsPerDocument( + List formFieldsPerDocument) { + this.formFieldsPerDocument = formFieldsPerDocument; + return this; + } + + public SignatureRequestEditEmbeddedRequest 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.Nullable @JsonProperty(JSON_PROPERTY_FORM_FIELDS_PER_DOCUMENT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getFormFieldsPerDocument() { + return formFieldsPerDocument; + } + + @JsonProperty(JSON_PROPERTY_FORM_FIELDS_PER_DOCUMENT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setFormFieldsPerDocument(List formFieldsPerDocument) { + this.formFieldsPerDocument = formFieldsPerDocument; + } + + public SignatureRequestEditEmbeddedRequest hideTextTags(Boolean hideTextTags) { + this.hideTextTags = hideTextTags; + return this; + } + + /** + * Enables automatic Text Tag removal when set to true. **NOTE:** Removing text tags this way + * can cause unwanted clipping. We recommend leaving this setting on `false` and + * instead hiding your text tags using white text or a similar approach. See the [Text Tags + * Walkthrough](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) for more + * information. + * + * @return hideTextTags + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_HIDE_TEXT_TAGS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getHideTextTags() { + return hideTextTags; + } + + @JsonProperty(JSON_PROPERTY_HIDE_TEXT_TAGS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setHideTextTags(Boolean hideTextTags) { + this.hideTextTags = hideTextTags; + } + + public SignatureRequestEditEmbeddedRequest message(String message) { + this.message = message; + return this; + } + + /** + * The custom message in the email that will be sent to the signers. + * + * @return message + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_MESSAGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getMessage() { + return message; + } + + @JsonProperty(JSON_PROPERTY_MESSAGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMessage(String message) { + this.message = message; + } + + public SignatureRequestEditEmbeddedRequest metadata(Map metadata) { + this.metadata = metadata; + return this; + } + + public SignatureRequestEditEmbeddedRequest putMetadataItem(String key, Object metadataItem) { + if (this.metadata == null) { + this.metadata = new HashMap<>(); + } + this.metadata.put(key, metadataItem); + return this; + } + + /** + * Key-value data that should be attached to the signature request. This metadata is included in + * all API responses and events involving the signature request. For example, use the metadata + * field to store a signer's order number for look up when receiving events for the + * signature request. Each request can include up to 10 metadata keys (or 50 nested metadata + * keys), with key names up to 40 characters long and values up to 1000 characters long. + * + * @return metadata + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_METADATA) + @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) + public Map getMetadata() { + return metadata; + } + + @JsonProperty(JSON_PROPERTY_METADATA) + @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) + public void setMetadata(Map metadata) { + this.metadata = metadata; + } + + public SignatureRequestEditEmbeddedRequest signingOptions(SubSigningOptions signingOptions) { + this.signingOptions = signingOptions; + return this; + } + + /** + * Get signingOptions + * + * @return signingOptions + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_SIGNING_OPTIONS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public SubSigningOptions getSigningOptions() { + return signingOptions; + } + + @JsonProperty(JSON_PROPERTY_SIGNING_OPTIONS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSigningOptions(SubSigningOptions signingOptions) { + this.signingOptions = signingOptions; + } + + public SignatureRequestEditEmbeddedRequest subject(String subject) { + this.subject = subject; + return this; + } + + /** + * The subject in the email that will be sent to the signers. + * + * @return subject + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_SUBJECT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getSubject() { + return subject; + } + + @JsonProperty(JSON_PROPERTY_SUBJECT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSubject(String subject) { + this.subject = subject; + } + + public SignatureRequestEditEmbeddedRequest testMode(Boolean testMode) { + this.testMode = testMode; + return this; + } + + /** + * Whether this is a test, the signature request will not be legally binding if set to + * `true`. Defaults to `false`. + * + * @return testMode + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_TEST_MODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getTestMode() { + return testMode; + } + + @JsonProperty(JSON_PROPERTY_TEST_MODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTestMode(Boolean testMode) { + this.testMode = testMode; + } + + public SignatureRequestEditEmbeddedRequest title(String title) { + this.title = title; + return this; + } + + /** + * The title you want to assign to the SignatureRequest. + * + * @return title + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_TITLE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getTitle() { + return title; + } + + @JsonProperty(JSON_PROPERTY_TITLE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTitle(String title) { + this.title = title; + } + + public SignatureRequestEditEmbeddedRequest useTextTags(Boolean useTextTags) { + this.useTextTags = useTextTags; + return this; + } + + /** + * Send with a value of `true` if you wish to enable [Text + * Tags](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) parsing in your + * document. Defaults to disabled, or `false`. + * + * @return useTextTags + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_USE_TEXT_TAGS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getUseTextTags() { + return useTextTags; + } + + @JsonProperty(JSON_PROPERTY_USE_TEXT_TAGS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setUseTextTags(Boolean useTextTags) { + this.useTextTags = useTextTags; + } + + public SignatureRequestEditEmbeddedRequest populateAutoFillFields( + Boolean populateAutoFillFields) { + this.populateAutoFillFields = populateAutoFillFields; + return this; + } + + /** + * 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. + * + * @return populateAutoFillFields + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_POPULATE_AUTO_FILL_FIELDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getPopulateAutoFillFields() { + return populateAutoFillFields; + } + + @JsonProperty(JSON_PROPERTY_POPULATE_AUTO_FILL_FIELDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPopulateAutoFillFields(Boolean populateAutoFillFields) { + this.populateAutoFillFields = populateAutoFillFields; + } + + public SignatureRequestEditEmbeddedRequest expiresAt(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(Integer expiresAt) { + this.expiresAt = expiresAt; + } + + /** Return true if this SignatureRequestEditEmbeddedRequest object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SignatureRequestEditEmbeddedRequest signatureRequestEditEmbeddedRequest = + (SignatureRequestEditEmbeddedRequest) o; + return Objects.equals(this.clientId, signatureRequestEditEmbeddedRequest.clientId) + && Objects.equals(this.files, signatureRequestEditEmbeddedRequest.files) + && Objects.equals(this.fileUrls, signatureRequestEditEmbeddedRequest.fileUrls) + && Objects.equals(this.signers, signatureRequestEditEmbeddedRequest.signers) + && Objects.equals( + this.groupedSigners, signatureRequestEditEmbeddedRequest.groupedSigners) + && Objects.equals( + this.allowDecline, signatureRequestEditEmbeddedRequest.allowDecline) + && Objects.equals( + this.allowReassign, signatureRequestEditEmbeddedRequest.allowReassign) + && Objects.equals(this.attachments, signatureRequestEditEmbeddedRequest.attachments) + && Objects.equals( + this.ccEmailAddresses, signatureRequestEditEmbeddedRequest.ccEmailAddresses) + && Objects.equals( + this.customFields, signatureRequestEditEmbeddedRequest.customFields) + && Objects.equals( + this.fieldOptions, signatureRequestEditEmbeddedRequest.fieldOptions) + && Objects.equals( + this.formFieldGroups, signatureRequestEditEmbeddedRequest.formFieldGroups) + && Objects.equals( + this.formFieldRules, signatureRequestEditEmbeddedRequest.formFieldRules) + && Objects.equals( + this.formFieldsPerDocument, + signatureRequestEditEmbeddedRequest.formFieldsPerDocument) + && Objects.equals( + this.hideTextTags, signatureRequestEditEmbeddedRequest.hideTextTags) + && Objects.equals(this.message, signatureRequestEditEmbeddedRequest.message) + && Objects.equals(this.metadata, signatureRequestEditEmbeddedRequest.metadata) + && Objects.equals( + this.signingOptions, signatureRequestEditEmbeddedRequest.signingOptions) + && Objects.equals(this.subject, signatureRequestEditEmbeddedRequest.subject) + && Objects.equals(this.testMode, signatureRequestEditEmbeddedRequest.testMode) + && Objects.equals(this.title, signatureRequestEditEmbeddedRequest.title) + && Objects.equals(this.useTextTags, signatureRequestEditEmbeddedRequest.useTextTags) + && Objects.equals( + this.populateAutoFillFields, + signatureRequestEditEmbeddedRequest.populateAutoFillFields) + && Objects.equals(this.expiresAt, signatureRequestEditEmbeddedRequest.expiresAt); + } + + @Override + public int hashCode() { + return Objects.hash( + clientId, + files, + fileUrls, + signers, + groupedSigners, + allowDecline, + allowReassign, + attachments, + ccEmailAddresses, + customFields, + fieldOptions, + formFieldGroups, + formFieldRules, + formFieldsPerDocument, + hideTextTags, + message, + metadata, + signingOptions, + subject, + testMode, + title, + useTextTags, + populateAutoFillFields, + expiresAt); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SignatureRequestEditEmbeddedRequest {\n"); + sb.append(" clientId: ").append(toIndentedString(clientId)).append("\n"); + sb.append(" files: ").append(toIndentedString(files)).append("\n"); + sb.append(" fileUrls: ").append(toIndentedString(fileUrls)).append("\n"); + sb.append(" signers: ").append(toIndentedString(signers)).append("\n"); + sb.append(" groupedSigners: ").append(toIndentedString(groupedSigners)).append("\n"); + sb.append(" allowDecline: ").append(toIndentedString(allowDecline)).append("\n"); + sb.append(" allowReassign: ").append(toIndentedString(allowReassign)).append("\n"); + sb.append(" attachments: ").append(toIndentedString(attachments)).append("\n"); + sb.append(" ccEmailAddresses: ").append(toIndentedString(ccEmailAddresses)).append("\n"); + sb.append(" customFields: ").append(toIndentedString(customFields)).append("\n"); + sb.append(" fieldOptions: ").append(toIndentedString(fieldOptions)).append("\n"); + sb.append(" formFieldGroups: ").append(toIndentedString(formFieldGroups)).append("\n"); + sb.append(" formFieldRules: ").append(toIndentedString(formFieldRules)).append("\n"); + sb.append(" formFieldsPerDocument: ") + .append(toIndentedString(formFieldsPerDocument)) + .append("\n"); + sb.append(" hideTextTags: ").append(toIndentedString(hideTextTags)).append("\n"); + sb.append(" message: ").append(toIndentedString(message)).append("\n"); + sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); + sb.append(" signingOptions: ").append(toIndentedString(signingOptions)).append("\n"); + 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(" useTextTags: ").append(toIndentedString(useTextTags)).append("\n"); + sb.append(" populateAutoFillFields: ") + .append(toIndentedString(populateAutoFillFields)) + .append("\n"); + sb.append(" expiresAt: ").append(toIndentedString(expiresAt)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public Map createFormData() throws ApiException { + Map map = new HashMap<>(); + boolean fileTypeFound = false; + try { + if (clientId != null) { + if (isFileTypeOrListOfFiles(clientId)) { + fileTypeFound = true; + } + + if (clientId.getClass().equals(java.io.File.class) + || clientId.getClass().equals(Integer.class) + || clientId.getClass().equals(String.class) + || clientId.getClass().isEnum()) { + map.put("client_id", clientId); + } else if (isListOfFile(clientId)) { + for (int i = 0; i < getListSize(clientId); i++) { + map.put("client_id[" + i + "]", getFromList(clientId, i)); + } + } else { + map.put( + "client_id", + JSON.getDefault().getMapper().writeValueAsString(clientId)); + } + } + if (files != null) { + if (isFileTypeOrListOfFiles(files)) { + fileTypeFound = true; + } + + if (files.getClass().equals(java.io.File.class) + || files.getClass().equals(Integer.class) + || files.getClass().equals(String.class) + || files.getClass().isEnum()) { + map.put("files", files); + } else if (isListOfFile(files)) { + for (int i = 0; i < getListSize(files); i++) { + map.put("files[" + i + "]", getFromList(files, i)); + } + } else { + map.put("files", JSON.getDefault().getMapper().writeValueAsString(files)); + } + } + if (fileUrls != null) { + if (isFileTypeOrListOfFiles(fileUrls)) { + fileTypeFound = true; + } + + if (fileUrls.getClass().equals(java.io.File.class) + || fileUrls.getClass().equals(Integer.class) + || fileUrls.getClass().equals(String.class) + || fileUrls.getClass().isEnum()) { + map.put("file_urls", fileUrls); + } else if (isListOfFile(fileUrls)) { + for (int i = 0; i < getListSize(fileUrls); i++) { + map.put("file_urls[" + i + "]", getFromList(fileUrls, i)); + } + } else { + map.put( + "file_urls", + JSON.getDefault().getMapper().writeValueAsString(fileUrls)); + } + } + if (signers != null) { + if (isFileTypeOrListOfFiles(signers)) { + fileTypeFound = true; + } + + if (signers.getClass().equals(java.io.File.class) + || signers.getClass().equals(Integer.class) + || signers.getClass().equals(String.class) + || signers.getClass().isEnum()) { + map.put("signers", signers); + } else if (isListOfFile(signers)) { + for (int i = 0; i < getListSize(signers); i++) { + map.put("signers[" + i + "]", getFromList(signers, i)); + } + } else { + map.put("signers", JSON.getDefault().getMapper().writeValueAsString(signers)); + } + } + if (groupedSigners != null) { + if (isFileTypeOrListOfFiles(groupedSigners)) { + fileTypeFound = true; + } + + if (groupedSigners.getClass().equals(java.io.File.class) + || groupedSigners.getClass().equals(Integer.class) + || groupedSigners.getClass().equals(String.class) + || groupedSigners.getClass().isEnum()) { + map.put("grouped_signers", groupedSigners); + } else if (isListOfFile(groupedSigners)) { + for (int i = 0; i < getListSize(groupedSigners); i++) { + map.put("grouped_signers[" + i + "]", getFromList(groupedSigners, i)); + } + } else { + map.put( + "grouped_signers", + JSON.getDefault().getMapper().writeValueAsString(groupedSigners)); + } + } + if (allowDecline != null) { + if (isFileTypeOrListOfFiles(allowDecline)) { + fileTypeFound = true; + } + + if (allowDecline.getClass().equals(java.io.File.class) + || allowDecline.getClass().equals(Integer.class) + || allowDecline.getClass().equals(String.class) + || allowDecline.getClass().isEnum()) { + map.put("allow_decline", allowDecline); + } else if (isListOfFile(allowDecline)) { + for (int i = 0; i < getListSize(allowDecline); i++) { + map.put("allow_decline[" + i + "]", getFromList(allowDecline, i)); + } + } else { + map.put( + "allow_decline", + JSON.getDefault().getMapper().writeValueAsString(allowDecline)); + } + } + if (allowReassign != null) { + if (isFileTypeOrListOfFiles(allowReassign)) { + fileTypeFound = true; + } + + if (allowReassign.getClass().equals(java.io.File.class) + || allowReassign.getClass().equals(Integer.class) + || allowReassign.getClass().equals(String.class) + || allowReassign.getClass().isEnum()) { + map.put("allow_reassign", allowReassign); + } else if (isListOfFile(allowReassign)) { + for (int i = 0; i < getListSize(allowReassign); i++) { + map.put("allow_reassign[" + i + "]", getFromList(allowReassign, i)); + } + } else { + map.put( + "allow_reassign", + JSON.getDefault().getMapper().writeValueAsString(allowReassign)); + } + } + if (attachments != null) { + if (isFileTypeOrListOfFiles(attachments)) { + fileTypeFound = true; + } + + if (attachments.getClass().equals(java.io.File.class) + || attachments.getClass().equals(Integer.class) + || attachments.getClass().equals(String.class) + || attachments.getClass().isEnum()) { + map.put("attachments", attachments); + } else if (isListOfFile(attachments)) { + for (int i = 0; i < getListSize(attachments); i++) { + map.put("attachments[" + i + "]", getFromList(attachments, i)); + } + } else { + map.put( + "attachments", + JSON.getDefault().getMapper().writeValueAsString(attachments)); + } + } + if (ccEmailAddresses != null) { + if (isFileTypeOrListOfFiles(ccEmailAddresses)) { + fileTypeFound = true; + } + + if (ccEmailAddresses.getClass().equals(java.io.File.class) + || ccEmailAddresses.getClass().equals(Integer.class) + || ccEmailAddresses.getClass().equals(String.class) + || ccEmailAddresses.getClass().isEnum()) { + map.put("cc_email_addresses", ccEmailAddresses); + } else if (isListOfFile(ccEmailAddresses)) { + for (int i = 0; i < getListSize(ccEmailAddresses); i++) { + map.put("cc_email_addresses[" + i + "]", getFromList(ccEmailAddresses, i)); + } + } else { + map.put( + "cc_email_addresses", + JSON.getDefault().getMapper().writeValueAsString(ccEmailAddresses)); + } + } + if (customFields != null) { + if (isFileTypeOrListOfFiles(customFields)) { + fileTypeFound = true; + } + + if (customFields.getClass().equals(java.io.File.class) + || customFields.getClass().equals(Integer.class) + || customFields.getClass().equals(String.class) + || customFields.getClass().isEnum()) { + map.put("custom_fields", customFields); + } else if (isListOfFile(customFields)) { + for (int i = 0; i < getListSize(customFields); i++) { + map.put("custom_fields[" + i + "]", getFromList(customFields, i)); + } + } else { + map.put( + "custom_fields", + JSON.getDefault().getMapper().writeValueAsString(customFields)); + } + } + if (fieldOptions != null) { + if (isFileTypeOrListOfFiles(fieldOptions)) { + fileTypeFound = true; + } + + if (fieldOptions.getClass().equals(java.io.File.class) + || fieldOptions.getClass().equals(Integer.class) + || fieldOptions.getClass().equals(String.class) + || fieldOptions.getClass().isEnum()) { + map.put("field_options", fieldOptions); + } else if (isListOfFile(fieldOptions)) { + for (int i = 0; i < getListSize(fieldOptions); i++) { + map.put("field_options[" + i + "]", getFromList(fieldOptions, i)); + } + } else { + map.put( + "field_options", + JSON.getDefault().getMapper().writeValueAsString(fieldOptions)); + } + } + 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 (formFieldRules != null) { + if (isFileTypeOrListOfFiles(formFieldRules)) { + fileTypeFound = true; + } + + if (formFieldRules.getClass().equals(java.io.File.class) + || formFieldRules.getClass().equals(Integer.class) + || formFieldRules.getClass().equals(String.class) + || formFieldRules.getClass().isEnum()) { + map.put("form_field_rules", formFieldRules); + } else if (isListOfFile(formFieldRules)) { + for (int i = 0; i < getListSize(formFieldRules); i++) { + map.put("form_field_rules[" + i + "]", getFromList(formFieldRules, i)); + } + } else { + map.put( + "form_field_rules", + JSON.getDefault().getMapper().writeValueAsString(formFieldRules)); + } + } + 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 (hideTextTags != null) { + if (isFileTypeOrListOfFiles(hideTextTags)) { + fileTypeFound = true; + } + + if (hideTextTags.getClass().equals(java.io.File.class) + || hideTextTags.getClass().equals(Integer.class) + || hideTextTags.getClass().equals(String.class) + || hideTextTags.getClass().isEnum()) { + map.put("hide_text_tags", hideTextTags); + } else if (isListOfFile(hideTextTags)) { + for (int i = 0; i < getListSize(hideTextTags); i++) { + map.put("hide_text_tags[" + i + "]", getFromList(hideTextTags, i)); + } + } else { + map.put( + "hide_text_tags", + JSON.getDefault().getMapper().writeValueAsString(hideTextTags)); + } + } + if (message != null) { + if (isFileTypeOrListOfFiles(message)) { + fileTypeFound = true; + } + + if (message.getClass().equals(java.io.File.class) + || message.getClass().equals(Integer.class) + || message.getClass().equals(String.class) + || message.getClass().isEnum()) { + map.put("message", message); + } else if (isListOfFile(message)) { + for (int i = 0; i < getListSize(message); i++) { + map.put("message[" + i + "]", getFromList(message, i)); + } + } else { + map.put("message", JSON.getDefault().getMapper().writeValueAsString(message)); + } + } + if (metadata != null) { + if (isFileTypeOrListOfFiles(metadata)) { + fileTypeFound = true; + } + + if (metadata.getClass().equals(java.io.File.class) + || metadata.getClass().equals(Integer.class) + || metadata.getClass().equals(String.class) + || metadata.getClass().isEnum()) { + map.put("metadata", metadata); + } else if (isListOfFile(metadata)) { + for (int i = 0; i < getListSize(metadata); i++) { + map.put("metadata[" + i + "]", getFromList(metadata, i)); + } + } else { + map.put("metadata", JSON.getDefault().getMapper().writeValueAsString(metadata)); + } + } + if (signingOptions != null) { + if (isFileTypeOrListOfFiles(signingOptions)) { + fileTypeFound = true; + } + + if (signingOptions.getClass().equals(java.io.File.class) + || signingOptions.getClass().equals(Integer.class) + || signingOptions.getClass().equals(String.class) + || signingOptions.getClass().isEnum()) { + map.put("signing_options", signingOptions); + } else if (isListOfFile(signingOptions)) { + for (int i = 0; i < getListSize(signingOptions); i++) { + map.put("signing_options[" + i + "]", getFromList(signingOptions, i)); + } + } else { + map.put( + "signing_options", + JSON.getDefault().getMapper().writeValueAsString(signingOptions)); + } + } + if (subject != null) { + if (isFileTypeOrListOfFiles(subject)) { + fileTypeFound = true; + } + + if (subject.getClass().equals(java.io.File.class) + || subject.getClass().equals(Integer.class) + || subject.getClass().equals(String.class) + || subject.getClass().isEnum()) { + map.put("subject", subject); + } else if (isListOfFile(subject)) { + for (int i = 0; i < getListSize(subject); i++) { + map.put("subject[" + i + "]", getFromList(subject, i)); + } + } else { + map.put("subject", JSON.getDefault().getMapper().writeValueAsString(subject)); + } + } + if (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 (title != null) { + if (isFileTypeOrListOfFiles(title)) { + fileTypeFound = true; + } + + if (title.getClass().equals(java.io.File.class) + || title.getClass().equals(Integer.class) + || title.getClass().equals(String.class) + || title.getClass().isEnum()) { + map.put("title", title); + } else if (isListOfFile(title)) { + for (int i = 0; i < getListSize(title); i++) { + map.put("title[" + i + "]", getFromList(title, i)); + } + } else { + map.put("title", JSON.getDefault().getMapper().writeValueAsString(title)); + } + } + if (useTextTags != null) { + if (isFileTypeOrListOfFiles(useTextTags)) { + fileTypeFound = true; + } + + if (useTextTags.getClass().equals(java.io.File.class) + || useTextTags.getClass().equals(Integer.class) + || useTextTags.getClass().equals(String.class) + || useTextTags.getClass().isEnum()) { + map.put("use_text_tags", useTextTags); + } else if (isListOfFile(useTextTags)) { + for (int i = 0; i < getListSize(useTextTags); i++) { + map.put("use_text_tags[" + i + "]", getFromList(useTextTags, i)); + } + } else { + map.put( + "use_text_tags", + JSON.getDefault().getMapper().writeValueAsString(useTextTags)); + } + } + if (populateAutoFillFields != null) { + if (isFileTypeOrListOfFiles(populateAutoFillFields)) { + fileTypeFound = true; + } + + if (populateAutoFillFields.getClass().equals(java.io.File.class) + || populateAutoFillFields.getClass().equals(Integer.class) + || populateAutoFillFields.getClass().equals(String.class) + || populateAutoFillFields.getClass().isEnum()) { + map.put("populate_auto_fill_fields", populateAutoFillFields); + } else if (isListOfFile(populateAutoFillFields)) { + for (int i = 0; i < getListSize(populateAutoFillFields); i++) { + map.put( + "populate_auto_fill_fields[" + i + "]", + getFromList(populateAutoFillFields, i)); + } + } else { + map.put( + "populate_auto_fill_fields", + JSON.getDefault() + .getMapper() + .writeValueAsString(populateAutoFillFields)); + } + } + if (expiresAt != null) { + if (isFileTypeOrListOfFiles(expiresAt)) { + fileTypeFound = true; + } + + if (expiresAt.getClass().equals(java.io.File.class) + || expiresAt.getClass().equals(Integer.class) + || expiresAt.getClass().equals(String.class) + || expiresAt.getClass().isEnum()) { + map.put("expires_at", expiresAt); + } else if (isListOfFile(expiresAt)) { + for (int i = 0; i < getListSize(expiresAt); i++) { + map.put("expires_at[" + i + "]", getFromList(expiresAt, i)); + } + } else { + map.put( + "expires_at", + JSON.getDefault().getMapper().writeValueAsString(expiresAt)); + } + } + } catch (Exception e) { + throw new ApiException(e); + } + + return fileTypeFound ? map : new HashMap<>(); + } + + private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { + return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); + } + + private boolean isListOfFile(Object obj) throws Exception { + return obj instanceof java.util.List + && !isListEmpty(obj) + && getFromList(obj, 0) instanceof java.io.File; + } + + private boolean isListEmpty(Object obj) throws Exception { + return (boolean) + Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); + } + + private Object getFromList(Object obj, int index) throws Exception { + return Class.forName(java.util.List.class.getName()) + .getMethod("get", int.class) + .invoke(obj, index); + } + + private int getListSize(Object obj) throws Exception { + return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/model/SignatureRequestEditEmbeddedWithTemplateRequest.java b/sdks/java-v1/src/main/java/com/dropbox/sign/model/SignatureRequestEditEmbeddedWithTemplateRequest.java new file mode 100644 index 000000000..03e4cccf7 --- /dev/null +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/model/SignatureRequestEditEmbeddedWithTemplateRequest.java @@ -0,0 +1,958 @@ +/* + * 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.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; + +/** SignatureRequestEditEmbeddedWithTemplateRequest */ +@JsonPropertyOrder({ + SignatureRequestEditEmbeddedWithTemplateRequest.JSON_PROPERTY_TEMPLATE_IDS, + SignatureRequestEditEmbeddedWithTemplateRequest.JSON_PROPERTY_CLIENT_ID, + SignatureRequestEditEmbeddedWithTemplateRequest.JSON_PROPERTY_SIGNERS, + SignatureRequestEditEmbeddedWithTemplateRequest.JSON_PROPERTY_ALLOW_DECLINE, + SignatureRequestEditEmbeddedWithTemplateRequest.JSON_PROPERTY_CCS, + SignatureRequestEditEmbeddedWithTemplateRequest.JSON_PROPERTY_CUSTOM_FIELDS, + SignatureRequestEditEmbeddedWithTemplateRequest.JSON_PROPERTY_FILES, + SignatureRequestEditEmbeddedWithTemplateRequest.JSON_PROPERTY_FILE_URLS, + SignatureRequestEditEmbeddedWithTemplateRequest.JSON_PROPERTY_MESSAGE, + SignatureRequestEditEmbeddedWithTemplateRequest.JSON_PROPERTY_METADATA, + SignatureRequestEditEmbeddedWithTemplateRequest.JSON_PROPERTY_SIGNING_OPTIONS, + SignatureRequestEditEmbeddedWithTemplateRequest.JSON_PROPERTY_SUBJECT, + SignatureRequestEditEmbeddedWithTemplateRequest.JSON_PROPERTY_TEST_MODE, + SignatureRequestEditEmbeddedWithTemplateRequest.JSON_PROPERTY_TITLE, + SignatureRequestEditEmbeddedWithTemplateRequest.JSON_PROPERTY_POPULATE_AUTO_FILL_FIELDS +}) +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.8.0") +@JsonIgnoreProperties(ignoreUnknown = true) +public class SignatureRequestEditEmbeddedWithTemplateRequest { + public static final String JSON_PROPERTY_TEMPLATE_IDS = "template_ids"; + private List templateIds = new ArrayList<>(); + + public static final String JSON_PROPERTY_CLIENT_ID = "client_id"; + private String clientId; + + public static final String JSON_PROPERTY_SIGNERS = "signers"; + private List signers = new ArrayList<>(); + + public static final String JSON_PROPERTY_ALLOW_DECLINE = "allow_decline"; + private Boolean allowDecline = false; + + public static final String JSON_PROPERTY_CCS = "ccs"; + private List ccs = null; + + public static final String JSON_PROPERTY_CUSTOM_FIELDS = "custom_fields"; + private List customFields = null; + + public static final String JSON_PROPERTY_FILES = "files"; + private List files = null; + + public static final String JSON_PROPERTY_FILE_URLS = "file_urls"; + private List fileUrls = null; + + public static final String JSON_PROPERTY_MESSAGE = "message"; + private String message; + + public static final String JSON_PROPERTY_METADATA = "metadata"; + private Map metadata = null; + + public static final String JSON_PROPERTY_SIGNING_OPTIONS = "signing_options"; + private SubSigningOptions signingOptions; + + public static final String JSON_PROPERTY_SUBJECT = "subject"; + private String subject; + + public static final String JSON_PROPERTY_TEST_MODE = "test_mode"; + private Boolean testMode = false; + + public static final String JSON_PROPERTY_TITLE = "title"; + private String title; + + public static final String JSON_PROPERTY_POPULATE_AUTO_FILL_FIELDS = + "populate_auto_fill_fields"; + private Boolean populateAutoFillFields = false; + + public SignatureRequestEditEmbeddedWithTemplateRequest() {} + + /** + * Attempt to instantiate and hydrate a new instance of this class + * + * @param jsonData String of JSON data representing target object + */ + public static SignatureRequestEditEmbeddedWithTemplateRequest init(String jsonData) + throws Exception { + return new ObjectMapper() + .readValue(jsonData, SignatureRequestEditEmbeddedWithTemplateRequest.class); + } + + public static SignatureRequestEditEmbeddedWithTemplateRequest init(HashMap data) + throws Exception { + return new ObjectMapper() + .readValue( + new ObjectMapper().writeValueAsString(data), + SignatureRequestEditEmbeddedWithTemplateRequest.class); + } + + public SignatureRequestEditEmbeddedWithTemplateRequest templateIds(List templateIds) { + this.templateIds = templateIds; + return this; + } + + public SignatureRequestEditEmbeddedWithTemplateRequest addTemplateIdsItem( + String templateIdsItem) { + if (this.templateIds == null) { + this.templateIds = new ArrayList<>(); + } + this.templateIds.add(templateIdsItem); + return this; + } + + /** + * Use `template_ids` to create a SignatureRequest from one or more templates, in the + * order in which the template will be used. + * + * @return templateIds + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_TEMPLATE_IDS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public List getTemplateIds() { + return templateIds; + } + + @JsonProperty(JSON_PROPERTY_TEMPLATE_IDS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setTemplateIds(List templateIds) { + this.templateIds = templateIds; + } + + public SignatureRequestEditEmbeddedWithTemplateRequest clientId(String clientId) { + this.clientId = clientId; + return this; + } + + /** + * Client id of the app you're using to create this embedded signature request. Used for + * security purposes. + * + * @return clientId + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_CLIENT_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getClientId() { + return clientId; + } + + @JsonProperty(JSON_PROPERTY_CLIENT_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setClientId(String clientId) { + this.clientId = clientId; + } + + public SignatureRequestEditEmbeddedWithTemplateRequest signers( + List signers) { + this.signers = signers; + return this; + } + + public SignatureRequestEditEmbeddedWithTemplateRequest addSignersItem( + SubSignatureRequestTemplateSigner signersItem) { + if (this.signers == null) { + this.signers = new ArrayList<>(); + } + this.signers.add(signersItem); + return this; + } + + /** + * Add Signers to your Templated-based Signature Request. + * + * @return signers + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_SIGNERS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public List getSigners() { + return signers; + } + + @JsonProperty(JSON_PROPERTY_SIGNERS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setSigners(List signers) { + this.signers = signers; + } + + public SignatureRequestEditEmbeddedWithTemplateRequest allowDecline(Boolean allowDecline) { + this.allowDecline = allowDecline; + return this; + } + + /** + * Allows signers to decline to sign a document if `true`. Defaults to + * `false`. + * + * @return allowDecline + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ALLOW_DECLINE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getAllowDecline() { + return allowDecline; + } + + @JsonProperty(JSON_PROPERTY_ALLOW_DECLINE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAllowDecline(Boolean allowDecline) { + this.allowDecline = allowDecline; + } + + public SignatureRequestEditEmbeddedWithTemplateRequest ccs(List ccs) { + this.ccs = ccs; + return this; + } + + public SignatureRequestEditEmbeddedWithTemplateRequest addCcsItem(SubCC ccsItem) { + if (this.ccs == null) { + this.ccs = new ArrayList<>(); + } + this.ccs.add(ccsItem); + return this; + } + + /** + * Add CC email recipients. Required when a CC role exists for the Template. + * + * @return ccs + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_CCS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getCcs() { + return ccs; + } + + @JsonProperty(JSON_PROPERTY_CCS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCcs(List ccs) { + this.ccs = ccs; + } + + public SignatureRequestEditEmbeddedWithTemplateRequest customFields( + List customFields) { + this.customFields = customFields; + return this; + } + + public SignatureRequestEditEmbeddedWithTemplateRequest addCustomFieldsItem( + SubCustomField customFieldsItem) { + if (this.customFields == null) { + this.customFields = new ArrayList<>(); + } + this.customFields.add(customFieldsItem); + return this; + } + + /** + * An array defining values and options for custom fields. Required when a custom field exists + * in the Template. + * + * @return customFields + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_CUSTOM_FIELDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getCustomFields() { + return customFields; + } + + @JsonProperty(JSON_PROPERTY_CUSTOM_FIELDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCustomFields(List customFields) { + this.customFields = customFields; + } + + public SignatureRequestEditEmbeddedWithTemplateRequest files(List files) { + this.files = files; + return this; + } + + public SignatureRequestEditEmbeddedWithTemplateRequest addFilesItem(File filesItem) { + if (this.files == null) { + this.files = new ArrayList<>(); + } + this.files.add(filesItem); + return this; + } + + /** + * Use `files[]` to indicate the uploaded file(s) to send for signature. This endpoint + * requires either **files** or **file_urls[]**, but not both. + * + * @return files + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_FILES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getFiles() { + return files; + } + + @JsonProperty(JSON_PROPERTY_FILES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setFiles(List files) { + this.files = files; + } + + public SignatureRequestEditEmbeddedWithTemplateRequest fileUrls(List fileUrls) { + this.fileUrls = fileUrls; + return this; + } + + public SignatureRequestEditEmbeddedWithTemplateRequest addFileUrlsItem(String fileUrlsItem) { + if (this.fileUrls == null) { + this.fileUrls = new ArrayList<>(); + } + this.fileUrls.add(fileUrlsItem); + return this; + } + + /** + * Use `file_urls[]` to have Dropbox Sign download the file(s) to send for signature. + * This endpoint requires either **files** or **file_urls[]**, but not both. + * + * @return fileUrls + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_FILE_URLS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getFileUrls() { + return fileUrls; + } + + @JsonProperty(JSON_PROPERTY_FILE_URLS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setFileUrls(List fileUrls) { + this.fileUrls = fileUrls; + } + + public SignatureRequestEditEmbeddedWithTemplateRequest message(String message) { + this.message = message; + return this; + } + + /** + * The custom message in the email that will be sent to the signers. + * + * @return message + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_MESSAGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getMessage() { + return message; + } + + @JsonProperty(JSON_PROPERTY_MESSAGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMessage(String message) { + this.message = message; + } + + public SignatureRequestEditEmbeddedWithTemplateRequest metadata(Map metadata) { + this.metadata = metadata; + return this; + } + + public SignatureRequestEditEmbeddedWithTemplateRequest putMetadataItem( + String key, Object metadataItem) { + if (this.metadata == null) { + this.metadata = new HashMap<>(); + } + this.metadata.put(key, metadataItem); + return this; + } + + /** + * Key-value data that should be attached to the signature request. This metadata is included in + * all API responses and events involving the signature request. For example, use the metadata + * field to store a signer's order number for look up when receiving events for the + * signature request. Each request can include up to 10 metadata keys (or 50 nested metadata + * keys), with key names up to 40 characters long and values up to 1000 characters long. + * + * @return metadata + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_METADATA) + @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) + public Map getMetadata() { + return metadata; + } + + @JsonProperty(JSON_PROPERTY_METADATA) + @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) + public void setMetadata(Map metadata) { + this.metadata = metadata; + } + + public SignatureRequestEditEmbeddedWithTemplateRequest signingOptions( + SubSigningOptions signingOptions) { + this.signingOptions = signingOptions; + return this; + } + + /** + * Get signingOptions + * + * @return signingOptions + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_SIGNING_OPTIONS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public SubSigningOptions getSigningOptions() { + return signingOptions; + } + + @JsonProperty(JSON_PROPERTY_SIGNING_OPTIONS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSigningOptions(SubSigningOptions signingOptions) { + this.signingOptions = signingOptions; + } + + public SignatureRequestEditEmbeddedWithTemplateRequest subject(String subject) { + this.subject = subject; + return this; + } + + /** + * The subject in the email that will be sent to the signers. + * + * @return subject + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_SUBJECT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getSubject() { + return subject; + } + + @JsonProperty(JSON_PROPERTY_SUBJECT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSubject(String subject) { + this.subject = subject; + } + + public SignatureRequestEditEmbeddedWithTemplateRequest testMode(Boolean testMode) { + this.testMode = testMode; + return this; + } + + /** + * Whether this is a test, the signature request will not be legally binding if set to + * `true`. Defaults to `false`. + * + * @return testMode + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_TEST_MODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getTestMode() { + return testMode; + } + + @JsonProperty(JSON_PROPERTY_TEST_MODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTestMode(Boolean testMode) { + this.testMode = testMode; + } + + public SignatureRequestEditEmbeddedWithTemplateRequest title(String title) { + this.title = title; + return this; + } + + /** + * The title you want to assign to the SignatureRequest. + * + * @return title + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_TITLE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getTitle() { + return title; + } + + @JsonProperty(JSON_PROPERTY_TITLE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTitle(String title) { + this.title = title; + } + + public SignatureRequestEditEmbeddedWithTemplateRequest populateAutoFillFields( + Boolean populateAutoFillFields) { + this.populateAutoFillFields = populateAutoFillFields; + return this; + } + + /** + * 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. + * + * @return populateAutoFillFields + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_POPULATE_AUTO_FILL_FIELDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getPopulateAutoFillFields() { + return populateAutoFillFields; + } + + @JsonProperty(JSON_PROPERTY_POPULATE_AUTO_FILL_FIELDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPopulateAutoFillFields(Boolean populateAutoFillFields) { + this.populateAutoFillFields = populateAutoFillFields; + } + + /** Return true if this SignatureRequestEditEmbeddedWithTemplateRequest object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SignatureRequestEditEmbeddedWithTemplateRequest + signatureRequestEditEmbeddedWithTemplateRequest = + (SignatureRequestEditEmbeddedWithTemplateRequest) o; + return Objects.equals( + this.templateIds, + signatureRequestEditEmbeddedWithTemplateRequest.templateIds) + && Objects.equals( + this.clientId, signatureRequestEditEmbeddedWithTemplateRequest.clientId) + && Objects.equals( + this.signers, signatureRequestEditEmbeddedWithTemplateRequest.signers) + && Objects.equals( + this.allowDecline, + signatureRequestEditEmbeddedWithTemplateRequest.allowDecline) + && Objects.equals(this.ccs, signatureRequestEditEmbeddedWithTemplateRequest.ccs) + && Objects.equals( + this.customFields, + signatureRequestEditEmbeddedWithTemplateRequest.customFields) + && Objects.equals(this.files, signatureRequestEditEmbeddedWithTemplateRequest.files) + && Objects.equals( + this.fileUrls, signatureRequestEditEmbeddedWithTemplateRequest.fileUrls) + && Objects.equals( + this.message, signatureRequestEditEmbeddedWithTemplateRequest.message) + && Objects.equals( + this.metadata, signatureRequestEditEmbeddedWithTemplateRequest.metadata) + && Objects.equals( + this.signingOptions, + signatureRequestEditEmbeddedWithTemplateRequest.signingOptions) + && Objects.equals( + this.subject, signatureRequestEditEmbeddedWithTemplateRequest.subject) + && Objects.equals( + this.testMode, signatureRequestEditEmbeddedWithTemplateRequest.testMode) + && Objects.equals(this.title, signatureRequestEditEmbeddedWithTemplateRequest.title) + && Objects.equals( + this.populateAutoFillFields, + signatureRequestEditEmbeddedWithTemplateRequest.populateAutoFillFields); + } + + @Override + public int hashCode() { + return Objects.hash( + templateIds, + clientId, + signers, + allowDecline, + ccs, + customFields, + files, + fileUrls, + message, + metadata, + signingOptions, + subject, + testMode, + title, + populateAutoFillFields); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SignatureRequestEditEmbeddedWithTemplateRequest {\n"); + sb.append(" templateIds: ").append(toIndentedString(templateIds)).append("\n"); + sb.append(" clientId: ").append(toIndentedString(clientId)).append("\n"); + sb.append(" signers: ").append(toIndentedString(signers)).append("\n"); + sb.append(" allowDecline: ").append(toIndentedString(allowDecline)).append("\n"); + sb.append(" ccs: ").append(toIndentedString(ccs)).append("\n"); + sb.append(" customFields: ").append(toIndentedString(customFields)).append("\n"); + sb.append(" files: ").append(toIndentedString(files)).append("\n"); + sb.append(" fileUrls: ").append(toIndentedString(fileUrls)).append("\n"); + sb.append(" message: ").append(toIndentedString(message)).append("\n"); + sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); + sb.append(" signingOptions: ").append(toIndentedString(signingOptions)).append("\n"); + 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(" populateAutoFillFields: ") + .append(toIndentedString(populateAutoFillFields)) + .append("\n"); + sb.append("}"); + return sb.toString(); + } + + public Map createFormData() throws ApiException { + Map map = new HashMap<>(); + boolean fileTypeFound = false; + try { + if (templateIds != null) { + if (isFileTypeOrListOfFiles(templateIds)) { + fileTypeFound = true; + } + + if (templateIds.getClass().equals(java.io.File.class) + || templateIds.getClass().equals(Integer.class) + || templateIds.getClass().equals(String.class) + || templateIds.getClass().isEnum()) { + map.put("template_ids", templateIds); + } else if (isListOfFile(templateIds)) { + for (int i = 0; i < getListSize(templateIds); i++) { + map.put("template_ids[" + i + "]", getFromList(templateIds, i)); + } + } else { + map.put( + "template_ids", + JSON.getDefault().getMapper().writeValueAsString(templateIds)); + } + } + if (clientId != null) { + if (isFileTypeOrListOfFiles(clientId)) { + fileTypeFound = true; + } + + if (clientId.getClass().equals(java.io.File.class) + || clientId.getClass().equals(Integer.class) + || clientId.getClass().equals(String.class) + || clientId.getClass().isEnum()) { + map.put("client_id", clientId); + } else if (isListOfFile(clientId)) { + for (int i = 0; i < getListSize(clientId); i++) { + map.put("client_id[" + i + "]", getFromList(clientId, i)); + } + } else { + map.put( + "client_id", + JSON.getDefault().getMapper().writeValueAsString(clientId)); + } + } + if (signers != null) { + if (isFileTypeOrListOfFiles(signers)) { + fileTypeFound = true; + } + + if (signers.getClass().equals(java.io.File.class) + || signers.getClass().equals(Integer.class) + || signers.getClass().equals(String.class) + || signers.getClass().isEnum()) { + map.put("signers", signers); + } else if (isListOfFile(signers)) { + for (int i = 0; i < getListSize(signers); i++) { + map.put("signers[" + i + "]", getFromList(signers, i)); + } + } else { + map.put("signers", JSON.getDefault().getMapper().writeValueAsString(signers)); + } + } + if (allowDecline != null) { + if (isFileTypeOrListOfFiles(allowDecline)) { + fileTypeFound = true; + } + + if (allowDecline.getClass().equals(java.io.File.class) + || allowDecline.getClass().equals(Integer.class) + || allowDecline.getClass().equals(String.class) + || allowDecline.getClass().isEnum()) { + map.put("allow_decline", allowDecline); + } else if (isListOfFile(allowDecline)) { + for (int i = 0; i < getListSize(allowDecline); i++) { + map.put("allow_decline[" + i + "]", getFromList(allowDecline, i)); + } + } else { + map.put( + "allow_decline", + JSON.getDefault().getMapper().writeValueAsString(allowDecline)); + } + } + if (ccs != null) { + if (isFileTypeOrListOfFiles(ccs)) { + fileTypeFound = true; + } + + if (ccs.getClass().equals(java.io.File.class) + || ccs.getClass().equals(Integer.class) + || ccs.getClass().equals(String.class) + || ccs.getClass().isEnum()) { + map.put("ccs", ccs); + } else if (isListOfFile(ccs)) { + for (int i = 0; i < getListSize(ccs); i++) { + map.put("ccs[" + i + "]", getFromList(ccs, i)); + } + } else { + map.put("ccs", JSON.getDefault().getMapper().writeValueAsString(ccs)); + } + } + if (customFields != null) { + if (isFileTypeOrListOfFiles(customFields)) { + fileTypeFound = true; + } + + if (customFields.getClass().equals(java.io.File.class) + || customFields.getClass().equals(Integer.class) + || customFields.getClass().equals(String.class) + || customFields.getClass().isEnum()) { + map.put("custom_fields", customFields); + } else if (isListOfFile(customFields)) { + for (int i = 0; i < getListSize(customFields); i++) { + map.put("custom_fields[" + i + "]", getFromList(customFields, i)); + } + } else { + map.put( + "custom_fields", + JSON.getDefault().getMapper().writeValueAsString(customFields)); + } + } + if (files != null) { + if (isFileTypeOrListOfFiles(files)) { + fileTypeFound = true; + } + + if (files.getClass().equals(java.io.File.class) + || files.getClass().equals(Integer.class) + || files.getClass().equals(String.class) + || files.getClass().isEnum()) { + map.put("files", files); + } else if (isListOfFile(files)) { + for (int i = 0; i < getListSize(files); i++) { + map.put("files[" + i + "]", getFromList(files, i)); + } + } else { + map.put("files", JSON.getDefault().getMapper().writeValueAsString(files)); + } + } + if (fileUrls != null) { + if (isFileTypeOrListOfFiles(fileUrls)) { + fileTypeFound = true; + } + + if (fileUrls.getClass().equals(java.io.File.class) + || fileUrls.getClass().equals(Integer.class) + || fileUrls.getClass().equals(String.class) + || fileUrls.getClass().isEnum()) { + map.put("file_urls", fileUrls); + } else if (isListOfFile(fileUrls)) { + for (int i = 0; i < getListSize(fileUrls); i++) { + map.put("file_urls[" + i + "]", getFromList(fileUrls, i)); + } + } else { + map.put( + "file_urls", + JSON.getDefault().getMapper().writeValueAsString(fileUrls)); + } + } + if (message != null) { + if (isFileTypeOrListOfFiles(message)) { + fileTypeFound = true; + } + + if (message.getClass().equals(java.io.File.class) + || message.getClass().equals(Integer.class) + || message.getClass().equals(String.class) + || message.getClass().isEnum()) { + map.put("message", message); + } else if (isListOfFile(message)) { + for (int i = 0; i < getListSize(message); i++) { + map.put("message[" + i + "]", getFromList(message, i)); + } + } else { + map.put("message", JSON.getDefault().getMapper().writeValueAsString(message)); + } + } + if (metadata != null) { + if (isFileTypeOrListOfFiles(metadata)) { + fileTypeFound = true; + } + + if (metadata.getClass().equals(java.io.File.class) + || metadata.getClass().equals(Integer.class) + || metadata.getClass().equals(String.class) + || metadata.getClass().isEnum()) { + map.put("metadata", metadata); + } else if (isListOfFile(metadata)) { + for (int i = 0; i < getListSize(metadata); i++) { + map.put("metadata[" + i + "]", getFromList(metadata, i)); + } + } else { + map.put("metadata", JSON.getDefault().getMapper().writeValueAsString(metadata)); + } + } + if (signingOptions != null) { + if (isFileTypeOrListOfFiles(signingOptions)) { + fileTypeFound = true; + } + + if (signingOptions.getClass().equals(java.io.File.class) + || signingOptions.getClass().equals(Integer.class) + || signingOptions.getClass().equals(String.class) + || signingOptions.getClass().isEnum()) { + map.put("signing_options", signingOptions); + } else if (isListOfFile(signingOptions)) { + for (int i = 0; i < getListSize(signingOptions); i++) { + map.put("signing_options[" + i + "]", getFromList(signingOptions, i)); + } + } else { + map.put( + "signing_options", + JSON.getDefault().getMapper().writeValueAsString(signingOptions)); + } + } + if (subject != null) { + if (isFileTypeOrListOfFiles(subject)) { + fileTypeFound = true; + } + + if (subject.getClass().equals(java.io.File.class) + || subject.getClass().equals(Integer.class) + || subject.getClass().equals(String.class) + || subject.getClass().isEnum()) { + map.put("subject", subject); + } else if (isListOfFile(subject)) { + for (int i = 0; i < getListSize(subject); i++) { + map.put("subject[" + i + "]", getFromList(subject, i)); + } + } else { + map.put("subject", JSON.getDefault().getMapper().writeValueAsString(subject)); + } + } + if (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 (title != null) { + if (isFileTypeOrListOfFiles(title)) { + fileTypeFound = true; + } + + if (title.getClass().equals(java.io.File.class) + || title.getClass().equals(Integer.class) + || title.getClass().equals(String.class) + || title.getClass().isEnum()) { + map.put("title", title); + } else if (isListOfFile(title)) { + for (int i = 0; i < getListSize(title); i++) { + map.put("title[" + i + "]", getFromList(title, i)); + } + } else { + map.put("title", JSON.getDefault().getMapper().writeValueAsString(title)); + } + } + if (populateAutoFillFields != null) { + if (isFileTypeOrListOfFiles(populateAutoFillFields)) { + fileTypeFound = true; + } + + if (populateAutoFillFields.getClass().equals(java.io.File.class) + || populateAutoFillFields.getClass().equals(Integer.class) + || populateAutoFillFields.getClass().equals(String.class) + || populateAutoFillFields.getClass().isEnum()) { + map.put("populate_auto_fill_fields", populateAutoFillFields); + } else if (isListOfFile(populateAutoFillFields)) { + for (int i = 0; i < getListSize(populateAutoFillFields); i++) { + map.put( + "populate_auto_fill_fields[" + i + "]", + getFromList(populateAutoFillFields, i)); + } + } else { + map.put( + "populate_auto_fill_fields", + JSON.getDefault() + .getMapper() + .writeValueAsString(populateAutoFillFields)); + } + } + } catch (Exception e) { + throw new ApiException(e); + } + + return fileTypeFound ? map : new HashMap<>(); + } + + private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { + return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); + } + + private boolean isListOfFile(Object obj) throws Exception { + return obj instanceof java.util.List + && !isListEmpty(obj) + && getFromList(obj, 0) instanceof java.io.File; + } + + private boolean isListEmpty(Object obj) throws Exception { + return (boolean) + Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); + } + + private Object getFromList(Object obj, int index) throws Exception { + return Class.forName(java.util.List.class.getName()) + .getMethod("get", int.class) + .invoke(obj, index); + } + + private int getListSize(Object obj) throws Exception { + return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/model/SignatureRequestEditRequest.java b/sdks/java-v1/src/main/java/com/dropbox/sign/model/SignatureRequestEditRequest.java new file mode 100644 index 000000000..92427a9db --- /dev/null +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/model/SignatureRequestEditRequest.java @@ -0,0 +1,1497 @@ +/* + * 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.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; + +/** SignatureRequestEditRequest */ +@JsonPropertyOrder({ + SignatureRequestEditRequest.JSON_PROPERTY_FILES, + SignatureRequestEditRequest.JSON_PROPERTY_FILE_URLS, + SignatureRequestEditRequest.JSON_PROPERTY_SIGNERS, + SignatureRequestEditRequest.JSON_PROPERTY_GROUPED_SIGNERS, + SignatureRequestEditRequest.JSON_PROPERTY_ALLOW_DECLINE, + SignatureRequestEditRequest.JSON_PROPERTY_ALLOW_REASSIGN, + SignatureRequestEditRequest.JSON_PROPERTY_ATTACHMENTS, + SignatureRequestEditRequest.JSON_PROPERTY_CC_EMAIL_ADDRESSES, + SignatureRequestEditRequest.JSON_PROPERTY_CLIENT_ID, + SignatureRequestEditRequest.JSON_PROPERTY_CUSTOM_FIELDS, + SignatureRequestEditRequest.JSON_PROPERTY_FIELD_OPTIONS, + SignatureRequestEditRequest.JSON_PROPERTY_FORM_FIELD_GROUPS, + SignatureRequestEditRequest.JSON_PROPERTY_FORM_FIELD_RULES, + SignatureRequestEditRequest.JSON_PROPERTY_FORM_FIELDS_PER_DOCUMENT, + SignatureRequestEditRequest.JSON_PROPERTY_HIDE_TEXT_TAGS, + SignatureRequestEditRequest.JSON_PROPERTY_IS_EID, + SignatureRequestEditRequest.JSON_PROPERTY_MESSAGE, + SignatureRequestEditRequest.JSON_PROPERTY_METADATA, + SignatureRequestEditRequest.JSON_PROPERTY_SIGNING_OPTIONS, + SignatureRequestEditRequest.JSON_PROPERTY_SIGNING_REDIRECT_URL, + SignatureRequestEditRequest.JSON_PROPERTY_SUBJECT, + SignatureRequestEditRequest.JSON_PROPERTY_TEST_MODE, + SignatureRequestEditRequest.JSON_PROPERTY_TITLE, + SignatureRequestEditRequest.JSON_PROPERTY_USE_TEXT_TAGS, + SignatureRequestEditRequest.JSON_PROPERTY_EXPIRES_AT +}) +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.8.0") +@JsonIgnoreProperties(ignoreUnknown = true) +public class SignatureRequestEditRequest { + public static final String JSON_PROPERTY_FILES = "files"; + private List files = null; + + public static final String JSON_PROPERTY_FILE_URLS = "file_urls"; + private List fileUrls = null; + + public static final String JSON_PROPERTY_SIGNERS = "signers"; + private List signers = null; + + public static final String JSON_PROPERTY_GROUPED_SIGNERS = "grouped_signers"; + private List groupedSigners = null; + + public static final String JSON_PROPERTY_ALLOW_DECLINE = "allow_decline"; + private Boolean allowDecline = false; + + public static final String JSON_PROPERTY_ALLOW_REASSIGN = "allow_reassign"; + private Boolean allowReassign = false; + + public static final String JSON_PROPERTY_ATTACHMENTS = "attachments"; + private List attachments = null; + + public static final String JSON_PROPERTY_CC_EMAIL_ADDRESSES = "cc_email_addresses"; + private List ccEmailAddresses = null; + + public static final String JSON_PROPERTY_CLIENT_ID = "client_id"; + private String clientId; + + public static final String JSON_PROPERTY_CUSTOM_FIELDS = "custom_fields"; + private List customFields = null; + + public static final String JSON_PROPERTY_FIELD_OPTIONS = "field_options"; + private SubFieldOptions fieldOptions; + + public static final String JSON_PROPERTY_FORM_FIELD_GROUPS = "form_field_groups"; + private List formFieldGroups = null; + + public static final String JSON_PROPERTY_FORM_FIELD_RULES = "form_field_rules"; + private List formFieldRules = null; + + public static final String JSON_PROPERTY_FORM_FIELDS_PER_DOCUMENT = "form_fields_per_document"; + private List formFieldsPerDocument = null; + + public static final String JSON_PROPERTY_HIDE_TEXT_TAGS = "hide_text_tags"; + private Boolean hideTextTags = false; + + public static final String JSON_PROPERTY_IS_EID = "is_eid"; + private Boolean isEid = false; + + public static final String JSON_PROPERTY_MESSAGE = "message"; + private String message; + + public static final String JSON_PROPERTY_METADATA = "metadata"; + private Map metadata = null; + + public static final String JSON_PROPERTY_SIGNING_OPTIONS = "signing_options"; + private SubSigningOptions signingOptions; + + public static final String JSON_PROPERTY_SIGNING_REDIRECT_URL = "signing_redirect_url"; + private String signingRedirectUrl; + + public static final String JSON_PROPERTY_SUBJECT = "subject"; + private String subject; + + public static final String JSON_PROPERTY_TEST_MODE = "test_mode"; + private Boolean testMode = false; + + public static final String JSON_PROPERTY_TITLE = "title"; + private String title; + + public static final String JSON_PROPERTY_USE_TEXT_TAGS = "use_text_tags"; + private Boolean useTextTags = false; + + public static final String JSON_PROPERTY_EXPIRES_AT = "expires_at"; + private Integer expiresAt; + + public SignatureRequestEditRequest() {} + + /** + * Attempt to instantiate and hydrate a new instance of this class + * + * @param jsonData String of JSON data representing target object + */ + public static SignatureRequestEditRequest init(String jsonData) throws Exception { + return new ObjectMapper().readValue(jsonData, SignatureRequestEditRequest.class); + } + + public static SignatureRequestEditRequest init(HashMap data) throws Exception { + return new ObjectMapper() + .readValue( + new ObjectMapper().writeValueAsString(data), + SignatureRequestEditRequest.class); + } + + public SignatureRequestEditRequest files(List files) { + this.files = files; + return this; + } + + public SignatureRequestEditRequest addFilesItem(File filesItem) { + if (this.files == null) { + this.files = new ArrayList<>(); + } + this.files.add(filesItem); + return this; + } + + /** + * Use `files[]` to indicate the uploaded file(s) to send for signature. This endpoint + * requires either **files** or **file_urls[]**, but not both. + * + * @return files + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_FILES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getFiles() { + return files; + } + + @JsonProperty(JSON_PROPERTY_FILES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setFiles(List files) { + this.files = files; + } + + public SignatureRequestEditRequest fileUrls(List fileUrls) { + this.fileUrls = fileUrls; + return this; + } + + public SignatureRequestEditRequest addFileUrlsItem(String fileUrlsItem) { + if (this.fileUrls == null) { + this.fileUrls = new ArrayList<>(); + } + this.fileUrls.add(fileUrlsItem); + return this; + } + + /** + * Use `file_urls[]` to have Dropbox Sign download the file(s) to send for signature. + * This endpoint requires either **files** or **file_urls[]**, but not both. + * + * @return fileUrls + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_FILE_URLS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getFileUrls() { + return fileUrls; + } + + @JsonProperty(JSON_PROPERTY_FILE_URLS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setFileUrls(List fileUrls) { + this.fileUrls = fileUrls; + } + + public SignatureRequestEditRequest signers(List signers) { + this.signers = signers; + return this; + } + + public SignatureRequestEditRequest addSignersItem(SubSignatureRequestSigner signersItem) { + if (this.signers == null) { + this.signers = new ArrayList<>(); + } + this.signers.add(signersItem); + return this; + } + + /** + * Add Signers to your Signature Request. This endpoint requires either **signers** or + * **grouped_signers**, but not both. + * + * @return signers + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_SIGNERS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getSigners() { + return signers; + } + + @JsonProperty(JSON_PROPERTY_SIGNERS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSigners(List signers) { + this.signers = signers; + } + + public SignatureRequestEditRequest groupedSigners( + List groupedSigners) { + this.groupedSigners = groupedSigners; + return this; + } + + public SignatureRequestEditRequest addGroupedSignersItem( + SubSignatureRequestGroupedSigners groupedSignersItem) { + if (this.groupedSigners == null) { + this.groupedSigners = new ArrayList<>(); + } + this.groupedSigners.add(groupedSignersItem); + return this; + } + + /** + * Add Grouped Signers to your Signature Request. This endpoint requires either **signers** or + * **grouped_signers**, but not both. + * + * @return groupedSigners + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_GROUPED_SIGNERS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getGroupedSigners() { + return groupedSigners; + } + + @JsonProperty(JSON_PROPERTY_GROUPED_SIGNERS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setGroupedSigners(List groupedSigners) { + this.groupedSigners = groupedSigners; + } + + public SignatureRequestEditRequest allowDecline(Boolean allowDecline) { + this.allowDecline = allowDecline; + return this; + } + + /** + * Allows signers to decline to sign a document if `true`. Defaults to + * `false`. + * + * @return allowDecline + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ALLOW_DECLINE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getAllowDecline() { + return allowDecline; + } + + @JsonProperty(JSON_PROPERTY_ALLOW_DECLINE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAllowDecline(Boolean allowDecline) { + this.allowDecline = allowDecline; + } + + public SignatureRequestEditRequest allowReassign(Boolean allowReassign) { + this.allowReassign = allowReassign; + return this; + } + + /** + * Allows signers to reassign their signature requests to other signers if set to + * `true`. Defaults to `false`. **NOTE:** Only available for Premium plan + * and higher. + * + * @return allowReassign + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ALLOW_REASSIGN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getAllowReassign() { + return allowReassign; + } + + @JsonProperty(JSON_PROPERTY_ALLOW_REASSIGN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAllowReassign(Boolean allowReassign) { + this.allowReassign = allowReassign; + } + + public SignatureRequestEditRequest attachments(List attachments) { + this.attachments = attachments; + return this; + } + + public SignatureRequestEditRequest addAttachmentsItem(SubAttachment attachmentsItem) { + if (this.attachments == null) { + this.attachments = new ArrayList<>(); + } + this.attachments.add(attachmentsItem); + return this; + } + + /** + * A list describing the attachments + * + * @return attachments + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ATTACHMENTS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getAttachments() { + return attachments; + } + + @JsonProperty(JSON_PROPERTY_ATTACHMENTS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAttachments(List attachments) { + this.attachments = attachments; + } + + public SignatureRequestEditRequest ccEmailAddresses(List ccEmailAddresses) { + this.ccEmailAddresses = ccEmailAddresses; + return this; + } + + public SignatureRequestEditRequest addCcEmailAddressesItem(String ccEmailAddressesItem) { + if (this.ccEmailAddresses == null) { + this.ccEmailAddresses = new ArrayList<>(); + } + this.ccEmailAddresses.add(ccEmailAddressesItem); + return this; + } + + /** + * The email addresses that should be CCed. + * + * @return ccEmailAddresses + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_CC_EMAIL_ADDRESSES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getCcEmailAddresses() { + return ccEmailAddresses; + } + + @JsonProperty(JSON_PROPERTY_CC_EMAIL_ADDRESSES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCcEmailAddresses(List ccEmailAddresses) { + this.ccEmailAddresses = ccEmailAddresses; + } + + public SignatureRequestEditRequest clientId(String clientId) { + this.clientId = clientId; + return this; + } + + /** + * The client id of the API App you want to associate with this request. Used to apply the + * branding and callback url defined for the app. + * + * @return clientId + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_CLIENT_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getClientId() { + return clientId; + } + + @JsonProperty(JSON_PROPERTY_CLIENT_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setClientId(String clientId) { + this.clientId = clientId; + } + + public SignatureRequestEditRequest customFields(List customFields) { + this.customFields = customFields; + return this; + } + + public SignatureRequestEditRequest addCustomFieldsItem(SubCustomField customFieldsItem) { + if (this.customFields == null) { + this.customFields = new ArrayList<>(); + } + this.customFields.add(customFieldsItem); + return this; + } + + /** + * When used together with merge fields, `custom_fields` allows users to add + * pre-filled data to their signature requests. Pre-filled data can be used with + * \"send-once\" signature requests by adding merge fields with + * `form_fields_per_document` or [Text + * Tags](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) while passing values + * back with `custom_fields` together in one API call. For using pre-filled on + * repeatable signature requests, merge fields are added to templates in the Dropbox Sign UI or + * by calling + * [/template/create_embedded_draft](/api/reference/operation/templateCreateEmbeddedDraft) and + * then passing `custom_fields` on subsequent signature requests referencing that + * template. + * + * @return customFields + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_CUSTOM_FIELDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getCustomFields() { + return customFields; + } + + @JsonProperty(JSON_PROPERTY_CUSTOM_FIELDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCustomFields(List customFields) { + this.customFields = customFields; + } + + public SignatureRequestEditRequest fieldOptions(SubFieldOptions fieldOptions) { + this.fieldOptions = fieldOptions; + return this; + } + + /** + * Get fieldOptions + * + * @return fieldOptions + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_FIELD_OPTIONS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public SubFieldOptions getFieldOptions() { + return fieldOptions; + } + + @JsonProperty(JSON_PROPERTY_FIELD_OPTIONS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setFieldOptions(SubFieldOptions fieldOptions) { + this.fieldOptions = fieldOptions; + } + + public SignatureRequestEditRequest formFieldGroups(List formFieldGroups) { + this.formFieldGroups = formFieldGroups; + return this; + } + + public SignatureRequestEditRequest 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.Nullable @JsonProperty(JSON_PROPERTY_FORM_FIELD_GROUPS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getFormFieldGroups() { + return formFieldGroups; + } + + @JsonProperty(JSON_PROPERTY_FORM_FIELD_GROUPS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setFormFieldGroups(List formFieldGroups) { + this.formFieldGroups = formFieldGroups; + } + + public SignatureRequestEditRequest formFieldRules(List formFieldRules) { + this.formFieldRules = formFieldRules; + return this; + } + + public SignatureRequestEditRequest addFormFieldRulesItem(SubFormFieldRule formFieldRulesItem) { + if (this.formFieldRules == null) { + this.formFieldRules = new ArrayList<>(); + } + this.formFieldRules.add(formFieldRulesItem); + return this; + } + + /** + * Conditional Logic rules for fields defined in `form_fields_per_document`. + * + * @return formFieldRules + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_FORM_FIELD_RULES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getFormFieldRules() { + return formFieldRules; + } + + @JsonProperty(JSON_PROPERTY_FORM_FIELD_RULES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setFormFieldRules(List formFieldRules) { + this.formFieldRules = formFieldRules; + } + + public SignatureRequestEditRequest formFieldsPerDocument( + List formFieldsPerDocument) { + this.formFieldsPerDocument = formFieldsPerDocument; + return this; + } + + public SignatureRequestEditRequest 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.Nullable @JsonProperty(JSON_PROPERTY_FORM_FIELDS_PER_DOCUMENT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getFormFieldsPerDocument() { + return formFieldsPerDocument; + } + + @JsonProperty(JSON_PROPERTY_FORM_FIELDS_PER_DOCUMENT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setFormFieldsPerDocument(List formFieldsPerDocument) { + this.formFieldsPerDocument = formFieldsPerDocument; + } + + public SignatureRequestEditRequest hideTextTags(Boolean hideTextTags) { + this.hideTextTags = hideTextTags; + return this; + } + + /** + * Enables automatic Text Tag removal when set to true. **NOTE:** Removing text tags this way + * can cause unwanted clipping. We recommend leaving this setting on `false` and + * instead hiding your text tags using white text or a similar approach. See the [Text Tags + * Walkthrough](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) for more + * information. + * + * @return hideTextTags + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_HIDE_TEXT_TAGS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getHideTextTags() { + return hideTextTags; + } + + @JsonProperty(JSON_PROPERTY_HIDE_TEXT_TAGS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setHideTextTags(Boolean hideTextTags) { + this.hideTextTags = hideTextTags; + } + + public SignatureRequestEditRequest isEid(Boolean isEid) { + this.isEid = isEid; + return this; + } + + /** + * Send with a value of `true` if you wish to enable [electronic identification + * (eID)](https://www.hellosign.com/features/electronic-id), which requires the signer to verify + * their identity with an eID provider to sign a document.<br> **NOTE:** eID is only + * available on the Premium API plan. Cannot be used in `test_mode`. Only works on + * requests with one signer. + * + * @return isEid + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_IS_EID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getIsEid() { + return isEid; + } + + @JsonProperty(JSON_PROPERTY_IS_EID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIsEid(Boolean isEid) { + this.isEid = isEid; + } + + public SignatureRequestEditRequest message(String message) { + this.message = message; + return this; + } + + /** + * The custom message in the email that will be sent to the signers. + * + * @return message + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_MESSAGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getMessage() { + return message; + } + + @JsonProperty(JSON_PROPERTY_MESSAGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMessage(String message) { + this.message = message; + } + + public SignatureRequestEditRequest metadata(Map metadata) { + this.metadata = metadata; + return this; + } + + public SignatureRequestEditRequest putMetadataItem(String key, Object metadataItem) { + if (this.metadata == null) { + this.metadata = new HashMap<>(); + } + this.metadata.put(key, metadataItem); + return this; + } + + /** + * Key-value data that should be attached to the signature request. This metadata is included in + * all API responses and events involving the signature request. For example, use the metadata + * field to store a signer's order number for look up when receiving events for the + * signature request. Each request can include up to 10 metadata keys (or 50 nested metadata + * keys), with key names up to 40 characters long and values up to 1000 characters long. + * + * @return metadata + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_METADATA) + @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) + public Map getMetadata() { + return metadata; + } + + @JsonProperty(JSON_PROPERTY_METADATA) + @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) + public void setMetadata(Map metadata) { + this.metadata = metadata; + } + + public SignatureRequestEditRequest signingOptions(SubSigningOptions signingOptions) { + this.signingOptions = signingOptions; + return this; + } + + /** + * Get signingOptions + * + * @return signingOptions + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_SIGNING_OPTIONS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public SubSigningOptions getSigningOptions() { + return signingOptions; + } + + @JsonProperty(JSON_PROPERTY_SIGNING_OPTIONS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSigningOptions(SubSigningOptions signingOptions) { + this.signingOptions = signingOptions; + } + + public SignatureRequestEditRequest signingRedirectUrl(String signingRedirectUrl) { + this.signingRedirectUrl = signingRedirectUrl; + return this; + } + + /** + * The URL you want signers redirected to after they successfully sign. + * + * @return signingRedirectUrl + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_SIGNING_REDIRECT_URL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getSigningRedirectUrl() { + return signingRedirectUrl; + } + + @JsonProperty(JSON_PROPERTY_SIGNING_REDIRECT_URL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSigningRedirectUrl(String signingRedirectUrl) { + this.signingRedirectUrl = signingRedirectUrl; + } + + public SignatureRequestEditRequest subject(String subject) { + this.subject = subject; + return this; + } + + /** + * The subject in the email that will be sent to the signers. + * + * @return subject + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_SUBJECT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getSubject() { + return subject; + } + + @JsonProperty(JSON_PROPERTY_SUBJECT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSubject(String subject) { + this.subject = subject; + } + + public SignatureRequestEditRequest testMode(Boolean testMode) { + this.testMode = testMode; + return this; + } + + /** + * Whether this is a test, the signature request will not be legally binding if set to + * `true`. Defaults to `false`. + * + * @return testMode + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_TEST_MODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getTestMode() { + return testMode; + } + + @JsonProperty(JSON_PROPERTY_TEST_MODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTestMode(Boolean testMode) { + this.testMode = testMode; + } + + public SignatureRequestEditRequest title(String title) { + this.title = title; + return this; + } + + /** + * The title you want to assign to the SignatureRequest. + * + * @return title + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_TITLE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getTitle() { + return title; + } + + @JsonProperty(JSON_PROPERTY_TITLE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTitle(String title) { + this.title = title; + } + + public SignatureRequestEditRequest useTextTags(Boolean useTextTags) { + this.useTextTags = useTextTags; + return this; + } + + /** + * Send with a value of `true` if you wish to enable [Text + * Tags](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) parsing in your + * document. Defaults to disabled, or `false`. + * + * @return useTextTags + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_USE_TEXT_TAGS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getUseTextTags() { + return useTextTags; + } + + @JsonProperty(JSON_PROPERTY_USE_TEXT_TAGS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setUseTextTags(Boolean useTextTags) { + this.useTextTags = useTextTags; + } + + public SignatureRequestEditRequest expiresAt(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(Integer expiresAt) { + this.expiresAt = expiresAt; + } + + /** Return true if this SignatureRequestEditRequest object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SignatureRequestEditRequest signatureRequestEditRequest = (SignatureRequestEditRequest) o; + return Objects.equals(this.files, signatureRequestEditRequest.files) + && Objects.equals(this.fileUrls, signatureRequestEditRequest.fileUrls) + && Objects.equals(this.signers, signatureRequestEditRequest.signers) + && Objects.equals(this.groupedSigners, signatureRequestEditRequest.groupedSigners) + && Objects.equals(this.allowDecline, signatureRequestEditRequest.allowDecline) + && Objects.equals(this.allowReassign, signatureRequestEditRequest.allowReassign) + && Objects.equals(this.attachments, signatureRequestEditRequest.attachments) + && Objects.equals( + this.ccEmailAddresses, signatureRequestEditRequest.ccEmailAddresses) + && Objects.equals(this.clientId, signatureRequestEditRequest.clientId) + && Objects.equals(this.customFields, signatureRequestEditRequest.customFields) + && Objects.equals(this.fieldOptions, signatureRequestEditRequest.fieldOptions) + && Objects.equals(this.formFieldGroups, signatureRequestEditRequest.formFieldGroups) + && Objects.equals(this.formFieldRules, signatureRequestEditRequest.formFieldRules) + && Objects.equals( + this.formFieldsPerDocument, + signatureRequestEditRequest.formFieldsPerDocument) + && Objects.equals(this.hideTextTags, signatureRequestEditRequest.hideTextTags) + && Objects.equals(this.isEid, signatureRequestEditRequest.isEid) + && Objects.equals(this.message, signatureRequestEditRequest.message) + && Objects.equals(this.metadata, signatureRequestEditRequest.metadata) + && Objects.equals(this.signingOptions, signatureRequestEditRequest.signingOptions) + && Objects.equals( + this.signingRedirectUrl, signatureRequestEditRequest.signingRedirectUrl) + && Objects.equals(this.subject, signatureRequestEditRequest.subject) + && Objects.equals(this.testMode, signatureRequestEditRequest.testMode) + && Objects.equals(this.title, signatureRequestEditRequest.title) + && Objects.equals(this.useTextTags, signatureRequestEditRequest.useTextTags) + && Objects.equals(this.expiresAt, signatureRequestEditRequest.expiresAt); + } + + @Override + public int hashCode() { + return Objects.hash( + files, + fileUrls, + signers, + groupedSigners, + allowDecline, + allowReassign, + attachments, + ccEmailAddresses, + clientId, + customFields, + fieldOptions, + formFieldGroups, + formFieldRules, + formFieldsPerDocument, + hideTextTags, + isEid, + message, + metadata, + signingOptions, + signingRedirectUrl, + subject, + testMode, + title, + useTextTags, + expiresAt); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SignatureRequestEditRequest {\n"); + sb.append(" files: ").append(toIndentedString(files)).append("\n"); + sb.append(" fileUrls: ").append(toIndentedString(fileUrls)).append("\n"); + sb.append(" signers: ").append(toIndentedString(signers)).append("\n"); + sb.append(" groupedSigners: ").append(toIndentedString(groupedSigners)).append("\n"); + sb.append(" allowDecline: ").append(toIndentedString(allowDecline)).append("\n"); + sb.append(" allowReassign: ").append(toIndentedString(allowReassign)).append("\n"); + sb.append(" attachments: ").append(toIndentedString(attachments)).append("\n"); + sb.append(" ccEmailAddresses: ").append(toIndentedString(ccEmailAddresses)).append("\n"); + sb.append(" clientId: ").append(toIndentedString(clientId)).append("\n"); + sb.append(" customFields: ").append(toIndentedString(customFields)).append("\n"); + sb.append(" fieldOptions: ").append(toIndentedString(fieldOptions)).append("\n"); + sb.append(" formFieldGroups: ").append(toIndentedString(formFieldGroups)).append("\n"); + sb.append(" formFieldRules: ").append(toIndentedString(formFieldRules)).append("\n"); + sb.append(" formFieldsPerDocument: ") + .append(toIndentedString(formFieldsPerDocument)) + .append("\n"); + sb.append(" hideTextTags: ").append(toIndentedString(hideTextTags)).append("\n"); + sb.append(" isEid: ").append(toIndentedString(isEid)).append("\n"); + sb.append(" message: ").append(toIndentedString(message)).append("\n"); + sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); + sb.append(" signingOptions: ").append(toIndentedString(signingOptions)).append("\n"); + sb.append(" signingRedirectUrl: ") + .append(toIndentedString(signingRedirectUrl)) + .append("\n"); + 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(" useTextTags: ").append(toIndentedString(useTextTags)).append("\n"); + sb.append(" expiresAt: ").append(toIndentedString(expiresAt)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public Map createFormData() throws ApiException { + Map map = new HashMap<>(); + boolean fileTypeFound = false; + try { + if (files != null) { + if (isFileTypeOrListOfFiles(files)) { + fileTypeFound = true; + } + + if (files.getClass().equals(java.io.File.class) + || files.getClass().equals(Integer.class) + || files.getClass().equals(String.class) + || files.getClass().isEnum()) { + map.put("files", files); + } else if (isListOfFile(files)) { + for (int i = 0; i < getListSize(files); i++) { + map.put("files[" + i + "]", getFromList(files, i)); + } + } else { + map.put("files", JSON.getDefault().getMapper().writeValueAsString(files)); + } + } + if (fileUrls != null) { + if (isFileTypeOrListOfFiles(fileUrls)) { + fileTypeFound = true; + } + + if (fileUrls.getClass().equals(java.io.File.class) + || fileUrls.getClass().equals(Integer.class) + || fileUrls.getClass().equals(String.class) + || fileUrls.getClass().isEnum()) { + map.put("file_urls", fileUrls); + } else if (isListOfFile(fileUrls)) { + for (int i = 0; i < getListSize(fileUrls); i++) { + map.put("file_urls[" + i + "]", getFromList(fileUrls, i)); + } + } else { + map.put( + "file_urls", + JSON.getDefault().getMapper().writeValueAsString(fileUrls)); + } + } + if (signers != null) { + if (isFileTypeOrListOfFiles(signers)) { + fileTypeFound = true; + } + + if (signers.getClass().equals(java.io.File.class) + || signers.getClass().equals(Integer.class) + || signers.getClass().equals(String.class) + || signers.getClass().isEnum()) { + map.put("signers", signers); + } else if (isListOfFile(signers)) { + for (int i = 0; i < getListSize(signers); i++) { + map.put("signers[" + i + "]", getFromList(signers, i)); + } + } else { + map.put("signers", JSON.getDefault().getMapper().writeValueAsString(signers)); + } + } + if (groupedSigners != null) { + if (isFileTypeOrListOfFiles(groupedSigners)) { + fileTypeFound = true; + } + + if (groupedSigners.getClass().equals(java.io.File.class) + || groupedSigners.getClass().equals(Integer.class) + || groupedSigners.getClass().equals(String.class) + || groupedSigners.getClass().isEnum()) { + map.put("grouped_signers", groupedSigners); + } else if (isListOfFile(groupedSigners)) { + for (int i = 0; i < getListSize(groupedSigners); i++) { + map.put("grouped_signers[" + i + "]", getFromList(groupedSigners, i)); + } + } else { + map.put( + "grouped_signers", + JSON.getDefault().getMapper().writeValueAsString(groupedSigners)); + } + } + if (allowDecline != null) { + if (isFileTypeOrListOfFiles(allowDecline)) { + fileTypeFound = true; + } + + if (allowDecline.getClass().equals(java.io.File.class) + || allowDecline.getClass().equals(Integer.class) + || allowDecline.getClass().equals(String.class) + || allowDecline.getClass().isEnum()) { + map.put("allow_decline", allowDecline); + } else if (isListOfFile(allowDecline)) { + for (int i = 0; i < getListSize(allowDecline); i++) { + map.put("allow_decline[" + i + "]", getFromList(allowDecline, i)); + } + } else { + map.put( + "allow_decline", + JSON.getDefault().getMapper().writeValueAsString(allowDecline)); + } + } + if (allowReassign != null) { + if (isFileTypeOrListOfFiles(allowReassign)) { + fileTypeFound = true; + } + + if (allowReassign.getClass().equals(java.io.File.class) + || allowReassign.getClass().equals(Integer.class) + || allowReassign.getClass().equals(String.class) + || allowReassign.getClass().isEnum()) { + map.put("allow_reassign", allowReassign); + } else if (isListOfFile(allowReassign)) { + for (int i = 0; i < getListSize(allowReassign); i++) { + map.put("allow_reassign[" + i + "]", getFromList(allowReassign, i)); + } + } else { + map.put( + "allow_reassign", + JSON.getDefault().getMapper().writeValueAsString(allowReassign)); + } + } + if (attachments != null) { + if (isFileTypeOrListOfFiles(attachments)) { + fileTypeFound = true; + } + + if (attachments.getClass().equals(java.io.File.class) + || attachments.getClass().equals(Integer.class) + || attachments.getClass().equals(String.class) + || attachments.getClass().isEnum()) { + map.put("attachments", attachments); + } else if (isListOfFile(attachments)) { + for (int i = 0; i < getListSize(attachments); i++) { + map.put("attachments[" + i + "]", getFromList(attachments, i)); + } + } else { + map.put( + "attachments", + JSON.getDefault().getMapper().writeValueAsString(attachments)); + } + } + if (ccEmailAddresses != null) { + if (isFileTypeOrListOfFiles(ccEmailAddresses)) { + fileTypeFound = true; + } + + if (ccEmailAddresses.getClass().equals(java.io.File.class) + || ccEmailAddresses.getClass().equals(Integer.class) + || ccEmailAddresses.getClass().equals(String.class) + || ccEmailAddresses.getClass().isEnum()) { + map.put("cc_email_addresses", ccEmailAddresses); + } else if (isListOfFile(ccEmailAddresses)) { + for (int i = 0; i < getListSize(ccEmailAddresses); i++) { + map.put("cc_email_addresses[" + i + "]", getFromList(ccEmailAddresses, i)); + } + } else { + map.put( + "cc_email_addresses", + JSON.getDefault().getMapper().writeValueAsString(ccEmailAddresses)); + } + } + if (clientId != null) { + if (isFileTypeOrListOfFiles(clientId)) { + fileTypeFound = true; + } + + if (clientId.getClass().equals(java.io.File.class) + || clientId.getClass().equals(Integer.class) + || clientId.getClass().equals(String.class) + || clientId.getClass().isEnum()) { + map.put("client_id", clientId); + } else if (isListOfFile(clientId)) { + for (int i = 0; i < getListSize(clientId); i++) { + map.put("client_id[" + i + "]", getFromList(clientId, i)); + } + } else { + map.put( + "client_id", + JSON.getDefault().getMapper().writeValueAsString(clientId)); + } + } + if (customFields != null) { + if (isFileTypeOrListOfFiles(customFields)) { + fileTypeFound = true; + } + + if (customFields.getClass().equals(java.io.File.class) + || customFields.getClass().equals(Integer.class) + || customFields.getClass().equals(String.class) + || customFields.getClass().isEnum()) { + map.put("custom_fields", customFields); + } else if (isListOfFile(customFields)) { + for (int i = 0; i < getListSize(customFields); i++) { + map.put("custom_fields[" + i + "]", getFromList(customFields, i)); + } + } else { + map.put( + "custom_fields", + JSON.getDefault().getMapper().writeValueAsString(customFields)); + } + } + if (fieldOptions != null) { + if (isFileTypeOrListOfFiles(fieldOptions)) { + fileTypeFound = true; + } + + if (fieldOptions.getClass().equals(java.io.File.class) + || fieldOptions.getClass().equals(Integer.class) + || fieldOptions.getClass().equals(String.class) + || fieldOptions.getClass().isEnum()) { + map.put("field_options", fieldOptions); + } else if (isListOfFile(fieldOptions)) { + for (int i = 0; i < getListSize(fieldOptions); i++) { + map.put("field_options[" + i + "]", getFromList(fieldOptions, i)); + } + } else { + map.put( + "field_options", + JSON.getDefault().getMapper().writeValueAsString(fieldOptions)); + } + } + 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 (formFieldRules != null) { + if (isFileTypeOrListOfFiles(formFieldRules)) { + fileTypeFound = true; + } + + if (formFieldRules.getClass().equals(java.io.File.class) + || formFieldRules.getClass().equals(Integer.class) + || formFieldRules.getClass().equals(String.class) + || formFieldRules.getClass().isEnum()) { + map.put("form_field_rules", formFieldRules); + } else if (isListOfFile(formFieldRules)) { + for (int i = 0; i < getListSize(formFieldRules); i++) { + map.put("form_field_rules[" + i + "]", getFromList(formFieldRules, i)); + } + } else { + map.put( + "form_field_rules", + JSON.getDefault().getMapper().writeValueAsString(formFieldRules)); + } + } + 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 (hideTextTags != null) { + if (isFileTypeOrListOfFiles(hideTextTags)) { + fileTypeFound = true; + } + + if (hideTextTags.getClass().equals(java.io.File.class) + || hideTextTags.getClass().equals(Integer.class) + || hideTextTags.getClass().equals(String.class) + || hideTextTags.getClass().isEnum()) { + map.put("hide_text_tags", hideTextTags); + } else if (isListOfFile(hideTextTags)) { + for (int i = 0; i < getListSize(hideTextTags); i++) { + map.put("hide_text_tags[" + i + "]", getFromList(hideTextTags, i)); + } + } else { + map.put( + "hide_text_tags", + JSON.getDefault().getMapper().writeValueAsString(hideTextTags)); + } + } + if (isEid != null) { + if (isFileTypeOrListOfFiles(isEid)) { + fileTypeFound = true; + } + + if (isEid.getClass().equals(java.io.File.class) + || isEid.getClass().equals(Integer.class) + || isEid.getClass().equals(String.class) + || isEid.getClass().isEnum()) { + map.put("is_eid", isEid); + } else if (isListOfFile(isEid)) { + for (int i = 0; i < getListSize(isEid); i++) { + map.put("is_eid[" + i + "]", getFromList(isEid, i)); + } + } else { + map.put("is_eid", JSON.getDefault().getMapper().writeValueAsString(isEid)); + } + } + if (message != null) { + if (isFileTypeOrListOfFiles(message)) { + fileTypeFound = true; + } + + if (message.getClass().equals(java.io.File.class) + || message.getClass().equals(Integer.class) + || message.getClass().equals(String.class) + || message.getClass().isEnum()) { + map.put("message", message); + } else if (isListOfFile(message)) { + for (int i = 0; i < getListSize(message); i++) { + map.put("message[" + i + "]", getFromList(message, i)); + } + } else { + map.put("message", JSON.getDefault().getMapper().writeValueAsString(message)); + } + } + if (metadata != null) { + if (isFileTypeOrListOfFiles(metadata)) { + fileTypeFound = true; + } + + if (metadata.getClass().equals(java.io.File.class) + || metadata.getClass().equals(Integer.class) + || metadata.getClass().equals(String.class) + || metadata.getClass().isEnum()) { + map.put("metadata", metadata); + } else if (isListOfFile(metadata)) { + for (int i = 0; i < getListSize(metadata); i++) { + map.put("metadata[" + i + "]", getFromList(metadata, i)); + } + } else { + map.put("metadata", JSON.getDefault().getMapper().writeValueAsString(metadata)); + } + } + if (signingOptions != null) { + if (isFileTypeOrListOfFiles(signingOptions)) { + fileTypeFound = true; + } + + if (signingOptions.getClass().equals(java.io.File.class) + || signingOptions.getClass().equals(Integer.class) + || signingOptions.getClass().equals(String.class) + || signingOptions.getClass().isEnum()) { + map.put("signing_options", signingOptions); + } else if (isListOfFile(signingOptions)) { + for (int i = 0; i < getListSize(signingOptions); i++) { + map.put("signing_options[" + i + "]", getFromList(signingOptions, i)); + } + } else { + map.put( + "signing_options", + JSON.getDefault().getMapper().writeValueAsString(signingOptions)); + } + } + if (signingRedirectUrl != null) { + if (isFileTypeOrListOfFiles(signingRedirectUrl)) { + fileTypeFound = true; + } + + if (signingRedirectUrl.getClass().equals(java.io.File.class) + || signingRedirectUrl.getClass().equals(Integer.class) + || signingRedirectUrl.getClass().equals(String.class) + || signingRedirectUrl.getClass().isEnum()) { + map.put("signing_redirect_url", signingRedirectUrl); + } else if (isListOfFile(signingRedirectUrl)) { + for (int i = 0; i < getListSize(signingRedirectUrl); i++) { + map.put( + "signing_redirect_url[" + i + "]", + getFromList(signingRedirectUrl, i)); + } + } else { + map.put( + "signing_redirect_url", + JSON.getDefault().getMapper().writeValueAsString(signingRedirectUrl)); + } + } + if (subject != null) { + if (isFileTypeOrListOfFiles(subject)) { + fileTypeFound = true; + } + + if (subject.getClass().equals(java.io.File.class) + || subject.getClass().equals(Integer.class) + || subject.getClass().equals(String.class) + || subject.getClass().isEnum()) { + map.put("subject", subject); + } else if (isListOfFile(subject)) { + for (int i = 0; i < getListSize(subject); i++) { + map.put("subject[" + i + "]", getFromList(subject, i)); + } + } else { + map.put("subject", JSON.getDefault().getMapper().writeValueAsString(subject)); + } + } + if (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 (title != null) { + if (isFileTypeOrListOfFiles(title)) { + fileTypeFound = true; + } + + if (title.getClass().equals(java.io.File.class) + || title.getClass().equals(Integer.class) + || title.getClass().equals(String.class) + || title.getClass().isEnum()) { + map.put("title", title); + } else if (isListOfFile(title)) { + for (int i = 0; i < getListSize(title); i++) { + map.put("title[" + i + "]", getFromList(title, i)); + } + } else { + map.put("title", JSON.getDefault().getMapper().writeValueAsString(title)); + } + } + if (useTextTags != null) { + if (isFileTypeOrListOfFiles(useTextTags)) { + fileTypeFound = true; + } + + if (useTextTags.getClass().equals(java.io.File.class) + || useTextTags.getClass().equals(Integer.class) + || useTextTags.getClass().equals(String.class) + || useTextTags.getClass().isEnum()) { + map.put("use_text_tags", useTextTags); + } else if (isListOfFile(useTextTags)) { + for (int i = 0; i < getListSize(useTextTags); i++) { + map.put("use_text_tags[" + i + "]", getFromList(useTextTags, i)); + } + } else { + map.put( + "use_text_tags", + JSON.getDefault().getMapper().writeValueAsString(useTextTags)); + } + } + 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); + } + + return fileTypeFound ? map : new HashMap<>(); + } + + private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { + return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); + } + + private boolean isListOfFile(Object obj) throws Exception { + return obj instanceof java.util.List + && !isListEmpty(obj) + && getFromList(obj, 0) instanceof java.io.File; + } + + private boolean isListEmpty(Object obj) throws Exception { + return (boolean) + Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); + } + + private Object getFromList(Object obj, int index) throws Exception { + return Class.forName(java.util.List.class.getName()) + .getMethod("get", int.class) + .invoke(obj, index); + } + + private int getListSize(Object obj) throws Exception { + return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/model/SignatureRequestEditWithTemplateRequest.java b/sdks/java-v1/src/main/java/com/dropbox/sign/model/SignatureRequestEditWithTemplateRequest.java new file mode 100644 index 000000000..3621d0d2f --- /dev/null +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/model/SignatureRequestEditWithTemplateRequest.java @@ -0,0 +1,983 @@ +/* + * 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.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; + +/** */ +@JsonPropertyOrder({ + SignatureRequestEditWithTemplateRequest.JSON_PROPERTY_TEMPLATE_IDS, + SignatureRequestEditWithTemplateRequest.JSON_PROPERTY_SIGNERS, + SignatureRequestEditWithTemplateRequest.JSON_PROPERTY_ALLOW_DECLINE, + SignatureRequestEditWithTemplateRequest.JSON_PROPERTY_CCS, + SignatureRequestEditWithTemplateRequest.JSON_PROPERTY_CLIENT_ID, + SignatureRequestEditWithTemplateRequest.JSON_PROPERTY_CUSTOM_FIELDS, + SignatureRequestEditWithTemplateRequest.JSON_PROPERTY_FILES, + SignatureRequestEditWithTemplateRequest.JSON_PROPERTY_FILE_URLS, + SignatureRequestEditWithTemplateRequest.JSON_PROPERTY_IS_EID, + SignatureRequestEditWithTemplateRequest.JSON_PROPERTY_MESSAGE, + SignatureRequestEditWithTemplateRequest.JSON_PROPERTY_METADATA, + SignatureRequestEditWithTemplateRequest.JSON_PROPERTY_SIGNING_OPTIONS, + SignatureRequestEditWithTemplateRequest.JSON_PROPERTY_SIGNING_REDIRECT_URL, + SignatureRequestEditWithTemplateRequest.JSON_PROPERTY_SUBJECT, + SignatureRequestEditWithTemplateRequest.JSON_PROPERTY_TEST_MODE, + SignatureRequestEditWithTemplateRequest.JSON_PROPERTY_TITLE +}) +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.8.0") +@JsonIgnoreProperties(ignoreUnknown = true) +public class SignatureRequestEditWithTemplateRequest { + public static final String JSON_PROPERTY_TEMPLATE_IDS = "template_ids"; + private List templateIds = new ArrayList<>(); + + public static final String JSON_PROPERTY_SIGNERS = "signers"; + private List signers = new ArrayList<>(); + + public static final String JSON_PROPERTY_ALLOW_DECLINE = "allow_decline"; + private Boolean allowDecline = false; + + public static final String JSON_PROPERTY_CCS = "ccs"; + private List ccs = null; + + public static final String JSON_PROPERTY_CLIENT_ID = "client_id"; + private String clientId; + + public static final String JSON_PROPERTY_CUSTOM_FIELDS = "custom_fields"; + private List customFields = null; + + public static final String JSON_PROPERTY_FILES = "files"; + private List files = null; + + public static final String JSON_PROPERTY_FILE_URLS = "file_urls"; + private List fileUrls = null; + + public static final String JSON_PROPERTY_IS_EID = "is_eid"; + private Boolean isEid = false; + + public static final String JSON_PROPERTY_MESSAGE = "message"; + private String message; + + public static final String JSON_PROPERTY_METADATA = "metadata"; + private Map metadata = null; + + public static final String JSON_PROPERTY_SIGNING_OPTIONS = "signing_options"; + private SubSigningOptions signingOptions; + + public static final String JSON_PROPERTY_SIGNING_REDIRECT_URL = "signing_redirect_url"; + private String signingRedirectUrl; + + public static final String JSON_PROPERTY_SUBJECT = "subject"; + private String subject; + + public static final String JSON_PROPERTY_TEST_MODE = "test_mode"; + private Boolean testMode = false; + + public static final String JSON_PROPERTY_TITLE = "title"; + private String title; + + public SignatureRequestEditWithTemplateRequest() {} + + /** + * Attempt to instantiate and hydrate a new instance of this class + * + * @param jsonData String of JSON data representing target object + */ + public static SignatureRequestEditWithTemplateRequest init(String jsonData) throws Exception { + return new ObjectMapper() + .readValue(jsonData, SignatureRequestEditWithTemplateRequest.class); + } + + public static SignatureRequestEditWithTemplateRequest init(HashMap data) throws Exception { + return new ObjectMapper() + .readValue( + new ObjectMapper().writeValueAsString(data), + SignatureRequestEditWithTemplateRequest.class); + } + + public SignatureRequestEditWithTemplateRequest templateIds(List templateIds) { + this.templateIds = templateIds; + return this; + } + + public SignatureRequestEditWithTemplateRequest addTemplateIdsItem(String templateIdsItem) { + if (this.templateIds == null) { + this.templateIds = new ArrayList<>(); + } + this.templateIds.add(templateIdsItem); + return this; + } + + /** + * Use `template_ids` to create a SignatureRequest from one or more templates, in the + * order in which the template will be used. + * + * @return templateIds + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_TEMPLATE_IDS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public List getTemplateIds() { + return templateIds; + } + + @JsonProperty(JSON_PROPERTY_TEMPLATE_IDS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setTemplateIds(List templateIds) { + this.templateIds = templateIds; + } + + public SignatureRequestEditWithTemplateRequest signers( + List signers) { + this.signers = signers; + return this; + } + + public SignatureRequestEditWithTemplateRequest addSignersItem( + SubSignatureRequestTemplateSigner signersItem) { + if (this.signers == null) { + this.signers = new ArrayList<>(); + } + this.signers.add(signersItem); + return this; + } + + /** + * Add Signers to your Templated-based Signature Request. + * + * @return signers + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_SIGNERS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public List getSigners() { + return signers; + } + + @JsonProperty(JSON_PROPERTY_SIGNERS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setSigners(List signers) { + this.signers = signers; + } + + public SignatureRequestEditWithTemplateRequest allowDecline(Boolean allowDecline) { + this.allowDecline = allowDecline; + return this; + } + + /** + * Allows signers to decline to sign a document if `true`. Defaults to + * `false`. + * + * @return allowDecline + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ALLOW_DECLINE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getAllowDecline() { + return allowDecline; + } + + @JsonProperty(JSON_PROPERTY_ALLOW_DECLINE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAllowDecline(Boolean allowDecline) { + this.allowDecline = allowDecline; + } + + public SignatureRequestEditWithTemplateRequest ccs(List ccs) { + this.ccs = ccs; + return this; + } + + public SignatureRequestEditWithTemplateRequest addCcsItem(SubCC ccsItem) { + if (this.ccs == null) { + this.ccs = new ArrayList<>(); + } + this.ccs.add(ccsItem); + return this; + } + + /** + * Add CC email recipients. Required when a CC role exists for the Template. + * + * @return ccs + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_CCS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getCcs() { + return ccs; + } + + @JsonProperty(JSON_PROPERTY_CCS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCcs(List ccs) { + this.ccs = ccs; + } + + public SignatureRequestEditWithTemplateRequest clientId(String clientId) { + this.clientId = clientId; + return this; + } + + /** + * Client id of the app to associate with the signature request. Used to apply the branding and + * callback url defined for the app. + * + * @return clientId + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_CLIENT_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getClientId() { + return clientId; + } + + @JsonProperty(JSON_PROPERTY_CLIENT_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setClientId(String clientId) { + this.clientId = clientId; + } + + public SignatureRequestEditWithTemplateRequest customFields(List customFields) { + this.customFields = customFields; + return this; + } + + public SignatureRequestEditWithTemplateRequest addCustomFieldsItem( + SubCustomField customFieldsItem) { + if (this.customFields == null) { + this.customFields = new ArrayList<>(); + } + this.customFields.add(customFieldsItem); + return this; + } + + /** + * An array defining values and options for custom fields. Required when a custom field exists + * in the Template. + * + * @return customFields + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_CUSTOM_FIELDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getCustomFields() { + return customFields; + } + + @JsonProperty(JSON_PROPERTY_CUSTOM_FIELDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCustomFields(List customFields) { + this.customFields = customFields; + } + + public SignatureRequestEditWithTemplateRequest files(List files) { + this.files = files; + return this; + } + + public SignatureRequestEditWithTemplateRequest addFilesItem(File filesItem) { + if (this.files == null) { + this.files = new ArrayList<>(); + } + this.files.add(filesItem); + return this; + } + + /** + * Use `files[]` to indicate the uploaded file(s) to send for signature. This endpoint + * requires either **files** or **file_urls[]**, but not both. + * + * @return files + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_FILES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getFiles() { + return files; + } + + @JsonProperty(JSON_PROPERTY_FILES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setFiles(List files) { + this.files = files; + } + + public SignatureRequestEditWithTemplateRequest fileUrls(List fileUrls) { + this.fileUrls = fileUrls; + return this; + } + + public SignatureRequestEditWithTemplateRequest addFileUrlsItem(String fileUrlsItem) { + if (this.fileUrls == null) { + this.fileUrls = new ArrayList<>(); + } + this.fileUrls.add(fileUrlsItem); + return this; + } + + /** + * Use `file_urls[]` to have Dropbox Sign download the file(s) to send for signature. + * This endpoint requires either **files** or **file_urls[]**, but not both. + * + * @return fileUrls + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_FILE_URLS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getFileUrls() { + return fileUrls; + } + + @JsonProperty(JSON_PROPERTY_FILE_URLS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setFileUrls(List fileUrls) { + this.fileUrls = fileUrls; + } + + public SignatureRequestEditWithTemplateRequest isEid(Boolean isEid) { + this.isEid = isEid; + return this; + } + + /** + * Send with a value of `true` if you wish to enable [electronic identification + * (eID)](https://www.hellosign.com/features/electronic-id), which requires the signer to verify + * their identity with an eID provider to sign a document.<br> **NOTE:** eID is only + * available on the Premium API plan. Cannot be used in `test_mode`. Only works on + * requests with one signer. + * + * @return isEid + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_IS_EID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getIsEid() { + return isEid; + } + + @JsonProperty(JSON_PROPERTY_IS_EID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIsEid(Boolean isEid) { + this.isEid = isEid; + } + + public SignatureRequestEditWithTemplateRequest message(String message) { + this.message = message; + return this; + } + + /** + * The custom message in the email that will be sent to the signers. + * + * @return message + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_MESSAGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getMessage() { + return message; + } + + @JsonProperty(JSON_PROPERTY_MESSAGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMessage(String message) { + this.message = message; + } + + public SignatureRequestEditWithTemplateRequest metadata(Map metadata) { + this.metadata = metadata; + return this; + } + + public SignatureRequestEditWithTemplateRequest putMetadataItem( + String key, Object metadataItem) { + if (this.metadata == null) { + this.metadata = new HashMap<>(); + } + this.metadata.put(key, metadataItem); + return this; + } + + /** + * Key-value data that should be attached to the signature request. This metadata is included in + * all API responses and events involving the signature request. For example, use the metadata + * field to store a signer's order number for look up when receiving events for the + * signature request. Each request can include up to 10 metadata keys (or 50 nested metadata + * keys), with key names up to 40 characters long and values up to 1000 characters long. + * + * @return metadata + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_METADATA) + @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) + public Map getMetadata() { + return metadata; + } + + @JsonProperty(JSON_PROPERTY_METADATA) + @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) + public void setMetadata(Map metadata) { + this.metadata = metadata; + } + + public SignatureRequestEditWithTemplateRequest signingOptions( + SubSigningOptions signingOptions) { + this.signingOptions = signingOptions; + return this; + } + + /** + * Get signingOptions + * + * @return signingOptions + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_SIGNING_OPTIONS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public SubSigningOptions getSigningOptions() { + return signingOptions; + } + + @JsonProperty(JSON_PROPERTY_SIGNING_OPTIONS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSigningOptions(SubSigningOptions signingOptions) { + this.signingOptions = signingOptions; + } + + public SignatureRequestEditWithTemplateRequest signingRedirectUrl(String signingRedirectUrl) { + this.signingRedirectUrl = signingRedirectUrl; + return this; + } + + /** + * The URL you want signers redirected to after they successfully sign. + * + * @return signingRedirectUrl + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_SIGNING_REDIRECT_URL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getSigningRedirectUrl() { + return signingRedirectUrl; + } + + @JsonProperty(JSON_PROPERTY_SIGNING_REDIRECT_URL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSigningRedirectUrl(String signingRedirectUrl) { + this.signingRedirectUrl = signingRedirectUrl; + } + + public SignatureRequestEditWithTemplateRequest subject(String subject) { + this.subject = subject; + return this; + } + + /** + * The subject in the email that will be sent to the signers. + * + * @return subject + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_SUBJECT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getSubject() { + return subject; + } + + @JsonProperty(JSON_PROPERTY_SUBJECT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSubject(String subject) { + this.subject = subject; + } + + public SignatureRequestEditWithTemplateRequest testMode(Boolean testMode) { + this.testMode = testMode; + return this; + } + + /** + * Whether this is a test, the signature request will not be legally binding if set to + * `true`. Defaults to `false`. + * + * @return testMode + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_TEST_MODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getTestMode() { + return testMode; + } + + @JsonProperty(JSON_PROPERTY_TEST_MODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTestMode(Boolean testMode) { + this.testMode = testMode; + } + + public SignatureRequestEditWithTemplateRequest title(String title) { + this.title = title; + return this; + } + + /** + * The title you want to assign to the SignatureRequest. + * + * @return title + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_TITLE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getTitle() { + return title; + } + + @JsonProperty(JSON_PROPERTY_TITLE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTitle(String title) { + this.title = title; + } + + /** Return true if this SignatureRequestEditWithTemplateRequest object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SignatureRequestEditWithTemplateRequest signatureRequestEditWithTemplateRequest = + (SignatureRequestEditWithTemplateRequest) o; + return Objects.equals(this.templateIds, signatureRequestEditWithTemplateRequest.templateIds) + && Objects.equals(this.signers, signatureRequestEditWithTemplateRequest.signers) + && Objects.equals( + this.allowDecline, signatureRequestEditWithTemplateRequest.allowDecline) + && Objects.equals(this.ccs, signatureRequestEditWithTemplateRequest.ccs) + && Objects.equals(this.clientId, signatureRequestEditWithTemplateRequest.clientId) + && Objects.equals( + this.customFields, signatureRequestEditWithTemplateRequest.customFields) + && Objects.equals(this.files, signatureRequestEditWithTemplateRequest.files) + && Objects.equals(this.fileUrls, signatureRequestEditWithTemplateRequest.fileUrls) + && Objects.equals(this.isEid, signatureRequestEditWithTemplateRequest.isEid) + && Objects.equals(this.message, signatureRequestEditWithTemplateRequest.message) + && Objects.equals(this.metadata, signatureRequestEditWithTemplateRequest.metadata) + && Objects.equals( + this.signingOptions, signatureRequestEditWithTemplateRequest.signingOptions) + && Objects.equals( + this.signingRedirectUrl, + signatureRequestEditWithTemplateRequest.signingRedirectUrl) + && Objects.equals(this.subject, signatureRequestEditWithTemplateRequest.subject) + && Objects.equals(this.testMode, signatureRequestEditWithTemplateRequest.testMode) + && Objects.equals(this.title, signatureRequestEditWithTemplateRequest.title); + } + + @Override + public int hashCode() { + return Objects.hash( + templateIds, + signers, + allowDecline, + ccs, + clientId, + customFields, + files, + fileUrls, + isEid, + message, + metadata, + signingOptions, + signingRedirectUrl, + subject, + testMode, + title); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SignatureRequestEditWithTemplateRequest {\n"); + sb.append(" templateIds: ").append(toIndentedString(templateIds)).append("\n"); + sb.append(" signers: ").append(toIndentedString(signers)).append("\n"); + sb.append(" allowDecline: ").append(toIndentedString(allowDecline)).append("\n"); + sb.append(" ccs: ").append(toIndentedString(ccs)).append("\n"); + sb.append(" clientId: ").append(toIndentedString(clientId)).append("\n"); + sb.append(" customFields: ").append(toIndentedString(customFields)).append("\n"); + sb.append(" files: ").append(toIndentedString(files)).append("\n"); + sb.append(" fileUrls: ").append(toIndentedString(fileUrls)).append("\n"); + sb.append(" isEid: ").append(toIndentedString(isEid)).append("\n"); + sb.append(" message: ").append(toIndentedString(message)).append("\n"); + sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); + sb.append(" signingOptions: ").append(toIndentedString(signingOptions)).append("\n"); + sb.append(" signingRedirectUrl: ") + .append(toIndentedString(signingRedirectUrl)) + .append("\n"); + 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("}"); + return sb.toString(); + } + + public Map createFormData() throws ApiException { + Map map = new HashMap<>(); + boolean fileTypeFound = false; + try { + if (templateIds != null) { + if (isFileTypeOrListOfFiles(templateIds)) { + fileTypeFound = true; + } + + if (templateIds.getClass().equals(java.io.File.class) + || templateIds.getClass().equals(Integer.class) + || templateIds.getClass().equals(String.class) + || templateIds.getClass().isEnum()) { + map.put("template_ids", templateIds); + } else if (isListOfFile(templateIds)) { + for (int i = 0; i < getListSize(templateIds); i++) { + map.put("template_ids[" + i + "]", getFromList(templateIds, i)); + } + } else { + map.put( + "template_ids", + JSON.getDefault().getMapper().writeValueAsString(templateIds)); + } + } + if (signers != null) { + if (isFileTypeOrListOfFiles(signers)) { + fileTypeFound = true; + } + + if (signers.getClass().equals(java.io.File.class) + || signers.getClass().equals(Integer.class) + || signers.getClass().equals(String.class) + || signers.getClass().isEnum()) { + map.put("signers", signers); + } else if (isListOfFile(signers)) { + for (int i = 0; i < getListSize(signers); i++) { + map.put("signers[" + i + "]", getFromList(signers, i)); + } + } else { + map.put("signers", JSON.getDefault().getMapper().writeValueAsString(signers)); + } + } + if (allowDecline != null) { + if (isFileTypeOrListOfFiles(allowDecline)) { + fileTypeFound = true; + } + + if (allowDecline.getClass().equals(java.io.File.class) + || allowDecline.getClass().equals(Integer.class) + || allowDecline.getClass().equals(String.class) + || allowDecline.getClass().isEnum()) { + map.put("allow_decline", allowDecline); + } else if (isListOfFile(allowDecline)) { + for (int i = 0; i < getListSize(allowDecline); i++) { + map.put("allow_decline[" + i + "]", getFromList(allowDecline, i)); + } + } else { + map.put( + "allow_decline", + JSON.getDefault().getMapper().writeValueAsString(allowDecline)); + } + } + if (ccs != null) { + if (isFileTypeOrListOfFiles(ccs)) { + fileTypeFound = true; + } + + if (ccs.getClass().equals(java.io.File.class) + || ccs.getClass().equals(Integer.class) + || ccs.getClass().equals(String.class) + || ccs.getClass().isEnum()) { + map.put("ccs", ccs); + } else if (isListOfFile(ccs)) { + for (int i = 0; i < getListSize(ccs); i++) { + map.put("ccs[" + i + "]", getFromList(ccs, i)); + } + } else { + map.put("ccs", JSON.getDefault().getMapper().writeValueAsString(ccs)); + } + } + if (clientId != null) { + if (isFileTypeOrListOfFiles(clientId)) { + fileTypeFound = true; + } + + if (clientId.getClass().equals(java.io.File.class) + || clientId.getClass().equals(Integer.class) + || clientId.getClass().equals(String.class) + || clientId.getClass().isEnum()) { + map.put("client_id", clientId); + } else if (isListOfFile(clientId)) { + for (int i = 0; i < getListSize(clientId); i++) { + map.put("client_id[" + i + "]", getFromList(clientId, i)); + } + } else { + map.put( + "client_id", + JSON.getDefault().getMapper().writeValueAsString(clientId)); + } + } + if (customFields != null) { + if (isFileTypeOrListOfFiles(customFields)) { + fileTypeFound = true; + } + + if (customFields.getClass().equals(java.io.File.class) + || customFields.getClass().equals(Integer.class) + || customFields.getClass().equals(String.class) + || customFields.getClass().isEnum()) { + map.put("custom_fields", customFields); + } else if (isListOfFile(customFields)) { + for (int i = 0; i < getListSize(customFields); i++) { + map.put("custom_fields[" + i + "]", getFromList(customFields, i)); + } + } else { + map.put( + "custom_fields", + JSON.getDefault().getMapper().writeValueAsString(customFields)); + } + } + if (files != null) { + if (isFileTypeOrListOfFiles(files)) { + fileTypeFound = true; + } + + if (files.getClass().equals(java.io.File.class) + || files.getClass().equals(Integer.class) + || files.getClass().equals(String.class) + || files.getClass().isEnum()) { + map.put("files", files); + } else if (isListOfFile(files)) { + for (int i = 0; i < getListSize(files); i++) { + map.put("files[" + i + "]", getFromList(files, i)); + } + } else { + map.put("files", JSON.getDefault().getMapper().writeValueAsString(files)); + } + } + if (fileUrls != null) { + if (isFileTypeOrListOfFiles(fileUrls)) { + fileTypeFound = true; + } + + if (fileUrls.getClass().equals(java.io.File.class) + || fileUrls.getClass().equals(Integer.class) + || fileUrls.getClass().equals(String.class) + || fileUrls.getClass().isEnum()) { + map.put("file_urls", fileUrls); + } else if (isListOfFile(fileUrls)) { + for (int i = 0; i < getListSize(fileUrls); i++) { + map.put("file_urls[" + i + "]", getFromList(fileUrls, i)); + } + } else { + map.put( + "file_urls", + JSON.getDefault().getMapper().writeValueAsString(fileUrls)); + } + } + if (isEid != null) { + if (isFileTypeOrListOfFiles(isEid)) { + fileTypeFound = true; + } + + if (isEid.getClass().equals(java.io.File.class) + || isEid.getClass().equals(Integer.class) + || isEid.getClass().equals(String.class) + || isEid.getClass().isEnum()) { + map.put("is_eid", isEid); + } else if (isListOfFile(isEid)) { + for (int i = 0; i < getListSize(isEid); i++) { + map.put("is_eid[" + i + "]", getFromList(isEid, i)); + } + } else { + map.put("is_eid", JSON.getDefault().getMapper().writeValueAsString(isEid)); + } + } + if (message != null) { + if (isFileTypeOrListOfFiles(message)) { + fileTypeFound = true; + } + + if (message.getClass().equals(java.io.File.class) + || message.getClass().equals(Integer.class) + || message.getClass().equals(String.class) + || message.getClass().isEnum()) { + map.put("message", message); + } else if (isListOfFile(message)) { + for (int i = 0; i < getListSize(message); i++) { + map.put("message[" + i + "]", getFromList(message, i)); + } + } else { + map.put("message", JSON.getDefault().getMapper().writeValueAsString(message)); + } + } + if (metadata != null) { + if (isFileTypeOrListOfFiles(metadata)) { + fileTypeFound = true; + } + + if (metadata.getClass().equals(java.io.File.class) + || metadata.getClass().equals(Integer.class) + || metadata.getClass().equals(String.class) + || metadata.getClass().isEnum()) { + map.put("metadata", metadata); + } else if (isListOfFile(metadata)) { + for (int i = 0; i < getListSize(metadata); i++) { + map.put("metadata[" + i + "]", getFromList(metadata, i)); + } + } else { + map.put("metadata", JSON.getDefault().getMapper().writeValueAsString(metadata)); + } + } + if (signingOptions != null) { + if (isFileTypeOrListOfFiles(signingOptions)) { + fileTypeFound = true; + } + + if (signingOptions.getClass().equals(java.io.File.class) + || signingOptions.getClass().equals(Integer.class) + || signingOptions.getClass().equals(String.class) + || signingOptions.getClass().isEnum()) { + map.put("signing_options", signingOptions); + } else if (isListOfFile(signingOptions)) { + for (int i = 0; i < getListSize(signingOptions); i++) { + map.put("signing_options[" + i + "]", getFromList(signingOptions, i)); + } + } else { + map.put( + "signing_options", + JSON.getDefault().getMapper().writeValueAsString(signingOptions)); + } + } + if (signingRedirectUrl != null) { + if (isFileTypeOrListOfFiles(signingRedirectUrl)) { + fileTypeFound = true; + } + + if (signingRedirectUrl.getClass().equals(java.io.File.class) + || signingRedirectUrl.getClass().equals(Integer.class) + || signingRedirectUrl.getClass().equals(String.class) + || signingRedirectUrl.getClass().isEnum()) { + map.put("signing_redirect_url", signingRedirectUrl); + } else if (isListOfFile(signingRedirectUrl)) { + for (int i = 0; i < getListSize(signingRedirectUrl); i++) { + map.put( + "signing_redirect_url[" + i + "]", + getFromList(signingRedirectUrl, i)); + } + } else { + map.put( + "signing_redirect_url", + JSON.getDefault().getMapper().writeValueAsString(signingRedirectUrl)); + } + } + if (subject != null) { + if (isFileTypeOrListOfFiles(subject)) { + fileTypeFound = true; + } + + if (subject.getClass().equals(java.io.File.class) + || subject.getClass().equals(Integer.class) + || subject.getClass().equals(String.class) + || subject.getClass().isEnum()) { + map.put("subject", subject); + } else if (isListOfFile(subject)) { + for (int i = 0; i < getListSize(subject); i++) { + map.put("subject[" + i + "]", getFromList(subject, i)); + } + } else { + map.put("subject", JSON.getDefault().getMapper().writeValueAsString(subject)); + } + } + if (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 (title != null) { + if (isFileTypeOrListOfFiles(title)) { + fileTypeFound = true; + } + + if (title.getClass().equals(java.io.File.class) + || title.getClass().equals(Integer.class) + || title.getClass().equals(String.class) + || title.getClass().isEnum()) { + map.put("title", title); + } else if (isListOfFile(title)) { + for (int i = 0; i < getListSize(title); i++) { + map.put("title[" + i + "]", getFromList(title, i)); + } + } else { + map.put("title", JSON.getDefault().getMapper().writeValueAsString(title)); + } + } + } catch (Exception e) { + throw new ApiException(e); + } + + return fileTypeFound ? map : new HashMap<>(); + } + + private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { + return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); + } + + private boolean isListOfFile(Object obj) throws Exception { + return obj instanceof java.util.List + && !isListEmpty(obj) + && getFromList(obj, 0) instanceof java.io.File; + } + + private boolean isListEmpty(Object obj) throws Exception { + return (boolean) + Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); + } + + private Object getFromList(Object obj, int index) throws Exception { + return Class.forName(java.util.List.class.getName()) + .getMethod("get", int.class) + .invoke(obj, index); + } + + private int getListSize(Object obj) throws Exception { + return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/sdks/java-v2/README.md b/sdks/java-v2/README.md index c012f8fdb..af3ac5223 100644 --- a/sdks/java-v2/README.md +++ b/sdks/java-v2/README.md @@ -173,6 +173,10 @@ Class | Method | HTTP request | Description *SignatureRequestApi* | [**signatureRequestCancel**](docs/SignatureRequestApi.md#signatureRequestCancel) | **POST** /signature_request/cancel/{signature_request_id} | Cancel Incomplete Signature Request *SignatureRequestApi* | [**signatureRequestCreateEmbedded**](docs/SignatureRequestApi.md#signatureRequestCreateEmbedded) | **POST** /signature_request/create_embedded | Create Embedded Signature Request *SignatureRequestApi* | [**signatureRequestCreateEmbeddedWithTemplate**](docs/SignatureRequestApi.md#signatureRequestCreateEmbeddedWithTemplate) | **POST** /signature_request/create_embedded_with_template | Create Embedded Signature Request with Template +*SignatureRequestApi* | [**signatureRequestEdit**](docs/SignatureRequestApi.md#signatureRequestEdit) | **PUT** /signature_request/edit/{signature_request_id} | Edit Signature Request +*SignatureRequestApi* | [**signatureRequestEditEmbedded**](docs/SignatureRequestApi.md#signatureRequestEditEmbedded) | **PUT** /signature_request/edit_embedded/{signature_request_id} | Edit Embedded Signature Request +*SignatureRequestApi* | [**signatureRequestEditEmbeddedWithTemplate**](docs/SignatureRequestApi.md#signatureRequestEditEmbeddedWithTemplate) | **PUT** /signature_request/edit_embedded_with_template/{signature_request_id} | Edit Embedded Signature Request with Template +*SignatureRequestApi* | [**signatureRequestEditWithTemplate**](docs/SignatureRequestApi.md#signatureRequestEditWithTemplate) | **PUT** /signature_request/edit_with_template/{signature_request_id} | Edit Signature Request With Template *SignatureRequestApi* | [**signatureRequestFiles**](docs/SignatureRequestApi.md#signatureRequestFiles) | **GET** /signature_request/files/{signature_request_id} | Download Files *SignatureRequestApi* | [**signatureRequestFilesAsDataUri**](docs/SignatureRequestApi.md#signatureRequestFilesAsDataUri) | **GET** /signature_request/files_as_data_uri/{signature_request_id} | Download Files as Data Uri *SignatureRequestApi* | [**signatureRequestFilesAsFileUrl**](docs/SignatureRequestApi.md#signatureRequestFilesAsFileUrl) | **GET** /signature_request/files_as_file_url/{signature_request_id} | Download Files as File Url @@ -276,6 +280,10 @@ Class | Method | HTTP request | Description - [SignatureRequestBulkSendWithTemplateRequest](docs/SignatureRequestBulkSendWithTemplateRequest.md) - [SignatureRequestCreateEmbeddedRequest](docs/SignatureRequestCreateEmbeddedRequest.md) - [SignatureRequestCreateEmbeddedWithTemplateRequest](docs/SignatureRequestCreateEmbeddedWithTemplateRequest.md) + - [SignatureRequestEditEmbeddedRequest](docs/SignatureRequestEditEmbeddedRequest.md) + - [SignatureRequestEditEmbeddedWithTemplateRequest](docs/SignatureRequestEditEmbeddedWithTemplateRequest.md) + - [SignatureRequestEditRequest](docs/SignatureRequestEditRequest.md) + - [SignatureRequestEditWithTemplateRequest](docs/SignatureRequestEditWithTemplateRequest.md) - [SignatureRequestGetResponse](docs/SignatureRequestGetResponse.md) - [SignatureRequestListResponse](docs/SignatureRequestListResponse.md) - [SignatureRequestRemindRequest](docs/SignatureRequestRemindRequest.md) diff --git a/sdks/java-v2/docs/SignatureRequestApi.md b/sdks/java-v2/docs/SignatureRequestApi.md index 60e02426f..4a9a22b75 100644 --- a/sdks/java-v2/docs/SignatureRequestApi.md +++ b/sdks/java-v2/docs/SignatureRequestApi.md @@ -9,6 +9,10 @@ All URIs are relative to *https://api.hellosign.com/v3* [**signatureRequestCancel**](SignatureRequestApi.md#signatureRequestCancel) | **POST** /signature_request/cancel/{signature_request_id} | Cancel Incomplete Signature Request [**signatureRequestCreateEmbedded**](SignatureRequestApi.md#signatureRequestCreateEmbedded) | **POST** /signature_request/create_embedded | Create Embedded Signature Request [**signatureRequestCreateEmbeddedWithTemplate**](SignatureRequestApi.md#signatureRequestCreateEmbeddedWithTemplate) | **POST** /signature_request/create_embedded_with_template | Create Embedded Signature Request with Template +[**signatureRequestEdit**](SignatureRequestApi.md#signatureRequestEdit) | **PUT** /signature_request/edit/{signature_request_id} | Edit Signature Request +[**signatureRequestEditEmbedded**](SignatureRequestApi.md#signatureRequestEditEmbedded) | **PUT** /signature_request/edit_embedded/{signature_request_id} | Edit Embedded Signature Request +[**signatureRequestEditEmbeddedWithTemplate**](SignatureRequestApi.md#signatureRequestEditEmbeddedWithTemplate) | **PUT** /signature_request/edit_embedded_with_template/{signature_request_id} | Edit Embedded Signature Request with Template +[**signatureRequestEditWithTemplate**](SignatureRequestApi.md#signatureRequestEditWithTemplate) | **PUT** /signature_request/edit_with_template/{signature_request_id} | Edit Signature Request With Template [**signatureRequestFiles**](SignatureRequestApi.md#signatureRequestFiles) | **GET** /signature_request/files/{signature_request_id} | Download Files [**signatureRequestFilesAsDataUri**](SignatureRequestApi.md#signatureRequestFilesAsDataUri) | **GET** /signature_request/files_as_data_uri/{signature_request_id} | Download Files as Data Uri [**signatureRequestFilesAsFileUrl**](SignatureRequestApi.md#signatureRequestFilesAsFileUrl) | **GET** /signature_request/files_as_file_url/{signature_request_id} | Download Files as File Url @@ -532,6 +536,442 @@ public class Example { | **4XX** | failed_operation | - | +## signatureRequestEdit + +> SignatureRequestGetResponse signatureRequestEdit(signatureRequestId, signatureRequestEditRequest) + +Edit Signature Request + +Edits and sends a SignatureRequest with the submitted documents. If `form_fields_per_document` is not specified, a signature page will be affixed where all signers will be required to add their signature, signifying their agreement to all contained documents. + +**NOTE:** Edit and resend will not deduct your signature request quota. + +### Example + +```java +import com.dropbox.sign.ApiException; +import com.dropbox.sign.Configuration; +import com.dropbox.sign.api.*; +import com.dropbox.sign.auth.*; +import com.dropbox.sign.model.*; + +import java.io.File; +import java.util.List; +import java.util.Map; + +public class Example { + public static void main(String[] args) { + var apiClient = Configuration.getDefaultApiClient() + .setApiKey("YOUR_API_KEY"); + + // or, configure Bearer (JWT) authorization: oauth2 + /* + var apiClient = Configuration.getDefaultApiClient() + .setBearerToken("YOUR_ACCESS_TOKEN"); + */ + + var signatureRequestApi = new SignatureRequestApi(apiClient); + + var signer1 = new SubSignatureRequestSigner() + .emailAddress("jack@example.com") + .name("Jack") + .order(0); + + var signer2 = new SubSignatureRequestSigner() + .emailAddress("jill@example.com") + .name("Jill") + .order(1); + + var signingOptions = new SubSigningOptions() + .draw(true) + .type(true) + .upload(true) + .phone(true) + .defaultType(SubSigningOptions.DefaultTypeEnum.DRAW); + + var subFieldOptions = new SubFieldOptions() + .dateFormat(SubFieldOptions.DateFormatEnum.DDMMYYYY); + + var signatureRequestId = "2f9781e1a8e2045224d808c153c2e1d3df6f8f2f"; + + var data = new SignatureRequestEditRequest() + .title("NDA with Acme Co.") + .subject("The NDA we talked about") + .message("Please sign this NDA and then we can discuss more. Let me know if you have any questions.") + .signers(List.of(signer1, signer2)) + .ccEmailAddresses(List.of("lawyer1@dropboxsign.com", "lawyer2@dropboxsign.com")) + .addFilesItem(new File("example_signature_request.pdf")) + .metadata(Map.of("custom_id", 1234, "custom_text", "NDA #9")) + .signingOptions(signingOptions) + .fieldOptions(subFieldOptions) + .testMode(true); + + try { + SignatureRequestGetResponse result = signatureRequestApi.signatureRequestEdit(signatureRequestId, data); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling AccountApi#accountCreate"); + 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 | +|------------- | ------------- | ------------- | -------------| + **signatureRequestId** | **String**| The id of the SignatureRequest to edit. | + **signatureRequestEditRequest** | [**SignatureRequestEditRequest**](SignatureRequestEditRequest.md)| | + +### Return type + +[**SignatureRequestGetResponse**](SignatureRequestGetResponse.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 | - | + + +## signatureRequestEditEmbedded + +> SignatureRequestGetResponse signatureRequestEditEmbedded(signatureRequestId, signatureRequestEditEmbeddedRequest) + +Edit Embedded Signature Request + +Edits a SignatureRequest with the submitted documents to be signed in an embedded iFrame. If form_fields_per_document is not specified, a signature page will be affixed where all signers will be required to add their signature, signifying their agreement to all contained documents. Note that embedded signature requests can only be signed in embedded iFrames whereas normal signature requests can only be signed on Dropbox Sign. + +### Example + +```java +import com.dropbox.sign.ApiException; +import com.dropbox.sign.Configuration; +import com.dropbox.sign.api.*; +import com.dropbox.sign.auth.*; +import com.dropbox.sign.model.*; + +import java.io.File; +import java.util.List; + +public class Example { + public static void main(String[] args) { + var apiClient = Configuration.getDefaultApiClient() + .setApiKey("YOUR_API_KEY"); + + // or, configure Bearer (JWT) authorization: oauth2 + /* + var apiClient = Configuration.getDefaultApiClient() + .setBearerToken("YOUR_ACCESS_TOKEN"); + */ + + var signatureRequestApi = new SignatureRequestApi(apiClient); + + var signer1 = new SubSignatureRequestSigner() + .emailAddress("jack@example.com") + .name("Jack") + .order(0); + + var signer2 = new SubSignatureRequestSigner() + .emailAddress("jill@example.com") + .name("Jill") + .order(1); + + var signingOptions = new SubSigningOptions() + .draw(true) + .type(true) + .upload(true) + .phone(true) + .defaultType(SubSigningOptions.DefaultTypeEnum.DRAW); + + var signatureRequestId = "2f9781e1a8e2045224d808c153c2e1d3df6f8f2f"; + + var data = new SignatureRequestEditEmbeddedRequest() + .clientId("ec64a202072370a737edf4a0eb7f4437") + .title("NDA with Acme Co.") + .subject("The NDA we talked about") + .message("Please sign this NDA and then we can discuss more. Let me know if you have any questions.") + .signers(List.of(signer1, signer2)) + .ccEmailAddresses(List.of("lawyer1@dropboxsign.com", "lawyer2@dropboxsign.com")) + .addFilesItem(new File("example_signature_request.pdf")) + .signingOptions(signingOptions) + .testMode(true); + + try { + SignatureRequestGetResponse result = signatureRequestApi.signatureRequestEditEmbedded( + signatureRequestId, + data + ); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling SignatureRequestApi#signatureRequestEditEmbedded"); + 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 | +|------------- | ------------- | ------------- | -------------| + **signatureRequestId** | **String**| The id of the SignatureRequest to edit. | + **signatureRequestEditEmbeddedRequest** | [**SignatureRequestEditEmbeddedRequest**](SignatureRequestEditEmbeddedRequest.md)| | + +### Return type + +[**SignatureRequestGetResponse**](SignatureRequestGetResponse.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 | - | + + +## signatureRequestEditEmbeddedWithTemplate + +> SignatureRequestGetResponse signatureRequestEditEmbeddedWithTemplate(signatureRequestId, signatureRequestEditEmbeddedWithTemplateRequest) + +Edit Embedded Signature Request with Template + +Edits a SignatureRequest based on the given Template(s) to be signed in an embedded iFrame. Note that embedded signature requests can only be signed in embedded iFrames whereas normal signature requests can only be signed on Dropbox Sign. + +### Example + +```java +import com.dropbox.sign.ApiException; +import com.dropbox.sign.Configuration; +import com.dropbox.sign.api.*; +import com.dropbox.sign.auth.*; +import com.dropbox.sign.model.*; + +import java.util.List; + +public class Example { + public static void main(String[] args) { + var apiClient = Configuration.getDefaultApiClient() + .setApiKey("YOUR_API_KEY"); + + // or, configure Bearer (JWT) authorization: oauth2 + /* + var apiClient = Configuration.getDefaultApiClient() + .setBearerToken("YOUR_ACCESS_TOKEN"); + */ + + var signatureRequestApi = new SignatureRequestApi(apiClient); + + var signer1 = new SubSignatureRequestTemplateSigner() + .role("Client") + .name("George"); + + var subSigningOptions = new SubSigningOptions() + .draw(true) + .type(true) + .upload(true) + .phone(false) + .defaultType(SubSigningOptions.DefaultTypeEnum.DRAW); + + var signatureRequestId = "2f9781e1a8e2045224d808c153c2e1d3df6f8f2f"; + + var data = new SignatureRequestEditEmbeddedWithTemplateRequest() + .clientId("ec64a202072370a737edf4a0eb7f4437") + .templateIds(List.of("c26b8a16784a872da37ea946b9ddec7c1e11dff6")) + .subject("Purchase Order") + .message("Glad we could come to an agreement.") + .signers(List.of(signer1)) + .signingOptions(subSigningOptions) + .testMode(true); + + try { + SignatureRequestGetResponse result = signatureRequestApi.signatureRequestEditEmbeddedWithTemplate( + signatureRequestId, + data + ); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling SignatureRequestApi#editEmbeddedWithTemplate"); + 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 | +|------------- | ------------- | ------------- | -------------| + **signatureRequestId** | **String**| The id of the SignatureRequest to edit. | + **signatureRequestEditEmbeddedWithTemplateRequest** | [**SignatureRequestEditEmbeddedWithTemplateRequest**](SignatureRequestEditEmbeddedWithTemplateRequest.md)| | + +### Return type + +[**SignatureRequestGetResponse**](SignatureRequestGetResponse.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 | - | + + +## signatureRequestEditWithTemplate + +> SignatureRequestGetResponse signatureRequestEditWithTemplate(signatureRequestId, signatureRequestEditWithTemplateRequest) + +Edit Signature Request With Template + +Edits and sends a SignatureRequest based off of the Template(s) specified with the template_ids parameter. + +**NOTE:** Edit and resend will not deduct your signature request quota. + +### Example + +```java +import com.dropbox.sign.ApiException; +import com.dropbox.sign.Configuration; +import com.dropbox.sign.api.*; +import com.dropbox.sign.auth.*; +import com.dropbox.sign.model.*; + +import java.util.List; + +public class Example { + public static void main(String[] args) { + var apiClient = Configuration.getDefaultApiClient() + .setApiKey("YOUR_API_KEY"); + + // or, configure Bearer (JWT) authorization: oauth2 + /* + var apiClient = Configuration.getDefaultApiClient() + .setBearerToken("YOUR_ACCESS_TOKEN"); + */ + + var signatureRequestApi = new SignatureRequestApi(apiClient); + + var signer1 = new SubSignatureRequestTemplateSigner() + .role("Client") + .emailAddress("george@example.com") + .name("George"); + + var cc1 = new SubCC() + .role("Accounting") + .emailAddress("accouting@emaple.com"); + + var customField1 = new SubCustomField() + .name("Cost") + .value("$20,000") + .editor("Client") + .required(true); + + var signingOptions = new SubSigningOptions() + .draw(true) + .type(true) + .upload(true) + .phone(false) + .defaultType(SubSigningOptions.DefaultTypeEnum.DRAW); + + var signatureRequestId = "2f9781e1a8e2045224d808c153c2e1d3df6f8f2f"; + + var data = new SignatureRequestEditWithTemplateRequest() + .templateIds(List.of("c26b8a16784a872da37ea946b9ddec7c1e11dff6")) + .subject("Purchase Order") + .message("Glad we could come to an agreement.") + .signers(List.of(signer1)) + .ccs(List.of(cc1)) + .customFields(List.of(customField1)) + .signingOptions(signingOptions) + .testMode(true); + + try { + SignatureRequestGetResponse result = signatureRequestApi.signatureRequestEditWithTemplate( + signatureRequestId, + data + ); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling AccountApi#accountCreate"); + 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 | +|------------- | ------------- | ------------- | -------------| + **signatureRequestId** | **String**| The id of the SignatureRequest to edit. | + **signatureRequestEditWithTemplateRequest** | [**SignatureRequestEditWithTemplateRequest**](SignatureRequestEditWithTemplateRequest.md)| | + +### Return type + +[**SignatureRequestGetResponse**](SignatureRequestGetResponse.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 | - | + + ## signatureRequestFiles > File signatureRequestFiles(signatureRequestId, fileType) diff --git a/sdks/java-v2/docs/SignatureRequestEditEmbeddedRequest.md b/sdks/java-v2/docs/SignatureRequestEditEmbeddedRequest.md new file mode 100644 index 000000000..dd8b06061 --- /dev/null +++ b/sdks/java-v2/docs/SignatureRequestEditEmbeddedRequest.md @@ -0,0 +1,37 @@ + + +# SignatureRequestEditEmbeddedRequest + + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +| `clientId`*_required_ | ```String``` | Client id of the app you're using to create this embedded signature request. Used for security purposes. | | +| `files` | ```List``` | Use `files[]` to indicate the uploaded file(s) to send for signature.

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

This endpoint requires either **files** or **file_urls[]**, but not both. | | +| `signers` | [```List```](SubSignatureRequestSigner.md) | Add Signers to your Signature Request.

This endpoint requires either **signers** or **grouped_signers**, but not both. | | +| `groupedSigners` | [```List```](SubSignatureRequestGroupedSigners.md) | Add Grouped Signers to your Signature Request.

This endpoint requires either **signers** or **grouped_signers**, but not both. | | +| `allowDecline` | ```Boolean``` | Allows signers to decline to sign a document if `true`. Defaults to `false`. | | +| `allowReassign` | ```Boolean``` | Allows signers to reassign their signature requests to other signers if set to `true`. Defaults to `false`.

**NOTE:** Only available for Premium plan. | | +| `attachments` | [```List```](SubAttachment.md) | A list describing the attachments | | +| `ccEmailAddresses` | ```List``` | The email addresses that should be CCed. | | +| `customFields` | [```List```](SubCustomField.md) | When used together with merge fields, `custom_fields` allows users to add pre-filled data to their signature requests.

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

For using pre-filled on repeatable signature requests, merge fields are added to templates in the Dropbox Sign UI or by calling [/template/create_embedded_draft](/api/reference/operation/templateCreateEmbeddedDraft) and then passing `custom_fields` on subsequent signature requests referencing that template. | | +| `fieldOptions` | [```SubFieldOptions```](SubFieldOptions.md) | | | +| `formFieldGroups` | [```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`. | | +| `formFieldRules` | [```List```](SubFormFieldRule.md) | Conditional Logic rules for fields defined in `form_fields_per_document`. | | +| `formFieldsPerDocument` | [```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` | | +| `hideTextTags` | ```Boolean``` | Enables automatic Text Tag removal when set to true.

**NOTE:** Removing text tags this way can cause unwanted clipping. We recommend leaving this setting on `false` and instead hiding your text tags using white text or a similar approach. See the [Text Tags Walkthrough](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) for more information. | | +| `message` | ```String``` | The custom message in the email that will be sent to the signers. | | +| `metadata` | ```Map``` | Key-value data that should be attached to the signature request. This metadata is included in all API responses and events involving the signature request. For example, use the metadata field to store a signer's order number for look up when receiving events for the signature request.

Each request can include up to 10 metadata keys (or 50 nested metadata keys), with key names up to 40 characters long and values up to 1000 characters long. | | +| `signingOptions` | [```SubSigningOptions```](SubSigningOptions.md) | | | +| `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. | | +| `useTextTags` | ```Boolean``` | Send with a value of `true` if you wish to enable [Text Tags](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) parsing in your document. Defaults to disabled, or `false`. | | +| `populateAutoFillFields` | ```Boolean``` | Controls whether [auto fill fields](https://faq.hellosign.com/hc/en-us/articles/360051467511-Auto-Fill-Fields) can automatically populate a signer's information during signing.

**NOTE:** Keep your signer's information safe by ensuring that the _signer on your signature request is the intended party_ before using this feature. | | +| `expiresAt` | ```Integer``` | When the signature request will expire. Unsigned signatures will be moved to the expired status, and no longer signable. See [Signature Request Expiration Date](https://developers.hellosign.com/docs/signature-request/expiration/) for details. | | + + + diff --git a/sdks/java-v2/docs/SignatureRequestEditEmbeddedWithTemplateRequest.md b/sdks/java-v2/docs/SignatureRequestEditEmbeddedWithTemplateRequest.md new file mode 100644 index 000000000..3cc3dee72 --- /dev/null +++ b/sdks/java-v2/docs/SignatureRequestEditEmbeddedWithTemplateRequest.md @@ -0,0 +1,28 @@ + + +# SignatureRequestEditEmbeddedWithTemplateRequest + + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +| `templateIds`*_required_ | ```List``` | Use `template_ids` to create a SignatureRequest from one or more templates, in the order in which the template will be used. | | +| `clientId`*_required_ | ```String``` | Client id of the app you're using to create this embedded signature request. Used for security purposes. | | +| `signers`*_required_ | [```List```](SubSignatureRequestTemplateSigner.md) | Add Signers to your Templated-based Signature Request. | | +| `allowDecline` | ```Boolean``` | Allows signers to decline to sign a document if `true`. Defaults to `false`. | | +| `ccs` | [```List```](SubCC.md) | Add CC email recipients. Required when a CC role exists for the Template. | | +| `customFields` | [```List```](SubCustomField.md) | An array defining values and options for custom fields. Required when a custom field exists in the Template. | | +| `files` | ```List``` | Use `files[]` to indicate the uploaded file(s) to send for signature.

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

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

Each request can include up to 10 metadata keys (or 50 nested metadata keys), with key names up to 40 characters long and values up to 1000 characters long. | | +| `signingOptions` | [```SubSigningOptions```](SubSigningOptions.md) | | | +| `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. | | +| `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. | | + + + diff --git a/sdks/java-v2/docs/SignatureRequestEditRequest.md b/sdks/java-v2/docs/SignatureRequestEditRequest.md new file mode 100644 index 000000000..7fa3aca65 --- /dev/null +++ b/sdks/java-v2/docs/SignatureRequestEditRequest.md @@ -0,0 +1,38 @@ + + +# SignatureRequestEditRequest + + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +| `files` | ```List``` | Use `files[]` to indicate the uploaded file(s) to send for signature.

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

This endpoint requires either **files** or **file_urls[]**, but not both. | | +| `signers` | [```List```](SubSignatureRequestSigner.md) | Add Signers to your Signature Request.

This endpoint requires either **signers** or **grouped_signers**, but not both. | | +| `groupedSigners` | [```List```](SubSignatureRequestGroupedSigners.md) | Add Grouped Signers to your Signature Request.

This endpoint requires either **signers** or **grouped_signers**, but not both. | | +| `allowDecline` | ```Boolean``` | Allows signers to decline to sign a document if `true`. Defaults to `false`. | | +| `allowReassign` | ```Boolean``` | Allows signers to reassign their signature requests to other signers if set to `true`. Defaults to `false`.

**NOTE:** Only available for Premium plan and higher. | | +| `attachments` | [```List```](SubAttachment.md) | A list describing the attachments | | +| `ccEmailAddresses` | ```List``` | The email addresses that should be CCed. | | +| `clientId` | ```String``` | The client id of the API App you want to associate with this request. Used to apply the branding and callback url defined for the app. | | +| `customFields` | [```List```](SubCustomField.md) | When used together with merge fields, `custom_fields` allows users to add pre-filled data to their signature requests.

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

For using pre-filled on repeatable signature requests, merge fields are added to templates in the Dropbox Sign UI or by calling [/template/create_embedded_draft](/api/reference/operation/templateCreateEmbeddedDraft) and then passing `custom_fields` on subsequent signature requests referencing that template. | | +| `fieldOptions` | [```SubFieldOptions```](SubFieldOptions.md) | | | +| `formFieldGroups` | [```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`. | | +| `formFieldRules` | [```List```](SubFormFieldRule.md) | Conditional Logic rules for fields defined in `form_fields_per_document`. | | +| `formFieldsPerDocument` | [```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` | | +| `hideTextTags` | ```Boolean``` | Enables automatic Text Tag removal when set to true.

**NOTE:** Removing text tags this way can cause unwanted clipping. We recommend leaving this setting on `false` and instead hiding your text tags using white text or a similar approach. See the [Text Tags Walkthrough](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) for more information. | | +| `isEid` | ```Boolean``` | Send with a value of `true` if you wish to enable [electronic identification (eID)](https://www.hellosign.com/features/electronic-id), which requires the signer to verify their identity with an eID provider to sign a document.<br>
**NOTE:** eID is only available on the Premium API plan. Cannot be used in `test_mode`. Only works on requests with one signer. | | +| `message` | ```String``` | The custom message in the email that will be sent to the signers. | | +| `metadata` | ```Map``` | Key-value data that should be attached to the signature request. This metadata is included in all API responses and events involving the signature request. For example, use the metadata field to store a signer's order number for look up when receiving events for the signature request.

Each request can include up to 10 metadata keys (or 50 nested metadata keys), with key names up to 40 characters long and values up to 1000 characters long. | | +| `signingOptions` | [```SubSigningOptions```](SubSigningOptions.md) | | | +| `signingRedirectUrl` | ```String``` | The URL you want signers redirected to after they successfully sign. | | +| `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. | | +| `useTextTags` | ```Boolean``` | Send with a value of `true` if you wish to enable [Text Tags](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) parsing in your document. Defaults to disabled, or `false`. | | +| `expiresAt` | ```Integer``` | When the signature request will expire. Unsigned signatures will be moved to the expired status, and no longer signable. See [Signature Request Expiration Date](https://developers.hellosign.com/docs/signature-request/expiration/) for details. | | + + + diff --git a/sdks/java-v2/docs/SignatureRequestEditWithTemplateRequest.md b/sdks/java-v2/docs/SignatureRequestEditWithTemplateRequest.md new file mode 100644 index 000000000..d079524b1 --- /dev/null +++ b/sdks/java-v2/docs/SignatureRequestEditWithTemplateRequest.md @@ -0,0 +1,29 @@ + + +# SignatureRequestEditWithTemplateRequest + + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +| `templateIds`*_required_ | ```List``` | Use `template_ids` to create a SignatureRequest from one or more templates, in the order in which the template will be used. | | +| `signers`*_required_ | [```List```](SubSignatureRequestTemplateSigner.md) | Add Signers to your Templated-based Signature Request. | | +| `allowDecline` | ```Boolean``` | Allows signers to decline to sign a document if `true`. Defaults to `false`. | | +| `ccs` | [```List```](SubCC.md) | Add CC email recipients. Required when a CC role exists for the Template. | | +| `clientId` | ```String``` | Client id of the app to associate with the signature request. Used to apply the branding and callback url defined for the app. | | +| `customFields` | [```List```](SubCustomField.md) | An array defining values and options for custom fields. Required when a custom field exists in the Template. | | +| `files` | ```List``` | Use `files[]` to indicate the uploaded file(s) to send for signature.

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

This endpoint requires either **files** or **file_urls[]**, but not both. | | +| `isEid` | ```Boolean``` | Send with a value of `true` if you wish to enable [electronic identification (eID)](https://www.hellosign.com/features/electronic-id), which requires the signer to verify their identity with an eID provider to sign a document.<br>
**NOTE:** eID is only available on the Premium API plan. Cannot be used in `test_mode`. Only works on requests with one signer. | | +| `message` | ```String``` | The custom message in the email that will be sent to the signers. | | +| `metadata` | ```Map``` | Key-value data that should be attached to the signature request. This metadata is included in all API responses and events involving the signature request. For example, use the metadata field to store a signer's order number for look up when receiving events for the signature request.

Each request can include up to 10 metadata keys (or 50 nested metadata keys), with key names up to 40 characters long and values up to 1000 characters long. | | +| `signingOptions` | [```SubSigningOptions```](SubSigningOptions.md) | | | +| `signingRedirectUrl` | ```String``` | The URL you want signers redirected to after they successfully sign. | | +| `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. | | + + + diff --git a/sdks/java-v2/src/main/java/com/dropbox/sign/api/SignatureRequestApi.java b/sdks/java-v2/src/main/java/com/dropbox/sign/api/SignatureRequestApi.java index 711191bc9..93510972e 100644 --- a/sdks/java-v2/src/main/java/com/dropbox/sign/api/SignatureRequestApi.java +++ b/sdks/java-v2/src/main/java/com/dropbox/sign/api/SignatureRequestApi.java @@ -17,6 +17,10 @@ import com.dropbox.sign.model.SignatureRequestBulkSendWithTemplateRequest; import com.dropbox.sign.model.SignatureRequestCreateEmbeddedRequest; import com.dropbox.sign.model.SignatureRequestCreateEmbeddedWithTemplateRequest; +import com.dropbox.sign.model.SignatureRequestEditEmbeddedRequest; +import com.dropbox.sign.model.SignatureRequestEditEmbeddedWithTemplateRequest; +import com.dropbox.sign.model.SignatureRequestEditRequest; +import com.dropbox.sign.model.SignatureRequestEditWithTemplateRequest; import com.dropbox.sign.model.SignatureRequestGetResponse; import com.dropbox.sign.model.SignatureRequestListResponse; import com.dropbox.sign.model.SignatureRequestRemindRequest; @@ -367,6 +371,286 @@ public ApiResponse signatureRequestCreateEmbeddedWi false ); } + /** + * Edit Signature Request. + * Edits and sends a SignatureRequest with the submitted documents. If `form_fields_per_document` is not specified, a signature page will be affixed where all signers will be required to add their signature, signifying their agreement to all contained documents. **NOTE:** Edit and resend will not deduct your signature request quota. + * @param signatureRequestId The id of the SignatureRequest to edit. (required) + * @param signatureRequestEditRequest (required) + * @return SignatureRequestGetResponse + * @throws ApiException if fails to make API call + * @http.response.details + + + + +
Status Code Description Response Headers
200 successful operation * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
4XX failed_operation -
+ */ + public SignatureRequestGetResponse signatureRequestEdit(String signatureRequestId, SignatureRequestEditRequest signatureRequestEditRequest) throws ApiException { + return signatureRequestEditWithHttpInfo(signatureRequestId, signatureRequestEditRequest).getData(); + } + + + /** + * Edit Signature Request. + * Edits and sends a SignatureRequest with the submitted documents. If `form_fields_per_document` is not specified, a signature page will be affixed where all signers will be required to add their signature, signifying their agreement to all contained documents. **NOTE:** Edit and resend will not deduct your signature request quota. + * @param signatureRequestId The id of the SignatureRequest to edit. (required) + * @param signatureRequestEditRequest (required) + * @return ApiResponse<SignatureRequestGetResponse> + * @throws ApiException if fails to make API call + * @http.response.details + + + + +
Status Code Description Response Headers
200 successful operation * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
4XX failed_operation -
+ */ + public ApiResponse signatureRequestEditWithHttpInfo(String signatureRequestId, SignatureRequestEditRequest signatureRequestEditRequest) throws ApiException { + + // Check required parameters + if (signatureRequestId == null) { + throw new ApiException(400, "Missing the required parameter 'signatureRequestId' when calling signatureRequestEdit"); + } + if (signatureRequestEditRequest == null) { + throw new ApiException(400, "Missing the required parameter 'signatureRequestEditRequest' when calling signatureRequestEdit"); + } + + // Path parameters + String localVarPath = "/signature_request/edit/{signature_request_id}" + .replaceAll("\\{signature_request_id}", apiClient.escapeString(signatureRequestId.toString())); + + String localVarAccept = apiClient.selectHeaderAccept("application/json"); + Map localVarFormParams = new LinkedHashMap<>(); + localVarFormParams = signatureRequestEditRequest.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( + "SignatureRequestApi.signatureRequestEdit", + localVarPath, + "PUT", + new ArrayList<>(), + isFileTypeFound ? null : signatureRequestEditRequest, + new LinkedHashMap<>(), + new LinkedHashMap<>(), + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType, + false + ); + } + /** + * Edit Embedded Signature Request. + * Edits a SignatureRequest with the submitted documents to be signed in an embedded iFrame. If form_fields_per_document is not specified, a signature page will be affixed where all signers will be required to add their signature, signifying their agreement to all contained documents. Note that embedded signature requests can only be signed in embedded iFrames whereas normal signature requests can only be signed on Dropbox Sign. + * @param signatureRequestId The id of the SignatureRequest to edit. (required) + * @param signatureRequestEditEmbeddedRequest (required) + * @return SignatureRequestGetResponse + * @throws ApiException if fails to make API call + * @http.response.details + + + + +
Status Code Description Response Headers
200 successful operation * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
4XX failed_operation -
+ */ + public SignatureRequestGetResponse signatureRequestEditEmbedded(String signatureRequestId, SignatureRequestEditEmbeddedRequest signatureRequestEditEmbeddedRequest) throws ApiException { + return signatureRequestEditEmbeddedWithHttpInfo(signatureRequestId, signatureRequestEditEmbeddedRequest).getData(); + } + + + /** + * Edit Embedded Signature Request. + * Edits a SignatureRequest with the submitted documents to be signed in an embedded iFrame. If form_fields_per_document is not specified, a signature page will be affixed where all signers will be required to add their signature, signifying their agreement to all contained documents. Note that embedded signature requests can only be signed in embedded iFrames whereas normal signature requests can only be signed on Dropbox Sign. + * @param signatureRequestId The id of the SignatureRequest to edit. (required) + * @param signatureRequestEditEmbeddedRequest (required) + * @return ApiResponse<SignatureRequestGetResponse> + * @throws ApiException if fails to make API call + * @http.response.details + + + + +
Status Code Description Response Headers
200 successful operation * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
4XX failed_operation -
+ */ + public ApiResponse signatureRequestEditEmbeddedWithHttpInfo(String signatureRequestId, SignatureRequestEditEmbeddedRequest signatureRequestEditEmbeddedRequest) throws ApiException { + + // Check required parameters + if (signatureRequestId == null) { + throw new ApiException(400, "Missing the required parameter 'signatureRequestId' when calling signatureRequestEditEmbedded"); + } + if (signatureRequestEditEmbeddedRequest == null) { + throw new ApiException(400, "Missing the required parameter 'signatureRequestEditEmbeddedRequest' when calling signatureRequestEditEmbedded"); + } + + // Path parameters + String localVarPath = "/signature_request/edit_embedded/{signature_request_id}" + .replaceAll("\\{signature_request_id}", apiClient.escapeString(signatureRequestId.toString())); + + String localVarAccept = apiClient.selectHeaderAccept("application/json"); + Map localVarFormParams = new LinkedHashMap<>(); + localVarFormParams = signatureRequestEditEmbeddedRequest.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( + "SignatureRequestApi.signatureRequestEditEmbedded", + localVarPath, + "PUT", + new ArrayList<>(), + isFileTypeFound ? null : signatureRequestEditEmbeddedRequest, + new LinkedHashMap<>(), + new LinkedHashMap<>(), + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType, + false + ); + } + /** + * Edit Embedded Signature Request with Template. + * Edits a SignatureRequest based on the given Template(s) to be signed in an embedded iFrame. Note that embedded signature requests can only be signed in embedded iFrames whereas normal signature requests can only be signed on Dropbox Sign. + * @param signatureRequestId The id of the SignatureRequest to edit. (required) + * @param signatureRequestEditEmbeddedWithTemplateRequest (required) + * @return SignatureRequestGetResponse + * @throws ApiException if fails to make API call + * @http.response.details + + + + +
Status Code Description Response Headers
200 successful operation * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
4XX failed_operation -
+ */ + public SignatureRequestGetResponse signatureRequestEditEmbeddedWithTemplate(String signatureRequestId, SignatureRequestEditEmbeddedWithTemplateRequest signatureRequestEditEmbeddedWithTemplateRequest) throws ApiException { + return signatureRequestEditEmbeddedWithTemplateWithHttpInfo(signatureRequestId, signatureRequestEditEmbeddedWithTemplateRequest).getData(); + } + + + /** + * Edit Embedded Signature Request with Template. + * Edits a SignatureRequest based on the given Template(s) to be signed in an embedded iFrame. Note that embedded signature requests can only be signed in embedded iFrames whereas normal signature requests can only be signed on Dropbox Sign. + * @param signatureRequestId The id of the SignatureRequest to edit. (required) + * @param signatureRequestEditEmbeddedWithTemplateRequest (required) + * @return ApiResponse<SignatureRequestGetResponse> + * @throws ApiException if fails to make API call + * @http.response.details + + + + +
Status Code Description Response Headers
200 successful operation * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
4XX failed_operation -
+ */ + public ApiResponse signatureRequestEditEmbeddedWithTemplateWithHttpInfo(String signatureRequestId, SignatureRequestEditEmbeddedWithTemplateRequest signatureRequestEditEmbeddedWithTemplateRequest) throws ApiException { + + // Check required parameters + if (signatureRequestId == null) { + throw new ApiException(400, "Missing the required parameter 'signatureRequestId' when calling signatureRequestEditEmbeddedWithTemplate"); + } + if (signatureRequestEditEmbeddedWithTemplateRequest == null) { + throw new ApiException(400, "Missing the required parameter 'signatureRequestEditEmbeddedWithTemplateRequest' when calling signatureRequestEditEmbeddedWithTemplate"); + } + + // Path parameters + String localVarPath = "/signature_request/edit_embedded_with_template/{signature_request_id}" + .replaceAll("\\{signature_request_id}", apiClient.escapeString(signatureRequestId.toString())); + + String localVarAccept = apiClient.selectHeaderAccept("application/json"); + Map localVarFormParams = new LinkedHashMap<>(); + localVarFormParams = signatureRequestEditEmbeddedWithTemplateRequest.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( + "SignatureRequestApi.signatureRequestEditEmbeddedWithTemplate", + localVarPath, + "PUT", + new ArrayList<>(), + isFileTypeFound ? null : signatureRequestEditEmbeddedWithTemplateRequest, + new LinkedHashMap<>(), + new LinkedHashMap<>(), + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType, + false + ); + } + /** + * Edit Signature Request With Template. + * Edits and sends a SignatureRequest based off of the Template(s) specified with the template_ids parameter. **NOTE:** Edit and resend will not deduct your signature request quota. + * @param signatureRequestId The id of the SignatureRequest to edit. (required) + * @param signatureRequestEditWithTemplateRequest (required) + * @return SignatureRequestGetResponse + * @throws ApiException if fails to make API call + * @http.response.details + + + + +
Status Code Description Response Headers
200 successful operation * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
4XX failed_operation -
+ */ + public SignatureRequestGetResponse signatureRequestEditWithTemplate(String signatureRequestId, SignatureRequestEditWithTemplateRequest signatureRequestEditWithTemplateRequest) throws ApiException { + return signatureRequestEditWithTemplateWithHttpInfo(signatureRequestId, signatureRequestEditWithTemplateRequest).getData(); + } + + + /** + * Edit Signature Request With Template. + * Edits and sends a SignatureRequest based off of the Template(s) specified with the template_ids parameter. **NOTE:** Edit and resend will not deduct your signature request quota. + * @param signatureRequestId The id of the SignatureRequest to edit. (required) + * @param signatureRequestEditWithTemplateRequest (required) + * @return ApiResponse<SignatureRequestGetResponse> + * @throws ApiException if fails to make API call + * @http.response.details + + + + +
Status Code Description Response Headers
200 successful operation * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
4XX failed_operation -
+ */ + public ApiResponse signatureRequestEditWithTemplateWithHttpInfo(String signatureRequestId, SignatureRequestEditWithTemplateRequest signatureRequestEditWithTemplateRequest) throws ApiException { + + // Check required parameters + if (signatureRequestId == null) { + throw new ApiException(400, "Missing the required parameter 'signatureRequestId' when calling signatureRequestEditWithTemplate"); + } + if (signatureRequestEditWithTemplateRequest == null) { + throw new ApiException(400, "Missing the required parameter 'signatureRequestEditWithTemplateRequest' when calling signatureRequestEditWithTemplate"); + } + + // Path parameters + String localVarPath = "/signature_request/edit_with_template/{signature_request_id}" + .replaceAll("\\{signature_request_id}", apiClient.escapeString(signatureRequestId.toString())); + + String localVarAccept = apiClient.selectHeaderAccept("application/json"); + Map localVarFormParams = new LinkedHashMap<>(); + localVarFormParams = signatureRequestEditWithTemplateRequest.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( + "SignatureRequestApi.signatureRequestEditWithTemplate", + localVarPath, + "PUT", + new ArrayList<>(), + isFileTypeFound ? null : signatureRequestEditWithTemplateRequest, + new LinkedHashMap<>(), + new LinkedHashMap<>(), + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType, + false + ); + } /** * Download Files. * Obtain a copy of the current documents specified by the `signature_request_id` parameter. Returns a PDF or ZIP file. If the files are currently being prepared, a status code of `409` will be returned instead. diff --git a/sdks/java-v2/src/main/java/com/dropbox/sign/model/SignatureRequestEditEmbeddedRequest.java b/sdks/java-v2/src/main/java/com/dropbox/sign/model/SignatureRequestEditEmbeddedRequest.java new file mode 100644 index 000000000..cc5c34cc5 --- /dev/null +++ b/sdks/java-v2/src/main/java/com/dropbox/sign/model/SignatureRequestEditEmbeddedRequest.java @@ -0,0 +1,1430 @@ +/* + * Dropbox Sign API + * Dropbox Sign v3 API + * + * The version of the OpenAPI document: 3.0.0 + * Contact: apisupport@hellosign.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.dropbox.sign.model; + +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.dropbox.sign.model.SubAttachment; +import com.dropbox.sign.model.SubCustomField; +import com.dropbox.sign.model.SubFieldOptions; +import com.dropbox.sign.model.SubFormFieldGroup; +import com.dropbox.sign.model.SubFormFieldRule; +import com.dropbox.sign.model.SubFormFieldsPerDocumentBase; +import com.dropbox.sign.model.SubSignatureRequestGroupedSigners; +import com.dropbox.sign.model.SubSignatureRequestSigner; +import com.dropbox.sign.model.SubSigningOptions; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.io.File; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.dropbox.sign.JSON; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.databind.ObjectMapper; + + +import com.dropbox.sign.ApiException; +/** + * SignatureRequestEditEmbeddedRequest + */ +@JsonPropertyOrder({ + SignatureRequestEditEmbeddedRequest.JSON_PROPERTY_CLIENT_ID, + SignatureRequestEditEmbeddedRequest.JSON_PROPERTY_FILES, + SignatureRequestEditEmbeddedRequest.JSON_PROPERTY_FILE_URLS, + SignatureRequestEditEmbeddedRequest.JSON_PROPERTY_SIGNERS, + SignatureRequestEditEmbeddedRequest.JSON_PROPERTY_GROUPED_SIGNERS, + SignatureRequestEditEmbeddedRequest.JSON_PROPERTY_ALLOW_DECLINE, + SignatureRequestEditEmbeddedRequest.JSON_PROPERTY_ALLOW_REASSIGN, + SignatureRequestEditEmbeddedRequest.JSON_PROPERTY_ATTACHMENTS, + SignatureRequestEditEmbeddedRequest.JSON_PROPERTY_CC_EMAIL_ADDRESSES, + SignatureRequestEditEmbeddedRequest.JSON_PROPERTY_CUSTOM_FIELDS, + SignatureRequestEditEmbeddedRequest.JSON_PROPERTY_FIELD_OPTIONS, + SignatureRequestEditEmbeddedRequest.JSON_PROPERTY_FORM_FIELD_GROUPS, + SignatureRequestEditEmbeddedRequest.JSON_PROPERTY_FORM_FIELD_RULES, + SignatureRequestEditEmbeddedRequest.JSON_PROPERTY_FORM_FIELDS_PER_DOCUMENT, + SignatureRequestEditEmbeddedRequest.JSON_PROPERTY_HIDE_TEXT_TAGS, + SignatureRequestEditEmbeddedRequest.JSON_PROPERTY_MESSAGE, + SignatureRequestEditEmbeddedRequest.JSON_PROPERTY_METADATA, + SignatureRequestEditEmbeddedRequest.JSON_PROPERTY_SIGNING_OPTIONS, + SignatureRequestEditEmbeddedRequest.JSON_PROPERTY_SUBJECT, + SignatureRequestEditEmbeddedRequest.JSON_PROPERTY_TEST_MODE, + SignatureRequestEditEmbeddedRequest.JSON_PROPERTY_TITLE, + SignatureRequestEditEmbeddedRequest.JSON_PROPERTY_USE_TEXT_TAGS, + SignatureRequestEditEmbeddedRequest.JSON_PROPERTY_POPULATE_AUTO_FILL_FIELDS, + SignatureRequestEditEmbeddedRequest.JSON_PROPERTY_EXPIRES_AT +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") +@JsonIgnoreProperties(ignoreUnknown=true) +public class SignatureRequestEditEmbeddedRequest { + public static final String JSON_PROPERTY_CLIENT_ID = "client_id"; + private String clientId; + + public static final String JSON_PROPERTY_FILES = "files"; + private List files = null; + + public static final String JSON_PROPERTY_FILE_URLS = "file_urls"; + private List fileUrls = null; + + public static final String JSON_PROPERTY_SIGNERS = "signers"; + private List signers = null; + + public static final String JSON_PROPERTY_GROUPED_SIGNERS = "grouped_signers"; + private List groupedSigners = null; + + public static final String JSON_PROPERTY_ALLOW_DECLINE = "allow_decline"; + private Boolean allowDecline = false; + + public static final String JSON_PROPERTY_ALLOW_REASSIGN = "allow_reassign"; + private Boolean allowReassign = false; + + public static final String JSON_PROPERTY_ATTACHMENTS = "attachments"; + private List attachments = null; + + public static final String JSON_PROPERTY_CC_EMAIL_ADDRESSES = "cc_email_addresses"; + private List ccEmailAddresses = null; + + public static final String JSON_PROPERTY_CUSTOM_FIELDS = "custom_fields"; + private List customFields = null; + + public static final String JSON_PROPERTY_FIELD_OPTIONS = "field_options"; + private SubFieldOptions fieldOptions; + + public static final String JSON_PROPERTY_FORM_FIELD_GROUPS = "form_field_groups"; + private List formFieldGroups = null; + + public static final String JSON_PROPERTY_FORM_FIELD_RULES = "form_field_rules"; + private List formFieldRules = null; + + public static final String JSON_PROPERTY_FORM_FIELDS_PER_DOCUMENT = "form_fields_per_document"; + private List formFieldsPerDocument = null; + + public static final String JSON_PROPERTY_HIDE_TEXT_TAGS = "hide_text_tags"; + private Boolean hideTextTags = false; + + public static final String JSON_PROPERTY_MESSAGE = "message"; + private String message; + + public static final String JSON_PROPERTY_METADATA = "metadata"; + private Map metadata = null; + + public static final String JSON_PROPERTY_SIGNING_OPTIONS = "signing_options"; + private SubSigningOptions signingOptions; + + public static final String JSON_PROPERTY_SUBJECT = "subject"; + private String subject; + + public static final String JSON_PROPERTY_TEST_MODE = "test_mode"; + private Boolean testMode = false; + + public static final String JSON_PROPERTY_TITLE = "title"; + private String title; + + public static final String JSON_PROPERTY_USE_TEXT_TAGS = "use_text_tags"; + private Boolean useTextTags = false; + + public static final String JSON_PROPERTY_POPULATE_AUTO_FILL_FIELDS = "populate_auto_fill_fields"; + private Boolean populateAutoFillFields = false; + + public static final String JSON_PROPERTY_EXPIRES_AT = "expires_at"; + private Integer expiresAt; + + public SignatureRequestEditEmbeddedRequest() { + } + + /** + * Attempt to instantiate and hydrate a new instance of this class + * @param jsonData String of JSON data representing target object + */ + static public SignatureRequestEditEmbeddedRequest init(String jsonData) throws Exception { + return new ObjectMapper().readValue(jsonData, SignatureRequestEditEmbeddedRequest.class); + } + + static public SignatureRequestEditEmbeddedRequest init(HashMap data) throws Exception { + return new ObjectMapper().readValue( + new ObjectMapper().writeValueAsString(data), + SignatureRequestEditEmbeddedRequest.class + ); + } + + public SignatureRequestEditEmbeddedRequest clientId(String clientId) { + this.clientId = clientId; + return this; + } + + /** + * Client id of the app you're using to create this embedded signature request. Used for security purposes. + * @return clientId + */ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_CLIENT_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getClientId() { + return clientId; + } + + + @JsonProperty(JSON_PROPERTY_CLIENT_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setClientId(String clientId) { + this.clientId = clientId; + } + + + public SignatureRequestEditEmbeddedRequest files(List files) { + this.files = files; + return this; + } + + public SignatureRequestEditEmbeddedRequest addFilesItem(File filesItem) { + if (this.files == null) { + this.files = new ArrayList<>(); + } + this.files.add(filesItem); + return this; + } + + /** + * Use `files[]` to indicate the uploaded file(s) to send for signature. This endpoint requires either **files** or **file_urls[]**, but not both. + * @return files + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_FILES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getFiles() { + return files; + } + + + @JsonProperty(JSON_PROPERTY_FILES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setFiles(List files) { + this.files = files; + } + + + public SignatureRequestEditEmbeddedRequest fileUrls(List fileUrls) { + this.fileUrls = fileUrls; + return this; + } + + public SignatureRequestEditEmbeddedRequest addFileUrlsItem(String fileUrlsItem) { + if (this.fileUrls == null) { + this.fileUrls = new ArrayList<>(); + } + this.fileUrls.add(fileUrlsItem); + return this; + } + + /** + * Use `file_urls[]` to have Dropbox Sign download the file(s) to send for signature. This endpoint requires either **files** or **file_urls[]**, but not both. + * @return fileUrls + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_FILE_URLS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getFileUrls() { + return fileUrls; + } + + + @JsonProperty(JSON_PROPERTY_FILE_URLS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setFileUrls(List fileUrls) { + this.fileUrls = fileUrls; + } + + + public SignatureRequestEditEmbeddedRequest signers(List signers) { + this.signers = signers; + return this; + } + + public SignatureRequestEditEmbeddedRequest addSignersItem(SubSignatureRequestSigner signersItem) { + if (this.signers == null) { + this.signers = new ArrayList<>(); + } + this.signers.add(signersItem); + return this; + } + + /** + * Add Signers to your Signature Request. This endpoint requires either **signers** or **grouped_signers**, but not both. + * @return signers + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SIGNERS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getSigners() { + return signers; + } + + + @JsonProperty(JSON_PROPERTY_SIGNERS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSigners(List signers) { + this.signers = signers; + } + + + public SignatureRequestEditEmbeddedRequest groupedSigners(List groupedSigners) { + this.groupedSigners = groupedSigners; + return this; + } + + public SignatureRequestEditEmbeddedRequest addGroupedSignersItem(SubSignatureRequestGroupedSigners groupedSignersItem) { + if (this.groupedSigners == null) { + this.groupedSigners = new ArrayList<>(); + } + this.groupedSigners.add(groupedSignersItem); + return this; + } + + /** + * Add Grouped Signers to your Signature Request. This endpoint requires either **signers** or **grouped_signers**, but not both. + * @return groupedSigners + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_GROUPED_SIGNERS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getGroupedSigners() { + return groupedSigners; + } + + + @JsonProperty(JSON_PROPERTY_GROUPED_SIGNERS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setGroupedSigners(List groupedSigners) { + this.groupedSigners = groupedSigners; + } + + + public SignatureRequestEditEmbeddedRequest allowDecline(Boolean allowDecline) { + this.allowDecline = allowDecline; + return this; + } + + /** + * Allows signers to decline to sign a document if `true`. Defaults to `false`. + * @return allowDecline + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ALLOW_DECLINE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Boolean getAllowDecline() { + return allowDecline; + } + + + @JsonProperty(JSON_PROPERTY_ALLOW_DECLINE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAllowDecline(Boolean allowDecline) { + this.allowDecline = allowDecline; + } + + + public SignatureRequestEditEmbeddedRequest allowReassign(Boolean allowReassign) { + this.allowReassign = allowReassign; + return this; + } + + /** + * Allows signers to reassign their signature requests to other signers if set to `true`. Defaults to `false`. **NOTE:** Only available for Premium plan. + * @return allowReassign + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ALLOW_REASSIGN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Boolean getAllowReassign() { + return allowReassign; + } + + + @JsonProperty(JSON_PROPERTY_ALLOW_REASSIGN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAllowReassign(Boolean allowReassign) { + this.allowReassign = allowReassign; + } + + + public SignatureRequestEditEmbeddedRequest attachments(List attachments) { + this.attachments = attachments; + return this; + } + + public SignatureRequestEditEmbeddedRequest addAttachmentsItem(SubAttachment attachmentsItem) { + if (this.attachments == null) { + this.attachments = new ArrayList<>(); + } + this.attachments.add(attachmentsItem); + return this; + } + + /** + * A list describing the attachments + * @return attachments + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ATTACHMENTS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getAttachments() { + return attachments; + } + + + @JsonProperty(JSON_PROPERTY_ATTACHMENTS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAttachments(List attachments) { + this.attachments = attachments; + } + + + public SignatureRequestEditEmbeddedRequest ccEmailAddresses(List ccEmailAddresses) { + this.ccEmailAddresses = ccEmailAddresses; + return this; + } + + public SignatureRequestEditEmbeddedRequest addCcEmailAddressesItem(String ccEmailAddressesItem) { + if (this.ccEmailAddresses == null) { + this.ccEmailAddresses = new ArrayList<>(); + } + this.ccEmailAddresses.add(ccEmailAddressesItem); + return this; + } + + /** + * The email addresses that should be CCed. + * @return ccEmailAddresses + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CC_EMAIL_ADDRESSES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getCcEmailAddresses() { + return ccEmailAddresses; + } + + + @JsonProperty(JSON_PROPERTY_CC_EMAIL_ADDRESSES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCcEmailAddresses(List ccEmailAddresses) { + this.ccEmailAddresses = ccEmailAddresses; + } + + + public SignatureRequestEditEmbeddedRequest customFields(List customFields) { + this.customFields = customFields; + return this; + } + + public SignatureRequestEditEmbeddedRequest addCustomFieldsItem(SubCustomField customFieldsItem) { + if (this.customFields == null) { + this.customFields = new ArrayList<>(); + } + this.customFields.add(customFieldsItem); + return this; + } + + /** + * When used together with merge fields, `custom_fields` allows users to add pre-filled data to their signature requests. Pre-filled data can be used with \"send-once\" signature requests by adding merge fields with `form_fields_per_document` or [Text Tags](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) while passing values back with `custom_fields` together in one API call. For using pre-filled on repeatable signature requests, merge fields are added to templates in the Dropbox Sign UI or by calling [/template/create_embedded_draft](/api/reference/operation/templateCreateEmbeddedDraft) and then passing `custom_fields` on subsequent signature requests referencing that template. + * @return customFields + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CUSTOM_FIELDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getCustomFields() { + return customFields; + } + + + @JsonProperty(JSON_PROPERTY_CUSTOM_FIELDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCustomFields(List customFields) { + this.customFields = customFields; + } + + + public SignatureRequestEditEmbeddedRequest fieldOptions(SubFieldOptions fieldOptions) { + this.fieldOptions = fieldOptions; + return this; + } + + /** + * Get fieldOptions + * @return fieldOptions + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_FIELD_OPTIONS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public SubFieldOptions getFieldOptions() { + return fieldOptions; + } + + + @JsonProperty(JSON_PROPERTY_FIELD_OPTIONS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setFieldOptions(SubFieldOptions fieldOptions) { + this.fieldOptions = fieldOptions; + } + + + public SignatureRequestEditEmbeddedRequest formFieldGroups(List formFieldGroups) { + this.formFieldGroups = formFieldGroups; + return this; + } + + public SignatureRequestEditEmbeddedRequest addFormFieldGroupsItem(SubFormFieldGroup formFieldGroupsItem) { + if (this.formFieldGroups == null) { + this.formFieldGroups = new ArrayList<>(); + } + this.formFieldGroups.add(formFieldGroupsItem); + return this; + } + + /** + * Group information for fields defined in `form_fields_per_document`. String-indexed JSON array with `group_label` and `requirement` keys. `form_fields_per_document` must contain fields referencing a group defined in `form_field_groups`. + * @return formFieldGroups + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_FORM_FIELD_GROUPS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getFormFieldGroups() { + return formFieldGroups; + } + + + @JsonProperty(JSON_PROPERTY_FORM_FIELD_GROUPS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setFormFieldGroups(List formFieldGroups) { + this.formFieldGroups = formFieldGroups; + } + + + public SignatureRequestEditEmbeddedRequest formFieldRules(List formFieldRules) { + this.formFieldRules = formFieldRules; + return this; + } + + public SignatureRequestEditEmbeddedRequest addFormFieldRulesItem(SubFormFieldRule formFieldRulesItem) { + if (this.formFieldRules == null) { + this.formFieldRules = new ArrayList<>(); + } + this.formFieldRules.add(formFieldRulesItem); + return this; + } + + /** + * Conditional Logic rules for fields defined in `form_fields_per_document`. + * @return formFieldRules + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_FORM_FIELD_RULES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getFormFieldRules() { + return formFieldRules; + } + + + @JsonProperty(JSON_PROPERTY_FORM_FIELD_RULES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setFormFieldRules(List formFieldRules) { + this.formFieldRules = formFieldRules; + } + + + public SignatureRequestEditEmbeddedRequest formFieldsPerDocument(List formFieldsPerDocument) { + this.formFieldsPerDocument = formFieldsPerDocument; + return this; + } + + public SignatureRequestEditEmbeddedRequest addFormFieldsPerDocumentItem(SubFormFieldsPerDocumentBase formFieldsPerDocumentItem) { + if (this.formFieldsPerDocument == null) { + this.formFieldsPerDocument = new ArrayList<>(); + } + this.formFieldsPerDocument.add(formFieldsPerDocumentItem); + return this; + } + + /** + * The fields that should appear on the document, expressed as an array of objects. (For more details you can read about it here: [Using Form Fields per Document](/docs/openapi/form-fields-per-document).) **NOTE:** Fields like **text**, **dropdown**, **checkbox**, **radio**, and **hyperlink** have additional required and optional parameters. Check out the list of [additional parameters](/api/reference/constants/#form-fields-per-document) for these field types. * Text Field use `SubFormFieldsPerDocumentText` * Dropdown Field use `SubFormFieldsPerDocumentDropdown` * Hyperlink Field use `SubFormFieldsPerDocumentHyperlink` * Checkbox Field use `SubFormFieldsPerDocumentCheckbox` * Radio Field use `SubFormFieldsPerDocumentRadio` * Signature Field use `SubFormFieldsPerDocumentSignature` * Date Signed Field use `SubFormFieldsPerDocumentDateSigned` * Initials Field use `SubFormFieldsPerDocumentInitials` * Text Merge Field use `SubFormFieldsPerDocumentTextMerge` * Checkbox Merge Field use `SubFormFieldsPerDocumentCheckboxMerge` + * @return formFieldsPerDocument + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_FORM_FIELDS_PER_DOCUMENT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getFormFieldsPerDocument() { + return formFieldsPerDocument; + } + + + @JsonProperty(JSON_PROPERTY_FORM_FIELDS_PER_DOCUMENT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setFormFieldsPerDocument(List formFieldsPerDocument) { + this.formFieldsPerDocument = formFieldsPerDocument; + } + + + public SignatureRequestEditEmbeddedRequest hideTextTags(Boolean hideTextTags) { + this.hideTextTags = hideTextTags; + return this; + } + + /** + * Enables automatic Text Tag removal when set to true. **NOTE:** Removing text tags this way can cause unwanted clipping. We recommend leaving this setting on `false` and instead hiding your text tags using white text or a similar approach. See the [Text Tags Walkthrough](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) for more information. + * @return hideTextTags + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_HIDE_TEXT_TAGS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Boolean getHideTextTags() { + return hideTextTags; + } + + + @JsonProperty(JSON_PROPERTY_HIDE_TEXT_TAGS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setHideTextTags(Boolean hideTextTags) { + this.hideTextTags = hideTextTags; + } + + + public SignatureRequestEditEmbeddedRequest message(String message) { + this.message = message; + return this; + } + + /** + * The custom message in the email that will be sent to the signers. + * @return message + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_MESSAGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getMessage() { + return message; + } + + + @JsonProperty(JSON_PROPERTY_MESSAGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMessage(String message) { + this.message = message; + } + + + public SignatureRequestEditEmbeddedRequest metadata(Map metadata) { + this.metadata = metadata; + return this; + } + + public SignatureRequestEditEmbeddedRequest putMetadataItem(String key, Object metadataItem) { + if (this.metadata == null) { + this.metadata = new HashMap<>(); + } + this.metadata.put(key, metadataItem); + return this; + } + + /** + * Key-value data that should be attached to the signature request. This metadata is included in all API responses and events involving the signature request. For example, use the metadata field to store a signer's order number for look up when receiving events for the signature request. Each request can include up to 10 metadata keys (or 50 nested metadata keys), with key names up to 40 characters long and values up to 1000 characters long. + * @return metadata + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_METADATA) + @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) + + public Map getMetadata() { + return metadata; + } + + + @JsonProperty(JSON_PROPERTY_METADATA) + @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) + public void setMetadata(Map metadata) { + this.metadata = metadata; + } + + + public SignatureRequestEditEmbeddedRequest signingOptions(SubSigningOptions signingOptions) { + this.signingOptions = signingOptions; + return this; + } + + /** + * Get signingOptions + * @return signingOptions + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SIGNING_OPTIONS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public SubSigningOptions getSigningOptions() { + return signingOptions; + } + + + @JsonProperty(JSON_PROPERTY_SIGNING_OPTIONS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSigningOptions(SubSigningOptions signingOptions) { + this.signingOptions = signingOptions; + } + + + public SignatureRequestEditEmbeddedRequest subject(String subject) { + this.subject = subject; + return this; + } + + /** + * The subject in the email that will be sent to the signers. + * @return subject + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SUBJECT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getSubject() { + return subject; + } + + + @JsonProperty(JSON_PROPERTY_SUBJECT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSubject(String subject) { + this.subject = subject; + } + + + public SignatureRequestEditEmbeddedRequest testMode(Boolean testMode) { + this.testMode = testMode; + return this; + } + + /** + * Whether this is a test, the signature request will not be legally binding if set to `true`. Defaults to `false`. + * @return testMode + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TEST_MODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Boolean getTestMode() { + return testMode; + } + + + @JsonProperty(JSON_PROPERTY_TEST_MODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTestMode(Boolean testMode) { + this.testMode = testMode; + } + + + public SignatureRequestEditEmbeddedRequest title(String title) { + this.title = title; + return this; + } + + /** + * The title you want to assign to the SignatureRequest. + * @return title + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TITLE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getTitle() { + return title; + } + + + @JsonProperty(JSON_PROPERTY_TITLE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTitle(String title) { + this.title = title; + } + + + public SignatureRequestEditEmbeddedRequest useTextTags(Boolean useTextTags) { + this.useTextTags = useTextTags; + return this; + } + + /** + * Send with a value of `true` if you wish to enable [Text Tags](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) parsing in your document. Defaults to disabled, or `false`. + * @return useTextTags + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_USE_TEXT_TAGS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Boolean getUseTextTags() { + return useTextTags; + } + + + @JsonProperty(JSON_PROPERTY_USE_TEXT_TAGS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setUseTextTags(Boolean useTextTags) { + this.useTextTags = useTextTags; + } + + + public SignatureRequestEditEmbeddedRequest populateAutoFillFields(Boolean populateAutoFillFields) { + this.populateAutoFillFields = populateAutoFillFields; + return this; + } + + /** + * 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. + * @return populateAutoFillFields + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_POPULATE_AUTO_FILL_FIELDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Boolean getPopulateAutoFillFields() { + return populateAutoFillFields; + } + + + @JsonProperty(JSON_PROPERTY_POPULATE_AUTO_FILL_FIELDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPopulateAutoFillFields(Boolean populateAutoFillFields) { + this.populateAutoFillFields = populateAutoFillFields; + } + + + public SignatureRequestEditEmbeddedRequest expiresAt(Integer expiresAt) { + this.expiresAt = expiresAt; + return this; + } + + /** + * When the signature request will expire. Unsigned signatures will be moved to the expired status, and no longer signable. See [Signature Request Expiration Date](https://developers.hellosign.com/docs/signature-request/expiration/) for details. + * @return expiresAt + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_EXPIRES_AT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Integer getExpiresAt() { + return expiresAt; + } + + + @JsonProperty(JSON_PROPERTY_EXPIRES_AT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setExpiresAt(Integer expiresAt) { + this.expiresAt = expiresAt; + } + + + /** + * Return true if this SignatureRequestEditEmbeddedRequest object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SignatureRequestEditEmbeddedRequest signatureRequestEditEmbeddedRequest = (SignatureRequestEditEmbeddedRequest) o; + return Objects.equals(this.clientId, signatureRequestEditEmbeddedRequest.clientId) && + Objects.equals(this.files, signatureRequestEditEmbeddedRequest.files) && + Objects.equals(this.fileUrls, signatureRequestEditEmbeddedRequest.fileUrls) && + Objects.equals(this.signers, signatureRequestEditEmbeddedRequest.signers) && + Objects.equals(this.groupedSigners, signatureRequestEditEmbeddedRequest.groupedSigners) && + Objects.equals(this.allowDecline, signatureRequestEditEmbeddedRequest.allowDecline) && + Objects.equals(this.allowReassign, signatureRequestEditEmbeddedRequest.allowReassign) && + Objects.equals(this.attachments, signatureRequestEditEmbeddedRequest.attachments) && + Objects.equals(this.ccEmailAddresses, signatureRequestEditEmbeddedRequest.ccEmailAddresses) && + Objects.equals(this.customFields, signatureRequestEditEmbeddedRequest.customFields) && + Objects.equals(this.fieldOptions, signatureRequestEditEmbeddedRequest.fieldOptions) && + Objects.equals(this.formFieldGroups, signatureRequestEditEmbeddedRequest.formFieldGroups) && + Objects.equals(this.formFieldRules, signatureRequestEditEmbeddedRequest.formFieldRules) && + Objects.equals(this.formFieldsPerDocument, signatureRequestEditEmbeddedRequest.formFieldsPerDocument) && + Objects.equals(this.hideTextTags, signatureRequestEditEmbeddedRequest.hideTextTags) && + Objects.equals(this.message, signatureRequestEditEmbeddedRequest.message) && + Objects.equals(this.metadata, signatureRequestEditEmbeddedRequest.metadata) && + Objects.equals(this.signingOptions, signatureRequestEditEmbeddedRequest.signingOptions) && + Objects.equals(this.subject, signatureRequestEditEmbeddedRequest.subject) && + Objects.equals(this.testMode, signatureRequestEditEmbeddedRequest.testMode) && + Objects.equals(this.title, signatureRequestEditEmbeddedRequest.title) && + Objects.equals(this.useTextTags, signatureRequestEditEmbeddedRequest.useTextTags) && + Objects.equals(this.populateAutoFillFields, signatureRequestEditEmbeddedRequest.populateAutoFillFields) && + Objects.equals(this.expiresAt, signatureRequestEditEmbeddedRequest.expiresAt); + } + + @Override + public int hashCode() { + return Objects.hash(clientId, files, fileUrls, signers, groupedSigners, allowDecline, allowReassign, attachments, ccEmailAddresses, customFields, fieldOptions, formFieldGroups, formFieldRules, formFieldsPerDocument, hideTextTags, message, metadata, signingOptions, subject, testMode, title, useTextTags, populateAutoFillFields, expiresAt); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SignatureRequestEditEmbeddedRequest {\n"); + sb.append(" clientId: ").append(toIndentedString(clientId)).append("\n"); + sb.append(" files: ").append(toIndentedString(files)).append("\n"); + sb.append(" fileUrls: ").append(toIndentedString(fileUrls)).append("\n"); + sb.append(" signers: ").append(toIndentedString(signers)).append("\n"); + sb.append(" groupedSigners: ").append(toIndentedString(groupedSigners)).append("\n"); + sb.append(" allowDecline: ").append(toIndentedString(allowDecline)).append("\n"); + sb.append(" allowReassign: ").append(toIndentedString(allowReassign)).append("\n"); + sb.append(" attachments: ").append(toIndentedString(attachments)).append("\n"); + sb.append(" ccEmailAddresses: ").append(toIndentedString(ccEmailAddresses)).append("\n"); + sb.append(" customFields: ").append(toIndentedString(customFields)).append("\n"); + sb.append(" fieldOptions: ").append(toIndentedString(fieldOptions)).append("\n"); + sb.append(" formFieldGroups: ").append(toIndentedString(formFieldGroups)).append("\n"); + sb.append(" formFieldRules: ").append(toIndentedString(formFieldRules)).append("\n"); + sb.append(" formFieldsPerDocument: ").append(toIndentedString(formFieldsPerDocument)).append("\n"); + sb.append(" hideTextTags: ").append(toIndentedString(hideTextTags)).append("\n"); + sb.append(" message: ").append(toIndentedString(message)).append("\n"); + sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); + sb.append(" signingOptions: ").append(toIndentedString(signingOptions)).append("\n"); + 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(" useTextTags: ").append(toIndentedString(useTextTags)).append("\n"); + sb.append(" populateAutoFillFields: ").append(toIndentedString(populateAutoFillFields)).append("\n"); + sb.append(" expiresAt: ").append(toIndentedString(expiresAt)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public Map createFormData() throws ApiException { + Map map = new HashMap<>(); + boolean fileTypeFound = false; + try { + if (clientId != null) { + if (isFileTypeOrListOfFiles(clientId)) { + fileTypeFound = true; + } + + if (clientId.getClass().equals(java.io.File.class) || + clientId.getClass().equals(Integer.class) || + clientId.getClass().equals(String.class) || + clientId.getClass().isEnum()) { + map.put("client_id", clientId); + } else if (isListOfFile(clientId)) { + for(int i = 0; i< getListSize(clientId); i++) { + map.put("client_id[" + i + "]", getFromList(clientId, i)); + } + } + else { + map.put("client_id", JSON.getDefault().getMapper().writeValueAsString(clientId)); + } + } + if (files != null) { + if (isFileTypeOrListOfFiles(files)) { + fileTypeFound = true; + } + + if (files.getClass().equals(java.io.File.class) || + files.getClass().equals(Integer.class) || + files.getClass().equals(String.class) || + files.getClass().isEnum()) { + map.put("files", files); + } else if (isListOfFile(files)) { + for(int i = 0; i< getListSize(files); i++) { + map.put("files[" + i + "]", getFromList(files, i)); + } + } + else { + map.put("files", JSON.getDefault().getMapper().writeValueAsString(files)); + } + } + if (fileUrls != null) { + if (isFileTypeOrListOfFiles(fileUrls)) { + fileTypeFound = true; + } + + if (fileUrls.getClass().equals(java.io.File.class) || + fileUrls.getClass().equals(Integer.class) || + fileUrls.getClass().equals(String.class) || + fileUrls.getClass().isEnum()) { + map.put("file_urls", fileUrls); + } else if (isListOfFile(fileUrls)) { + for(int i = 0; i< getListSize(fileUrls); i++) { + map.put("file_urls[" + i + "]", getFromList(fileUrls, i)); + } + } + else { + map.put("file_urls", JSON.getDefault().getMapper().writeValueAsString(fileUrls)); + } + } + if (signers != null) { + if (isFileTypeOrListOfFiles(signers)) { + fileTypeFound = true; + } + + if (signers.getClass().equals(java.io.File.class) || + signers.getClass().equals(Integer.class) || + signers.getClass().equals(String.class) || + signers.getClass().isEnum()) { + map.put("signers", signers); + } else if (isListOfFile(signers)) { + for(int i = 0; i< getListSize(signers); i++) { + map.put("signers[" + i + "]", getFromList(signers, i)); + } + } + else { + map.put("signers", JSON.getDefault().getMapper().writeValueAsString(signers)); + } + } + if (groupedSigners != null) { + if (isFileTypeOrListOfFiles(groupedSigners)) { + fileTypeFound = true; + } + + if (groupedSigners.getClass().equals(java.io.File.class) || + groupedSigners.getClass().equals(Integer.class) || + groupedSigners.getClass().equals(String.class) || + groupedSigners.getClass().isEnum()) { + map.put("grouped_signers", groupedSigners); + } else if (isListOfFile(groupedSigners)) { + for(int i = 0; i< getListSize(groupedSigners); i++) { + map.put("grouped_signers[" + i + "]", getFromList(groupedSigners, i)); + } + } + else { + map.put("grouped_signers", JSON.getDefault().getMapper().writeValueAsString(groupedSigners)); + } + } + if (allowDecline != null) { + if (isFileTypeOrListOfFiles(allowDecline)) { + fileTypeFound = true; + } + + if (allowDecline.getClass().equals(java.io.File.class) || + allowDecline.getClass().equals(Integer.class) || + allowDecline.getClass().equals(String.class) || + allowDecline.getClass().isEnum()) { + map.put("allow_decline", allowDecline); + } else if (isListOfFile(allowDecline)) { + for(int i = 0; i< getListSize(allowDecline); i++) { + map.put("allow_decline[" + i + "]", getFromList(allowDecline, i)); + } + } + else { + map.put("allow_decline", JSON.getDefault().getMapper().writeValueAsString(allowDecline)); + } + } + if (allowReassign != null) { + if (isFileTypeOrListOfFiles(allowReassign)) { + fileTypeFound = true; + } + + if (allowReassign.getClass().equals(java.io.File.class) || + allowReassign.getClass().equals(Integer.class) || + allowReassign.getClass().equals(String.class) || + allowReassign.getClass().isEnum()) { + map.put("allow_reassign", allowReassign); + } else if (isListOfFile(allowReassign)) { + for(int i = 0; i< getListSize(allowReassign); i++) { + map.put("allow_reassign[" + i + "]", getFromList(allowReassign, i)); + } + } + else { + map.put("allow_reassign", JSON.getDefault().getMapper().writeValueAsString(allowReassign)); + } + } + if (attachments != null) { + if (isFileTypeOrListOfFiles(attachments)) { + fileTypeFound = true; + } + + if (attachments.getClass().equals(java.io.File.class) || + attachments.getClass().equals(Integer.class) || + attachments.getClass().equals(String.class) || + attachments.getClass().isEnum()) { + map.put("attachments", attachments); + } else if (isListOfFile(attachments)) { + for(int i = 0; i< getListSize(attachments); i++) { + map.put("attachments[" + i + "]", getFromList(attachments, i)); + } + } + else { + map.put("attachments", JSON.getDefault().getMapper().writeValueAsString(attachments)); + } + } + if (ccEmailAddresses != null) { + if (isFileTypeOrListOfFiles(ccEmailAddresses)) { + fileTypeFound = true; + } + + if (ccEmailAddresses.getClass().equals(java.io.File.class) || + ccEmailAddresses.getClass().equals(Integer.class) || + ccEmailAddresses.getClass().equals(String.class) || + ccEmailAddresses.getClass().isEnum()) { + map.put("cc_email_addresses", ccEmailAddresses); + } else if (isListOfFile(ccEmailAddresses)) { + for(int i = 0; i< getListSize(ccEmailAddresses); i++) { + map.put("cc_email_addresses[" + i + "]", getFromList(ccEmailAddresses, i)); + } + } + else { + map.put("cc_email_addresses", JSON.getDefault().getMapper().writeValueAsString(ccEmailAddresses)); + } + } + if (customFields != null) { + if (isFileTypeOrListOfFiles(customFields)) { + fileTypeFound = true; + } + + if (customFields.getClass().equals(java.io.File.class) || + customFields.getClass().equals(Integer.class) || + customFields.getClass().equals(String.class) || + customFields.getClass().isEnum()) { + map.put("custom_fields", customFields); + } else if (isListOfFile(customFields)) { + for(int i = 0; i< getListSize(customFields); i++) { + map.put("custom_fields[" + i + "]", getFromList(customFields, i)); + } + } + else { + map.put("custom_fields", JSON.getDefault().getMapper().writeValueAsString(customFields)); + } + } + if (fieldOptions != null) { + if (isFileTypeOrListOfFiles(fieldOptions)) { + fileTypeFound = true; + } + + if (fieldOptions.getClass().equals(java.io.File.class) || + fieldOptions.getClass().equals(Integer.class) || + fieldOptions.getClass().equals(String.class) || + fieldOptions.getClass().isEnum()) { + map.put("field_options", fieldOptions); + } else if (isListOfFile(fieldOptions)) { + for(int i = 0; i< getListSize(fieldOptions); i++) { + map.put("field_options[" + i + "]", getFromList(fieldOptions, i)); + } + } + else { + map.put("field_options", JSON.getDefault().getMapper().writeValueAsString(fieldOptions)); + } + } + 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 (formFieldRules != null) { + if (isFileTypeOrListOfFiles(formFieldRules)) { + fileTypeFound = true; + } + + if (formFieldRules.getClass().equals(java.io.File.class) || + formFieldRules.getClass().equals(Integer.class) || + formFieldRules.getClass().equals(String.class) || + formFieldRules.getClass().isEnum()) { + map.put("form_field_rules", formFieldRules); + } else if (isListOfFile(formFieldRules)) { + for(int i = 0; i< getListSize(formFieldRules); i++) { + map.put("form_field_rules[" + i + "]", getFromList(formFieldRules, i)); + } + } + else { + map.put("form_field_rules", JSON.getDefault().getMapper().writeValueAsString(formFieldRules)); + } + } + 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 (hideTextTags != null) { + if (isFileTypeOrListOfFiles(hideTextTags)) { + fileTypeFound = true; + } + + if (hideTextTags.getClass().equals(java.io.File.class) || + hideTextTags.getClass().equals(Integer.class) || + hideTextTags.getClass().equals(String.class) || + hideTextTags.getClass().isEnum()) { + map.put("hide_text_tags", hideTextTags); + } else if (isListOfFile(hideTextTags)) { + for(int i = 0; i< getListSize(hideTextTags); i++) { + map.put("hide_text_tags[" + i + "]", getFromList(hideTextTags, i)); + } + } + else { + map.put("hide_text_tags", JSON.getDefault().getMapper().writeValueAsString(hideTextTags)); + } + } + if (message != null) { + if (isFileTypeOrListOfFiles(message)) { + fileTypeFound = true; + } + + if (message.getClass().equals(java.io.File.class) || + message.getClass().equals(Integer.class) || + message.getClass().equals(String.class) || + message.getClass().isEnum()) { + map.put("message", message); + } else if (isListOfFile(message)) { + for(int i = 0; i< getListSize(message); i++) { + map.put("message[" + i + "]", getFromList(message, i)); + } + } + else { + map.put("message", JSON.getDefault().getMapper().writeValueAsString(message)); + } + } + if (metadata != null) { + if (isFileTypeOrListOfFiles(metadata)) { + fileTypeFound = true; + } + + if (metadata.getClass().equals(java.io.File.class) || + metadata.getClass().equals(Integer.class) || + metadata.getClass().equals(String.class) || + metadata.getClass().isEnum()) { + map.put("metadata", metadata); + } else if (isListOfFile(metadata)) { + for(int i = 0; i< getListSize(metadata); i++) { + map.put("metadata[" + i + "]", getFromList(metadata, i)); + } + } + else { + map.put("metadata", JSON.getDefault().getMapper().writeValueAsString(metadata)); + } + } + if (signingOptions != null) { + if (isFileTypeOrListOfFiles(signingOptions)) { + fileTypeFound = true; + } + + if (signingOptions.getClass().equals(java.io.File.class) || + signingOptions.getClass().equals(Integer.class) || + signingOptions.getClass().equals(String.class) || + signingOptions.getClass().isEnum()) { + map.put("signing_options", signingOptions); + } else if (isListOfFile(signingOptions)) { + for(int i = 0; i< getListSize(signingOptions); i++) { + map.put("signing_options[" + i + "]", getFromList(signingOptions, i)); + } + } + else { + map.put("signing_options", JSON.getDefault().getMapper().writeValueAsString(signingOptions)); + } + } + if (subject != null) { + if (isFileTypeOrListOfFiles(subject)) { + fileTypeFound = true; + } + + if (subject.getClass().equals(java.io.File.class) || + subject.getClass().equals(Integer.class) || + subject.getClass().equals(String.class) || + subject.getClass().isEnum()) { + map.put("subject", subject); + } else if (isListOfFile(subject)) { + for(int i = 0; i< getListSize(subject); i++) { + map.put("subject[" + i + "]", getFromList(subject, i)); + } + } + else { + map.put("subject", JSON.getDefault().getMapper().writeValueAsString(subject)); + } + } + if (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 (title != null) { + if (isFileTypeOrListOfFiles(title)) { + fileTypeFound = true; + } + + if (title.getClass().equals(java.io.File.class) || + title.getClass().equals(Integer.class) || + title.getClass().equals(String.class) || + title.getClass().isEnum()) { + map.put("title", title); + } else if (isListOfFile(title)) { + for(int i = 0; i< getListSize(title); i++) { + map.put("title[" + i + "]", getFromList(title, i)); + } + } + else { + map.put("title", JSON.getDefault().getMapper().writeValueAsString(title)); + } + } + if (useTextTags != null) { + if (isFileTypeOrListOfFiles(useTextTags)) { + fileTypeFound = true; + } + + if (useTextTags.getClass().equals(java.io.File.class) || + useTextTags.getClass().equals(Integer.class) || + useTextTags.getClass().equals(String.class) || + useTextTags.getClass().isEnum()) { + map.put("use_text_tags", useTextTags); + } else if (isListOfFile(useTextTags)) { + for(int i = 0; i< getListSize(useTextTags); i++) { + map.put("use_text_tags[" + i + "]", getFromList(useTextTags, i)); + } + } + else { + map.put("use_text_tags", JSON.getDefault().getMapper().writeValueAsString(useTextTags)); + } + } + if (populateAutoFillFields != null) { + if (isFileTypeOrListOfFiles(populateAutoFillFields)) { + fileTypeFound = true; + } + + if (populateAutoFillFields.getClass().equals(java.io.File.class) || + populateAutoFillFields.getClass().equals(Integer.class) || + populateAutoFillFields.getClass().equals(String.class) || + populateAutoFillFields.getClass().isEnum()) { + map.put("populate_auto_fill_fields", populateAutoFillFields); + } else if (isListOfFile(populateAutoFillFields)) { + for(int i = 0; i< getListSize(populateAutoFillFields); i++) { + map.put("populate_auto_fill_fields[" + i + "]", getFromList(populateAutoFillFields, i)); + } + } + else { + map.put("populate_auto_fill_fields", JSON.getDefault().getMapper().writeValueAsString(populateAutoFillFields)); + } + } + if (expiresAt != null) { + if (isFileTypeOrListOfFiles(expiresAt)) { + fileTypeFound = true; + } + + if (expiresAt.getClass().equals(java.io.File.class) || + expiresAt.getClass().equals(Integer.class) || + expiresAt.getClass().equals(String.class) || + expiresAt.getClass().isEnum()) { + map.put("expires_at", expiresAt); + } else if (isListOfFile(expiresAt)) { + for(int i = 0; i< getListSize(expiresAt); i++) { + map.put("expires_at[" + i + "]", getFromList(expiresAt, i)); + } + } + else { + map.put("expires_at", JSON.getDefault().getMapper().writeValueAsString(expiresAt)); + } + } + } catch (Exception e) { + throw new ApiException(e); + } + + return fileTypeFound ? map : new HashMap<>(); + } + + private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { + return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); + } + + private boolean isListOfFile(Object obj) throws Exception { + return obj instanceof java.util.List && !isListEmpty(obj) && getFromList(obj, 0) instanceof java.io.File; + } + + private boolean isListEmpty(Object obj) throws Exception { + return (boolean) Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); + } + + private Object getFromList(Object obj, int index) throws Exception { + return Class.forName(java.util.List.class.getName()).getMethod("get", int.class).invoke(obj, index); + } + + private int getListSize(Object obj) throws Exception { + return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/sdks/java-v2/src/main/java/com/dropbox/sign/model/SignatureRequestEditEmbeddedWithTemplateRequest.java b/sdks/java-v2/src/main/java/com/dropbox/sign/model/SignatureRequestEditEmbeddedWithTemplateRequest.java new file mode 100644 index 000000000..00615239f --- /dev/null +++ b/sdks/java-v2/src/main/java/com/dropbox/sign/model/SignatureRequestEditEmbeddedWithTemplateRequest.java @@ -0,0 +1,943 @@ +/* + * Dropbox Sign API + * Dropbox Sign v3 API + * + * The version of the OpenAPI document: 3.0.0 + * Contact: apisupport@hellosign.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.dropbox.sign.model; + +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.dropbox.sign.model.SubCC; +import com.dropbox.sign.model.SubCustomField; +import com.dropbox.sign.model.SubSignatureRequestTemplateSigner; +import com.dropbox.sign.model.SubSigningOptions; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.io.File; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.dropbox.sign.JSON; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.databind.ObjectMapper; + + +import com.dropbox.sign.ApiException; +/** + * SignatureRequestEditEmbeddedWithTemplateRequest + */ +@JsonPropertyOrder({ + SignatureRequestEditEmbeddedWithTemplateRequest.JSON_PROPERTY_TEMPLATE_IDS, + SignatureRequestEditEmbeddedWithTemplateRequest.JSON_PROPERTY_CLIENT_ID, + SignatureRequestEditEmbeddedWithTemplateRequest.JSON_PROPERTY_SIGNERS, + SignatureRequestEditEmbeddedWithTemplateRequest.JSON_PROPERTY_ALLOW_DECLINE, + SignatureRequestEditEmbeddedWithTemplateRequest.JSON_PROPERTY_CCS, + SignatureRequestEditEmbeddedWithTemplateRequest.JSON_PROPERTY_CUSTOM_FIELDS, + SignatureRequestEditEmbeddedWithTemplateRequest.JSON_PROPERTY_FILES, + SignatureRequestEditEmbeddedWithTemplateRequest.JSON_PROPERTY_FILE_URLS, + SignatureRequestEditEmbeddedWithTemplateRequest.JSON_PROPERTY_MESSAGE, + SignatureRequestEditEmbeddedWithTemplateRequest.JSON_PROPERTY_METADATA, + SignatureRequestEditEmbeddedWithTemplateRequest.JSON_PROPERTY_SIGNING_OPTIONS, + SignatureRequestEditEmbeddedWithTemplateRequest.JSON_PROPERTY_SUBJECT, + SignatureRequestEditEmbeddedWithTemplateRequest.JSON_PROPERTY_TEST_MODE, + SignatureRequestEditEmbeddedWithTemplateRequest.JSON_PROPERTY_TITLE, + SignatureRequestEditEmbeddedWithTemplateRequest.JSON_PROPERTY_POPULATE_AUTO_FILL_FIELDS +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") +@JsonIgnoreProperties(ignoreUnknown=true) +public class SignatureRequestEditEmbeddedWithTemplateRequest { + public static final String JSON_PROPERTY_TEMPLATE_IDS = "template_ids"; + private List templateIds = new ArrayList<>(); + + public static final String JSON_PROPERTY_CLIENT_ID = "client_id"; + private String clientId; + + public static final String JSON_PROPERTY_SIGNERS = "signers"; + private List signers = new ArrayList<>(); + + public static final String JSON_PROPERTY_ALLOW_DECLINE = "allow_decline"; + private Boolean allowDecline = false; + + public static final String JSON_PROPERTY_CCS = "ccs"; + private List ccs = null; + + public static final String JSON_PROPERTY_CUSTOM_FIELDS = "custom_fields"; + private List customFields = null; + + public static final String JSON_PROPERTY_FILES = "files"; + private List files = null; + + public static final String JSON_PROPERTY_FILE_URLS = "file_urls"; + private List fileUrls = null; + + public static final String JSON_PROPERTY_MESSAGE = "message"; + private String message; + + public static final String JSON_PROPERTY_METADATA = "metadata"; + private Map metadata = null; + + public static final String JSON_PROPERTY_SIGNING_OPTIONS = "signing_options"; + private SubSigningOptions signingOptions; + + public static final String JSON_PROPERTY_SUBJECT = "subject"; + private String subject; + + public static final String JSON_PROPERTY_TEST_MODE = "test_mode"; + private Boolean testMode = false; + + public static final String JSON_PROPERTY_TITLE = "title"; + private String title; + + public static final String JSON_PROPERTY_POPULATE_AUTO_FILL_FIELDS = "populate_auto_fill_fields"; + private Boolean populateAutoFillFields = false; + + public SignatureRequestEditEmbeddedWithTemplateRequest() { + } + + /** + * Attempt to instantiate and hydrate a new instance of this class + * @param jsonData String of JSON data representing target object + */ + static public SignatureRequestEditEmbeddedWithTemplateRequest init(String jsonData) throws Exception { + return new ObjectMapper().readValue(jsonData, SignatureRequestEditEmbeddedWithTemplateRequest.class); + } + + static public SignatureRequestEditEmbeddedWithTemplateRequest init(HashMap data) throws Exception { + return new ObjectMapper().readValue( + new ObjectMapper().writeValueAsString(data), + SignatureRequestEditEmbeddedWithTemplateRequest.class + ); + } + + public SignatureRequestEditEmbeddedWithTemplateRequest templateIds(List templateIds) { + this.templateIds = templateIds; + return this; + } + + public SignatureRequestEditEmbeddedWithTemplateRequest addTemplateIdsItem(String templateIdsItem) { + if (this.templateIds == null) { + this.templateIds = new ArrayList<>(); + } + this.templateIds.add(templateIdsItem); + return this; + } + + /** + * Use `template_ids` to create a SignatureRequest from one or more templates, in the order in which the template will be used. + * @return templateIds + */ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_TEMPLATE_IDS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public List getTemplateIds() { + return templateIds; + } + + + @JsonProperty(JSON_PROPERTY_TEMPLATE_IDS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setTemplateIds(List templateIds) { + this.templateIds = templateIds; + } + + + public SignatureRequestEditEmbeddedWithTemplateRequest clientId(String clientId) { + this.clientId = clientId; + return this; + } + + /** + * Client id of the app you're using to create this embedded signature request. Used for security purposes. + * @return clientId + */ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_CLIENT_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getClientId() { + return clientId; + } + + + @JsonProperty(JSON_PROPERTY_CLIENT_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setClientId(String clientId) { + this.clientId = clientId; + } + + + public SignatureRequestEditEmbeddedWithTemplateRequest signers(List signers) { + this.signers = signers; + return this; + } + + public SignatureRequestEditEmbeddedWithTemplateRequest addSignersItem(SubSignatureRequestTemplateSigner signersItem) { + if (this.signers == null) { + this.signers = new ArrayList<>(); + } + this.signers.add(signersItem); + return this; + } + + /** + * Add Signers to your Templated-based Signature Request. + * @return signers + */ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_SIGNERS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public List getSigners() { + return signers; + } + + + @JsonProperty(JSON_PROPERTY_SIGNERS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setSigners(List signers) { + this.signers = signers; + } + + + public SignatureRequestEditEmbeddedWithTemplateRequest allowDecline(Boolean allowDecline) { + this.allowDecline = allowDecline; + return this; + } + + /** + * Allows signers to decline to sign a document if `true`. Defaults to `false`. + * @return allowDecline + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ALLOW_DECLINE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Boolean getAllowDecline() { + return allowDecline; + } + + + @JsonProperty(JSON_PROPERTY_ALLOW_DECLINE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAllowDecline(Boolean allowDecline) { + this.allowDecline = allowDecline; + } + + + public SignatureRequestEditEmbeddedWithTemplateRequest ccs(List ccs) { + this.ccs = ccs; + return this; + } + + public SignatureRequestEditEmbeddedWithTemplateRequest addCcsItem(SubCC ccsItem) { + if (this.ccs == null) { + this.ccs = new ArrayList<>(); + } + this.ccs.add(ccsItem); + return this; + } + + /** + * Add CC email recipients. Required when a CC role exists for the Template. + * @return ccs + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CCS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getCcs() { + return ccs; + } + + + @JsonProperty(JSON_PROPERTY_CCS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCcs(List ccs) { + this.ccs = ccs; + } + + + public SignatureRequestEditEmbeddedWithTemplateRequest customFields(List customFields) { + this.customFields = customFields; + return this; + } + + public SignatureRequestEditEmbeddedWithTemplateRequest addCustomFieldsItem(SubCustomField customFieldsItem) { + if (this.customFields == null) { + this.customFields = new ArrayList<>(); + } + this.customFields.add(customFieldsItem); + return this; + } + + /** + * An array defining values and options for custom fields. Required when a custom field exists in the Template. + * @return customFields + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CUSTOM_FIELDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getCustomFields() { + return customFields; + } + + + @JsonProperty(JSON_PROPERTY_CUSTOM_FIELDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCustomFields(List customFields) { + this.customFields = customFields; + } + + + public SignatureRequestEditEmbeddedWithTemplateRequest files(List files) { + this.files = files; + return this; + } + + public SignatureRequestEditEmbeddedWithTemplateRequest addFilesItem(File filesItem) { + if (this.files == null) { + this.files = new ArrayList<>(); + } + this.files.add(filesItem); + return this; + } + + /** + * Use `files[]` to indicate the uploaded file(s) to send for signature. This endpoint requires either **files** or **file_urls[]**, but not both. + * @return files + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_FILES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getFiles() { + return files; + } + + + @JsonProperty(JSON_PROPERTY_FILES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setFiles(List files) { + this.files = files; + } + + + public SignatureRequestEditEmbeddedWithTemplateRequest fileUrls(List fileUrls) { + this.fileUrls = fileUrls; + return this; + } + + public SignatureRequestEditEmbeddedWithTemplateRequest addFileUrlsItem(String fileUrlsItem) { + if (this.fileUrls == null) { + this.fileUrls = new ArrayList<>(); + } + this.fileUrls.add(fileUrlsItem); + return this; + } + + /** + * Use `file_urls[]` to have Dropbox Sign download the file(s) to send for signature. This endpoint requires either **files** or **file_urls[]**, but not both. + * @return fileUrls + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_FILE_URLS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getFileUrls() { + return fileUrls; + } + + + @JsonProperty(JSON_PROPERTY_FILE_URLS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setFileUrls(List fileUrls) { + this.fileUrls = fileUrls; + } + + + public SignatureRequestEditEmbeddedWithTemplateRequest message(String message) { + this.message = message; + return this; + } + + /** + * The custom message in the email that will be sent to the signers. + * @return message + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_MESSAGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getMessage() { + return message; + } + + + @JsonProperty(JSON_PROPERTY_MESSAGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMessage(String message) { + this.message = message; + } + + + public SignatureRequestEditEmbeddedWithTemplateRequest metadata(Map metadata) { + this.metadata = metadata; + return this; + } + + public SignatureRequestEditEmbeddedWithTemplateRequest putMetadataItem(String key, Object metadataItem) { + if (this.metadata == null) { + this.metadata = new HashMap<>(); + } + this.metadata.put(key, metadataItem); + return this; + } + + /** + * Key-value data that should be attached to the signature request. This metadata is included in all API responses and events involving the signature request. For example, use the metadata field to store a signer's order number for look up when receiving events for the signature request. Each request can include up to 10 metadata keys (or 50 nested metadata keys), with key names up to 40 characters long and values up to 1000 characters long. + * @return metadata + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_METADATA) + @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) + + public Map getMetadata() { + return metadata; + } + + + @JsonProperty(JSON_PROPERTY_METADATA) + @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) + public void setMetadata(Map metadata) { + this.metadata = metadata; + } + + + public SignatureRequestEditEmbeddedWithTemplateRequest signingOptions(SubSigningOptions signingOptions) { + this.signingOptions = signingOptions; + return this; + } + + /** + * Get signingOptions + * @return signingOptions + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SIGNING_OPTIONS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public SubSigningOptions getSigningOptions() { + return signingOptions; + } + + + @JsonProperty(JSON_PROPERTY_SIGNING_OPTIONS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSigningOptions(SubSigningOptions signingOptions) { + this.signingOptions = signingOptions; + } + + + public SignatureRequestEditEmbeddedWithTemplateRequest subject(String subject) { + this.subject = subject; + return this; + } + + /** + * The subject in the email that will be sent to the signers. + * @return subject + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SUBJECT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getSubject() { + return subject; + } + + + @JsonProperty(JSON_PROPERTY_SUBJECT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSubject(String subject) { + this.subject = subject; + } + + + public SignatureRequestEditEmbeddedWithTemplateRequest testMode(Boolean testMode) { + this.testMode = testMode; + return this; + } + + /** + * Whether this is a test, the signature request will not be legally binding if set to `true`. Defaults to `false`. + * @return testMode + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TEST_MODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Boolean getTestMode() { + return testMode; + } + + + @JsonProperty(JSON_PROPERTY_TEST_MODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTestMode(Boolean testMode) { + this.testMode = testMode; + } + + + public SignatureRequestEditEmbeddedWithTemplateRequest title(String title) { + this.title = title; + return this; + } + + /** + * The title you want to assign to the SignatureRequest. + * @return title + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TITLE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getTitle() { + return title; + } + + + @JsonProperty(JSON_PROPERTY_TITLE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTitle(String title) { + this.title = title; + } + + + public SignatureRequestEditEmbeddedWithTemplateRequest populateAutoFillFields(Boolean populateAutoFillFields) { + this.populateAutoFillFields = populateAutoFillFields; + return this; + } + + /** + * 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. + * @return populateAutoFillFields + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_POPULATE_AUTO_FILL_FIELDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Boolean getPopulateAutoFillFields() { + return populateAutoFillFields; + } + + + @JsonProperty(JSON_PROPERTY_POPULATE_AUTO_FILL_FIELDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPopulateAutoFillFields(Boolean populateAutoFillFields) { + this.populateAutoFillFields = populateAutoFillFields; + } + + + /** + * Return true if this SignatureRequestEditEmbeddedWithTemplateRequest object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SignatureRequestEditEmbeddedWithTemplateRequest signatureRequestEditEmbeddedWithTemplateRequest = (SignatureRequestEditEmbeddedWithTemplateRequest) o; + return Objects.equals(this.templateIds, signatureRequestEditEmbeddedWithTemplateRequest.templateIds) && + Objects.equals(this.clientId, signatureRequestEditEmbeddedWithTemplateRequest.clientId) && + Objects.equals(this.signers, signatureRequestEditEmbeddedWithTemplateRequest.signers) && + Objects.equals(this.allowDecline, signatureRequestEditEmbeddedWithTemplateRequest.allowDecline) && + Objects.equals(this.ccs, signatureRequestEditEmbeddedWithTemplateRequest.ccs) && + Objects.equals(this.customFields, signatureRequestEditEmbeddedWithTemplateRequest.customFields) && + Objects.equals(this.files, signatureRequestEditEmbeddedWithTemplateRequest.files) && + Objects.equals(this.fileUrls, signatureRequestEditEmbeddedWithTemplateRequest.fileUrls) && + Objects.equals(this.message, signatureRequestEditEmbeddedWithTemplateRequest.message) && + Objects.equals(this.metadata, signatureRequestEditEmbeddedWithTemplateRequest.metadata) && + Objects.equals(this.signingOptions, signatureRequestEditEmbeddedWithTemplateRequest.signingOptions) && + Objects.equals(this.subject, signatureRequestEditEmbeddedWithTemplateRequest.subject) && + Objects.equals(this.testMode, signatureRequestEditEmbeddedWithTemplateRequest.testMode) && + Objects.equals(this.title, signatureRequestEditEmbeddedWithTemplateRequest.title) && + Objects.equals(this.populateAutoFillFields, signatureRequestEditEmbeddedWithTemplateRequest.populateAutoFillFields); + } + + @Override + public int hashCode() { + return Objects.hash(templateIds, clientId, signers, allowDecline, ccs, customFields, files, fileUrls, message, metadata, signingOptions, subject, testMode, title, populateAutoFillFields); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SignatureRequestEditEmbeddedWithTemplateRequest {\n"); + sb.append(" templateIds: ").append(toIndentedString(templateIds)).append("\n"); + sb.append(" clientId: ").append(toIndentedString(clientId)).append("\n"); + sb.append(" signers: ").append(toIndentedString(signers)).append("\n"); + sb.append(" allowDecline: ").append(toIndentedString(allowDecline)).append("\n"); + sb.append(" ccs: ").append(toIndentedString(ccs)).append("\n"); + sb.append(" customFields: ").append(toIndentedString(customFields)).append("\n"); + sb.append(" files: ").append(toIndentedString(files)).append("\n"); + sb.append(" fileUrls: ").append(toIndentedString(fileUrls)).append("\n"); + sb.append(" message: ").append(toIndentedString(message)).append("\n"); + sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); + sb.append(" signingOptions: ").append(toIndentedString(signingOptions)).append("\n"); + 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(" populateAutoFillFields: ").append(toIndentedString(populateAutoFillFields)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public Map createFormData() throws ApiException { + Map map = new HashMap<>(); + boolean fileTypeFound = false; + try { + if (templateIds != null) { + if (isFileTypeOrListOfFiles(templateIds)) { + fileTypeFound = true; + } + + if (templateIds.getClass().equals(java.io.File.class) || + templateIds.getClass().equals(Integer.class) || + templateIds.getClass().equals(String.class) || + templateIds.getClass().isEnum()) { + map.put("template_ids", templateIds); + } else if (isListOfFile(templateIds)) { + for(int i = 0; i< getListSize(templateIds); i++) { + map.put("template_ids[" + i + "]", getFromList(templateIds, i)); + } + } + else { + map.put("template_ids", JSON.getDefault().getMapper().writeValueAsString(templateIds)); + } + } + if (clientId != null) { + if (isFileTypeOrListOfFiles(clientId)) { + fileTypeFound = true; + } + + if (clientId.getClass().equals(java.io.File.class) || + clientId.getClass().equals(Integer.class) || + clientId.getClass().equals(String.class) || + clientId.getClass().isEnum()) { + map.put("client_id", clientId); + } else if (isListOfFile(clientId)) { + for(int i = 0; i< getListSize(clientId); i++) { + map.put("client_id[" + i + "]", getFromList(clientId, i)); + } + } + else { + map.put("client_id", JSON.getDefault().getMapper().writeValueAsString(clientId)); + } + } + if (signers != null) { + if (isFileTypeOrListOfFiles(signers)) { + fileTypeFound = true; + } + + if (signers.getClass().equals(java.io.File.class) || + signers.getClass().equals(Integer.class) || + signers.getClass().equals(String.class) || + signers.getClass().isEnum()) { + map.put("signers", signers); + } else if (isListOfFile(signers)) { + for(int i = 0; i< getListSize(signers); i++) { + map.put("signers[" + i + "]", getFromList(signers, i)); + } + } + else { + map.put("signers", JSON.getDefault().getMapper().writeValueAsString(signers)); + } + } + if (allowDecline != null) { + if (isFileTypeOrListOfFiles(allowDecline)) { + fileTypeFound = true; + } + + if (allowDecline.getClass().equals(java.io.File.class) || + allowDecline.getClass().equals(Integer.class) || + allowDecline.getClass().equals(String.class) || + allowDecline.getClass().isEnum()) { + map.put("allow_decline", allowDecline); + } else if (isListOfFile(allowDecline)) { + for(int i = 0; i< getListSize(allowDecline); i++) { + map.put("allow_decline[" + i + "]", getFromList(allowDecline, i)); + } + } + else { + map.put("allow_decline", JSON.getDefault().getMapper().writeValueAsString(allowDecline)); + } + } + if (ccs != null) { + if (isFileTypeOrListOfFiles(ccs)) { + fileTypeFound = true; + } + + if (ccs.getClass().equals(java.io.File.class) || + ccs.getClass().equals(Integer.class) || + ccs.getClass().equals(String.class) || + ccs.getClass().isEnum()) { + map.put("ccs", ccs); + } else if (isListOfFile(ccs)) { + for(int i = 0; i< getListSize(ccs); i++) { + map.put("ccs[" + i + "]", getFromList(ccs, i)); + } + } + else { + map.put("ccs", JSON.getDefault().getMapper().writeValueAsString(ccs)); + } + } + if (customFields != null) { + if (isFileTypeOrListOfFiles(customFields)) { + fileTypeFound = true; + } + + if (customFields.getClass().equals(java.io.File.class) || + customFields.getClass().equals(Integer.class) || + customFields.getClass().equals(String.class) || + customFields.getClass().isEnum()) { + map.put("custom_fields", customFields); + } else if (isListOfFile(customFields)) { + for(int i = 0; i< getListSize(customFields); i++) { + map.put("custom_fields[" + i + "]", getFromList(customFields, i)); + } + } + else { + map.put("custom_fields", JSON.getDefault().getMapper().writeValueAsString(customFields)); + } + } + if (files != null) { + if (isFileTypeOrListOfFiles(files)) { + fileTypeFound = true; + } + + if (files.getClass().equals(java.io.File.class) || + files.getClass().equals(Integer.class) || + files.getClass().equals(String.class) || + files.getClass().isEnum()) { + map.put("files", files); + } else if (isListOfFile(files)) { + for(int i = 0; i< getListSize(files); i++) { + map.put("files[" + i + "]", getFromList(files, i)); + } + } + else { + map.put("files", JSON.getDefault().getMapper().writeValueAsString(files)); + } + } + if (fileUrls != null) { + if (isFileTypeOrListOfFiles(fileUrls)) { + fileTypeFound = true; + } + + if (fileUrls.getClass().equals(java.io.File.class) || + fileUrls.getClass().equals(Integer.class) || + fileUrls.getClass().equals(String.class) || + fileUrls.getClass().isEnum()) { + map.put("file_urls", fileUrls); + } else if (isListOfFile(fileUrls)) { + for(int i = 0; i< getListSize(fileUrls); i++) { + map.put("file_urls[" + i + "]", getFromList(fileUrls, i)); + } + } + else { + map.put("file_urls", JSON.getDefault().getMapper().writeValueAsString(fileUrls)); + } + } + if (message != null) { + if (isFileTypeOrListOfFiles(message)) { + fileTypeFound = true; + } + + if (message.getClass().equals(java.io.File.class) || + message.getClass().equals(Integer.class) || + message.getClass().equals(String.class) || + message.getClass().isEnum()) { + map.put("message", message); + } else if (isListOfFile(message)) { + for(int i = 0; i< getListSize(message); i++) { + map.put("message[" + i + "]", getFromList(message, i)); + } + } + else { + map.put("message", JSON.getDefault().getMapper().writeValueAsString(message)); + } + } + if (metadata != null) { + if (isFileTypeOrListOfFiles(metadata)) { + fileTypeFound = true; + } + + if (metadata.getClass().equals(java.io.File.class) || + metadata.getClass().equals(Integer.class) || + metadata.getClass().equals(String.class) || + metadata.getClass().isEnum()) { + map.put("metadata", metadata); + } else if (isListOfFile(metadata)) { + for(int i = 0; i< getListSize(metadata); i++) { + map.put("metadata[" + i + "]", getFromList(metadata, i)); + } + } + else { + map.put("metadata", JSON.getDefault().getMapper().writeValueAsString(metadata)); + } + } + if (signingOptions != null) { + if (isFileTypeOrListOfFiles(signingOptions)) { + fileTypeFound = true; + } + + if (signingOptions.getClass().equals(java.io.File.class) || + signingOptions.getClass().equals(Integer.class) || + signingOptions.getClass().equals(String.class) || + signingOptions.getClass().isEnum()) { + map.put("signing_options", signingOptions); + } else if (isListOfFile(signingOptions)) { + for(int i = 0; i< getListSize(signingOptions); i++) { + map.put("signing_options[" + i + "]", getFromList(signingOptions, i)); + } + } + else { + map.put("signing_options", JSON.getDefault().getMapper().writeValueAsString(signingOptions)); + } + } + if (subject != null) { + if (isFileTypeOrListOfFiles(subject)) { + fileTypeFound = true; + } + + if (subject.getClass().equals(java.io.File.class) || + subject.getClass().equals(Integer.class) || + subject.getClass().equals(String.class) || + subject.getClass().isEnum()) { + map.put("subject", subject); + } else if (isListOfFile(subject)) { + for(int i = 0; i< getListSize(subject); i++) { + map.put("subject[" + i + "]", getFromList(subject, i)); + } + } + else { + map.put("subject", JSON.getDefault().getMapper().writeValueAsString(subject)); + } + } + if (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 (title != null) { + if (isFileTypeOrListOfFiles(title)) { + fileTypeFound = true; + } + + if (title.getClass().equals(java.io.File.class) || + title.getClass().equals(Integer.class) || + title.getClass().equals(String.class) || + title.getClass().isEnum()) { + map.put("title", title); + } else if (isListOfFile(title)) { + for(int i = 0; i< getListSize(title); i++) { + map.put("title[" + i + "]", getFromList(title, i)); + } + } + else { + map.put("title", JSON.getDefault().getMapper().writeValueAsString(title)); + } + } + if (populateAutoFillFields != null) { + if (isFileTypeOrListOfFiles(populateAutoFillFields)) { + fileTypeFound = true; + } + + if (populateAutoFillFields.getClass().equals(java.io.File.class) || + populateAutoFillFields.getClass().equals(Integer.class) || + populateAutoFillFields.getClass().equals(String.class) || + populateAutoFillFields.getClass().isEnum()) { + map.put("populate_auto_fill_fields", populateAutoFillFields); + } else if (isListOfFile(populateAutoFillFields)) { + for(int i = 0; i< getListSize(populateAutoFillFields); i++) { + map.put("populate_auto_fill_fields[" + i + "]", getFromList(populateAutoFillFields, i)); + } + } + else { + map.put("populate_auto_fill_fields", JSON.getDefault().getMapper().writeValueAsString(populateAutoFillFields)); + } + } + } catch (Exception e) { + throw new ApiException(e); + } + + return fileTypeFound ? map : new HashMap<>(); + } + + private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { + return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); + } + + private boolean isListOfFile(Object obj) throws Exception { + return obj instanceof java.util.List && !isListEmpty(obj) && getFromList(obj, 0) instanceof java.io.File; + } + + private boolean isListEmpty(Object obj) throws Exception { + return (boolean) Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); + } + + private Object getFromList(Object obj, int index) throws Exception { + return Class.forName(java.util.List.class.getName()).getMethod("get", int.class).invoke(obj, index); + } + + private int getListSize(Object obj) throws Exception { + return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/sdks/java-v2/src/main/java/com/dropbox/sign/model/SignatureRequestEditRequest.java b/sdks/java-v2/src/main/java/com/dropbox/sign/model/SignatureRequestEditRequest.java new file mode 100644 index 000000000..96dbcb67e --- /dev/null +++ b/sdks/java-v2/src/main/java/com/dropbox/sign/model/SignatureRequestEditRequest.java @@ -0,0 +1,1480 @@ +/* + * Dropbox Sign API + * Dropbox Sign v3 API + * + * The version of the OpenAPI document: 3.0.0 + * Contact: apisupport@hellosign.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.dropbox.sign.model; + +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.dropbox.sign.model.SubAttachment; +import com.dropbox.sign.model.SubCustomField; +import com.dropbox.sign.model.SubFieldOptions; +import com.dropbox.sign.model.SubFormFieldGroup; +import com.dropbox.sign.model.SubFormFieldRule; +import com.dropbox.sign.model.SubFormFieldsPerDocumentBase; +import com.dropbox.sign.model.SubSignatureRequestGroupedSigners; +import com.dropbox.sign.model.SubSignatureRequestSigner; +import com.dropbox.sign.model.SubSigningOptions; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.io.File; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.dropbox.sign.JSON; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.databind.ObjectMapper; + + +import com.dropbox.sign.ApiException; +/** + * SignatureRequestEditRequest + */ +@JsonPropertyOrder({ + SignatureRequestEditRequest.JSON_PROPERTY_FILES, + SignatureRequestEditRequest.JSON_PROPERTY_FILE_URLS, + SignatureRequestEditRequest.JSON_PROPERTY_SIGNERS, + SignatureRequestEditRequest.JSON_PROPERTY_GROUPED_SIGNERS, + SignatureRequestEditRequest.JSON_PROPERTY_ALLOW_DECLINE, + SignatureRequestEditRequest.JSON_PROPERTY_ALLOW_REASSIGN, + SignatureRequestEditRequest.JSON_PROPERTY_ATTACHMENTS, + SignatureRequestEditRequest.JSON_PROPERTY_CC_EMAIL_ADDRESSES, + SignatureRequestEditRequest.JSON_PROPERTY_CLIENT_ID, + SignatureRequestEditRequest.JSON_PROPERTY_CUSTOM_FIELDS, + SignatureRequestEditRequest.JSON_PROPERTY_FIELD_OPTIONS, + SignatureRequestEditRequest.JSON_PROPERTY_FORM_FIELD_GROUPS, + SignatureRequestEditRequest.JSON_PROPERTY_FORM_FIELD_RULES, + SignatureRequestEditRequest.JSON_PROPERTY_FORM_FIELDS_PER_DOCUMENT, + SignatureRequestEditRequest.JSON_PROPERTY_HIDE_TEXT_TAGS, + SignatureRequestEditRequest.JSON_PROPERTY_IS_EID, + SignatureRequestEditRequest.JSON_PROPERTY_MESSAGE, + SignatureRequestEditRequest.JSON_PROPERTY_METADATA, + SignatureRequestEditRequest.JSON_PROPERTY_SIGNING_OPTIONS, + SignatureRequestEditRequest.JSON_PROPERTY_SIGNING_REDIRECT_URL, + SignatureRequestEditRequest.JSON_PROPERTY_SUBJECT, + SignatureRequestEditRequest.JSON_PROPERTY_TEST_MODE, + SignatureRequestEditRequest.JSON_PROPERTY_TITLE, + SignatureRequestEditRequest.JSON_PROPERTY_USE_TEXT_TAGS, + SignatureRequestEditRequest.JSON_PROPERTY_EXPIRES_AT +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") +@JsonIgnoreProperties(ignoreUnknown=true) +public class SignatureRequestEditRequest { + public static final String JSON_PROPERTY_FILES = "files"; + private List files = null; + + public static final String JSON_PROPERTY_FILE_URLS = "file_urls"; + private List fileUrls = null; + + public static final String JSON_PROPERTY_SIGNERS = "signers"; + private List signers = null; + + public static final String JSON_PROPERTY_GROUPED_SIGNERS = "grouped_signers"; + private List groupedSigners = null; + + public static final String JSON_PROPERTY_ALLOW_DECLINE = "allow_decline"; + private Boolean allowDecline = false; + + public static final String JSON_PROPERTY_ALLOW_REASSIGN = "allow_reassign"; + private Boolean allowReassign = false; + + public static final String JSON_PROPERTY_ATTACHMENTS = "attachments"; + private List attachments = null; + + public static final String JSON_PROPERTY_CC_EMAIL_ADDRESSES = "cc_email_addresses"; + private List ccEmailAddresses = null; + + public static final String JSON_PROPERTY_CLIENT_ID = "client_id"; + private String clientId; + + public static final String JSON_PROPERTY_CUSTOM_FIELDS = "custom_fields"; + private List customFields = null; + + public static final String JSON_PROPERTY_FIELD_OPTIONS = "field_options"; + private SubFieldOptions fieldOptions; + + public static final String JSON_PROPERTY_FORM_FIELD_GROUPS = "form_field_groups"; + private List formFieldGroups = null; + + public static final String JSON_PROPERTY_FORM_FIELD_RULES = "form_field_rules"; + private List formFieldRules = null; + + public static final String JSON_PROPERTY_FORM_FIELDS_PER_DOCUMENT = "form_fields_per_document"; + private List formFieldsPerDocument = null; + + public static final String JSON_PROPERTY_HIDE_TEXT_TAGS = "hide_text_tags"; + private Boolean hideTextTags = false; + + public static final String JSON_PROPERTY_IS_EID = "is_eid"; + private Boolean isEid = false; + + public static final String JSON_PROPERTY_MESSAGE = "message"; + private String message; + + public static final String JSON_PROPERTY_METADATA = "metadata"; + private Map metadata = null; + + public static final String JSON_PROPERTY_SIGNING_OPTIONS = "signing_options"; + private SubSigningOptions signingOptions; + + public static final String JSON_PROPERTY_SIGNING_REDIRECT_URL = "signing_redirect_url"; + private String signingRedirectUrl; + + public static final String JSON_PROPERTY_SUBJECT = "subject"; + private String subject; + + public static final String JSON_PROPERTY_TEST_MODE = "test_mode"; + private Boolean testMode = false; + + public static final String JSON_PROPERTY_TITLE = "title"; + private String title; + + public static final String JSON_PROPERTY_USE_TEXT_TAGS = "use_text_tags"; + private Boolean useTextTags = false; + + public static final String JSON_PROPERTY_EXPIRES_AT = "expires_at"; + private Integer expiresAt; + + public SignatureRequestEditRequest() { + } + + /** + * Attempt to instantiate and hydrate a new instance of this class + * @param jsonData String of JSON data representing target object + */ + static public SignatureRequestEditRequest init(String jsonData) throws Exception { + return new ObjectMapper().readValue(jsonData, SignatureRequestEditRequest.class); + } + + static public SignatureRequestEditRequest init(HashMap data) throws Exception { + return new ObjectMapper().readValue( + new ObjectMapper().writeValueAsString(data), + SignatureRequestEditRequest.class + ); + } + + public SignatureRequestEditRequest files(List files) { + this.files = files; + return this; + } + + public SignatureRequestEditRequest addFilesItem(File filesItem) { + if (this.files == null) { + this.files = new ArrayList<>(); + } + this.files.add(filesItem); + return this; + } + + /** + * Use `files[]` to indicate the uploaded file(s) to send for signature. This endpoint requires either **files** or **file_urls[]**, but not both. + * @return files + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_FILES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getFiles() { + return files; + } + + + @JsonProperty(JSON_PROPERTY_FILES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setFiles(List files) { + this.files = files; + } + + + public SignatureRequestEditRequest fileUrls(List fileUrls) { + this.fileUrls = fileUrls; + return this; + } + + public SignatureRequestEditRequest addFileUrlsItem(String fileUrlsItem) { + if (this.fileUrls == null) { + this.fileUrls = new ArrayList<>(); + } + this.fileUrls.add(fileUrlsItem); + return this; + } + + /** + * Use `file_urls[]` to have Dropbox Sign download the file(s) to send for signature. This endpoint requires either **files** or **file_urls[]**, but not both. + * @return fileUrls + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_FILE_URLS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getFileUrls() { + return fileUrls; + } + + + @JsonProperty(JSON_PROPERTY_FILE_URLS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setFileUrls(List fileUrls) { + this.fileUrls = fileUrls; + } + + + public SignatureRequestEditRequest signers(List signers) { + this.signers = signers; + return this; + } + + public SignatureRequestEditRequest addSignersItem(SubSignatureRequestSigner signersItem) { + if (this.signers == null) { + this.signers = new ArrayList<>(); + } + this.signers.add(signersItem); + return this; + } + + /** + * Add Signers to your Signature Request. This endpoint requires either **signers** or **grouped_signers**, but not both. + * @return signers + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SIGNERS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getSigners() { + return signers; + } + + + @JsonProperty(JSON_PROPERTY_SIGNERS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSigners(List signers) { + this.signers = signers; + } + + + public SignatureRequestEditRequest groupedSigners(List groupedSigners) { + this.groupedSigners = groupedSigners; + return this; + } + + public SignatureRequestEditRequest addGroupedSignersItem(SubSignatureRequestGroupedSigners groupedSignersItem) { + if (this.groupedSigners == null) { + this.groupedSigners = new ArrayList<>(); + } + this.groupedSigners.add(groupedSignersItem); + return this; + } + + /** + * Add Grouped Signers to your Signature Request. This endpoint requires either **signers** or **grouped_signers**, but not both. + * @return groupedSigners + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_GROUPED_SIGNERS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getGroupedSigners() { + return groupedSigners; + } + + + @JsonProperty(JSON_PROPERTY_GROUPED_SIGNERS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setGroupedSigners(List groupedSigners) { + this.groupedSigners = groupedSigners; + } + + + public SignatureRequestEditRequest allowDecline(Boolean allowDecline) { + this.allowDecline = allowDecline; + return this; + } + + /** + * Allows signers to decline to sign a document if `true`. Defaults to `false`. + * @return allowDecline + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ALLOW_DECLINE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Boolean getAllowDecline() { + return allowDecline; + } + + + @JsonProperty(JSON_PROPERTY_ALLOW_DECLINE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAllowDecline(Boolean allowDecline) { + this.allowDecline = allowDecline; + } + + + public SignatureRequestEditRequest allowReassign(Boolean allowReassign) { + this.allowReassign = allowReassign; + return this; + } + + /** + * Allows signers to reassign their signature requests to other signers if set to `true`. Defaults to `false`. **NOTE:** Only available for Premium plan and higher. + * @return allowReassign + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ALLOW_REASSIGN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Boolean getAllowReassign() { + return allowReassign; + } + + + @JsonProperty(JSON_PROPERTY_ALLOW_REASSIGN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAllowReassign(Boolean allowReassign) { + this.allowReassign = allowReassign; + } + + + public SignatureRequestEditRequest attachments(List attachments) { + this.attachments = attachments; + return this; + } + + public SignatureRequestEditRequest addAttachmentsItem(SubAttachment attachmentsItem) { + if (this.attachments == null) { + this.attachments = new ArrayList<>(); + } + this.attachments.add(attachmentsItem); + return this; + } + + /** + * A list describing the attachments + * @return attachments + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ATTACHMENTS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getAttachments() { + return attachments; + } + + + @JsonProperty(JSON_PROPERTY_ATTACHMENTS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAttachments(List attachments) { + this.attachments = attachments; + } + + + public SignatureRequestEditRequest ccEmailAddresses(List ccEmailAddresses) { + this.ccEmailAddresses = ccEmailAddresses; + return this; + } + + public SignatureRequestEditRequest addCcEmailAddressesItem(String ccEmailAddressesItem) { + if (this.ccEmailAddresses == null) { + this.ccEmailAddresses = new ArrayList<>(); + } + this.ccEmailAddresses.add(ccEmailAddressesItem); + return this; + } + + /** + * The email addresses that should be CCed. + * @return ccEmailAddresses + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CC_EMAIL_ADDRESSES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getCcEmailAddresses() { + return ccEmailAddresses; + } + + + @JsonProperty(JSON_PROPERTY_CC_EMAIL_ADDRESSES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCcEmailAddresses(List ccEmailAddresses) { + this.ccEmailAddresses = ccEmailAddresses; + } + + + public SignatureRequestEditRequest clientId(String clientId) { + this.clientId = clientId; + return this; + } + + /** + * The client id of the API App you want to associate with this request. Used to apply the branding and callback url defined for the app. + * @return clientId + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CLIENT_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getClientId() { + return clientId; + } + + + @JsonProperty(JSON_PROPERTY_CLIENT_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setClientId(String clientId) { + this.clientId = clientId; + } + + + public SignatureRequestEditRequest customFields(List customFields) { + this.customFields = customFields; + return this; + } + + public SignatureRequestEditRequest addCustomFieldsItem(SubCustomField customFieldsItem) { + if (this.customFields == null) { + this.customFields = new ArrayList<>(); + } + this.customFields.add(customFieldsItem); + return this; + } + + /** + * When used together with merge fields, `custom_fields` allows users to add pre-filled data to their signature requests. Pre-filled data can be used with \"send-once\" signature requests by adding merge fields with `form_fields_per_document` or [Text Tags](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) while passing values back with `custom_fields` together in one API call. For using pre-filled on repeatable signature requests, merge fields are added to templates in the Dropbox Sign UI or by calling [/template/create_embedded_draft](/api/reference/operation/templateCreateEmbeddedDraft) and then passing `custom_fields` on subsequent signature requests referencing that template. + * @return customFields + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CUSTOM_FIELDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getCustomFields() { + return customFields; + } + + + @JsonProperty(JSON_PROPERTY_CUSTOM_FIELDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCustomFields(List customFields) { + this.customFields = customFields; + } + + + public SignatureRequestEditRequest fieldOptions(SubFieldOptions fieldOptions) { + this.fieldOptions = fieldOptions; + return this; + } + + /** + * Get fieldOptions + * @return fieldOptions + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_FIELD_OPTIONS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public SubFieldOptions getFieldOptions() { + return fieldOptions; + } + + + @JsonProperty(JSON_PROPERTY_FIELD_OPTIONS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setFieldOptions(SubFieldOptions fieldOptions) { + this.fieldOptions = fieldOptions; + } + + + public SignatureRequestEditRequest formFieldGroups(List formFieldGroups) { + this.formFieldGroups = formFieldGroups; + return this; + } + + public SignatureRequestEditRequest addFormFieldGroupsItem(SubFormFieldGroup formFieldGroupsItem) { + if (this.formFieldGroups == null) { + this.formFieldGroups = new ArrayList<>(); + } + this.formFieldGroups.add(formFieldGroupsItem); + return this; + } + + /** + * Group information for fields defined in `form_fields_per_document`. String-indexed JSON array with `group_label` and `requirement` keys. `form_fields_per_document` must contain fields referencing a group defined in `form_field_groups`. + * @return formFieldGroups + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_FORM_FIELD_GROUPS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getFormFieldGroups() { + return formFieldGroups; + } + + + @JsonProperty(JSON_PROPERTY_FORM_FIELD_GROUPS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setFormFieldGroups(List formFieldGroups) { + this.formFieldGroups = formFieldGroups; + } + + + public SignatureRequestEditRequest formFieldRules(List formFieldRules) { + this.formFieldRules = formFieldRules; + return this; + } + + public SignatureRequestEditRequest addFormFieldRulesItem(SubFormFieldRule formFieldRulesItem) { + if (this.formFieldRules == null) { + this.formFieldRules = new ArrayList<>(); + } + this.formFieldRules.add(formFieldRulesItem); + return this; + } + + /** + * Conditional Logic rules for fields defined in `form_fields_per_document`. + * @return formFieldRules + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_FORM_FIELD_RULES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getFormFieldRules() { + return formFieldRules; + } + + + @JsonProperty(JSON_PROPERTY_FORM_FIELD_RULES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setFormFieldRules(List formFieldRules) { + this.formFieldRules = formFieldRules; + } + + + public SignatureRequestEditRequest formFieldsPerDocument(List formFieldsPerDocument) { + this.formFieldsPerDocument = formFieldsPerDocument; + return this; + } + + public SignatureRequestEditRequest addFormFieldsPerDocumentItem(SubFormFieldsPerDocumentBase formFieldsPerDocumentItem) { + if (this.formFieldsPerDocument == null) { + this.formFieldsPerDocument = new ArrayList<>(); + } + this.formFieldsPerDocument.add(formFieldsPerDocumentItem); + return this; + } + + /** + * The fields that should appear on the document, expressed as an array of objects. (For more details you can read about it here: [Using Form Fields per Document](/docs/openapi/form-fields-per-document).) **NOTE:** Fields like **text**, **dropdown**, **checkbox**, **radio**, and **hyperlink** have additional required and optional parameters. Check out the list of [additional parameters](/api/reference/constants/#form-fields-per-document) for these field types. * Text Field use `SubFormFieldsPerDocumentText` * Dropdown Field use `SubFormFieldsPerDocumentDropdown` * Hyperlink Field use `SubFormFieldsPerDocumentHyperlink` * Checkbox Field use `SubFormFieldsPerDocumentCheckbox` * Radio Field use `SubFormFieldsPerDocumentRadio` * Signature Field use `SubFormFieldsPerDocumentSignature` * Date Signed Field use `SubFormFieldsPerDocumentDateSigned` * Initials Field use `SubFormFieldsPerDocumentInitials` * Text Merge Field use `SubFormFieldsPerDocumentTextMerge` * Checkbox Merge Field use `SubFormFieldsPerDocumentCheckboxMerge` + * @return formFieldsPerDocument + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_FORM_FIELDS_PER_DOCUMENT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getFormFieldsPerDocument() { + return formFieldsPerDocument; + } + + + @JsonProperty(JSON_PROPERTY_FORM_FIELDS_PER_DOCUMENT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setFormFieldsPerDocument(List formFieldsPerDocument) { + this.formFieldsPerDocument = formFieldsPerDocument; + } + + + public SignatureRequestEditRequest hideTextTags(Boolean hideTextTags) { + this.hideTextTags = hideTextTags; + return this; + } + + /** + * Enables automatic Text Tag removal when set to true. **NOTE:** Removing text tags this way can cause unwanted clipping. We recommend leaving this setting on `false` and instead hiding your text tags using white text or a similar approach. See the [Text Tags Walkthrough](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) for more information. + * @return hideTextTags + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_HIDE_TEXT_TAGS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Boolean getHideTextTags() { + return hideTextTags; + } + + + @JsonProperty(JSON_PROPERTY_HIDE_TEXT_TAGS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setHideTextTags(Boolean hideTextTags) { + this.hideTextTags = hideTextTags; + } + + + public SignatureRequestEditRequest isEid(Boolean isEid) { + this.isEid = isEid; + return this; + } + + /** + * Send with a value of `true` if you wish to enable [electronic identification (eID)](https://www.hellosign.com/features/electronic-id), which requires the signer to verify their identity with an eID provider to sign a document.<br> **NOTE:** eID is only available on the Premium API plan. Cannot be used in `test_mode`. Only works on requests with one signer. + * @return isEid + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_IS_EID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Boolean getIsEid() { + return isEid; + } + + + @JsonProperty(JSON_PROPERTY_IS_EID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIsEid(Boolean isEid) { + this.isEid = isEid; + } + + + public SignatureRequestEditRequest message(String message) { + this.message = message; + return this; + } + + /** + * The custom message in the email that will be sent to the signers. + * @return message + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_MESSAGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getMessage() { + return message; + } + + + @JsonProperty(JSON_PROPERTY_MESSAGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMessage(String message) { + this.message = message; + } + + + public SignatureRequestEditRequest metadata(Map metadata) { + this.metadata = metadata; + return this; + } + + public SignatureRequestEditRequest putMetadataItem(String key, Object metadataItem) { + if (this.metadata == null) { + this.metadata = new HashMap<>(); + } + this.metadata.put(key, metadataItem); + return this; + } + + /** + * Key-value data that should be attached to the signature request. This metadata is included in all API responses and events involving the signature request. For example, use the metadata field to store a signer's order number for look up when receiving events for the signature request. Each request can include up to 10 metadata keys (or 50 nested metadata keys), with key names up to 40 characters long and values up to 1000 characters long. + * @return metadata + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_METADATA) + @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) + + public Map getMetadata() { + return metadata; + } + + + @JsonProperty(JSON_PROPERTY_METADATA) + @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) + public void setMetadata(Map metadata) { + this.metadata = metadata; + } + + + public SignatureRequestEditRequest signingOptions(SubSigningOptions signingOptions) { + this.signingOptions = signingOptions; + return this; + } + + /** + * Get signingOptions + * @return signingOptions + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SIGNING_OPTIONS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public SubSigningOptions getSigningOptions() { + return signingOptions; + } + + + @JsonProperty(JSON_PROPERTY_SIGNING_OPTIONS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSigningOptions(SubSigningOptions signingOptions) { + this.signingOptions = signingOptions; + } + + + public SignatureRequestEditRequest signingRedirectUrl(String signingRedirectUrl) { + this.signingRedirectUrl = signingRedirectUrl; + return this; + } + + /** + * The URL you want signers redirected to after they successfully sign. + * @return signingRedirectUrl + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SIGNING_REDIRECT_URL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getSigningRedirectUrl() { + return signingRedirectUrl; + } + + + @JsonProperty(JSON_PROPERTY_SIGNING_REDIRECT_URL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSigningRedirectUrl(String signingRedirectUrl) { + this.signingRedirectUrl = signingRedirectUrl; + } + + + public SignatureRequestEditRequest subject(String subject) { + this.subject = subject; + return this; + } + + /** + * The subject in the email that will be sent to the signers. + * @return subject + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SUBJECT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getSubject() { + return subject; + } + + + @JsonProperty(JSON_PROPERTY_SUBJECT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSubject(String subject) { + this.subject = subject; + } + + + public SignatureRequestEditRequest testMode(Boolean testMode) { + this.testMode = testMode; + return this; + } + + /** + * Whether this is a test, the signature request will not be legally binding if set to `true`. Defaults to `false`. + * @return testMode + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TEST_MODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Boolean getTestMode() { + return testMode; + } + + + @JsonProperty(JSON_PROPERTY_TEST_MODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTestMode(Boolean testMode) { + this.testMode = testMode; + } + + + public SignatureRequestEditRequest title(String title) { + this.title = title; + return this; + } + + /** + * The title you want to assign to the SignatureRequest. + * @return title + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TITLE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getTitle() { + return title; + } + + + @JsonProperty(JSON_PROPERTY_TITLE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTitle(String title) { + this.title = title; + } + + + public SignatureRequestEditRequest useTextTags(Boolean useTextTags) { + this.useTextTags = useTextTags; + return this; + } + + /** + * Send with a value of `true` if you wish to enable [Text Tags](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) parsing in your document. Defaults to disabled, or `false`. + * @return useTextTags + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_USE_TEXT_TAGS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Boolean getUseTextTags() { + return useTextTags; + } + + + @JsonProperty(JSON_PROPERTY_USE_TEXT_TAGS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setUseTextTags(Boolean useTextTags) { + this.useTextTags = useTextTags; + } + + + public SignatureRequestEditRequest expiresAt(Integer expiresAt) { + this.expiresAt = expiresAt; + return this; + } + + /** + * When the signature request will expire. Unsigned signatures will be moved to the expired status, and no longer signable. See [Signature Request Expiration Date](https://developers.hellosign.com/docs/signature-request/expiration/) for details. + * @return expiresAt + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_EXPIRES_AT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Integer getExpiresAt() { + return expiresAt; + } + + + @JsonProperty(JSON_PROPERTY_EXPIRES_AT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setExpiresAt(Integer expiresAt) { + this.expiresAt = expiresAt; + } + + + /** + * Return true if this SignatureRequestEditRequest object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SignatureRequestEditRequest signatureRequestEditRequest = (SignatureRequestEditRequest) o; + return Objects.equals(this.files, signatureRequestEditRequest.files) && + Objects.equals(this.fileUrls, signatureRequestEditRequest.fileUrls) && + Objects.equals(this.signers, signatureRequestEditRequest.signers) && + Objects.equals(this.groupedSigners, signatureRequestEditRequest.groupedSigners) && + Objects.equals(this.allowDecline, signatureRequestEditRequest.allowDecline) && + Objects.equals(this.allowReassign, signatureRequestEditRequest.allowReassign) && + Objects.equals(this.attachments, signatureRequestEditRequest.attachments) && + Objects.equals(this.ccEmailAddresses, signatureRequestEditRequest.ccEmailAddresses) && + Objects.equals(this.clientId, signatureRequestEditRequest.clientId) && + Objects.equals(this.customFields, signatureRequestEditRequest.customFields) && + Objects.equals(this.fieldOptions, signatureRequestEditRequest.fieldOptions) && + Objects.equals(this.formFieldGroups, signatureRequestEditRequest.formFieldGroups) && + Objects.equals(this.formFieldRules, signatureRequestEditRequest.formFieldRules) && + Objects.equals(this.formFieldsPerDocument, signatureRequestEditRequest.formFieldsPerDocument) && + Objects.equals(this.hideTextTags, signatureRequestEditRequest.hideTextTags) && + Objects.equals(this.isEid, signatureRequestEditRequest.isEid) && + Objects.equals(this.message, signatureRequestEditRequest.message) && + Objects.equals(this.metadata, signatureRequestEditRequest.metadata) && + Objects.equals(this.signingOptions, signatureRequestEditRequest.signingOptions) && + Objects.equals(this.signingRedirectUrl, signatureRequestEditRequest.signingRedirectUrl) && + Objects.equals(this.subject, signatureRequestEditRequest.subject) && + Objects.equals(this.testMode, signatureRequestEditRequest.testMode) && + Objects.equals(this.title, signatureRequestEditRequest.title) && + Objects.equals(this.useTextTags, signatureRequestEditRequest.useTextTags) && + Objects.equals(this.expiresAt, signatureRequestEditRequest.expiresAt); + } + + @Override + public int hashCode() { + return Objects.hash(files, fileUrls, signers, groupedSigners, allowDecline, allowReassign, attachments, ccEmailAddresses, clientId, customFields, fieldOptions, formFieldGroups, formFieldRules, formFieldsPerDocument, hideTextTags, isEid, message, metadata, signingOptions, signingRedirectUrl, subject, testMode, title, useTextTags, expiresAt); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SignatureRequestEditRequest {\n"); + sb.append(" files: ").append(toIndentedString(files)).append("\n"); + sb.append(" fileUrls: ").append(toIndentedString(fileUrls)).append("\n"); + sb.append(" signers: ").append(toIndentedString(signers)).append("\n"); + sb.append(" groupedSigners: ").append(toIndentedString(groupedSigners)).append("\n"); + sb.append(" allowDecline: ").append(toIndentedString(allowDecline)).append("\n"); + sb.append(" allowReassign: ").append(toIndentedString(allowReassign)).append("\n"); + sb.append(" attachments: ").append(toIndentedString(attachments)).append("\n"); + sb.append(" ccEmailAddresses: ").append(toIndentedString(ccEmailAddresses)).append("\n"); + sb.append(" clientId: ").append(toIndentedString(clientId)).append("\n"); + sb.append(" customFields: ").append(toIndentedString(customFields)).append("\n"); + sb.append(" fieldOptions: ").append(toIndentedString(fieldOptions)).append("\n"); + sb.append(" formFieldGroups: ").append(toIndentedString(formFieldGroups)).append("\n"); + sb.append(" formFieldRules: ").append(toIndentedString(formFieldRules)).append("\n"); + sb.append(" formFieldsPerDocument: ").append(toIndentedString(formFieldsPerDocument)).append("\n"); + sb.append(" hideTextTags: ").append(toIndentedString(hideTextTags)).append("\n"); + sb.append(" isEid: ").append(toIndentedString(isEid)).append("\n"); + sb.append(" message: ").append(toIndentedString(message)).append("\n"); + sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); + sb.append(" signingOptions: ").append(toIndentedString(signingOptions)).append("\n"); + sb.append(" signingRedirectUrl: ").append(toIndentedString(signingRedirectUrl)).append("\n"); + 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(" useTextTags: ").append(toIndentedString(useTextTags)).append("\n"); + sb.append(" expiresAt: ").append(toIndentedString(expiresAt)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public Map createFormData() throws ApiException { + Map map = new HashMap<>(); + boolean fileTypeFound = false; + try { + if (files != null) { + if (isFileTypeOrListOfFiles(files)) { + fileTypeFound = true; + } + + if (files.getClass().equals(java.io.File.class) || + files.getClass().equals(Integer.class) || + files.getClass().equals(String.class) || + files.getClass().isEnum()) { + map.put("files", files); + } else if (isListOfFile(files)) { + for(int i = 0; i< getListSize(files); i++) { + map.put("files[" + i + "]", getFromList(files, i)); + } + } + else { + map.put("files", JSON.getDefault().getMapper().writeValueAsString(files)); + } + } + if (fileUrls != null) { + if (isFileTypeOrListOfFiles(fileUrls)) { + fileTypeFound = true; + } + + if (fileUrls.getClass().equals(java.io.File.class) || + fileUrls.getClass().equals(Integer.class) || + fileUrls.getClass().equals(String.class) || + fileUrls.getClass().isEnum()) { + map.put("file_urls", fileUrls); + } else if (isListOfFile(fileUrls)) { + for(int i = 0; i< getListSize(fileUrls); i++) { + map.put("file_urls[" + i + "]", getFromList(fileUrls, i)); + } + } + else { + map.put("file_urls", JSON.getDefault().getMapper().writeValueAsString(fileUrls)); + } + } + if (signers != null) { + if (isFileTypeOrListOfFiles(signers)) { + fileTypeFound = true; + } + + if (signers.getClass().equals(java.io.File.class) || + signers.getClass().equals(Integer.class) || + signers.getClass().equals(String.class) || + signers.getClass().isEnum()) { + map.put("signers", signers); + } else if (isListOfFile(signers)) { + for(int i = 0; i< getListSize(signers); i++) { + map.put("signers[" + i + "]", getFromList(signers, i)); + } + } + else { + map.put("signers", JSON.getDefault().getMapper().writeValueAsString(signers)); + } + } + if (groupedSigners != null) { + if (isFileTypeOrListOfFiles(groupedSigners)) { + fileTypeFound = true; + } + + if (groupedSigners.getClass().equals(java.io.File.class) || + groupedSigners.getClass().equals(Integer.class) || + groupedSigners.getClass().equals(String.class) || + groupedSigners.getClass().isEnum()) { + map.put("grouped_signers", groupedSigners); + } else if (isListOfFile(groupedSigners)) { + for(int i = 0; i< getListSize(groupedSigners); i++) { + map.put("grouped_signers[" + i + "]", getFromList(groupedSigners, i)); + } + } + else { + map.put("grouped_signers", JSON.getDefault().getMapper().writeValueAsString(groupedSigners)); + } + } + if (allowDecline != null) { + if (isFileTypeOrListOfFiles(allowDecline)) { + fileTypeFound = true; + } + + if (allowDecline.getClass().equals(java.io.File.class) || + allowDecline.getClass().equals(Integer.class) || + allowDecline.getClass().equals(String.class) || + allowDecline.getClass().isEnum()) { + map.put("allow_decline", allowDecline); + } else if (isListOfFile(allowDecline)) { + for(int i = 0; i< getListSize(allowDecline); i++) { + map.put("allow_decline[" + i + "]", getFromList(allowDecline, i)); + } + } + else { + map.put("allow_decline", JSON.getDefault().getMapper().writeValueAsString(allowDecline)); + } + } + if (allowReassign != null) { + if (isFileTypeOrListOfFiles(allowReassign)) { + fileTypeFound = true; + } + + if (allowReassign.getClass().equals(java.io.File.class) || + allowReassign.getClass().equals(Integer.class) || + allowReassign.getClass().equals(String.class) || + allowReassign.getClass().isEnum()) { + map.put("allow_reassign", allowReassign); + } else if (isListOfFile(allowReassign)) { + for(int i = 0; i< getListSize(allowReassign); i++) { + map.put("allow_reassign[" + i + "]", getFromList(allowReassign, i)); + } + } + else { + map.put("allow_reassign", JSON.getDefault().getMapper().writeValueAsString(allowReassign)); + } + } + if (attachments != null) { + if (isFileTypeOrListOfFiles(attachments)) { + fileTypeFound = true; + } + + if (attachments.getClass().equals(java.io.File.class) || + attachments.getClass().equals(Integer.class) || + attachments.getClass().equals(String.class) || + attachments.getClass().isEnum()) { + map.put("attachments", attachments); + } else if (isListOfFile(attachments)) { + for(int i = 0; i< getListSize(attachments); i++) { + map.put("attachments[" + i + "]", getFromList(attachments, i)); + } + } + else { + map.put("attachments", JSON.getDefault().getMapper().writeValueAsString(attachments)); + } + } + if (ccEmailAddresses != null) { + if (isFileTypeOrListOfFiles(ccEmailAddresses)) { + fileTypeFound = true; + } + + if (ccEmailAddresses.getClass().equals(java.io.File.class) || + ccEmailAddresses.getClass().equals(Integer.class) || + ccEmailAddresses.getClass().equals(String.class) || + ccEmailAddresses.getClass().isEnum()) { + map.put("cc_email_addresses", ccEmailAddresses); + } else if (isListOfFile(ccEmailAddresses)) { + for(int i = 0; i< getListSize(ccEmailAddresses); i++) { + map.put("cc_email_addresses[" + i + "]", getFromList(ccEmailAddresses, i)); + } + } + else { + map.put("cc_email_addresses", JSON.getDefault().getMapper().writeValueAsString(ccEmailAddresses)); + } + } + if (clientId != null) { + if (isFileTypeOrListOfFiles(clientId)) { + fileTypeFound = true; + } + + if (clientId.getClass().equals(java.io.File.class) || + clientId.getClass().equals(Integer.class) || + clientId.getClass().equals(String.class) || + clientId.getClass().isEnum()) { + map.put("client_id", clientId); + } else if (isListOfFile(clientId)) { + for(int i = 0; i< getListSize(clientId); i++) { + map.put("client_id[" + i + "]", getFromList(clientId, i)); + } + } + else { + map.put("client_id", JSON.getDefault().getMapper().writeValueAsString(clientId)); + } + } + if (customFields != null) { + if (isFileTypeOrListOfFiles(customFields)) { + fileTypeFound = true; + } + + if (customFields.getClass().equals(java.io.File.class) || + customFields.getClass().equals(Integer.class) || + customFields.getClass().equals(String.class) || + customFields.getClass().isEnum()) { + map.put("custom_fields", customFields); + } else if (isListOfFile(customFields)) { + for(int i = 0; i< getListSize(customFields); i++) { + map.put("custom_fields[" + i + "]", getFromList(customFields, i)); + } + } + else { + map.put("custom_fields", JSON.getDefault().getMapper().writeValueAsString(customFields)); + } + } + if (fieldOptions != null) { + if (isFileTypeOrListOfFiles(fieldOptions)) { + fileTypeFound = true; + } + + if (fieldOptions.getClass().equals(java.io.File.class) || + fieldOptions.getClass().equals(Integer.class) || + fieldOptions.getClass().equals(String.class) || + fieldOptions.getClass().isEnum()) { + map.put("field_options", fieldOptions); + } else if (isListOfFile(fieldOptions)) { + for(int i = 0; i< getListSize(fieldOptions); i++) { + map.put("field_options[" + i + "]", getFromList(fieldOptions, i)); + } + } + else { + map.put("field_options", JSON.getDefault().getMapper().writeValueAsString(fieldOptions)); + } + } + 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 (formFieldRules != null) { + if (isFileTypeOrListOfFiles(formFieldRules)) { + fileTypeFound = true; + } + + if (formFieldRules.getClass().equals(java.io.File.class) || + formFieldRules.getClass().equals(Integer.class) || + formFieldRules.getClass().equals(String.class) || + formFieldRules.getClass().isEnum()) { + map.put("form_field_rules", formFieldRules); + } else if (isListOfFile(formFieldRules)) { + for(int i = 0; i< getListSize(formFieldRules); i++) { + map.put("form_field_rules[" + i + "]", getFromList(formFieldRules, i)); + } + } + else { + map.put("form_field_rules", JSON.getDefault().getMapper().writeValueAsString(formFieldRules)); + } + } + 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 (hideTextTags != null) { + if (isFileTypeOrListOfFiles(hideTextTags)) { + fileTypeFound = true; + } + + if (hideTextTags.getClass().equals(java.io.File.class) || + hideTextTags.getClass().equals(Integer.class) || + hideTextTags.getClass().equals(String.class) || + hideTextTags.getClass().isEnum()) { + map.put("hide_text_tags", hideTextTags); + } else if (isListOfFile(hideTextTags)) { + for(int i = 0; i< getListSize(hideTextTags); i++) { + map.put("hide_text_tags[" + i + "]", getFromList(hideTextTags, i)); + } + } + else { + map.put("hide_text_tags", JSON.getDefault().getMapper().writeValueAsString(hideTextTags)); + } + } + if (isEid != null) { + if (isFileTypeOrListOfFiles(isEid)) { + fileTypeFound = true; + } + + if (isEid.getClass().equals(java.io.File.class) || + isEid.getClass().equals(Integer.class) || + isEid.getClass().equals(String.class) || + isEid.getClass().isEnum()) { + map.put("is_eid", isEid); + } else if (isListOfFile(isEid)) { + for(int i = 0; i< getListSize(isEid); i++) { + map.put("is_eid[" + i + "]", getFromList(isEid, i)); + } + } + else { + map.put("is_eid", JSON.getDefault().getMapper().writeValueAsString(isEid)); + } + } + if (message != null) { + if (isFileTypeOrListOfFiles(message)) { + fileTypeFound = true; + } + + if (message.getClass().equals(java.io.File.class) || + message.getClass().equals(Integer.class) || + message.getClass().equals(String.class) || + message.getClass().isEnum()) { + map.put("message", message); + } else if (isListOfFile(message)) { + for(int i = 0; i< getListSize(message); i++) { + map.put("message[" + i + "]", getFromList(message, i)); + } + } + else { + map.put("message", JSON.getDefault().getMapper().writeValueAsString(message)); + } + } + if (metadata != null) { + if (isFileTypeOrListOfFiles(metadata)) { + fileTypeFound = true; + } + + if (metadata.getClass().equals(java.io.File.class) || + metadata.getClass().equals(Integer.class) || + metadata.getClass().equals(String.class) || + metadata.getClass().isEnum()) { + map.put("metadata", metadata); + } else if (isListOfFile(metadata)) { + for(int i = 0; i< getListSize(metadata); i++) { + map.put("metadata[" + i + "]", getFromList(metadata, i)); + } + } + else { + map.put("metadata", JSON.getDefault().getMapper().writeValueAsString(metadata)); + } + } + if (signingOptions != null) { + if (isFileTypeOrListOfFiles(signingOptions)) { + fileTypeFound = true; + } + + if (signingOptions.getClass().equals(java.io.File.class) || + signingOptions.getClass().equals(Integer.class) || + signingOptions.getClass().equals(String.class) || + signingOptions.getClass().isEnum()) { + map.put("signing_options", signingOptions); + } else if (isListOfFile(signingOptions)) { + for(int i = 0; i< getListSize(signingOptions); i++) { + map.put("signing_options[" + i + "]", getFromList(signingOptions, i)); + } + } + else { + map.put("signing_options", JSON.getDefault().getMapper().writeValueAsString(signingOptions)); + } + } + if (signingRedirectUrl != null) { + if (isFileTypeOrListOfFiles(signingRedirectUrl)) { + fileTypeFound = true; + } + + if (signingRedirectUrl.getClass().equals(java.io.File.class) || + signingRedirectUrl.getClass().equals(Integer.class) || + signingRedirectUrl.getClass().equals(String.class) || + signingRedirectUrl.getClass().isEnum()) { + map.put("signing_redirect_url", signingRedirectUrl); + } else if (isListOfFile(signingRedirectUrl)) { + for(int i = 0; i< getListSize(signingRedirectUrl); i++) { + map.put("signing_redirect_url[" + i + "]", getFromList(signingRedirectUrl, i)); + } + } + else { + map.put("signing_redirect_url", JSON.getDefault().getMapper().writeValueAsString(signingRedirectUrl)); + } + } + if (subject != null) { + if (isFileTypeOrListOfFiles(subject)) { + fileTypeFound = true; + } + + if (subject.getClass().equals(java.io.File.class) || + subject.getClass().equals(Integer.class) || + subject.getClass().equals(String.class) || + subject.getClass().isEnum()) { + map.put("subject", subject); + } else if (isListOfFile(subject)) { + for(int i = 0; i< getListSize(subject); i++) { + map.put("subject[" + i + "]", getFromList(subject, i)); + } + } + else { + map.put("subject", JSON.getDefault().getMapper().writeValueAsString(subject)); + } + } + if (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 (title != null) { + if (isFileTypeOrListOfFiles(title)) { + fileTypeFound = true; + } + + if (title.getClass().equals(java.io.File.class) || + title.getClass().equals(Integer.class) || + title.getClass().equals(String.class) || + title.getClass().isEnum()) { + map.put("title", title); + } else if (isListOfFile(title)) { + for(int i = 0; i< getListSize(title); i++) { + map.put("title[" + i + "]", getFromList(title, i)); + } + } + else { + map.put("title", JSON.getDefault().getMapper().writeValueAsString(title)); + } + } + if (useTextTags != null) { + if (isFileTypeOrListOfFiles(useTextTags)) { + fileTypeFound = true; + } + + if (useTextTags.getClass().equals(java.io.File.class) || + useTextTags.getClass().equals(Integer.class) || + useTextTags.getClass().equals(String.class) || + useTextTags.getClass().isEnum()) { + map.put("use_text_tags", useTextTags); + } else if (isListOfFile(useTextTags)) { + for(int i = 0; i< getListSize(useTextTags); i++) { + map.put("use_text_tags[" + i + "]", getFromList(useTextTags, i)); + } + } + else { + map.put("use_text_tags", JSON.getDefault().getMapper().writeValueAsString(useTextTags)); + } + } + 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); + } + + return fileTypeFound ? map : new HashMap<>(); + } + + private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { + return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); + } + + private boolean isListOfFile(Object obj) throws Exception { + return obj instanceof java.util.List && !isListEmpty(obj) && getFromList(obj, 0) instanceof java.io.File; + } + + private boolean isListEmpty(Object obj) throws Exception { + return (boolean) Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); + } + + private Object getFromList(Object obj, int index) throws Exception { + return Class.forName(java.util.List.class.getName()).getMethod("get", int.class).invoke(obj, index); + } + + private int getListSize(Object obj) throws Exception { + return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/sdks/java-v2/src/main/java/com/dropbox/sign/model/SignatureRequestEditWithTemplateRequest.java b/sdks/java-v2/src/main/java/com/dropbox/sign/model/SignatureRequestEditWithTemplateRequest.java new file mode 100644 index 000000000..3eff53358 --- /dev/null +++ b/sdks/java-v2/src/main/java/com/dropbox/sign/model/SignatureRequestEditWithTemplateRequest.java @@ -0,0 +1,993 @@ +/* + * Dropbox Sign API + * Dropbox Sign v3 API + * + * The version of the OpenAPI document: 3.0.0 + * Contact: apisupport@hellosign.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.dropbox.sign.model; + +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.dropbox.sign.model.SubCC; +import com.dropbox.sign.model.SubCustomField; +import com.dropbox.sign.model.SubSignatureRequestTemplateSigner; +import com.dropbox.sign.model.SubSigningOptions; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.io.File; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.dropbox.sign.JSON; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.databind.ObjectMapper; + + +import com.dropbox.sign.ApiException; +/** + * + */ +@JsonPropertyOrder({ + SignatureRequestEditWithTemplateRequest.JSON_PROPERTY_TEMPLATE_IDS, + SignatureRequestEditWithTemplateRequest.JSON_PROPERTY_SIGNERS, + SignatureRequestEditWithTemplateRequest.JSON_PROPERTY_ALLOW_DECLINE, + SignatureRequestEditWithTemplateRequest.JSON_PROPERTY_CCS, + SignatureRequestEditWithTemplateRequest.JSON_PROPERTY_CLIENT_ID, + SignatureRequestEditWithTemplateRequest.JSON_PROPERTY_CUSTOM_FIELDS, + SignatureRequestEditWithTemplateRequest.JSON_PROPERTY_FILES, + SignatureRequestEditWithTemplateRequest.JSON_PROPERTY_FILE_URLS, + SignatureRequestEditWithTemplateRequest.JSON_PROPERTY_IS_EID, + SignatureRequestEditWithTemplateRequest.JSON_PROPERTY_MESSAGE, + SignatureRequestEditWithTemplateRequest.JSON_PROPERTY_METADATA, + SignatureRequestEditWithTemplateRequest.JSON_PROPERTY_SIGNING_OPTIONS, + SignatureRequestEditWithTemplateRequest.JSON_PROPERTY_SIGNING_REDIRECT_URL, + SignatureRequestEditWithTemplateRequest.JSON_PROPERTY_SUBJECT, + SignatureRequestEditWithTemplateRequest.JSON_PROPERTY_TEST_MODE, + SignatureRequestEditWithTemplateRequest.JSON_PROPERTY_TITLE +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") +@JsonIgnoreProperties(ignoreUnknown=true) +public class SignatureRequestEditWithTemplateRequest { + public static final String JSON_PROPERTY_TEMPLATE_IDS = "template_ids"; + private List templateIds = new ArrayList<>(); + + public static final String JSON_PROPERTY_SIGNERS = "signers"; + private List signers = new ArrayList<>(); + + public static final String JSON_PROPERTY_ALLOW_DECLINE = "allow_decline"; + private Boolean allowDecline = false; + + public static final String JSON_PROPERTY_CCS = "ccs"; + private List ccs = null; + + public static final String JSON_PROPERTY_CLIENT_ID = "client_id"; + private String clientId; + + public static final String JSON_PROPERTY_CUSTOM_FIELDS = "custom_fields"; + private List customFields = null; + + public static final String JSON_PROPERTY_FILES = "files"; + private List files = null; + + public static final String JSON_PROPERTY_FILE_URLS = "file_urls"; + private List fileUrls = null; + + public static final String JSON_PROPERTY_IS_EID = "is_eid"; + private Boolean isEid = false; + + public static final String JSON_PROPERTY_MESSAGE = "message"; + private String message; + + public static final String JSON_PROPERTY_METADATA = "metadata"; + private Map metadata = null; + + public static final String JSON_PROPERTY_SIGNING_OPTIONS = "signing_options"; + private SubSigningOptions signingOptions; + + public static final String JSON_PROPERTY_SIGNING_REDIRECT_URL = "signing_redirect_url"; + private String signingRedirectUrl; + + public static final String JSON_PROPERTY_SUBJECT = "subject"; + private String subject; + + public static final String JSON_PROPERTY_TEST_MODE = "test_mode"; + private Boolean testMode = false; + + public static final String JSON_PROPERTY_TITLE = "title"; + private String title; + + public SignatureRequestEditWithTemplateRequest() { + } + + /** + * Attempt to instantiate and hydrate a new instance of this class + * @param jsonData String of JSON data representing target object + */ + static public SignatureRequestEditWithTemplateRequest init(String jsonData) throws Exception { + return new ObjectMapper().readValue(jsonData, SignatureRequestEditWithTemplateRequest.class); + } + + static public SignatureRequestEditWithTemplateRequest init(HashMap data) throws Exception { + return new ObjectMapper().readValue( + new ObjectMapper().writeValueAsString(data), + SignatureRequestEditWithTemplateRequest.class + ); + } + + public SignatureRequestEditWithTemplateRequest templateIds(List templateIds) { + this.templateIds = templateIds; + return this; + } + + public SignatureRequestEditWithTemplateRequest addTemplateIdsItem(String templateIdsItem) { + if (this.templateIds == null) { + this.templateIds = new ArrayList<>(); + } + this.templateIds.add(templateIdsItem); + return this; + } + + /** + * Use `template_ids` to create a SignatureRequest from one or more templates, in the order in which the template will be used. + * @return templateIds + */ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_TEMPLATE_IDS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public List getTemplateIds() { + return templateIds; + } + + + @JsonProperty(JSON_PROPERTY_TEMPLATE_IDS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setTemplateIds(List templateIds) { + this.templateIds = templateIds; + } + + + public SignatureRequestEditWithTemplateRequest signers(List signers) { + this.signers = signers; + return this; + } + + public SignatureRequestEditWithTemplateRequest addSignersItem(SubSignatureRequestTemplateSigner signersItem) { + if (this.signers == null) { + this.signers = new ArrayList<>(); + } + this.signers.add(signersItem); + return this; + } + + /** + * Add Signers to your Templated-based Signature Request. + * @return signers + */ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_SIGNERS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public List getSigners() { + return signers; + } + + + @JsonProperty(JSON_PROPERTY_SIGNERS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setSigners(List signers) { + this.signers = signers; + } + + + public SignatureRequestEditWithTemplateRequest allowDecline(Boolean allowDecline) { + this.allowDecline = allowDecline; + return this; + } + + /** + * Allows signers to decline to sign a document if `true`. Defaults to `false`. + * @return allowDecline + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ALLOW_DECLINE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Boolean getAllowDecline() { + return allowDecline; + } + + + @JsonProperty(JSON_PROPERTY_ALLOW_DECLINE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAllowDecline(Boolean allowDecline) { + this.allowDecline = allowDecline; + } + + + public SignatureRequestEditWithTemplateRequest ccs(List ccs) { + this.ccs = ccs; + return this; + } + + public SignatureRequestEditWithTemplateRequest addCcsItem(SubCC ccsItem) { + if (this.ccs == null) { + this.ccs = new ArrayList<>(); + } + this.ccs.add(ccsItem); + return this; + } + + /** + * Add CC email recipients. Required when a CC role exists for the Template. + * @return ccs + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CCS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getCcs() { + return ccs; + } + + + @JsonProperty(JSON_PROPERTY_CCS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCcs(List ccs) { + this.ccs = ccs; + } + + + public SignatureRequestEditWithTemplateRequest clientId(String clientId) { + this.clientId = clientId; + return this; + } + + /** + * Client id of the app to associate with the signature request. Used to apply the branding and callback url defined for the app. + * @return clientId + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CLIENT_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getClientId() { + return clientId; + } + + + @JsonProperty(JSON_PROPERTY_CLIENT_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setClientId(String clientId) { + this.clientId = clientId; + } + + + public SignatureRequestEditWithTemplateRequest customFields(List customFields) { + this.customFields = customFields; + return this; + } + + public SignatureRequestEditWithTemplateRequest addCustomFieldsItem(SubCustomField customFieldsItem) { + if (this.customFields == null) { + this.customFields = new ArrayList<>(); + } + this.customFields.add(customFieldsItem); + return this; + } + + /** + * An array defining values and options for custom fields. Required when a custom field exists in the Template. + * @return customFields + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CUSTOM_FIELDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getCustomFields() { + return customFields; + } + + + @JsonProperty(JSON_PROPERTY_CUSTOM_FIELDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCustomFields(List customFields) { + this.customFields = customFields; + } + + + public SignatureRequestEditWithTemplateRequest files(List files) { + this.files = files; + return this; + } + + public SignatureRequestEditWithTemplateRequest addFilesItem(File filesItem) { + if (this.files == null) { + this.files = new ArrayList<>(); + } + this.files.add(filesItem); + return this; + } + + /** + * Use `files[]` to indicate the uploaded file(s) to send for signature. This endpoint requires either **files** or **file_urls[]**, but not both. + * @return files + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_FILES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getFiles() { + return files; + } + + + @JsonProperty(JSON_PROPERTY_FILES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setFiles(List files) { + this.files = files; + } + + + public SignatureRequestEditWithTemplateRequest fileUrls(List fileUrls) { + this.fileUrls = fileUrls; + return this; + } + + public SignatureRequestEditWithTemplateRequest addFileUrlsItem(String fileUrlsItem) { + if (this.fileUrls == null) { + this.fileUrls = new ArrayList<>(); + } + this.fileUrls.add(fileUrlsItem); + return this; + } + + /** + * Use `file_urls[]` to have Dropbox Sign download the file(s) to send for signature. This endpoint requires either **files** or **file_urls[]**, but not both. + * @return fileUrls + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_FILE_URLS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getFileUrls() { + return fileUrls; + } + + + @JsonProperty(JSON_PROPERTY_FILE_URLS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setFileUrls(List fileUrls) { + this.fileUrls = fileUrls; + } + + + public SignatureRequestEditWithTemplateRequest isEid(Boolean isEid) { + this.isEid = isEid; + return this; + } + + /** + * Send with a value of `true` if you wish to enable [electronic identification (eID)](https://www.hellosign.com/features/electronic-id), which requires the signer to verify their identity with an eID provider to sign a document.<br> **NOTE:** eID is only available on the Premium API plan. Cannot be used in `test_mode`. Only works on requests with one signer. + * @return isEid + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_IS_EID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Boolean getIsEid() { + return isEid; + } + + + @JsonProperty(JSON_PROPERTY_IS_EID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIsEid(Boolean isEid) { + this.isEid = isEid; + } + + + public SignatureRequestEditWithTemplateRequest message(String message) { + this.message = message; + return this; + } + + /** + * The custom message in the email that will be sent to the signers. + * @return message + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_MESSAGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getMessage() { + return message; + } + + + @JsonProperty(JSON_PROPERTY_MESSAGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMessage(String message) { + this.message = message; + } + + + public SignatureRequestEditWithTemplateRequest metadata(Map metadata) { + this.metadata = metadata; + return this; + } + + public SignatureRequestEditWithTemplateRequest putMetadataItem(String key, Object metadataItem) { + if (this.metadata == null) { + this.metadata = new HashMap<>(); + } + this.metadata.put(key, metadataItem); + return this; + } + + /** + * Key-value data that should be attached to the signature request. This metadata is included in all API responses and events involving the signature request. For example, use the metadata field to store a signer's order number for look up when receiving events for the signature request. Each request can include up to 10 metadata keys (or 50 nested metadata keys), with key names up to 40 characters long and values up to 1000 characters long. + * @return metadata + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_METADATA) + @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) + + public Map getMetadata() { + return metadata; + } + + + @JsonProperty(JSON_PROPERTY_METADATA) + @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) + public void setMetadata(Map metadata) { + this.metadata = metadata; + } + + + public SignatureRequestEditWithTemplateRequest signingOptions(SubSigningOptions signingOptions) { + this.signingOptions = signingOptions; + return this; + } + + /** + * Get signingOptions + * @return signingOptions + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SIGNING_OPTIONS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public SubSigningOptions getSigningOptions() { + return signingOptions; + } + + + @JsonProperty(JSON_PROPERTY_SIGNING_OPTIONS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSigningOptions(SubSigningOptions signingOptions) { + this.signingOptions = signingOptions; + } + + + public SignatureRequestEditWithTemplateRequest signingRedirectUrl(String signingRedirectUrl) { + this.signingRedirectUrl = signingRedirectUrl; + return this; + } + + /** + * The URL you want signers redirected to after they successfully sign. + * @return signingRedirectUrl + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SIGNING_REDIRECT_URL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getSigningRedirectUrl() { + return signingRedirectUrl; + } + + + @JsonProperty(JSON_PROPERTY_SIGNING_REDIRECT_URL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSigningRedirectUrl(String signingRedirectUrl) { + this.signingRedirectUrl = signingRedirectUrl; + } + + + public SignatureRequestEditWithTemplateRequest subject(String subject) { + this.subject = subject; + return this; + } + + /** + * The subject in the email that will be sent to the signers. + * @return subject + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SUBJECT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getSubject() { + return subject; + } + + + @JsonProperty(JSON_PROPERTY_SUBJECT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSubject(String subject) { + this.subject = subject; + } + + + public SignatureRequestEditWithTemplateRequest testMode(Boolean testMode) { + this.testMode = testMode; + return this; + } + + /** + * Whether this is a test, the signature request will not be legally binding if set to `true`. Defaults to `false`. + * @return testMode + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TEST_MODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Boolean getTestMode() { + return testMode; + } + + + @JsonProperty(JSON_PROPERTY_TEST_MODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTestMode(Boolean testMode) { + this.testMode = testMode; + } + + + public SignatureRequestEditWithTemplateRequest title(String title) { + this.title = title; + return this; + } + + /** + * The title you want to assign to the SignatureRequest. + * @return title + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TITLE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getTitle() { + return title; + } + + + @JsonProperty(JSON_PROPERTY_TITLE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTitle(String title) { + this.title = title; + } + + + /** + * Return true if this SignatureRequestEditWithTemplateRequest object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SignatureRequestEditWithTemplateRequest signatureRequestEditWithTemplateRequest = (SignatureRequestEditWithTemplateRequest) o; + return Objects.equals(this.templateIds, signatureRequestEditWithTemplateRequest.templateIds) && + Objects.equals(this.signers, signatureRequestEditWithTemplateRequest.signers) && + Objects.equals(this.allowDecline, signatureRequestEditWithTemplateRequest.allowDecline) && + Objects.equals(this.ccs, signatureRequestEditWithTemplateRequest.ccs) && + Objects.equals(this.clientId, signatureRequestEditWithTemplateRequest.clientId) && + Objects.equals(this.customFields, signatureRequestEditWithTemplateRequest.customFields) && + Objects.equals(this.files, signatureRequestEditWithTemplateRequest.files) && + Objects.equals(this.fileUrls, signatureRequestEditWithTemplateRequest.fileUrls) && + Objects.equals(this.isEid, signatureRequestEditWithTemplateRequest.isEid) && + Objects.equals(this.message, signatureRequestEditWithTemplateRequest.message) && + Objects.equals(this.metadata, signatureRequestEditWithTemplateRequest.metadata) && + Objects.equals(this.signingOptions, signatureRequestEditWithTemplateRequest.signingOptions) && + Objects.equals(this.signingRedirectUrl, signatureRequestEditWithTemplateRequest.signingRedirectUrl) && + Objects.equals(this.subject, signatureRequestEditWithTemplateRequest.subject) && + Objects.equals(this.testMode, signatureRequestEditWithTemplateRequest.testMode) && + Objects.equals(this.title, signatureRequestEditWithTemplateRequest.title); + } + + @Override + public int hashCode() { + return Objects.hash(templateIds, signers, allowDecline, ccs, clientId, customFields, files, fileUrls, isEid, message, metadata, signingOptions, signingRedirectUrl, subject, testMode, title); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SignatureRequestEditWithTemplateRequest {\n"); + sb.append(" templateIds: ").append(toIndentedString(templateIds)).append("\n"); + sb.append(" signers: ").append(toIndentedString(signers)).append("\n"); + sb.append(" allowDecline: ").append(toIndentedString(allowDecline)).append("\n"); + sb.append(" ccs: ").append(toIndentedString(ccs)).append("\n"); + sb.append(" clientId: ").append(toIndentedString(clientId)).append("\n"); + sb.append(" customFields: ").append(toIndentedString(customFields)).append("\n"); + sb.append(" files: ").append(toIndentedString(files)).append("\n"); + sb.append(" fileUrls: ").append(toIndentedString(fileUrls)).append("\n"); + sb.append(" isEid: ").append(toIndentedString(isEid)).append("\n"); + sb.append(" message: ").append(toIndentedString(message)).append("\n"); + sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); + sb.append(" signingOptions: ").append(toIndentedString(signingOptions)).append("\n"); + sb.append(" signingRedirectUrl: ").append(toIndentedString(signingRedirectUrl)).append("\n"); + 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("}"); + return sb.toString(); + } + + public Map createFormData() throws ApiException { + Map map = new HashMap<>(); + boolean fileTypeFound = false; + try { + if (templateIds != null) { + if (isFileTypeOrListOfFiles(templateIds)) { + fileTypeFound = true; + } + + if (templateIds.getClass().equals(java.io.File.class) || + templateIds.getClass().equals(Integer.class) || + templateIds.getClass().equals(String.class) || + templateIds.getClass().isEnum()) { + map.put("template_ids", templateIds); + } else if (isListOfFile(templateIds)) { + for(int i = 0; i< getListSize(templateIds); i++) { + map.put("template_ids[" + i + "]", getFromList(templateIds, i)); + } + } + else { + map.put("template_ids", JSON.getDefault().getMapper().writeValueAsString(templateIds)); + } + } + if (signers != null) { + if (isFileTypeOrListOfFiles(signers)) { + fileTypeFound = true; + } + + if (signers.getClass().equals(java.io.File.class) || + signers.getClass().equals(Integer.class) || + signers.getClass().equals(String.class) || + signers.getClass().isEnum()) { + map.put("signers", signers); + } else if (isListOfFile(signers)) { + for(int i = 0; i< getListSize(signers); i++) { + map.put("signers[" + i + "]", getFromList(signers, i)); + } + } + else { + map.put("signers", JSON.getDefault().getMapper().writeValueAsString(signers)); + } + } + if (allowDecline != null) { + if (isFileTypeOrListOfFiles(allowDecline)) { + fileTypeFound = true; + } + + if (allowDecline.getClass().equals(java.io.File.class) || + allowDecline.getClass().equals(Integer.class) || + allowDecline.getClass().equals(String.class) || + allowDecline.getClass().isEnum()) { + map.put("allow_decline", allowDecline); + } else if (isListOfFile(allowDecline)) { + for(int i = 0; i< getListSize(allowDecline); i++) { + map.put("allow_decline[" + i + "]", getFromList(allowDecline, i)); + } + } + else { + map.put("allow_decline", JSON.getDefault().getMapper().writeValueAsString(allowDecline)); + } + } + if (ccs != null) { + if (isFileTypeOrListOfFiles(ccs)) { + fileTypeFound = true; + } + + if (ccs.getClass().equals(java.io.File.class) || + ccs.getClass().equals(Integer.class) || + ccs.getClass().equals(String.class) || + ccs.getClass().isEnum()) { + map.put("ccs", ccs); + } else if (isListOfFile(ccs)) { + for(int i = 0; i< getListSize(ccs); i++) { + map.put("ccs[" + i + "]", getFromList(ccs, i)); + } + } + else { + map.put("ccs", JSON.getDefault().getMapper().writeValueAsString(ccs)); + } + } + if (clientId != null) { + if (isFileTypeOrListOfFiles(clientId)) { + fileTypeFound = true; + } + + if (clientId.getClass().equals(java.io.File.class) || + clientId.getClass().equals(Integer.class) || + clientId.getClass().equals(String.class) || + clientId.getClass().isEnum()) { + map.put("client_id", clientId); + } else if (isListOfFile(clientId)) { + for(int i = 0; i< getListSize(clientId); i++) { + map.put("client_id[" + i + "]", getFromList(clientId, i)); + } + } + else { + map.put("client_id", JSON.getDefault().getMapper().writeValueAsString(clientId)); + } + } + if (customFields != null) { + if (isFileTypeOrListOfFiles(customFields)) { + fileTypeFound = true; + } + + if (customFields.getClass().equals(java.io.File.class) || + customFields.getClass().equals(Integer.class) || + customFields.getClass().equals(String.class) || + customFields.getClass().isEnum()) { + map.put("custom_fields", customFields); + } else if (isListOfFile(customFields)) { + for(int i = 0; i< getListSize(customFields); i++) { + map.put("custom_fields[" + i + "]", getFromList(customFields, i)); + } + } + else { + map.put("custom_fields", JSON.getDefault().getMapper().writeValueAsString(customFields)); + } + } + if (files != null) { + if (isFileTypeOrListOfFiles(files)) { + fileTypeFound = true; + } + + if (files.getClass().equals(java.io.File.class) || + files.getClass().equals(Integer.class) || + files.getClass().equals(String.class) || + files.getClass().isEnum()) { + map.put("files", files); + } else if (isListOfFile(files)) { + for(int i = 0; i< getListSize(files); i++) { + map.put("files[" + i + "]", getFromList(files, i)); + } + } + else { + map.put("files", JSON.getDefault().getMapper().writeValueAsString(files)); + } + } + if (fileUrls != null) { + if (isFileTypeOrListOfFiles(fileUrls)) { + fileTypeFound = true; + } + + if (fileUrls.getClass().equals(java.io.File.class) || + fileUrls.getClass().equals(Integer.class) || + fileUrls.getClass().equals(String.class) || + fileUrls.getClass().isEnum()) { + map.put("file_urls", fileUrls); + } else if (isListOfFile(fileUrls)) { + for(int i = 0; i< getListSize(fileUrls); i++) { + map.put("file_urls[" + i + "]", getFromList(fileUrls, i)); + } + } + else { + map.put("file_urls", JSON.getDefault().getMapper().writeValueAsString(fileUrls)); + } + } + if (isEid != null) { + if (isFileTypeOrListOfFiles(isEid)) { + fileTypeFound = true; + } + + if (isEid.getClass().equals(java.io.File.class) || + isEid.getClass().equals(Integer.class) || + isEid.getClass().equals(String.class) || + isEid.getClass().isEnum()) { + map.put("is_eid", isEid); + } else if (isListOfFile(isEid)) { + for(int i = 0; i< getListSize(isEid); i++) { + map.put("is_eid[" + i + "]", getFromList(isEid, i)); + } + } + else { + map.put("is_eid", JSON.getDefault().getMapper().writeValueAsString(isEid)); + } + } + if (message != null) { + if (isFileTypeOrListOfFiles(message)) { + fileTypeFound = true; + } + + if (message.getClass().equals(java.io.File.class) || + message.getClass().equals(Integer.class) || + message.getClass().equals(String.class) || + message.getClass().isEnum()) { + map.put("message", message); + } else if (isListOfFile(message)) { + for(int i = 0; i< getListSize(message); i++) { + map.put("message[" + i + "]", getFromList(message, i)); + } + } + else { + map.put("message", JSON.getDefault().getMapper().writeValueAsString(message)); + } + } + if (metadata != null) { + if (isFileTypeOrListOfFiles(metadata)) { + fileTypeFound = true; + } + + if (metadata.getClass().equals(java.io.File.class) || + metadata.getClass().equals(Integer.class) || + metadata.getClass().equals(String.class) || + metadata.getClass().isEnum()) { + map.put("metadata", metadata); + } else if (isListOfFile(metadata)) { + for(int i = 0; i< getListSize(metadata); i++) { + map.put("metadata[" + i + "]", getFromList(metadata, i)); + } + } + else { + map.put("metadata", JSON.getDefault().getMapper().writeValueAsString(metadata)); + } + } + if (signingOptions != null) { + if (isFileTypeOrListOfFiles(signingOptions)) { + fileTypeFound = true; + } + + if (signingOptions.getClass().equals(java.io.File.class) || + signingOptions.getClass().equals(Integer.class) || + signingOptions.getClass().equals(String.class) || + signingOptions.getClass().isEnum()) { + map.put("signing_options", signingOptions); + } else if (isListOfFile(signingOptions)) { + for(int i = 0; i< getListSize(signingOptions); i++) { + map.put("signing_options[" + i + "]", getFromList(signingOptions, i)); + } + } + else { + map.put("signing_options", JSON.getDefault().getMapper().writeValueAsString(signingOptions)); + } + } + if (signingRedirectUrl != null) { + if (isFileTypeOrListOfFiles(signingRedirectUrl)) { + fileTypeFound = true; + } + + if (signingRedirectUrl.getClass().equals(java.io.File.class) || + signingRedirectUrl.getClass().equals(Integer.class) || + signingRedirectUrl.getClass().equals(String.class) || + signingRedirectUrl.getClass().isEnum()) { + map.put("signing_redirect_url", signingRedirectUrl); + } else if (isListOfFile(signingRedirectUrl)) { + for(int i = 0; i< getListSize(signingRedirectUrl); i++) { + map.put("signing_redirect_url[" + i + "]", getFromList(signingRedirectUrl, i)); + } + } + else { + map.put("signing_redirect_url", JSON.getDefault().getMapper().writeValueAsString(signingRedirectUrl)); + } + } + if (subject != null) { + if (isFileTypeOrListOfFiles(subject)) { + fileTypeFound = true; + } + + if (subject.getClass().equals(java.io.File.class) || + subject.getClass().equals(Integer.class) || + subject.getClass().equals(String.class) || + subject.getClass().isEnum()) { + map.put("subject", subject); + } else if (isListOfFile(subject)) { + for(int i = 0; i< getListSize(subject); i++) { + map.put("subject[" + i + "]", getFromList(subject, i)); + } + } + else { + map.put("subject", JSON.getDefault().getMapper().writeValueAsString(subject)); + } + } + if (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 (title != null) { + if (isFileTypeOrListOfFiles(title)) { + fileTypeFound = true; + } + + if (title.getClass().equals(java.io.File.class) || + title.getClass().equals(Integer.class) || + title.getClass().equals(String.class) || + title.getClass().isEnum()) { + map.put("title", title); + } else if (isListOfFile(title)) { + for(int i = 0; i< getListSize(title); i++) { + map.put("title[" + i + "]", getFromList(title, i)); + } + } + else { + map.put("title", JSON.getDefault().getMapper().writeValueAsString(title)); + } + } + } catch (Exception e) { + throw new ApiException(e); + } + + return fileTypeFound ? map : new HashMap<>(); + } + + private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { + return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); + } + + private boolean isListOfFile(Object obj) throws Exception { + return obj instanceof java.util.List && !isListEmpty(obj) && getFromList(obj, 0) instanceof java.io.File; + } + + private boolean isListEmpty(Object obj) throws Exception { + return (boolean) Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); + } + + private Object getFromList(Object obj, int index) throws Exception { + return Class.forName(java.util.List.class.getName()).getMethod("get", int.class).invoke(obj, index); + } + + private int getListSize(Object obj) throws Exception { + return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/sdks/node/README.md b/sdks/node/README.md index 7e05e443f..ea771b194 100644 --- a/sdks/node/README.md +++ b/sdks/node/README.md @@ -140,6 +140,10 @@ All URIs are relative to *https://api.hellosign.com/v3* | *SignatureRequestApi* | [**signatureRequestCancel**](./docs/api/SignatureRequestApi.md#signaturerequestcancel) | **POST** /signature_request/cancel/{signature_request_id} | Cancel Incomplete Signature Request | | *SignatureRequestApi* | [**signatureRequestCreateEmbedded**](./docs/api/SignatureRequestApi.md#signaturerequestcreateembedded) | **POST** /signature_request/create_embedded | Create Embedded Signature Request | | *SignatureRequestApi* | [**signatureRequestCreateEmbeddedWithTemplate**](./docs/api/SignatureRequestApi.md#signaturerequestcreateembeddedwithtemplate) | **POST** /signature_request/create_embedded_with_template | Create Embedded Signature Request with Template | +| *SignatureRequestApi* | [**signatureRequestEdit**](./docs/api/SignatureRequestApi.md#signaturerequestedit) | **PUT** /signature_request/edit/{signature_request_id} | Edit Signature Request | +| *SignatureRequestApi* | [**signatureRequestEditEmbedded**](./docs/api/SignatureRequestApi.md#signaturerequesteditembedded) | **PUT** /signature_request/edit_embedded/{signature_request_id} | Edit Embedded Signature Request | +| *SignatureRequestApi* | [**signatureRequestEditEmbeddedWithTemplate**](./docs/api/SignatureRequestApi.md#signaturerequesteditembeddedwithtemplate) | **PUT** /signature_request/edit_embedded_with_template/{signature_request_id} | Edit Embedded Signature Request with Template | +| *SignatureRequestApi* | [**signatureRequestEditWithTemplate**](./docs/api/SignatureRequestApi.md#signaturerequesteditwithtemplate) | **PUT** /signature_request/edit_with_template/{signature_request_id} | Edit Signature Request With Template | | *SignatureRequestApi* | [**signatureRequestFiles**](./docs/api/SignatureRequestApi.md#signaturerequestfiles) | **GET** /signature_request/files/{signature_request_id} | Download Files | | *SignatureRequestApi* | [**signatureRequestFilesAsDataUri**](./docs/api/SignatureRequestApi.md#signaturerequestfilesasdatauri) | **GET** /signature_request/files_as_data_uri/{signature_request_id} | Download Files as Data Uri | | *SignatureRequestApi* | [**signatureRequestFilesAsFileUrl**](./docs/api/SignatureRequestApi.md#signaturerequestfilesasfileurl) | **GET** /signature_request/files_as_file_url/{signature_request_id} | Download Files as File Url | @@ -242,6 +246,10 @@ All URIs are relative to *https://api.hellosign.com/v3* - [SignatureRequestBulkSendWithTemplateRequest](./docs/model/SignatureRequestBulkSendWithTemplateRequest.md) - [SignatureRequestCreateEmbeddedRequest](./docs/model/SignatureRequestCreateEmbeddedRequest.md) - [SignatureRequestCreateEmbeddedWithTemplateRequest](./docs/model/SignatureRequestCreateEmbeddedWithTemplateRequest.md) +- [SignatureRequestEditEmbeddedRequest](./docs/model/SignatureRequestEditEmbeddedRequest.md) +- [SignatureRequestEditEmbeddedWithTemplateRequest](./docs/model/SignatureRequestEditEmbeddedWithTemplateRequest.md) +- [SignatureRequestEditRequest](./docs/model/SignatureRequestEditRequest.md) +- [SignatureRequestEditWithTemplateRequest](./docs/model/SignatureRequestEditWithTemplateRequest.md) - [SignatureRequestGetResponse](./docs/model/SignatureRequestGetResponse.md) - [SignatureRequestListResponse](./docs/model/SignatureRequestListResponse.md) - [SignatureRequestRemindRequest](./docs/model/SignatureRequestRemindRequest.md) diff --git a/sdks/node/api/signatureRequestApi.ts b/sdks/node/api/signatureRequestApi.ts index 3fd0d611e..845c9f787 100644 --- a/sdks/node/api/signatureRequestApi.ts +++ b/sdks/node/api/signatureRequestApi.ts @@ -37,6 +37,10 @@ import { SignatureRequestBulkSendWithTemplateRequest, SignatureRequestCreateEmbeddedRequest, SignatureRequestCreateEmbeddedWithTemplateRequest, + SignatureRequestEditEmbeddedRequest, + SignatureRequestEditEmbeddedWithTemplateRequest, + SignatureRequestEditRequest, + SignatureRequestEditWithTemplateRequest, SignatureRequestGetResponse, SignatureRequestListResponse, SignatureRequestRemindRequest, @@ -824,6 +828,654 @@ export class SignatureRequestApi { ); }); } + /** + * Edits and sends a SignatureRequest with the submitted documents. If `form_fields_per_document` is not specified, a signature page will be affixed where all signers will be required to add their signature, signifying their agreement to all contained documents. **NOTE:** Edit and resend will not deduct your signature request quota. + * @summary Edit Signature Request + * @param signatureRequestId The id of the SignatureRequest to edit. + * @param signatureRequestEditRequest + * @param options + */ + public async signatureRequestEdit( + signatureRequestId: string, + signatureRequestEditRequest: SignatureRequestEditRequest, + options: optionsI = { headers: {} } + ): Promise> { + signatureRequestEditRequest = deserializeIfNeeded( + signatureRequestEditRequest, + "SignatureRequestEditRequest" + ); + const localVarPath = + this.basePath + + "/signature_request/edit/{signature_request_id}".replace( + "{" + "signature_request_id" + "}", + encodeURIComponent(String(signatureRequestId)) + ); + let localVarQueryParameters: any = {}; + let localVarHeaderParams: any = (Object).assign( + {}, + this._defaultHeaders + ); + const produces = ["application/json"]; + // give precedence to 'application/json' + if (produces.indexOf("application/json") >= 0) { + localVarHeaderParams["content-type"] = "application/json"; + } else { + localVarHeaderParams["content-type"] = produces.join(","); + } + let localVarFormParams: any = {}; + let localVarBodyParams: any = undefined; + + // verify required parameter 'signatureRequestId' is not null or undefined + if (signatureRequestId === null || signatureRequestId === undefined) { + throw new Error( + "Required parameter signatureRequestId was null or undefined when calling signatureRequestEdit." + ); + } + + // verify required parameter 'signatureRequestEditRequest' is not null or undefined + if ( + signatureRequestEditRequest === null || + signatureRequestEditRequest === undefined + ) { + throw new Error( + "Required parameter signatureRequestEditRequest was null or undefined when calling signatureRequestEdit." + ); + } + + (Object).assign(localVarHeaderParams, options.headers); + + let localVarUseFormData = false; + + const result = generateFormData( + signatureRequestEditRequest, + SignatureRequestEditRequest.attributeTypeMap + ); + localVarUseFormData = result.localVarUseFormData; + + let data = {}; + if (localVarUseFormData) { + const formData = toFormData(result.data); + data = formData; + localVarHeaderParams = { + ...localVarHeaderParams, + ...formData.getHeaders(), + }; + } else { + data = ObjectSerializer.serialize( + signatureRequestEditRequest, + "SignatureRequestEditRequest" + ); + } + + let localVarRequestOptions: AxiosRequestConfig = { + method: "PUT", + params: localVarQueryParameters, + headers: localVarHeaderParams, + url: localVarPath, + paramsSerializer: this._useQuerystring + ? queryParamsSerializer + : undefined, + maxContentLength: Infinity, + maxBodyLength: Infinity, + responseType: "json", + data, + }; + + let authenticationPromise = Promise.resolve(); + if (this.authentications.api_key.username) { + authenticationPromise = authenticationPromise.then(() => + this.authentications.api_key.applyToRequest(localVarRequestOptions) + ); + } + if (this.authentications.oauth2.accessToken) { + authenticationPromise = authenticationPromise.then(() => + this.authentications.oauth2.applyToRequest(localVarRequestOptions) + ); + } + authenticationPromise = authenticationPromise.then(() => + this.authentications.default.applyToRequest(localVarRequestOptions) + ); + + let interceptorPromise = authenticationPromise; + for (const interceptor of this.interceptors) { + interceptorPromise = interceptorPromise.then(() => + interceptor(localVarRequestOptions) + ); + } + + return interceptorPromise.then(() => { + return new Promise>( + (resolve, reject) => { + axios.request(localVarRequestOptions).then( + (response) => { + handleSuccessfulResponse( + resolve, + reject, + response, + "SignatureRequestGetResponse" + ); + }, + (error: AxiosError) => { + if (error.response == null) { + reject(error); + return; + } + + if ( + handleErrorCodeResponse( + reject, + error.response, + 200, + "SignatureRequestGetResponse" + ) + ) { + return; + } + + if ( + handleErrorRangeResponse( + reject, + error.response, + "4XX", + "ErrorResponse" + ) + ) { + return; + } + + reject(error); + } + ); + } + ); + }); + } + /** + * Edits a SignatureRequest with the submitted documents to be signed in an embedded iFrame. If form_fields_per_document is not specified, a signature page will be affixed where all signers will be required to add their signature, signifying their agreement to all contained documents. Note that embedded signature requests can only be signed in embedded iFrames whereas normal signature requests can only be signed on Dropbox Sign. + * @summary Edit Embedded Signature Request + * @param signatureRequestId The id of the SignatureRequest to edit. + * @param signatureRequestEditEmbeddedRequest + * @param options + */ + public async signatureRequestEditEmbedded( + signatureRequestId: string, + signatureRequestEditEmbeddedRequest: SignatureRequestEditEmbeddedRequest, + options: optionsI = { headers: {} } + ): Promise> { + signatureRequestEditEmbeddedRequest = deserializeIfNeeded( + signatureRequestEditEmbeddedRequest, + "SignatureRequestEditEmbeddedRequest" + ); + const localVarPath = + this.basePath + + "/signature_request/edit_embedded/{signature_request_id}".replace( + "{" + "signature_request_id" + "}", + encodeURIComponent(String(signatureRequestId)) + ); + let localVarQueryParameters: any = {}; + let localVarHeaderParams: any = (Object).assign( + {}, + this._defaultHeaders + ); + const produces = ["application/json"]; + // give precedence to 'application/json' + if (produces.indexOf("application/json") >= 0) { + localVarHeaderParams["content-type"] = "application/json"; + } else { + localVarHeaderParams["content-type"] = produces.join(","); + } + let localVarFormParams: any = {}; + let localVarBodyParams: any = undefined; + + // verify required parameter 'signatureRequestId' is not null or undefined + if (signatureRequestId === null || signatureRequestId === undefined) { + throw new Error( + "Required parameter signatureRequestId was null or undefined when calling signatureRequestEditEmbedded." + ); + } + + // verify required parameter 'signatureRequestEditEmbeddedRequest' is not null or undefined + if ( + signatureRequestEditEmbeddedRequest === null || + signatureRequestEditEmbeddedRequest === undefined + ) { + throw new Error( + "Required parameter signatureRequestEditEmbeddedRequest was null or undefined when calling signatureRequestEditEmbedded." + ); + } + + (Object).assign(localVarHeaderParams, options.headers); + + let localVarUseFormData = false; + + const result = generateFormData( + signatureRequestEditEmbeddedRequest, + SignatureRequestEditEmbeddedRequest.attributeTypeMap + ); + localVarUseFormData = result.localVarUseFormData; + + let data = {}; + if (localVarUseFormData) { + const formData = toFormData(result.data); + data = formData; + localVarHeaderParams = { + ...localVarHeaderParams, + ...formData.getHeaders(), + }; + } else { + data = ObjectSerializer.serialize( + signatureRequestEditEmbeddedRequest, + "SignatureRequestEditEmbeddedRequest" + ); + } + + let localVarRequestOptions: AxiosRequestConfig = { + method: "PUT", + params: localVarQueryParameters, + headers: localVarHeaderParams, + url: localVarPath, + paramsSerializer: this._useQuerystring + ? queryParamsSerializer + : undefined, + maxContentLength: Infinity, + maxBodyLength: Infinity, + responseType: "json", + data, + }; + + let authenticationPromise = Promise.resolve(); + if (this.authentications.api_key.username) { + authenticationPromise = authenticationPromise.then(() => + this.authentications.api_key.applyToRequest(localVarRequestOptions) + ); + } + if (this.authentications.oauth2.accessToken) { + authenticationPromise = authenticationPromise.then(() => + this.authentications.oauth2.applyToRequest(localVarRequestOptions) + ); + } + authenticationPromise = authenticationPromise.then(() => + this.authentications.default.applyToRequest(localVarRequestOptions) + ); + + let interceptorPromise = authenticationPromise; + for (const interceptor of this.interceptors) { + interceptorPromise = interceptorPromise.then(() => + interceptor(localVarRequestOptions) + ); + } + + return interceptorPromise.then(() => { + return new Promise>( + (resolve, reject) => { + axios.request(localVarRequestOptions).then( + (response) => { + handleSuccessfulResponse( + resolve, + reject, + response, + "SignatureRequestGetResponse" + ); + }, + (error: AxiosError) => { + if (error.response == null) { + reject(error); + return; + } + + if ( + handleErrorCodeResponse( + reject, + error.response, + 200, + "SignatureRequestGetResponse" + ) + ) { + return; + } + + if ( + handleErrorRangeResponse( + reject, + error.response, + "4XX", + "ErrorResponse" + ) + ) { + return; + } + + reject(error); + } + ); + } + ); + }); + } + /** + * Edits a SignatureRequest based on the given Template(s) to be signed in an embedded iFrame. Note that embedded signature requests can only be signed in embedded iFrames whereas normal signature requests can only be signed on Dropbox Sign. + * @summary Edit Embedded Signature Request with Template + * @param signatureRequestId The id of the SignatureRequest to edit. + * @param signatureRequestEditEmbeddedWithTemplateRequest + * @param options + */ + public async signatureRequestEditEmbeddedWithTemplate( + signatureRequestId: string, + signatureRequestEditEmbeddedWithTemplateRequest: SignatureRequestEditEmbeddedWithTemplateRequest, + options: optionsI = { headers: {} } + ): Promise> { + signatureRequestEditEmbeddedWithTemplateRequest = deserializeIfNeeded( + signatureRequestEditEmbeddedWithTemplateRequest, + "SignatureRequestEditEmbeddedWithTemplateRequest" + ); + const localVarPath = + this.basePath + + "/signature_request/edit_embedded_with_template/{signature_request_id}".replace( + "{" + "signature_request_id" + "}", + encodeURIComponent(String(signatureRequestId)) + ); + let localVarQueryParameters: any = {}; + let localVarHeaderParams: any = (Object).assign( + {}, + this._defaultHeaders + ); + const produces = ["application/json"]; + // give precedence to 'application/json' + if (produces.indexOf("application/json") >= 0) { + localVarHeaderParams["content-type"] = "application/json"; + } else { + localVarHeaderParams["content-type"] = produces.join(","); + } + let localVarFormParams: any = {}; + let localVarBodyParams: any = undefined; + + // verify required parameter 'signatureRequestId' is not null or undefined + if (signatureRequestId === null || signatureRequestId === undefined) { + throw new Error( + "Required parameter signatureRequestId was null or undefined when calling signatureRequestEditEmbeddedWithTemplate." + ); + } + + // verify required parameter 'signatureRequestEditEmbeddedWithTemplateRequest' is not null or undefined + if ( + signatureRequestEditEmbeddedWithTemplateRequest === null || + signatureRequestEditEmbeddedWithTemplateRequest === undefined + ) { + throw new Error( + "Required parameter signatureRequestEditEmbeddedWithTemplateRequest was null or undefined when calling signatureRequestEditEmbeddedWithTemplate." + ); + } + + (Object).assign(localVarHeaderParams, options.headers); + + let localVarUseFormData = false; + + const result = generateFormData( + signatureRequestEditEmbeddedWithTemplateRequest, + SignatureRequestEditEmbeddedWithTemplateRequest.attributeTypeMap + ); + localVarUseFormData = result.localVarUseFormData; + + let data = {}; + if (localVarUseFormData) { + const formData = toFormData(result.data); + data = formData; + localVarHeaderParams = { + ...localVarHeaderParams, + ...formData.getHeaders(), + }; + } else { + data = ObjectSerializer.serialize( + signatureRequestEditEmbeddedWithTemplateRequest, + "SignatureRequestEditEmbeddedWithTemplateRequest" + ); + } + + let localVarRequestOptions: AxiosRequestConfig = { + method: "PUT", + params: localVarQueryParameters, + headers: localVarHeaderParams, + url: localVarPath, + paramsSerializer: this._useQuerystring + ? queryParamsSerializer + : undefined, + maxContentLength: Infinity, + maxBodyLength: Infinity, + responseType: "json", + data, + }; + + let authenticationPromise = Promise.resolve(); + if (this.authentications.api_key.username) { + authenticationPromise = authenticationPromise.then(() => + this.authentications.api_key.applyToRequest(localVarRequestOptions) + ); + } + if (this.authentications.oauth2.accessToken) { + authenticationPromise = authenticationPromise.then(() => + this.authentications.oauth2.applyToRequest(localVarRequestOptions) + ); + } + authenticationPromise = authenticationPromise.then(() => + this.authentications.default.applyToRequest(localVarRequestOptions) + ); + + let interceptorPromise = authenticationPromise; + for (const interceptor of this.interceptors) { + interceptorPromise = interceptorPromise.then(() => + interceptor(localVarRequestOptions) + ); + } + + return interceptorPromise.then(() => { + return new Promise>( + (resolve, reject) => { + axios.request(localVarRequestOptions).then( + (response) => { + handleSuccessfulResponse( + resolve, + reject, + response, + "SignatureRequestGetResponse" + ); + }, + (error: AxiosError) => { + if (error.response == null) { + reject(error); + return; + } + + if ( + handleErrorCodeResponse( + reject, + error.response, + 200, + "SignatureRequestGetResponse" + ) + ) { + return; + } + + if ( + handleErrorRangeResponse( + reject, + error.response, + "4XX", + "ErrorResponse" + ) + ) { + return; + } + + reject(error); + } + ); + } + ); + }); + } + /** + * Edits and sends a SignatureRequest based off of the Template(s) specified with the template_ids parameter. **NOTE:** Edit and resend will not deduct your signature request quota. + * @summary Edit Signature Request With Template + * @param signatureRequestId The id of the SignatureRequest to edit. + * @param signatureRequestEditWithTemplateRequest + * @param options + */ + public async signatureRequestEditWithTemplate( + signatureRequestId: string, + signatureRequestEditWithTemplateRequest: SignatureRequestEditWithTemplateRequest, + options: optionsI = { headers: {} } + ): Promise> { + signatureRequestEditWithTemplateRequest = deserializeIfNeeded( + signatureRequestEditWithTemplateRequest, + "SignatureRequestEditWithTemplateRequest" + ); + const localVarPath = + this.basePath + + "/signature_request/edit_with_template/{signature_request_id}".replace( + "{" + "signature_request_id" + "}", + encodeURIComponent(String(signatureRequestId)) + ); + let localVarQueryParameters: any = {}; + let localVarHeaderParams: any = (Object).assign( + {}, + this._defaultHeaders + ); + const produces = ["application/json"]; + // give precedence to 'application/json' + if (produces.indexOf("application/json") >= 0) { + localVarHeaderParams["content-type"] = "application/json"; + } else { + localVarHeaderParams["content-type"] = produces.join(","); + } + let localVarFormParams: any = {}; + let localVarBodyParams: any = undefined; + + // verify required parameter 'signatureRequestId' is not null or undefined + if (signatureRequestId === null || signatureRequestId === undefined) { + throw new Error( + "Required parameter signatureRequestId was null or undefined when calling signatureRequestEditWithTemplate." + ); + } + + // verify required parameter 'signatureRequestEditWithTemplateRequest' is not null or undefined + if ( + signatureRequestEditWithTemplateRequest === null || + signatureRequestEditWithTemplateRequest === undefined + ) { + throw new Error( + "Required parameter signatureRequestEditWithTemplateRequest was null or undefined when calling signatureRequestEditWithTemplate." + ); + } + + (Object).assign(localVarHeaderParams, options.headers); + + let localVarUseFormData = false; + + const result = generateFormData( + signatureRequestEditWithTemplateRequest, + SignatureRequestEditWithTemplateRequest.attributeTypeMap + ); + localVarUseFormData = result.localVarUseFormData; + + let data = {}; + if (localVarUseFormData) { + const formData = toFormData(result.data); + data = formData; + localVarHeaderParams = { + ...localVarHeaderParams, + ...formData.getHeaders(), + }; + } else { + data = ObjectSerializer.serialize( + signatureRequestEditWithTemplateRequest, + "SignatureRequestEditWithTemplateRequest" + ); + } + + let localVarRequestOptions: AxiosRequestConfig = { + method: "PUT", + params: localVarQueryParameters, + headers: localVarHeaderParams, + url: localVarPath, + paramsSerializer: this._useQuerystring + ? queryParamsSerializer + : undefined, + maxContentLength: Infinity, + maxBodyLength: Infinity, + responseType: "json", + data, + }; + + let authenticationPromise = Promise.resolve(); + if (this.authentications.api_key.username) { + authenticationPromise = authenticationPromise.then(() => + this.authentications.api_key.applyToRequest(localVarRequestOptions) + ); + } + if (this.authentications.oauth2.accessToken) { + authenticationPromise = authenticationPromise.then(() => + this.authentications.oauth2.applyToRequest(localVarRequestOptions) + ); + } + authenticationPromise = authenticationPromise.then(() => + this.authentications.default.applyToRequest(localVarRequestOptions) + ); + + let interceptorPromise = authenticationPromise; + for (const interceptor of this.interceptors) { + interceptorPromise = interceptorPromise.then(() => + interceptor(localVarRequestOptions) + ); + } + + return interceptorPromise.then(() => { + return new Promise>( + (resolve, reject) => { + axios.request(localVarRequestOptions).then( + (response) => { + handleSuccessfulResponse( + resolve, + reject, + response, + "SignatureRequestGetResponse" + ); + }, + (error: AxiosError) => { + if (error.response == null) { + reject(error); + return; + } + + if ( + handleErrorCodeResponse( + reject, + error.response, + 200, + "SignatureRequestGetResponse" + ) + ) { + return; + } + + if ( + handleErrorRangeResponse( + reject, + error.response, + "4XX", + "ErrorResponse" + ) + ) { + return; + } + + reject(error); + } + ); + } + ); + }); + } /** * Obtain a copy of the current documents specified by the `signature_request_id` parameter. Returns a PDF or ZIP file. If the files are currently being prepared, a status code of `409` will be returned instead. * @summary Download Files diff --git a/sdks/node/dist/api.js b/sdks/node/dist/api.js index 3b8851064..13138becb 100644 --- a/sdks/node/dist/api.js +++ b/sdks/node/dist/api.js @@ -13015,6 +13015,10 @@ __export(api_exports, { SignatureRequestBulkSendWithTemplateRequest: () => SignatureRequestBulkSendWithTemplateRequest, SignatureRequestCreateEmbeddedRequest: () => SignatureRequestCreateEmbeddedRequest, SignatureRequestCreateEmbeddedWithTemplateRequest: () => SignatureRequestCreateEmbeddedWithTemplateRequest, + SignatureRequestEditEmbeddedRequest: () => SignatureRequestEditEmbeddedRequest, + SignatureRequestEditEmbeddedWithTemplateRequest: () => SignatureRequestEditEmbeddedWithTemplateRequest, + SignatureRequestEditRequest: () => SignatureRequestEditRequest, + SignatureRequestEditWithTemplateRequest: () => SignatureRequestEditWithTemplateRequest, SignatureRequestGetResponse: () => SignatureRequestGetResponse, SignatureRequestListResponse: () => SignatureRequestListResponse, SignatureRequestRemindRequest: () => SignatureRequestRemindRequest, @@ -19125,6 +19129,497 @@ SignatureRequestCreateEmbeddedWithTemplateRequest.attributeTypeMap = [ } ]; +// model/signatureRequestEditEmbeddedRequest.ts +var _SignatureRequestEditEmbeddedRequest = class { + constructor() { + this["allowDecline"] = false; + this["allowReassign"] = false; + this["hideTextTags"] = false; + this["testMode"] = false; + this["useTextTags"] = false; + this["populateAutoFillFields"] = false; + } + static getAttributeTypeMap() { + return _SignatureRequestEditEmbeddedRequest.attributeTypeMap; + } + static init(data) { + return ObjectSerializer.deserialize( + data, + "SignatureRequestEditEmbeddedRequest" + ); + } +}; +var SignatureRequestEditEmbeddedRequest = _SignatureRequestEditEmbeddedRequest; +SignatureRequestEditEmbeddedRequest.discriminator = void 0; +SignatureRequestEditEmbeddedRequest.attributeTypeMap = [ + { + name: "clientId", + baseName: "client_id", + type: "string" + }, + { + name: "files", + baseName: "files", + type: "Array" + }, + { + name: "fileUrls", + baseName: "file_urls", + type: "Array" + }, + { + name: "signers", + baseName: "signers", + type: "Array" + }, + { + name: "groupedSigners", + baseName: "grouped_signers", + type: "Array" + }, + { + name: "allowDecline", + baseName: "allow_decline", + type: "boolean" + }, + { + name: "allowReassign", + baseName: "allow_reassign", + type: "boolean" + }, + { + name: "attachments", + baseName: "attachments", + type: "Array" + }, + { + name: "ccEmailAddresses", + baseName: "cc_email_addresses", + type: "Array" + }, + { + name: "customFields", + baseName: "custom_fields", + type: "Array" + }, + { + name: "fieldOptions", + baseName: "field_options", + type: "SubFieldOptions" + }, + { + name: "formFieldGroups", + baseName: "form_field_groups", + type: "Array" + }, + { + name: "formFieldRules", + baseName: "form_field_rules", + type: "Array" + }, + { + name: "formFieldsPerDocument", + baseName: "form_fields_per_document", + type: "Array" + }, + { + name: "hideTextTags", + baseName: "hide_text_tags", + type: "boolean" + }, + { + name: "message", + baseName: "message", + type: "string" + }, + { + name: "metadata", + baseName: "metadata", + type: "{ [key: string]: any; }" + }, + { + name: "signingOptions", + baseName: "signing_options", + type: "SubSigningOptions" + }, + { + name: "subject", + baseName: "subject", + type: "string" + }, + { + name: "testMode", + baseName: "test_mode", + type: "boolean" + }, + { + name: "title", + baseName: "title", + type: "string" + }, + { + name: "useTextTags", + baseName: "use_text_tags", + type: "boolean" + }, + { + name: "populateAutoFillFields", + baseName: "populate_auto_fill_fields", + type: "boolean" + }, + { + name: "expiresAt", + baseName: "expires_at", + type: "number" + } +]; + +// model/signatureRequestEditEmbeddedWithTemplateRequest.ts +var _SignatureRequestEditEmbeddedWithTemplateRequest = class { + constructor() { + this["allowDecline"] = false; + this["testMode"] = false; + this["populateAutoFillFields"] = false; + } + static getAttributeTypeMap() { + return _SignatureRequestEditEmbeddedWithTemplateRequest.attributeTypeMap; + } + static init(data) { + return ObjectSerializer.deserialize( + data, + "SignatureRequestEditEmbeddedWithTemplateRequest" + ); + } +}; +var SignatureRequestEditEmbeddedWithTemplateRequest = _SignatureRequestEditEmbeddedWithTemplateRequest; +SignatureRequestEditEmbeddedWithTemplateRequest.discriminator = void 0; +SignatureRequestEditEmbeddedWithTemplateRequest.attributeTypeMap = [ + { + name: "templateIds", + baseName: "template_ids", + type: "Array" + }, + { + name: "clientId", + baseName: "client_id", + type: "string" + }, + { + name: "signers", + baseName: "signers", + type: "Array" + }, + { + name: "allowDecline", + baseName: "allow_decline", + type: "boolean" + }, + { + name: "ccs", + baseName: "ccs", + type: "Array" + }, + { + name: "customFields", + baseName: "custom_fields", + type: "Array" + }, + { + name: "files", + baseName: "files", + type: "Array" + }, + { + name: "fileUrls", + baseName: "file_urls", + type: "Array" + }, + { + name: "message", + baseName: "message", + type: "string" + }, + { + name: "metadata", + baseName: "metadata", + type: "{ [key: string]: any; }" + }, + { + name: "signingOptions", + baseName: "signing_options", + type: "SubSigningOptions" + }, + { + name: "subject", + baseName: "subject", + type: "string" + }, + { + name: "testMode", + baseName: "test_mode", + type: "boolean" + }, + { + name: "title", + baseName: "title", + type: "string" + }, + { + name: "populateAutoFillFields", + baseName: "populate_auto_fill_fields", + type: "boolean" + } +]; + +// model/signatureRequestEditRequest.ts +var _SignatureRequestEditRequest = class { + constructor() { + this["allowDecline"] = false; + this["allowReassign"] = false; + this["hideTextTags"] = false; + this["isEid"] = false; + this["testMode"] = false; + this["useTextTags"] = false; + } + static getAttributeTypeMap() { + return _SignatureRequestEditRequest.attributeTypeMap; + } + static init(data) { + return ObjectSerializer.deserialize(data, "SignatureRequestEditRequest"); + } +}; +var SignatureRequestEditRequest = _SignatureRequestEditRequest; +SignatureRequestEditRequest.discriminator = void 0; +SignatureRequestEditRequest.attributeTypeMap = [ + { + name: "files", + baseName: "files", + type: "Array" + }, + { + name: "fileUrls", + baseName: "file_urls", + type: "Array" + }, + { + name: "signers", + baseName: "signers", + type: "Array" + }, + { + name: "groupedSigners", + baseName: "grouped_signers", + type: "Array" + }, + { + name: "allowDecline", + baseName: "allow_decline", + type: "boolean" + }, + { + name: "allowReassign", + baseName: "allow_reassign", + type: "boolean" + }, + { + name: "attachments", + baseName: "attachments", + type: "Array" + }, + { + name: "ccEmailAddresses", + baseName: "cc_email_addresses", + type: "Array" + }, + { + name: "clientId", + baseName: "client_id", + type: "string" + }, + { + name: "customFields", + baseName: "custom_fields", + type: "Array" + }, + { + name: "fieldOptions", + baseName: "field_options", + type: "SubFieldOptions" + }, + { + name: "formFieldGroups", + baseName: "form_field_groups", + type: "Array" + }, + { + name: "formFieldRules", + baseName: "form_field_rules", + type: "Array" + }, + { + name: "formFieldsPerDocument", + baseName: "form_fields_per_document", + type: "Array" + }, + { + name: "hideTextTags", + baseName: "hide_text_tags", + type: "boolean" + }, + { + name: "isEid", + baseName: "is_eid", + type: "boolean" + }, + { + name: "message", + baseName: "message", + type: "string" + }, + { + name: "metadata", + baseName: "metadata", + type: "{ [key: string]: any; }" + }, + { + name: "signingOptions", + baseName: "signing_options", + type: "SubSigningOptions" + }, + { + name: "signingRedirectUrl", + baseName: "signing_redirect_url", + type: "string" + }, + { + name: "subject", + baseName: "subject", + type: "string" + }, + { + name: "testMode", + baseName: "test_mode", + type: "boolean" + }, + { + name: "title", + baseName: "title", + type: "string" + }, + { + name: "useTextTags", + baseName: "use_text_tags", + type: "boolean" + }, + { + name: "expiresAt", + baseName: "expires_at", + type: "number" + } +]; + +// model/signatureRequestEditWithTemplateRequest.ts +var _SignatureRequestEditWithTemplateRequest = class { + constructor() { + this["allowDecline"] = false; + this["isEid"] = false; + this["testMode"] = false; + } + static getAttributeTypeMap() { + return _SignatureRequestEditWithTemplateRequest.attributeTypeMap; + } + static init(data) { + return ObjectSerializer.deserialize( + data, + "SignatureRequestEditWithTemplateRequest" + ); + } +}; +var SignatureRequestEditWithTemplateRequest = _SignatureRequestEditWithTemplateRequest; +SignatureRequestEditWithTemplateRequest.discriminator = void 0; +SignatureRequestEditWithTemplateRequest.attributeTypeMap = [ + { + name: "templateIds", + baseName: "template_ids", + type: "Array" + }, + { + name: "signers", + baseName: "signers", + type: "Array" + }, + { + name: "allowDecline", + baseName: "allow_decline", + type: "boolean" + }, + { + name: "ccs", + baseName: "ccs", + type: "Array" + }, + { + name: "clientId", + baseName: "client_id", + type: "string" + }, + { + name: "customFields", + baseName: "custom_fields", + type: "Array" + }, + { + name: "files", + baseName: "files", + type: "Array" + }, + { + name: "fileUrls", + baseName: "file_urls", + type: "Array" + }, + { + name: "isEid", + baseName: "is_eid", + type: "boolean" + }, + { + name: "message", + baseName: "message", + type: "string" + }, + { + name: "metadata", + baseName: "metadata", + type: "{ [key: string]: any; }" + }, + { + name: "signingOptions", + baseName: "signing_options", + type: "SubSigningOptions" + }, + { + name: "signingRedirectUrl", + baseName: "signing_redirect_url", + type: "string" + }, + { + name: "subject", + baseName: "subject", + type: "string" + }, + { + name: "testMode", + baseName: "test_mode", + type: "boolean" + }, + { + name: "title", + baseName: "title", + type: "string" + } +]; + // model/signatureRequestGetResponse.ts var _SignatureRequestGetResponse = class { static getAttributeTypeMap() { @@ -24788,6 +25283,10 @@ var typeMap = { SignatureRequestBulkSendWithTemplateRequest, SignatureRequestCreateEmbeddedRequest, SignatureRequestCreateEmbeddedWithTemplateRequest, + SignatureRequestEditEmbeddedRequest, + SignatureRequestEditEmbeddedWithTemplateRequest, + SignatureRequestEditRequest, + SignatureRequestEditWithTemplateRequest, SignatureRequestGetResponse, SignatureRequestListResponse, SignatureRequestRemindRequest, @@ -28148,13 +28647,203 @@ var OAuthApi = class { }); }); } - oauthTokenRefresh(_0) { - return __async(this, arguments, function* (oAuthTokenRefreshRequest, options = { headers: {} }) { - oAuthTokenRefreshRequest = deserializeIfNeeded6( - oAuthTokenRefreshRequest, - "OAuthTokenRefreshRequest" + oauthTokenRefresh(_0) { + return __async(this, arguments, function* (oAuthTokenRefreshRequest, options = { headers: {} }) { + oAuthTokenRefreshRequest = deserializeIfNeeded6( + oAuthTokenRefreshRequest, + "OAuthTokenRefreshRequest" + ); + const localVarPath = this.basePath + "/oauth/token?refresh"; + let localVarQueryParameters = {}; + let localVarHeaderParams = Object.assign( + {}, + this._defaultHeaders + ); + const produces = ["application/json"]; + if (produces.indexOf("application/json") >= 0) { + localVarHeaderParams["content-type"] = "application/json"; + } else { + localVarHeaderParams["content-type"] = produces.join(","); + } + let localVarFormParams = {}; + let localVarBodyParams = void 0; + if (oAuthTokenRefreshRequest === null || oAuthTokenRefreshRequest === void 0) { + throw new Error( + "Required parameter oAuthTokenRefreshRequest was null or undefined when calling oauthTokenRefresh." + ); + } + Object.assign(localVarHeaderParams, options.headers); + let localVarUseFormData = false; + const result = generateFormData( + oAuthTokenRefreshRequest, + OAuthTokenRefreshRequest.attributeTypeMap + ); + localVarUseFormData = result.localVarUseFormData; + let data = {}; + if (localVarUseFormData) { + const formData2 = toFormData3(result.data); + data = formData2; + localVarHeaderParams = __spreadValues(__spreadValues({}, localVarHeaderParams), formData2.getHeaders()); + } else { + data = ObjectSerializer.serialize( + oAuthTokenRefreshRequest, + "OAuthTokenRefreshRequest" + ); + } + let localVarRequestOptions = { + method: "POST", + params: localVarQueryParameters, + headers: localVarHeaderParams, + url: localVarPath, + paramsSerializer: this._useQuerystring ? queryParamsSerializer : void 0, + maxContentLength: Infinity, + maxBodyLength: Infinity, + responseType: "json", + data + }; + let authenticationPromise = Promise.resolve(); + authenticationPromise = authenticationPromise.then( + () => this.authentications.default.applyToRequest(localVarRequestOptions) + ); + let interceptorPromise = authenticationPromise; + for (const interceptor of this.interceptors) { + interceptorPromise = interceptorPromise.then( + () => interceptor(localVarRequestOptions) + ); + } + return interceptorPromise.then(() => { + return new Promise((resolve, reject) => { + axios_default.request(localVarRequestOptions).then( + (response) => { + handleSuccessfulResponse7( + resolve, + reject, + response, + "OAuthTokenResponse" + ); + }, + (error) => { + if (error.response == null) { + reject(error); + return; + } + if (handleErrorCodeResponse7( + reject, + error.response, + 200, + "OAuthTokenResponse" + )) { + return; + } + if (handleErrorRangeResponse7( + reject, + error.response, + "4XX", + "ErrorResponse" + )) { + return; + } + reject(error); + } + ); + }); + }); + }); + } +}; +function deserializeIfNeeded6(obj, classname) { + if (obj !== null && obj !== void 0 && obj.constructor.name !== classname) { + return ObjectSerializer.deserialize(obj, classname); + } + return obj; +} +function handleSuccessfulResponse7(resolve, reject, response, returnType) { + let body = response.data; + if (response.status && response.status >= 200 && response.status <= 299) { + if (returnType) { + body = ObjectSerializer.deserialize(body, returnType); + } + resolve({ response, body }); + } else { + reject(new HttpError(response, body, response.status)); + } +} +function handleErrorCodeResponse7(reject, response, code, returnType) { + if (response.status !== code) { + return false; + } + const body = ObjectSerializer.deserialize(response.data, returnType); + reject(new HttpError(response, body, response.status)); + return true; +} +function handleErrorRangeResponse7(reject, response, code, returnType) { + let rangeCodeLeft = Number(code[0] + "00"); + let rangeCodeRight = Number(code[0] + "99"); + if (response.status >= rangeCodeLeft && response.status <= rangeCodeRight) { + const body = ObjectSerializer.deserialize(response.data, returnType); + reject(new HttpError(response, body, response.status)); + return true; + } + return false; +} + +// api/reportApi.ts +var defaultBasePath8 = "https://api.hellosign.com/v3"; +var ReportApi = class { + constructor(basePath) { + this._basePath = defaultBasePath8; + this._defaultHeaders = { "User-Agent": USER_AGENT }; + this._useQuerystring = false; + this.authentications = { + default: new VoidAuth(), + api_key: new HttpBasicAuth(), + oauth2: new HttpBearerAuth() + }; + this.interceptors = []; + if (basePath) { + this.basePath = basePath; + } + } + set useQuerystring(value) { + this._useQuerystring = value; + } + set basePath(basePath) { + this._basePath = basePath; + } + set defaultHeaders(defaultHeaders) { + this._defaultHeaders = __spreadProps(__spreadValues({}, defaultHeaders), { "User-Agent": USER_AGENT }); + } + get defaultHeaders() { + return this._defaultHeaders; + } + get basePath() { + return this._basePath; + } + setDefaultAuthentication(auth) { + this.authentications.default = auth; + } + setApiKey(key) { + this.authentications.api_key.username = key; + } + set username(username) { + this.authentications.api_key.username = username; + } + set password(password) { + this.authentications.api_key.password = password; + } + set accessToken(accessToken) { + this.authentications.oauth2.accessToken = accessToken; + } + addInterceptor(interceptor) { + this.interceptors.push(interceptor); + } + reportCreate(_0) { + return __async(this, arguments, function* (reportCreateRequest, options = { headers: {} }) { + reportCreateRequest = deserializeIfNeeded7( + reportCreateRequest, + "ReportCreateRequest" ); - const localVarPath = this.basePath + "/oauth/token?refresh"; + const localVarPath = this.basePath + "/report/create"; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign( {}, @@ -28168,16 +28857,16 @@ var OAuthApi = class { } let localVarFormParams = {}; let localVarBodyParams = void 0; - if (oAuthTokenRefreshRequest === null || oAuthTokenRefreshRequest === void 0) { + if (reportCreateRequest === null || reportCreateRequest === void 0) { throw new Error( - "Required parameter oAuthTokenRefreshRequest was null or undefined when calling oauthTokenRefresh." + "Required parameter reportCreateRequest was null or undefined when calling reportCreate." ); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; const result = generateFormData( - oAuthTokenRefreshRequest, - OAuthTokenRefreshRequest.attributeTypeMap + reportCreateRequest, + ReportCreateRequest.attributeTypeMap ); localVarUseFormData = result.localVarUseFormData; let data = {}; @@ -28187,8 +28876,8 @@ var OAuthApi = class { localVarHeaderParams = __spreadValues(__spreadValues({}, localVarHeaderParams), formData2.getHeaders()); } else { data = ObjectSerializer.serialize( - oAuthTokenRefreshRequest, - "OAuthTokenRefreshRequest" + reportCreateRequest, + "ReportCreateRequest" ); } let localVarRequestOptions = { @@ -28203,6 +28892,11 @@ var OAuthApi = class { data }; let authenticationPromise = Promise.resolve(); + if (this.authentications.api_key.username) { + authenticationPromise = authenticationPromise.then( + () => this.authentications.api_key.applyToRequest(localVarRequestOptions) + ); + } authenticationPromise = authenticationPromise.then( () => this.authentications.default.applyToRequest(localVarRequestOptions) ); @@ -28213,52 +28907,54 @@ var OAuthApi = class { ); } return interceptorPromise.then(() => { - return new Promise((resolve, reject) => { - axios_default.request(localVarRequestOptions).then( - (response) => { - handleSuccessfulResponse7( - resolve, - reject, - response, - "OAuthTokenResponse" - ); - }, - (error) => { - if (error.response == null) { + return new Promise( + (resolve, reject) => { + axios_default.request(localVarRequestOptions).then( + (response) => { + handleSuccessfulResponse8( + resolve, + reject, + response, + "ReportCreateResponse" + ); + }, + (error) => { + if (error.response == null) { + reject(error); + return; + } + if (handleErrorCodeResponse8( + reject, + error.response, + 200, + "ReportCreateResponse" + )) { + return; + } + if (handleErrorRangeResponse8( + reject, + error.response, + "4XX", + "ErrorResponse" + )) { + return; + } reject(error); - return; - } - if (handleErrorCodeResponse7( - reject, - error.response, - 200, - "OAuthTokenResponse" - )) { - return; } - if (handleErrorRangeResponse7( - reject, - error.response, - "4XX", - "ErrorResponse" - )) { - return; - } - reject(error); - } - ); - }); + ); + } + ); }); }); } }; -function deserializeIfNeeded6(obj, classname) { +function deserializeIfNeeded7(obj, classname) { if (obj !== null && obj !== void 0 && obj.constructor.name !== classname) { return ObjectSerializer.deserialize(obj, classname); } return obj; } -function handleSuccessfulResponse7(resolve, reject, response, returnType) { +function handleSuccessfulResponse8(resolve, reject, response, returnType) { let body = response.data; if (response.status && response.status >= 200 && response.status <= 299) { if (returnType) { @@ -28269,7 +28965,7 @@ function handleSuccessfulResponse7(resolve, reject, response, returnType) { reject(new HttpError(response, body, response.status)); } } -function handleErrorCodeResponse7(reject, response, code, returnType) { +function handleErrorCodeResponse8(reject, response, code, returnType) { if (response.status !== code) { return false; } @@ -28277,7 +28973,7 @@ function handleErrorCodeResponse7(reject, response, code, returnType) { reject(new HttpError(response, body, response.status)); return true; } -function handleErrorRangeResponse7(reject, response, code, returnType) { +function handleErrorRangeResponse8(reject, response, code, returnType) { let rangeCodeLeft = Number(code[0] + "00"); let rangeCodeRight = Number(code[0] + "99"); if (response.status >= rangeCodeLeft && response.status <= rangeCodeRight) { @@ -28288,11 +28984,11 @@ function handleErrorRangeResponse7(reject, response, code, returnType) { return false; } -// api/reportApi.ts -var defaultBasePath8 = "https://api.hellosign.com/v3"; -var ReportApi = class { +// api/signatureRequestApi.ts +var defaultBasePath9 = "https://api.hellosign.com/v3"; +var SignatureRequestApi = class { constructor(basePath) { - this._basePath = defaultBasePath8; + this._basePath = defaultBasePath9; this._defaultHeaders = { "User-Agent": USER_AGENT }; this._useQuerystring = false; this.authentications = { @@ -28338,13 +29034,123 @@ var ReportApi = class { addInterceptor(interceptor) { this.interceptors.push(interceptor); } - reportCreate(_0) { - return __async(this, arguments, function* (reportCreateRequest, options = { headers: {} }) { - reportCreateRequest = deserializeIfNeeded7( - reportCreateRequest, - "ReportCreateRequest" + signatureRequestBulkCreateEmbeddedWithTemplate(_0) { + return __async(this, arguments, function* (signatureRequestBulkCreateEmbeddedWithTemplateRequest, options = { headers: {} }) { + signatureRequestBulkCreateEmbeddedWithTemplateRequest = deserializeIfNeeded8( + signatureRequestBulkCreateEmbeddedWithTemplateRequest, + "SignatureRequestBulkCreateEmbeddedWithTemplateRequest" + ); + const localVarPath = this.basePath + "/signature_request/bulk_create_embedded_with_template"; + let localVarQueryParameters = {}; + let localVarHeaderParams = Object.assign( + {}, + this._defaultHeaders + ); + const produces = ["application/json"]; + if (produces.indexOf("application/json") >= 0) { + localVarHeaderParams["content-type"] = "application/json"; + } else { + localVarHeaderParams["content-type"] = produces.join(","); + } + let localVarFormParams = {}; + let localVarBodyParams = void 0; + if (signatureRequestBulkCreateEmbeddedWithTemplateRequest === null || signatureRequestBulkCreateEmbeddedWithTemplateRequest === void 0) { + throw new Error( + "Required parameter signatureRequestBulkCreateEmbeddedWithTemplateRequest was null or undefined when calling signatureRequestBulkCreateEmbeddedWithTemplate." + ); + } + Object.assign(localVarHeaderParams, options.headers); + let localVarUseFormData = false; + const result = generateFormData( + signatureRequestBulkCreateEmbeddedWithTemplateRequest, + SignatureRequestBulkCreateEmbeddedWithTemplateRequest.attributeTypeMap + ); + localVarUseFormData = result.localVarUseFormData; + let data = {}; + if (localVarUseFormData) { + const formData2 = toFormData3(result.data); + data = formData2; + localVarHeaderParams = __spreadValues(__spreadValues({}, localVarHeaderParams), formData2.getHeaders()); + } else { + data = ObjectSerializer.serialize( + signatureRequestBulkCreateEmbeddedWithTemplateRequest, + "SignatureRequestBulkCreateEmbeddedWithTemplateRequest" + ); + } + let localVarRequestOptions = { + method: "POST", + params: localVarQueryParameters, + headers: localVarHeaderParams, + url: localVarPath, + paramsSerializer: this._useQuerystring ? queryParamsSerializer : void 0, + maxContentLength: Infinity, + maxBodyLength: Infinity, + responseType: "json", + data + }; + let authenticationPromise = Promise.resolve(); + if (this.authentications.api_key.username) { + authenticationPromise = authenticationPromise.then( + () => this.authentications.api_key.applyToRequest(localVarRequestOptions) + ); + } + authenticationPromise = authenticationPromise.then( + () => this.authentications.default.applyToRequest(localVarRequestOptions) + ); + let interceptorPromise = authenticationPromise; + for (const interceptor of this.interceptors) { + interceptorPromise = interceptorPromise.then( + () => interceptor(localVarRequestOptions) + ); + } + return interceptorPromise.then(() => { + return new Promise( + (resolve, reject) => { + axios_default.request(localVarRequestOptions).then( + (response) => { + handleSuccessfulResponse9( + resolve, + reject, + response, + "BulkSendJobSendResponse" + ); + }, + (error) => { + if (error.response == null) { + reject(error); + return; + } + if (handleErrorCodeResponse9( + reject, + error.response, + 200, + "BulkSendJobSendResponse" + )) { + return; + } + if (handleErrorRangeResponse9( + reject, + error.response, + "4XX", + "ErrorResponse" + )) { + return; + } + reject(error); + } + ); + } + ); + }); + }); + } + signatureRequestBulkSendWithTemplate(_0) { + return __async(this, arguments, function* (signatureRequestBulkSendWithTemplateRequest, options = { headers: {} }) { + signatureRequestBulkSendWithTemplateRequest = deserializeIfNeeded8( + signatureRequestBulkSendWithTemplateRequest, + "SignatureRequestBulkSendWithTemplateRequest" ); - const localVarPath = this.basePath + "/report/create"; + const localVarPath = this.basePath + "/signature_request/bulk_send_with_template"; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign( {}, @@ -28358,16 +29164,16 @@ var ReportApi = class { } let localVarFormParams = {}; let localVarBodyParams = void 0; - if (reportCreateRequest === null || reportCreateRequest === void 0) { + if (signatureRequestBulkSendWithTemplateRequest === null || signatureRequestBulkSendWithTemplateRequest === void 0) { throw new Error( - "Required parameter reportCreateRequest was null or undefined when calling reportCreate." + "Required parameter signatureRequestBulkSendWithTemplateRequest was null or undefined when calling signatureRequestBulkSendWithTemplate." ); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; const result = generateFormData( - reportCreateRequest, - ReportCreateRequest.attributeTypeMap + signatureRequestBulkSendWithTemplateRequest, + SignatureRequestBulkSendWithTemplateRequest.attributeTypeMap ); localVarUseFormData = result.localVarUseFormData; let data = {}; @@ -28377,8 +29183,8 @@ var ReportApi = class { localVarHeaderParams = __spreadValues(__spreadValues({}, localVarHeaderParams), formData2.getHeaders()); } else { data = ObjectSerializer.serialize( - reportCreateRequest, - "ReportCreateRequest" + signatureRequestBulkSendWithTemplateRequest, + "SignatureRequestBulkSendWithTemplateRequest" ); } let localVarRequestOptions = { @@ -28398,6 +29204,11 @@ var ReportApi = class { () => this.authentications.api_key.applyToRequest(localVarRequestOptions) ); } + if (this.authentications.oauth2.accessToken) { + authenticationPromise = authenticationPromise.then( + () => this.authentications.oauth2.applyToRequest(localVarRequestOptions) + ); + } authenticationPromise = authenticationPromise.then( () => this.authentications.default.applyToRequest(localVarRequestOptions) ); @@ -28412,11 +29223,11 @@ var ReportApi = class { (resolve, reject) => { axios_default.request(localVarRequestOptions).then( (response) => { - handleSuccessfulResponse8( + handleSuccessfulResponse9( resolve, reject, response, - "ReportCreateResponse" + "BulkSendJobSendResponse" ); }, (error) => { @@ -28424,15 +29235,15 @@ var ReportApi = class { reject(error); return; } - if (handleErrorCodeResponse8( + if (handleErrorCodeResponse9( reject, error.response, 200, - "ReportCreateResponse" + "BulkSendJobSendResponse" )) { return; } - if (handleErrorRangeResponse8( + if (handleErrorRangeResponse9( reject, error.response, "4XX", @@ -28448,100 +29259,210 @@ var ReportApi = class { }); }); } -}; -function deserializeIfNeeded7(obj, classname) { - if (obj !== null && obj !== void 0 && obj.constructor.name !== classname) { - return ObjectSerializer.deserialize(obj, classname); - } - return obj; -} -function handleSuccessfulResponse8(resolve, reject, response, returnType) { - let body = response.data; - if (response.status && response.status >= 200 && response.status <= 299) { - if (returnType) { - body = ObjectSerializer.deserialize(body, returnType); - } - resolve({ response, body }); - } else { - reject(new HttpError(response, body, response.status)); - } -} -function handleErrorCodeResponse8(reject, response, code, returnType) { - if (response.status !== code) { - return false; - } - const body = ObjectSerializer.deserialize(response.data, returnType); - reject(new HttpError(response, body, response.status)); - return true; -} -function handleErrorRangeResponse8(reject, response, code, returnType) { - let rangeCodeLeft = Number(code[0] + "00"); - let rangeCodeRight = Number(code[0] + "99"); - if (response.status >= rangeCodeLeft && response.status <= rangeCodeRight) { - const body = ObjectSerializer.deserialize(response.data, returnType); - reject(new HttpError(response, body, response.status)); - return true; - } - return false; -} - -// api/signatureRequestApi.ts -var defaultBasePath9 = "https://api.hellosign.com/v3"; -var SignatureRequestApi = class { - constructor(basePath) { - this._basePath = defaultBasePath9; - this._defaultHeaders = { "User-Agent": USER_AGENT }; - this._useQuerystring = false; - this.authentications = { - default: new VoidAuth(), - api_key: new HttpBasicAuth(), - oauth2: new HttpBearerAuth() - }; - this.interceptors = []; - if (basePath) { - this.basePath = basePath; - } - } - set useQuerystring(value) { - this._useQuerystring = value; - } - set basePath(basePath) { - this._basePath = basePath; - } - set defaultHeaders(defaultHeaders) { - this._defaultHeaders = __spreadProps(__spreadValues({}, defaultHeaders), { "User-Agent": USER_AGENT }); - } - get defaultHeaders() { - return this._defaultHeaders; - } - get basePath() { - return this._basePath; - } - setDefaultAuthentication(auth) { - this.authentications.default = auth; - } - setApiKey(key) { - this.authentications.api_key.username = key; - } - set username(username) { - this.authentications.api_key.username = username; - } - set password(password) { - this.authentications.api_key.password = password; - } - set accessToken(accessToken) { - this.authentications.oauth2.accessToken = accessToken; + signatureRequestCancel(_0) { + return __async(this, arguments, function* (signatureRequestId, options = { headers: {} }) { + const localVarPath = this.basePath + "/signature_request/cancel/{signature_request_id}".replace( + "{signature_request_id}", + encodeURIComponent(String(signatureRequestId)) + ); + let localVarQueryParameters = {}; + let localVarHeaderParams = Object.assign( + {}, + this._defaultHeaders + ); + const produces = ["application/json"]; + if (produces.indexOf("application/json") >= 0) { + localVarHeaderParams["content-type"] = "application/json"; + } else { + localVarHeaderParams["content-type"] = produces.join(","); + } + let localVarFormParams = {}; + let localVarBodyParams = void 0; + if (signatureRequestId === null || signatureRequestId === void 0) { + throw new Error( + "Required parameter signatureRequestId was null or undefined when calling signatureRequestCancel." + ); + } + Object.assign(localVarHeaderParams, options.headers); + let localVarUseFormData = false; + let localVarRequestOptions = { + method: "POST", + params: localVarQueryParameters, + headers: localVarHeaderParams, + url: localVarPath, + paramsSerializer: this._useQuerystring ? queryParamsSerializer : void 0, + maxContentLength: Infinity, + maxBodyLength: Infinity, + responseType: "json" + }; + let authenticationPromise = Promise.resolve(); + if (this.authentications.api_key.username) { + authenticationPromise = authenticationPromise.then( + () => this.authentications.api_key.applyToRequest(localVarRequestOptions) + ); + } + if (this.authentications.oauth2.accessToken) { + authenticationPromise = authenticationPromise.then( + () => this.authentications.oauth2.applyToRequest(localVarRequestOptions) + ); + } + authenticationPromise = authenticationPromise.then( + () => this.authentications.default.applyToRequest(localVarRequestOptions) + ); + let interceptorPromise = authenticationPromise; + for (const interceptor of this.interceptors) { + interceptorPromise = interceptorPromise.then( + () => interceptor(localVarRequestOptions) + ); + } + return interceptorPromise.then(() => { + return new Promise((resolve, reject) => { + axios_default.request(localVarRequestOptions).then( + (response) => { + handleSuccessfulResponse9(resolve, reject, response); + }, + (error) => { + if (error.response == null) { + reject(error); + return; + } + if (handleErrorRangeResponse9( + reject, + error.response, + "4XX", + "ErrorResponse" + )) { + return; + } + reject(error); + } + ); + }); + }); + }); } - addInterceptor(interceptor) { - this.interceptors.push(interceptor); + signatureRequestCreateEmbedded(_0) { + return __async(this, arguments, function* (signatureRequestCreateEmbeddedRequest, options = { headers: {} }) { + signatureRequestCreateEmbeddedRequest = deserializeIfNeeded8( + signatureRequestCreateEmbeddedRequest, + "SignatureRequestCreateEmbeddedRequest" + ); + const localVarPath = this.basePath + "/signature_request/create_embedded"; + let localVarQueryParameters = {}; + let localVarHeaderParams = Object.assign( + {}, + this._defaultHeaders + ); + const produces = ["application/json"]; + if (produces.indexOf("application/json") >= 0) { + localVarHeaderParams["content-type"] = "application/json"; + } else { + localVarHeaderParams["content-type"] = produces.join(","); + } + let localVarFormParams = {}; + let localVarBodyParams = void 0; + if (signatureRequestCreateEmbeddedRequest === null || signatureRequestCreateEmbeddedRequest === void 0) { + throw new Error( + "Required parameter signatureRequestCreateEmbeddedRequest was null or undefined when calling signatureRequestCreateEmbedded." + ); + } + Object.assign(localVarHeaderParams, options.headers); + let localVarUseFormData = false; + const result = generateFormData( + signatureRequestCreateEmbeddedRequest, + SignatureRequestCreateEmbeddedRequest.attributeTypeMap + ); + localVarUseFormData = result.localVarUseFormData; + let data = {}; + if (localVarUseFormData) { + const formData2 = toFormData3(result.data); + data = formData2; + localVarHeaderParams = __spreadValues(__spreadValues({}, localVarHeaderParams), formData2.getHeaders()); + } else { + data = ObjectSerializer.serialize( + signatureRequestCreateEmbeddedRequest, + "SignatureRequestCreateEmbeddedRequest" + ); + } + let localVarRequestOptions = { + method: "POST", + params: localVarQueryParameters, + headers: localVarHeaderParams, + url: localVarPath, + paramsSerializer: this._useQuerystring ? queryParamsSerializer : void 0, + maxContentLength: Infinity, + maxBodyLength: Infinity, + responseType: "json", + data + }; + let authenticationPromise = Promise.resolve(); + if (this.authentications.api_key.username) { + authenticationPromise = authenticationPromise.then( + () => this.authentications.api_key.applyToRequest(localVarRequestOptions) + ); + } + if (this.authentications.oauth2.accessToken) { + authenticationPromise = authenticationPromise.then( + () => this.authentications.oauth2.applyToRequest(localVarRequestOptions) + ); + } + authenticationPromise = authenticationPromise.then( + () => this.authentications.default.applyToRequest(localVarRequestOptions) + ); + let interceptorPromise = authenticationPromise; + for (const interceptor of this.interceptors) { + interceptorPromise = interceptorPromise.then( + () => interceptor(localVarRequestOptions) + ); + } + return interceptorPromise.then(() => { + return new Promise( + (resolve, reject) => { + axios_default.request(localVarRequestOptions).then( + (response) => { + handleSuccessfulResponse9( + resolve, + reject, + response, + "SignatureRequestGetResponse" + ); + }, + (error) => { + if (error.response == null) { + reject(error); + return; + } + if (handleErrorCodeResponse9( + reject, + error.response, + 200, + "SignatureRequestGetResponse" + )) { + return; + } + if (handleErrorRangeResponse9( + reject, + error.response, + "4XX", + "ErrorResponse" + )) { + return; + } + reject(error); + } + ); + } + ); + }); + }); } - signatureRequestBulkCreateEmbeddedWithTemplate(_0) { - return __async(this, arguments, function* (signatureRequestBulkCreateEmbeddedWithTemplateRequest, options = { headers: {} }) { - signatureRequestBulkCreateEmbeddedWithTemplateRequest = deserializeIfNeeded8( - signatureRequestBulkCreateEmbeddedWithTemplateRequest, - "SignatureRequestBulkCreateEmbeddedWithTemplateRequest" + signatureRequestCreateEmbeddedWithTemplate(_0) { + return __async(this, arguments, function* (signatureRequestCreateEmbeddedWithTemplateRequest, options = { headers: {} }) { + signatureRequestCreateEmbeddedWithTemplateRequest = deserializeIfNeeded8( + signatureRequestCreateEmbeddedWithTemplateRequest, + "SignatureRequestCreateEmbeddedWithTemplateRequest" ); - const localVarPath = this.basePath + "/signature_request/bulk_create_embedded_with_template"; + const localVarPath = this.basePath + "/signature_request/create_embedded_with_template"; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign( {}, @@ -28555,16 +29476,16 @@ var SignatureRequestApi = class { } let localVarFormParams = {}; let localVarBodyParams = void 0; - if (signatureRequestBulkCreateEmbeddedWithTemplateRequest === null || signatureRequestBulkCreateEmbeddedWithTemplateRequest === void 0) { + if (signatureRequestCreateEmbeddedWithTemplateRequest === null || signatureRequestCreateEmbeddedWithTemplateRequest === void 0) { throw new Error( - "Required parameter signatureRequestBulkCreateEmbeddedWithTemplateRequest was null or undefined when calling signatureRequestBulkCreateEmbeddedWithTemplate." + "Required parameter signatureRequestCreateEmbeddedWithTemplateRequest was null or undefined when calling signatureRequestCreateEmbeddedWithTemplate." ); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; const result = generateFormData( - signatureRequestBulkCreateEmbeddedWithTemplateRequest, - SignatureRequestBulkCreateEmbeddedWithTemplateRequest.attributeTypeMap + signatureRequestCreateEmbeddedWithTemplateRequest, + SignatureRequestCreateEmbeddedWithTemplateRequest.attributeTypeMap ); localVarUseFormData = result.localVarUseFormData; let data = {}; @@ -28574,8 +29495,8 @@ var SignatureRequestApi = class { localVarHeaderParams = __spreadValues(__spreadValues({}, localVarHeaderParams), formData2.getHeaders()); } else { data = ObjectSerializer.serialize( - signatureRequestBulkCreateEmbeddedWithTemplateRequest, - "SignatureRequestBulkCreateEmbeddedWithTemplateRequest" + signatureRequestCreateEmbeddedWithTemplateRequest, + "SignatureRequestCreateEmbeddedWithTemplateRequest" ); } let localVarRequestOptions = { @@ -28595,6 +29516,11 @@ var SignatureRequestApi = class { () => this.authentications.api_key.applyToRequest(localVarRequestOptions) ); } + if (this.authentications.oauth2.accessToken) { + authenticationPromise = authenticationPromise.then( + () => this.authentications.oauth2.applyToRequest(localVarRequestOptions) + ); + } authenticationPromise = authenticationPromise.then( () => this.authentications.default.applyToRequest(localVarRequestOptions) ); @@ -28613,7 +29539,7 @@ var SignatureRequestApi = class { resolve, reject, response, - "BulkSendJobSendResponse" + "SignatureRequestGetResponse" ); }, (error) => { @@ -28625,7 +29551,7 @@ var SignatureRequestApi = class { reject, error.response, 200, - "BulkSendJobSendResponse" + "SignatureRequestGetResponse" )) { return; } @@ -28645,13 +29571,16 @@ var SignatureRequestApi = class { }); }); } - signatureRequestBulkSendWithTemplate(_0) { - return __async(this, arguments, function* (signatureRequestBulkSendWithTemplateRequest, options = { headers: {} }) { - signatureRequestBulkSendWithTemplateRequest = deserializeIfNeeded8( - signatureRequestBulkSendWithTemplateRequest, - "SignatureRequestBulkSendWithTemplateRequest" + signatureRequestEdit(_0, _1) { + return __async(this, arguments, function* (signatureRequestId, signatureRequestEditRequest, options = { headers: {} }) { + signatureRequestEditRequest = deserializeIfNeeded8( + signatureRequestEditRequest, + "SignatureRequestEditRequest" + ); + const localVarPath = this.basePath + "/signature_request/edit/{signature_request_id}".replace( + "{signature_request_id}", + encodeURIComponent(String(signatureRequestId)) ); - const localVarPath = this.basePath + "/signature_request/bulk_send_with_template"; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign( {}, @@ -28665,16 +29594,21 @@ var SignatureRequestApi = class { } let localVarFormParams = {}; let localVarBodyParams = void 0; - if (signatureRequestBulkSendWithTemplateRequest === null || signatureRequestBulkSendWithTemplateRequest === void 0) { + if (signatureRequestId === null || signatureRequestId === void 0) { throw new Error( - "Required parameter signatureRequestBulkSendWithTemplateRequest was null or undefined when calling signatureRequestBulkSendWithTemplate." + "Required parameter signatureRequestId was null or undefined when calling signatureRequestEdit." + ); + } + if (signatureRequestEditRequest === null || signatureRequestEditRequest === void 0) { + throw new Error( + "Required parameter signatureRequestEditRequest was null or undefined when calling signatureRequestEdit." ); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; const result = generateFormData( - signatureRequestBulkSendWithTemplateRequest, - SignatureRequestBulkSendWithTemplateRequest.attributeTypeMap + signatureRequestEditRequest, + SignatureRequestEditRequest.attributeTypeMap ); localVarUseFormData = result.localVarUseFormData; let data = {}; @@ -28684,12 +29618,12 @@ var SignatureRequestApi = class { localVarHeaderParams = __spreadValues(__spreadValues({}, localVarHeaderParams), formData2.getHeaders()); } else { data = ObjectSerializer.serialize( - signatureRequestBulkSendWithTemplateRequest, - "SignatureRequestBulkSendWithTemplateRequest" + signatureRequestEditRequest, + "SignatureRequestEditRequest" ); } let localVarRequestOptions = { - method: "POST", + method: "PUT", params: localVarQueryParameters, headers: localVarHeaderParams, url: localVarPath, @@ -28728,7 +29662,7 @@ var SignatureRequestApi = class { resolve, reject, response, - "BulkSendJobSendResponse" + "SignatureRequestGetResponse" ); }, (error) => { @@ -28740,7 +29674,7 @@ var SignatureRequestApi = class { reject, error.response, 200, - "BulkSendJobSendResponse" + "SignatureRequestGetResponse" )) { return; } @@ -28760,9 +29694,13 @@ var SignatureRequestApi = class { }); }); } - signatureRequestCancel(_0) { - return __async(this, arguments, function* (signatureRequestId, options = { headers: {} }) { - const localVarPath = this.basePath + "/signature_request/cancel/{signature_request_id}".replace( + signatureRequestEditEmbedded(_0, _1) { + return __async(this, arguments, function* (signatureRequestId, signatureRequestEditEmbeddedRequest, options = { headers: {} }) { + signatureRequestEditEmbeddedRequest = deserializeIfNeeded8( + signatureRequestEditEmbeddedRequest, + "SignatureRequestEditEmbeddedRequest" + ); + const localVarPath = this.basePath + "/signature_request/edit_embedded/{signature_request_id}".replace( "{signature_request_id}", encodeURIComponent(String(signatureRequestId)) ); @@ -28781,20 +29719,42 @@ var SignatureRequestApi = class { let localVarBodyParams = void 0; if (signatureRequestId === null || signatureRequestId === void 0) { throw new Error( - "Required parameter signatureRequestId was null or undefined when calling signatureRequestCancel." + "Required parameter signatureRequestId was null or undefined when calling signatureRequestEditEmbedded." + ); + } + if (signatureRequestEditEmbeddedRequest === null || signatureRequestEditEmbeddedRequest === void 0) { + throw new Error( + "Required parameter signatureRequestEditEmbeddedRequest was null or undefined when calling signatureRequestEditEmbedded." ); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; + const result = generateFormData( + signatureRequestEditEmbeddedRequest, + SignatureRequestEditEmbeddedRequest.attributeTypeMap + ); + localVarUseFormData = result.localVarUseFormData; + let data = {}; + if (localVarUseFormData) { + const formData2 = toFormData3(result.data); + data = formData2; + localVarHeaderParams = __spreadValues(__spreadValues({}, localVarHeaderParams), formData2.getHeaders()); + } else { + data = ObjectSerializer.serialize( + signatureRequestEditEmbeddedRequest, + "SignatureRequestEditEmbeddedRequest" + ); + } let localVarRequestOptions = { - method: "POST", + method: "PUT", params: localVarQueryParameters, headers: localVarHeaderParams, url: localVarPath, paramsSerializer: this._useQuerystring ? queryParamsSerializer : void 0, maxContentLength: Infinity, maxBodyLength: Infinity, - responseType: "json" + responseType: "json", + data }; let authenticationPromise = Promise.resolve(); if (this.authentications.api_key.username) { @@ -28817,38 +29777,56 @@ var SignatureRequestApi = class { ); } return interceptorPromise.then(() => { - return new Promise((resolve, reject) => { - axios_default.request(localVarRequestOptions).then( - (response) => { - handleSuccessfulResponse9(resolve, reject, response); - }, - (error) => { - if (error.response == null) { + return new Promise( + (resolve, reject) => { + axios_default.request(localVarRequestOptions).then( + (response) => { + handleSuccessfulResponse9( + resolve, + reject, + response, + "SignatureRequestGetResponse" + ); + }, + (error) => { + if (error.response == null) { + reject(error); + return; + } + if (handleErrorCodeResponse9( + reject, + error.response, + 200, + "SignatureRequestGetResponse" + )) { + return; + } + if (handleErrorRangeResponse9( + reject, + error.response, + "4XX", + "ErrorResponse" + )) { + return; + } reject(error); - return; - } - if (handleErrorRangeResponse9( - reject, - error.response, - "4XX", - "ErrorResponse" - )) { - return; } - reject(error); - } - ); - }); + ); + } + ); }); }); } - signatureRequestCreateEmbedded(_0) { - return __async(this, arguments, function* (signatureRequestCreateEmbeddedRequest, options = { headers: {} }) { - signatureRequestCreateEmbeddedRequest = deserializeIfNeeded8( - signatureRequestCreateEmbeddedRequest, - "SignatureRequestCreateEmbeddedRequest" + signatureRequestEditEmbeddedWithTemplate(_0, _1) { + return __async(this, arguments, function* (signatureRequestId, signatureRequestEditEmbeddedWithTemplateRequest, options = { headers: {} }) { + signatureRequestEditEmbeddedWithTemplateRequest = deserializeIfNeeded8( + signatureRequestEditEmbeddedWithTemplateRequest, + "SignatureRequestEditEmbeddedWithTemplateRequest" + ); + const localVarPath = this.basePath + "/signature_request/edit_embedded_with_template/{signature_request_id}".replace( + "{signature_request_id}", + encodeURIComponent(String(signatureRequestId)) ); - const localVarPath = this.basePath + "/signature_request/create_embedded"; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign( {}, @@ -28862,16 +29840,21 @@ var SignatureRequestApi = class { } let localVarFormParams = {}; let localVarBodyParams = void 0; - if (signatureRequestCreateEmbeddedRequest === null || signatureRequestCreateEmbeddedRequest === void 0) { + if (signatureRequestId === null || signatureRequestId === void 0) { throw new Error( - "Required parameter signatureRequestCreateEmbeddedRequest was null or undefined when calling signatureRequestCreateEmbedded." + "Required parameter signatureRequestId was null or undefined when calling signatureRequestEditEmbeddedWithTemplate." + ); + } + if (signatureRequestEditEmbeddedWithTemplateRequest === null || signatureRequestEditEmbeddedWithTemplateRequest === void 0) { + throw new Error( + "Required parameter signatureRequestEditEmbeddedWithTemplateRequest was null or undefined when calling signatureRequestEditEmbeddedWithTemplate." ); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; const result = generateFormData( - signatureRequestCreateEmbeddedRequest, - SignatureRequestCreateEmbeddedRequest.attributeTypeMap + signatureRequestEditEmbeddedWithTemplateRequest, + SignatureRequestEditEmbeddedWithTemplateRequest.attributeTypeMap ); localVarUseFormData = result.localVarUseFormData; let data = {}; @@ -28881,12 +29864,12 @@ var SignatureRequestApi = class { localVarHeaderParams = __spreadValues(__spreadValues({}, localVarHeaderParams), formData2.getHeaders()); } else { data = ObjectSerializer.serialize( - signatureRequestCreateEmbeddedRequest, - "SignatureRequestCreateEmbeddedRequest" + signatureRequestEditEmbeddedWithTemplateRequest, + "SignatureRequestEditEmbeddedWithTemplateRequest" ); } let localVarRequestOptions = { - method: "POST", + method: "PUT", params: localVarQueryParameters, headers: localVarHeaderParams, url: localVarPath, @@ -28957,13 +29940,16 @@ var SignatureRequestApi = class { }); }); } - signatureRequestCreateEmbeddedWithTemplate(_0) { - return __async(this, arguments, function* (signatureRequestCreateEmbeddedWithTemplateRequest, options = { headers: {} }) { - signatureRequestCreateEmbeddedWithTemplateRequest = deserializeIfNeeded8( - signatureRequestCreateEmbeddedWithTemplateRequest, - "SignatureRequestCreateEmbeddedWithTemplateRequest" + signatureRequestEditWithTemplate(_0, _1) { + return __async(this, arguments, function* (signatureRequestId, signatureRequestEditWithTemplateRequest, options = { headers: {} }) { + signatureRequestEditWithTemplateRequest = deserializeIfNeeded8( + signatureRequestEditWithTemplateRequest, + "SignatureRequestEditWithTemplateRequest" + ); + const localVarPath = this.basePath + "/signature_request/edit_with_template/{signature_request_id}".replace( + "{signature_request_id}", + encodeURIComponent(String(signatureRequestId)) ); - const localVarPath = this.basePath + "/signature_request/create_embedded_with_template"; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign( {}, @@ -28977,16 +29963,21 @@ var SignatureRequestApi = class { } let localVarFormParams = {}; let localVarBodyParams = void 0; - if (signatureRequestCreateEmbeddedWithTemplateRequest === null || signatureRequestCreateEmbeddedWithTemplateRequest === void 0) { + if (signatureRequestId === null || signatureRequestId === void 0) { throw new Error( - "Required parameter signatureRequestCreateEmbeddedWithTemplateRequest was null or undefined when calling signatureRequestCreateEmbeddedWithTemplate." + "Required parameter signatureRequestId was null or undefined when calling signatureRequestEditWithTemplate." + ); + } + if (signatureRequestEditWithTemplateRequest === null || signatureRequestEditWithTemplateRequest === void 0) { + throw new Error( + "Required parameter signatureRequestEditWithTemplateRequest was null or undefined when calling signatureRequestEditWithTemplate." ); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; const result = generateFormData( - signatureRequestCreateEmbeddedWithTemplateRequest, - SignatureRequestCreateEmbeddedWithTemplateRequest.attributeTypeMap + signatureRequestEditWithTemplateRequest, + SignatureRequestEditWithTemplateRequest.attributeTypeMap ); localVarUseFormData = result.localVarUseFormData; let data = {}; @@ -28996,12 +29987,12 @@ var SignatureRequestApi = class { localVarHeaderParams = __spreadValues(__spreadValues({}, localVarHeaderParams), formData2.getHeaders()); } else { data = ObjectSerializer.serialize( - signatureRequestCreateEmbeddedWithTemplateRequest, - "SignatureRequestCreateEmbeddedWithTemplateRequest" + signatureRequestEditWithTemplateRequest, + "SignatureRequestEditWithTemplateRequest" ); } let localVarRequestOptions = { - method: "POST", + method: "PUT", params: localVarQueryParameters, headers: localVarHeaderParams, url: localVarPath, @@ -33378,6 +34369,10 @@ var APIS = [ SignatureRequestBulkSendWithTemplateRequest, SignatureRequestCreateEmbeddedRequest, SignatureRequestCreateEmbeddedWithTemplateRequest, + SignatureRequestEditEmbeddedRequest, + SignatureRequestEditEmbeddedWithTemplateRequest, + SignatureRequestEditRequest, + SignatureRequestEditWithTemplateRequest, SignatureRequestGetResponse, SignatureRequestListResponse, SignatureRequestRemindRequest, diff --git a/sdks/node/docs/api/SignatureRequestApi.md b/sdks/node/docs/api/SignatureRequestApi.md index 459c8c120..851264e7b 100644 --- a/sdks/node/docs/api/SignatureRequestApi.md +++ b/sdks/node/docs/api/SignatureRequestApi.md @@ -9,6 +9,10 @@ All URIs are relative to https://api.hellosign.com/v3. | [**signatureRequestCancel()**](SignatureRequestApi.md#signatureRequestCancel) | **POST** /signature_request/cancel/{signature_request_id} | Cancel Incomplete Signature Request | | [**signatureRequestCreateEmbedded()**](SignatureRequestApi.md#signatureRequestCreateEmbedded) | **POST** /signature_request/create_embedded | Create Embedded Signature Request | | [**signatureRequestCreateEmbeddedWithTemplate()**](SignatureRequestApi.md#signatureRequestCreateEmbeddedWithTemplate) | **POST** /signature_request/create_embedded_with_template | Create Embedded Signature Request with Template | +| [**signatureRequestEdit()**](SignatureRequestApi.md#signatureRequestEdit) | **PUT** /signature_request/edit/{signature_request_id} | Edit Signature Request | +| [**signatureRequestEditEmbedded()**](SignatureRequestApi.md#signatureRequestEditEmbedded) | **PUT** /signature_request/edit_embedded/{signature_request_id} | Edit Embedded Signature Request | +| [**signatureRequestEditEmbeddedWithTemplate()**](SignatureRequestApi.md#signatureRequestEditEmbeddedWithTemplate) | **PUT** /signature_request/edit_embedded_with_template/{signature_request_id} | Edit Embedded Signature Request with Template | +| [**signatureRequestEditWithTemplate()**](SignatureRequestApi.md#signatureRequestEditWithTemplate) | **PUT** /signature_request/edit_with_template/{signature_request_id} | Edit Signature Request With Template | | [**signatureRequestFiles()**](SignatureRequestApi.md#signatureRequestFiles) | **GET** /signature_request/files/{signature_request_id} | Download Files | | [**signatureRequestFilesAsDataUri()**](SignatureRequestApi.md#signatureRequestFilesAsDataUri) | **GET** /signature_request/files_as_data_uri/{signature_request_id} | Download Files as Data Uri | | [**signatureRequestFilesAsFileUrl()**](SignatureRequestApi.md#signatureRequestFilesAsFileUrl) | **GET** /signature_request/files_as_file_url/{signature_request_id} | Download Files as File Url | @@ -732,6 +736,685 @@ result.then(response => { [[Back to Model list]](../../README.md#models) [[Back to README]](../../README.md) +## `signatureRequestEdit()` + +```typescript +signatureRequestEdit(signatureRequestId: string, signatureRequestEditRequest: SignatureRequestEditRequest): SignatureRequestGetResponse +``` + +Edit Signature Request + +Edits and sends a SignatureRequest with the submitted documents. If `form_fields_per_document` is not specified, a signature page will be affixed where all signers will be required to add their signature, signifying their agreement to all contained documents. **NOTE:** Edit and resend will not deduct your signature request quota. + +### TypeScript Example + +```typescript +import * as DropboxSign from "@dropbox/sign"; +import * as fs from 'fs'; + +const signatureRequestApi = new DropboxSign.SignatureRequestApi(); + +// Configure HTTP basic authorization: api_key +signatureRequestApi.username = "YOUR_API_KEY"; + +// or, configure Bearer (JWT) authorization: oauth2 +// signatureRequestApi.accessToken = "YOUR_ACCESS_TOKEN"; + +const signer1: DropboxSign.SubSignatureRequestSigner = { + emailAddress: "jack@example.com", + name: "Jack", + order: 0, +}; + +const signer2: DropboxSign.SubSignatureRequestSigner = { + emailAddress: "jill@example.com", + name: "Jill", + order: 1, +}; + +const signingOptions: DropboxSign.SubSigningOptions = { + draw: true, + type: true, + upload: true, + phone: false, + defaultType: DropboxSign.SubSigningOptions.DefaultTypeEnum.Draw, +}; + +const fieldOptions: DropboxSign.SubFieldOptions = { + dateFormat: DropboxSign.SubFieldOptions.DateFormatEnum.DD_MM_YYYY, +}; + +// Upload a local file +const file = fs.createReadStream("example_signature_request.pdf"); + +// or, upload from buffer +const fileBuffer: DropboxSign.RequestDetailedFile = { + value: fs.readFileSync("example_signature_request.pdf"), + options: { + filename: "example_signature_request.pdf", + contentType: "application/pdf", + }, +}; + +// or, upload from buffer alternative +const fileBufferAlt: DropboxSign.RequestDetailedFile = { + value: Buffer.from("abc-123"), + options: { + filename: "txt-sample.txt", + contentType: "text/plain", + }, +}; + +const data: DropboxSign.SignatureRequestEditRequest = { + title: "NDA with Acme Co.", + subject: "The NDA we talked about", + message: "Please sign this NDA and then we can discuss more. Let me know if you have any questions.", + signers: [ signer1, signer2 ], + ccEmailAddresses: [ + "lawyer1@dropboxsign.com", + "lawyer2@dropboxsign.com", + ], + files: [ file, fileBuffer, fileBufferAlt ], + metadata: { + "custom_id": 1234, + "custom_text": "NDA #9", + }, + signingOptions, + fieldOptions, + testMode: true, +}; + +const signatureRequestId = "2f9781e1a8e2045224d808c153c2e1d3df6f8f2f"; + + +const result = signatureRequestApi.signatureRequestEdit(signatureRequestId, data); +result.then(response => { + console.log(response.body); +}).catch(error => { + console.log("Exception when calling Dropbox Sign API:"); + console.log(error.body); +}); + +``` + +### JavaScript Example + +```javascript +import * as DropboxSign from "@dropbox/sign"; +import * as fs from 'fs'; + +const signatureRequestApi = new DropboxSign.SignatureRequestApi(); + +// Configure HTTP basic authorization: api_key +signatureRequestApi.username = "YOUR_API_KEY"; + +// or, configure Bearer (JWT) authorization: oauth2 +// signatureRequestApi.accessToken = "YOUR_ACCESS_TOKEN"; + +const signer1: DropboxSign.SubSignatureRequestSigner = { + emailAddress: "jack@example.com", + name: "Jack", + order: 0, +}; + +const signer2: DropboxSign.SubSignatureRequestSigner = { + emailAddress: "jill@example.com", + name: "Jill", + order: 1, +}; + +const signingOptions: DropboxSign.SubSigningOptions = { + draw: true, + type: true, + upload: true, + phone: false, + defaultType: DropboxSign.SubSigningOptions.DefaultTypeEnum.Draw, +}; + +const fieldOptions: DropboxSign.SubFieldOptions = { + dateFormat: DropboxSign.SubFieldOptions.DateFormatEnum.DD_MM_YYYY, +}; + +// Upload a local file +const file = fs.createReadStream("example_signature_request.pdf"); + +// or, upload from buffer +const fileBuffer: DropboxSign.RequestDetailedFile = { + value: fs.readFileSync("example_signature_request.pdf"), + options: { + filename: "example_signature_request.pdf", + contentType: "application/pdf", + }, +}; + +// or, upload from buffer alternative +const fileBufferAlt: DropboxSign.RequestDetailedFile = { + value: Buffer.from("abc-123"), + options: { + filename: "txt-sample.txt", + contentType: "text/plain", + }, +}; + +const data: DropboxSign.SignatureRequestEditRequest = { + title: "NDA with Acme Co.", + subject: "The NDA we talked about", + message: "Please sign this NDA and then we can discuss more. Let me know if you have any questions.", + signers: [ signer1, signer2 ], + ccEmailAddresses: [ + "lawyer1@dropboxsign.com", + "lawyer2@dropboxsign.com", + ], + files: [ file, fileBuffer, fileBufferAlt ], + metadata: { + "custom_id": 1234, + "custom_text": "NDA #9", + }, + signingOptions, + fieldOptions, + testMode: true, +}; + +const signatureRequestId = "2f9781e1a8e2045224d808c153c2e1d3df6f8f2f"; + +const result = signatureRequestApi.signatureRequestEdit(signatureRequestId, data); +result.then(response => { + console.log(response.body); +}).catch(error => { + console.log("Exception when calling Dropbox Sign API:"); + console.log(error.body); +}); + +``` + +### Parameters + +|Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **signatureRequestId** | **string**| The id of the SignatureRequest to edit. | | +| **signatureRequestEditRequest** | [**SignatureRequestEditRequest**](../model/SignatureRequestEditRequest.md)| | | + +### Return type + +[**SignatureRequestGetResponse**](../model/SignatureRequestGetResponse.md) + +### Authorization + +[api_key](../../README.md#api_key), [oauth2](../../README.md#oauth2) + +### HTTP request headers + +- **Content-Type**: `application/json`, `multipart/form-data` +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `signatureRequestEditEmbedded()` + +```typescript +signatureRequestEditEmbedded(signatureRequestId: string, signatureRequestEditEmbeddedRequest: SignatureRequestEditEmbeddedRequest): SignatureRequestGetResponse +``` + +Edit Embedded Signature Request + +Edits a SignatureRequest with the submitted documents to be signed in an embedded iFrame. If form_fields_per_document is not specified, a signature page will be affixed where all signers will be required to add their signature, signifying their agreement to all contained documents. Note that embedded signature requests can only be signed in embedded iFrames whereas normal signature requests can only be signed on Dropbox Sign. + +### TypeScript Example + +```typescript +import * as DropboxSign from "@dropbox/sign"; +import * as fs from 'fs'; + +const signatureRequestApi = new DropboxSign.SignatureRequestApi(); + +// Configure HTTP basic authorization: api_key +signatureRequestApi.username = "YOUR_API_KEY"; + +// or, configure Bearer (JWT) authorization: oauth2 +// signatureRequestApi.accessToken = "YOUR_ACCESS_TOKEN"; + +const signer1: DropboxSign.SubSignatureRequestSigner = { + emailAddress: "jack@example.com", + name: "Jack", + order: 0, +}; + +const signer2: DropboxSign.SubSignatureRequestSigner = { + emailAddress: "jill@example.com", + name: "Jill", + order: 1, +}; + +const signingOptions: DropboxSign.SubSigningOptions = { + draw: true, + type: true, + upload: true, + phone: true, + defaultType: DropboxSign.SubSigningOptions.DefaultTypeEnum.Draw, +}; + +const data: DropboxSign.SignatureRequestEditEmbeddedRequest = { + clientId: "ec64a202072370a737edf4a0eb7f4437", + title: "NDA with Acme Co.", + subject: "The NDA we talked about", + message: "Please sign this NDA and then we can discuss more. Let me know if you have any questions.", + signers: [ signer1, signer2 ], + ccEmailAddresses: [ + "lawyer1@dropboxsign.com", + "lawyer2@dropboxsign.com", + ], + files: [fs.createReadStream("example_signature_request.pdf")], + signingOptions, + testMode: true, +}; + +const signatureRequestId = "2f9781e1a8e2045224d808c153c2e1d3df6f8f2f"; + +const result = signatureRequestApi.signatureRequestEditEmbedded( + signatureRequestId, + data +); +result.then(response => { + console.log(response.body); +}).catch(error => { + console.log("Exception when calling Dropbox Sign API:"); + console.log(error.body); +}); + +``` + +### JavaScript Example + +```javascript +import * as DropboxSign from "@dropbox/sign"; +import * as fs from 'fs'; + +const signatureRequestApi = new DropboxSign.SignatureRequestApi(); + +// Configure HTTP basic authorization: api_key +signatureRequestApi.username = "YOUR_API_KEY"; + +// or, configure Bearer (JWT) authorization: oauth2 +// signatureRequestApi.accessToken = "YOUR_ACCESS_TOKEN"; + +const signer1 = { + emailAddress: "jack@example.com", + name: "Jack", + order: 0, +}; + +const signer2 = { + emailAddress: "jill@example.com", + name: "Jill", + order: 1, +}; + +const signingOptions = { + draw: true, + type: true, + upload: true, + phone: true, + defaultType: "draw", +}; + +const data = { + clientId: "ec64a202072370a737edf4a0eb7f4437", + title: "NDA with Acme Co.", + subject: "The NDA we talked about", + message: "Please sign this NDA and then we can discuss more. Let me know if you have any questions.", + signers: [ signer1, signer2 ], + ccEmailAddresses: [ + "lawyer1@dropboxsign.com", + "lawyer2@example.com", + ], + files: [fs.createReadStream("example_signature_request.pdf")], + signingOptions, + testMode: true, +}; + +const signatureRequestId = "2f9781e1a8e2045224d808c153c2e1d3df6f8f2f"; + +const result = signatureRequestApi.signatureRequestEditEmbedded( + signatureRequestId, + data +); +result.then(response => { + console.log(response.body); +}).catch(error => { + console.log("Exception when calling Dropbox Sign API:"); + console.log(error.body); +}); + +``` + +### Parameters + +|Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **signatureRequestId** | **string**| The id of the SignatureRequest to edit. | | +| **signatureRequestEditEmbeddedRequest** | [**SignatureRequestEditEmbeddedRequest**](../model/SignatureRequestEditEmbeddedRequest.md)| | | + +### Return type + +[**SignatureRequestGetResponse**](../model/SignatureRequestGetResponse.md) + +### Authorization + +[api_key](../../README.md#api_key), [oauth2](../../README.md#oauth2) + +### HTTP request headers + +- **Content-Type**: `application/json`, `multipart/form-data` +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `signatureRequestEditEmbeddedWithTemplate()` + +```typescript +signatureRequestEditEmbeddedWithTemplate(signatureRequestId: string, signatureRequestEditEmbeddedWithTemplateRequest: SignatureRequestEditEmbeddedWithTemplateRequest): SignatureRequestGetResponse +``` + +Edit Embedded Signature Request with Template + +Edits a SignatureRequest based on the given Template(s) to be signed in an embedded iFrame. Note that embedded signature requests can only be signed in embedded iFrames whereas normal signature requests can only be signed on Dropbox Sign. + +### TypeScript Example + +```typescript +import * as DropboxSign from "@dropbox/sign"; + +const signatureRequestApi = new DropboxSign.SignatureRequestApi(); + +// Configure HTTP basic authorization: api_key +signatureRequestApi.username = "YOUR_API_KEY"; + +// or, configure Bearer (JWT) authorization: oauth2 +// signatureRequestApi.accessToken = "YOUR_ACCESS_TOKEN"; + +const signer1: DropboxSign.SubSignatureRequestTemplateSigner = { + role: "Client", + emailAddress: "george@example.com", + name: "George", +}; + +const signingOptions: DropboxSign.SubSigningOptions = { + draw: true, + type: true, + upload: true, + phone: false, + defaultType: DropboxSign.SubSigningOptions.DefaultTypeEnum.Draw, +}; + +const data: DropboxSign.SignatureRequestEditEmbeddedWithTemplateRequest = { + clientId: "ec64a202072370a737edf4a0eb7f4437", + templateIds: ["c26b8a16784a872da37ea946b9ddec7c1e11dff6"], + subject: "Purchase Order", + message: "Glad we could come to an agreement.", + signers: [ signer1 ], + signingOptions, + testMode: true, +}; + +const signatureRequestId = "2f9781e1a8e2045224d808c153c2e1d3df6f8f2f"; + +const result = signatureRequestApi.signatureRequestEditEmbeddedWithTemplate( + signatureRequestId, + data +); +result.then(response => { + console.log(response.body); +}).catch(error => { + console.log("Exception when calling Dropbox Sign API:"); + console.log(error.body); +}); + +``` + +### JavaScript Example + +```javascript +import * as DropboxSign from "@dropbox/sign"; + +const signatureRequestApi = new DropboxSign.SignatureRequestApi(); + +// Configure HTTP basic authorization: api_key +signatureRequestApi.username = "YOUR_API_KEY"; + +// or, configure Bearer (JWT) authorization: oauth2 +// signatureRequestApi.accessToken = "YOUR_ACCESS_TOKEN"; + +const signer1 = { + role: "Client", + emailAddress: "george@example.com", + name: "George", +}; + +const signingOptions = { + draw: true, + type: true, + upload: true, + phone: false, + defaultType: "draw", +}; + +const data = { + clientId: "ec64a202072370a737edf4a0eb7f4437", + templateIds: ["c26b8a16784a872da37ea946b9ddec7c1e11dff6"], + subject: "Purchase Order", + message: "Glad we could come to an agreement.", + signers: [ signer1 ], + signingOptions, + testMode: true, +}; + +const signatureRequestId = "2f9781e1a8e2045224d808c153c2e1d3df6f8f2f"; + +const result = signatureRequestApi.signatureRequestEditEmbeddedWithTemplate( + signatureRequestId, + data +); +result.then(response => { + console.log(response.body); +}).catch(error => { + console.log("Exception when calling Dropbox Sign API:"); + console.log(error.body); +}); + +``` + +### Parameters + +|Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **signatureRequestId** | **string**| The id of the SignatureRequest to edit. | | +| **signatureRequestEditEmbeddedWithTemplateRequest** | [**SignatureRequestEditEmbeddedWithTemplateRequest**](../model/SignatureRequestEditEmbeddedWithTemplateRequest.md)| | | + +### Return type + +[**SignatureRequestGetResponse**](../model/SignatureRequestGetResponse.md) + +### Authorization + +[api_key](../../README.md#api_key), [oauth2](../../README.md#oauth2) + +### HTTP request headers + +- **Content-Type**: `application/json`, `multipart/form-data` +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `signatureRequestEditWithTemplate()` + +```typescript +signatureRequestEditWithTemplate(signatureRequestId: string, signatureRequestEditWithTemplateRequest: SignatureRequestEditWithTemplateRequest): SignatureRequestGetResponse +``` + +Edit Signature Request With Template + +Edits and sends a SignatureRequest based off of the Template(s) specified with the template_ids parameter. **NOTE:** Edit and resend will not deduct your signature request quota. + +### TypeScript Example + +```typescript +import * as DropboxSign from "@dropbox/sign"; + +const signatureRequestApi = new DropboxSign.SignatureRequestApi(); + +// Configure HTTP basic authorization: api_key +signatureRequestApi.username = "YOUR_API_KEY"; + +// or, configure Bearer (JWT) authorization: oauth2 +// signatureRequestApi.accessToken = "YOUR_ACCESS_TOKEN"; + +const signer1: DropboxSign.SubSignatureRequestTemplateSigner = { + role: "Client", + emailAddress: "george@example.com", + name: "George", +}; + +const cc1: DropboxSign.SubCC = { + role: "Accounting", + emailAddress: "accounting@example.com", +}; + +const customField1: DropboxSign.SubCustomField = { + name: "Cost", + value: "$20,000", + editor: "Client", + required: true, +}; + +const signingOptions: DropboxSign.SubSigningOptions = { + draw: true, + type: true, + upload: true, + phone: false, + defaultType: DropboxSign.SubSigningOptions.DefaultTypeEnum.Draw, +}; + +const data: DropboxSign.SignatureRequestSendWithTemplateRequest = { + templateIds: ["c26b8a16784a872da37ea946b9ddec7c1e11dff6"], + subject: "Purchase Order", + message: "Glad we could come to an agreement.", + signers: [ signer1 ], + ccs: [ cc1 ], + customFields: [ customField1 ], + signingOptions, + testMode: true, +}; + +const signatureRequestId = "2f9781e1a8e2045224d808c153c2e1d3df6f8f2f"; + +const result = signatureRequestApi.signatureRequestEditWithTemplate( + signatureRequestId, + data +); +result.then(response => { + console.log(response.body); +}).catch(error => { + console.log("Exception when calling Dropbox Sign API:"); + console.log(error.body); +}); + +``` + +### JavaScript Example + +```javascript +import * as DropboxSign from "@dropbox/sign"; + +const signatureRequestApi = new DropboxSign.SignatureRequestApi(); + +// Configure HTTP basic authorization: api_key +signatureRequestApi.username = "YOUR_API_KEY"; + +// or, configure Bearer (JWT) authorization: oauth2 +// signatureRequestApi.accessToken = "YOUR_ACCESS_TOKEN"; + +const signer1 = { + role: "Client", + emailAddress: "george@example.com", + name: "George", +}; + +const cc1 = { + role: "Accounting", + emailAddress: "accounting@example.com", +}; + +const customField1 = { + name: "Cost", + value: "$20,000", + editor: "Client", + required: true, +}; + +const signingOptions = { + draw: true, + type: true, + upload: true, + phone: false, + defaultType: "draw", +}; + +const data = { + templateIds: ["c26b8a16784a872da37ea946b9ddec7c1e11dff6"], + subject: "Purchase Order", + message: "Glad we could come to an agreement.", + signers: [ signer1 ], + ccs: [ cc1 ], + customFields: [ customField1 ], + signingOptions, + testMode: true, +}; + +const signatureRequestId = "2f9781e1a8e2045224d808c153c2e1d3df6f8f2f"; + +const result = signatureRequestApi.signatureRequestEditWithTemplate( + signatureRequestId, + data, +); +result.then(response => { + console.log(response.body); +}).catch(error => { + console.log("Exception when calling Dropbox Sign API:"); + console.log(error.body); +}); + +``` + +### Parameters + +|Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **signatureRequestId** | **string**| The id of the SignatureRequest to edit. | | +| **signatureRequestEditWithTemplateRequest** | [**SignatureRequestEditWithTemplateRequest**](../model/SignatureRequestEditWithTemplateRequest.md)| | | + +### Return type + +[**SignatureRequestGetResponse**](../model/SignatureRequestGetResponse.md) + +### Authorization + +[api_key](../../README.md#api_key), [oauth2](../../README.md#oauth2) + +### HTTP request headers + +- **Content-Type**: `application/json`, `multipart/form-data` +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + ## `signatureRequestFiles()` ```typescript diff --git a/sdks/node/docs/model/SignatureRequestEditEmbeddedRequest.md b/sdks/node/docs/model/SignatureRequestEditEmbeddedRequest.md new file mode 100644 index 000000000..bcc66ecf9 --- /dev/null +++ b/sdks/node/docs/model/SignatureRequestEditEmbeddedRequest.md @@ -0,0 +1,34 @@ +# # SignatureRequestEditEmbeddedRequest + + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +| `clientId`*_required_ | ```string``` | Client id of the app you're using to create this embedded signature request. Used for security purposes. | | +| `files` | ```Array``` | Use `files[]` to indicate the uploaded file(s) to send for signature.

This endpoint requires either **files** or **file_urls[]**, but not both. | | +| `fileUrls` | ```Array``` | Use `file_urls[]` to have Dropbox Sign download the file(s) to send for signature.

This endpoint requires either **files** or **file_urls[]**, but not both. | | +| `signers` | [```Array```](SubSignatureRequestSigner.md) | Add Signers to your Signature Request.

This endpoint requires either **signers** or **grouped_signers**, but not both. | | +| `groupedSigners` | [```Array```](SubSignatureRequestGroupedSigners.md) | Add Grouped Signers to your Signature Request.

This endpoint requires either **signers** or **grouped_signers**, but not both. | | +| `allowDecline` | ```boolean``` | Allows signers to decline to sign a document if `true`. Defaults to `false`. | [default to false] | +| `allowReassign` | ```boolean``` | Allows signers to reassign their signature requests to other signers if set to `true`. Defaults to `false`.

**NOTE:** Only available for Premium plan. | [default to false] | +| `attachments` | [```Array```](SubAttachment.md) | A list describing the attachments | | +| `ccEmailAddresses` | ```Array``` | The email addresses that should be CCed. | | +| `customFields` | [```Array```](SubCustomField.md) | When used together with merge fields, `custom_fields` allows users to add pre-filled data to their signature requests.

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

For using pre-filled on repeatable signature requests, merge fields are added to templates in the Dropbox Sign UI or by calling [/template/create_embedded_draft](/api/reference/operation/templateCreateEmbeddedDraft) and then passing `custom_fields` on subsequent signature requests referencing that template. | | +| `fieldOptions` | [```SubFieldOptions```](SubFieldOptions.md) | | | +| `formFieldGroups` | [```Array```](SubFormFieldGroup.md) | Group information for fields defined in `form_fields_per_document`. String-indexed JSON array with `group_label` and `requirement` keys. `form_fields_per_document` must contain fields referencing a group defined in `form_field_groups`. | | +| `formFieldRules` | [```Array```](SubFormFieldRule.md) | Conditional Logic rules for fields defined in `form_fields_per_document`. | | +| `formFieldsPerDocument` | [```Array```](SubFormFieldsPerDocumentBase.md) | The fields that should appear on the document, expressed as an array of objects. (For more details you can read about it here: [Using Form Fields per Document](/docs/openapi/form-fields-per-document).)

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

* Text Field use `SubFormFieldsPerDocumentText`
* Dropdown Field use `SubFormFieldsPerDocumentDropdown`
* Hyperlink Field use `SubFormFieldsPerDocumentHyperlink`
* Checkbox Field use `SubFormFieldsPerDocumentCheckbox`
* Radio Field use `SubFormFieldsPerDocumentRadio`
* Signature Field use `SubFormFieldsPerDocumentSignature`
* Date Signed Field use `SubFormFieldsPerDocumentDateSigned`
* Initials Field use `SubFormFieldsPerDocumentInitials`
* Text Merge Field use `SubFormFieldsPerDocumentTextMerge`
* Checkbox Merge Field use `SubFormFieldsPerDocumentCheckboxMerge` | | +| `hideTextTags` | ```boolean``` | Enables automatic Text Tag removal when set to true.

**NOTE:** Removing text tags this way can cause unwanted clipping. We recommend leaving this setting on `false` and instead hiding your text tags using white text or a similar approach. See the [Text Tags Walkthrough](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) for more information. | [default to false] | +| `message` | ```string``` | The custom message in the email that will be sent to the signers. | | +| `metadata` | ```{ [key: string]: any; }``` | Key-value data that should be attached to the signature request. This metadata is included in all API responses and events involving the signature request. For example, use the metadata field to store a signer's order number for look up when receiving events for the signature request.

Each request can include up to 10 metadata keys (or 50 nested metadata keys), with key names up to 40 characters long and values up to 1000 characters long. | | +| `signingOptions` | [```SubSigningOptions```](SubSigningOptions.md) | | | +| `subject` | ```string``` | The subject in the email that will be sent to the signers. | | +| `testMode` | ```boolean``` | Whether this is a test, the signature request will not be legally binding if set to `true`. Defaults to `false`. | [default to false] | +| `title` | ```string``` | The title you want to assign to the SignatureRequest. | | +| `useTextTags` | ```boolean``` | Send with a value of `true` if you wish to enable [Text Tags](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) parsing in your document. Defaults to disabled, or `false`. | [default to false] | +| `populateAutoFillFields` | ```boolean``` | Controls whether [auto fill fields](https://faq.hellosign.com/hc/en-us/articles/360051467511-Auto-Fill-Fields) can automatically populate a signer's information during signing.

**NOTE:** Keep your signer's information safe by ensuring that the _signer on your signature request is the intended party_ before using this feature. | [default to false] | +| `expiresAt` | ```number``` | When the signature request will expire. Unsigned signatures will be moved to the expired status, and no longer signable. See [Signature Request Expiration Date](https://developers.hellosign.com/docs/signature-request/expiration/) for details. | | + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/sdks/node/docs/model/SignatureRequestEditEmbeddedWithTemplateRequest.md b/sdks/node/docs/model/SignatureRequestEditEmbeddedWithTemplateRequest.md new file mode 100644 index 000000000..f417f0f72 --- /dev/null +++ b/sdks/node/docs/model/SignatureRequestEditEmbeddedWithTemplateRequest.md @@ -0,0 +1,25 @@ +# # SignatureRequestEditEmbeddedWithTemplateRequest + + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +| `templateIds`*_required_ | ```Array``` | Use `template_ids` to create a SignatureRequest from one or more templates, in the order in which the template will be used. | | +| `clientId`*_required_ | ```string``` | Client id of the app you're using to create this embedded signature request. Used for security purposes. | | +| `signers`*_required_ | [```Array```](SubSignatureRequestTemplateSigner.md) | Add Signers to your Templated-based Signature Request. | | +| `allowDecline` | ```boolean``` | Allows signers to decline to sign a document if `true`. Defaults to `false`. | [default to false] | +| `ccs` | [```Array```](SubCC.md) | Add CC email recipients. Required when a CC role exists for the Template. | | +| `customFields` | [```Array```](SubCustomField.md) | An array defining values and options for custom fields. Required when a custom field exists in the Template. | | +| `files` | ```Array``` | Use `files[]` to indicate the uploaded file(s) to send for signature.

This endpoint requires either **files** or **file_urls[]**, but not both. | | +| `fileUrls` | ```Array``` | Use `file_urls[]` to have Dropbox Sign download the file(s) to send for signature.

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

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

**NOTE:** Keep your signer's information safe by ensuring that the _signer on your signature request is the intended party_ before using this feature. | [default to false] | + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/sdks/node/docs/model/SignatureRequestEditRequest.md b/sdks/node/docs/model/SignatureRequestEditRequest.md new file mode 100644 index 000000000..309384652 --- /dev/null +++ b/sdks/node/docs/model/SignatureRequestEditRequest.md @@ -0,0 +1,35 @@ +# # SignatureRequestEditRequest + + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +| `files` | ```Array``` | Use `files[]` to indicate the uploaded file(s) to send for signature.

This endpoint requires either **files** or **file_urls[]**, but not both. | | +| `fileUrls` | ```Array``` | Use `file_urls[]` to have Dropbox Sign download the file(s) to send for signature.

This endpoint requires either **files** or **file_urls[]**, but not both. | | +| `signers` | [```Array```](SubSignatureRequestSigner.md) | Add Signers to your Signature Request.

This endpoint requires either **signers** or **grouped_signers**, but not both. | | +| `groupedSigners` | [```Array```](SubSignatureRequestGroupedSigners.md) | Add Grouped Signers to your Signature Request.

This endpoint requires either **signers** or **grouped_signers**, but not both. | | +| `allowDecline` | ```boolean``` | Allows signers to decline to sign a document if `true`. Defaults to `false`. | [default to false] | +| `allowReassign` | ```boolean``` | Allows signers to reassign their signature requests to other signers if set to `true`. Defaults to `false`.

**NOTE:** Only available for Premium plan and higher. | [default to false] | +| `attachments` | [```Array```](SubAttachment.md) | A list describing the attachments | | +| `ccEmailAddresses` | ```Array``` | The email addresses that should be CCed. | | +| `clientId` | ```string``` | The client id of the API App you want to associate with this request. Used to apply the branding and callback url defined for the app. | | +| `customFields` | [```Array```](SubCustomField.md) | When used together with merge fields, `custom_fields` allows users to add pre-filled data to their signature requests.

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

For using pre-filled on repeatable signature requests, merge fields are added to templates in the Dropbox Sign UI or by calling [/template/create_embedded_draft](/api/reference/operation/templateCreateEmbeddedDraft) and then passing `custom_fields` on subsequent signature requests referencing that template. | | +| `fieldOptions` | [```SubFieldOptions```](SubFieldOptions.md) | | | +| `formFieldGroups` | [```Array```](SubFormFieldGroup.md) | Group information for fields defined in `form_fields_per_document`. String-indexed JSON array with `group_label` and `requirement` keys. `form_fields_per_document` must contain fields referencing a group defined in `form_field_groups`. | | +| `formFieldRules` | [```Array```](SubFormFieldRule.md) | Conditional Logic rules for fields defined in `form_fields_per_document`. | | +| `formFieldsPerDocument` | [```Array```](SubFormFieldsPerDocumentBase.md) | The fields that should appear on the document, expressed as an array of objects. (For more details you can read about it here: [Using Form Fields per Document](/docs/openapi/form-fields-per-document).)

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

* Text Field use `SubFormFieldsPerDocumentText`
* Dropdown Field use `SubFormFieldsPerDocumentDropdown`
* Hyperlink Field use `SubFormFieldsPerDocumentHyperlink`
* Checkbox Field use `SubFormFieldsPerDocumentCheckbox`
* Radio Field use `SubFormFieldsPerDocumentRadio`
* Signature Field use `SubFormFieldsPerDocumentSignature`
* Date Signed Field use `SubFormFieldsPerDocumentDateSigned`
* Initials Field use `SubFormFieldsPerDocumentInitials`
* Text Merge Field use `SubFormFieldsPerDocumentTextMerge`
* Checkbox Merge Field use `SubFormFieldsPerDocumentCheckboxMerge` | | +| `hideTextTags` | ```boolean``` | Enables automatic Text Tag removal when set to true.

**NOTE:** Removing text tags this way can cause unwanted clipping. We recommend leaving this setting on `false` and instead hiding your text tags using white text or a similar approach. See the [Text Tags Walkthrough](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) for more information. | [default to false] | +| `isEid` | ```boolean``` | Send with a value of `true` if you wish to enable [electronic identification (eID)](https://www.hellosign.com/features/electronic-id), which requires the signer to verify their identity with an eID provider to sign a document.<br>
**NOTE:** eID is only available on the Premium API plan. Cannot be used in `test_mode`. Only works on requests with one signer. | [default to false] | +| `message` | ```string``` | The custom message in the email that will be sent to the signers. | | +| `metadata` | ```{ [key: string]: any; }``` | Key-value data that should be attached to the signature request. This metadata is included in all API responses and events involving the signature request. For example, use the metadata field to store a signer's order number for look up when receiving events for the signature request.

Each request can include up to 10 metadata keys (or 50 nested metadata keys), with key names up to 40 characters long and values up to 1000 characters long. | | +| `signingOptions` | [```SubSigningOptions```](SubSigningOptions.md) | | | +| `signingRedirectUrl` | ```string``` | The URL you want signers redirected to after they successfully sign. | | +| `subject` | ```string``` | The subject in the email that will be sent to the signers. | | +| `testMode` | ```boolean``` | Whether this is a test, the signature request will not be legally binding if set to `true`. Defaults to `false`. | [default to false] | +| `title` | ```string``` | The title you want to assign to the SignatureRequest. | | +| `useTextTags` | ```boolean``` | Send with a value of `true` if you wish to enable [Text Tags](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) parsing in your document. Defaults to disabled, or `false`. | [default to false] | +| `expiresAt` | ```number``` | When the signature request will expire. Unsigned signatures will be moved to the expired status, and no longer signable. See [Signature Request Expiration Date](https://developers.hellosign.com/docs/signature-request/expiration/) for details. | | + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/sdks/node/docs/model/SignatureRequestEditWithTemplateRequest.md b/sdks/node/docs/model/SignatureRequestEditWithTemplateRequest.md new file mode 100644 index 000000000..fdec2cfc0 --- /dev/null +++ b/sdks/node/docs/model/SignatureRequestEditWithTemplateRequest.md @@ -0,0 +1,26 @@ +# # SignatureRequestEditWithTemplateRequest + + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +| `templateIds`*_required_ | ```Array``` | Use `template_ids` to create a SignatureRequest from one or more templates, in the order in which the template will be used. | | +| `signers`*_required_ | [```Array```](SubSignatureRequestTemplateSigner.md) | Add Signers to your Templated-based Signature Request. | | +| `allowDecline` | ```boolean``` | Allows signers to decline to sign a document if `true`. Defaults to `false`. | [default to false] | +| `ccs` | [```Array```](SubCC.md) | Add CC email recipients. Required when a CC role exists for the Template. | | +| `clientId` | ```string``` | Client id of the app to associate with the signature request. Used to apply the branding and callback url defined for the app. | | +| `customFields` | [```Array```](SubCustomField.md) | An array defining values and options for custom fields. Required when a custom field exists in the Template. | | +| `files` | ```Array``` | Use `files[]` to indicate the uploaded file(s) to send for signature.

This endpoint requires either **files** or **file_urls[]**, but not both. | | +| `fileUrls` | ```Array``` | Use `file_urls[]` to have Dropbox Sign download the file(s) to send for signature.

This endpoint requires either **files** or **file_urls[]**, but not both. | | +| `isEid` | ```boolean``` | Send with a value of `true` if you wish to enable [electronic identification (eID)](https://www.hellosign.com/features/electronic-id), which requires the signer to verify their identity with an eID provider to sign a document.<br>
**NOTE:** eID is only available on the Premium API plan. Cannot be used in `test_mode`. Only works on requests with one signer. | [default to false] | +| `message` | ```string``` | The custom message in the email that will be sent to the signers. | | +| `metadata` | ```{ [key: string]: any; }``` | Key-value data that should be attached to the signature request. This metadata is included in all API responses and events involving the signature request. For example, use the metadata field to store a signer's order number for look up when receiving events for the signature request.

Each request can include up to 10 metadata keys (or 50 nested metadata keys), with key names up to 40 characters long and values up to 1000 characters long. | | +| `signingOptions` | [```SubSigningOptions```](SubSigningOptions.md) | | | +| `signingRedirectUrl` | ```string``` | The URL you want signers redirected to after they successfully sign. | | +| `subject` | ```string``` | The subject in the email that will be sent to the signers. | | +| `testMode` | ```boolean``` | Whether this is a test, the signature request will not be legally binding if set to `true`. Defaults to `false`. | [default to false] | +| `title` | ```string``` | The title you want to assign to the SignatureRequest. | | + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/sdks/node/model/index.ts b/sdks/node/model/index.ts index 7813c02fc..1f2ea9c97 100644 --- a/sdks/node/model/index.ts +++ b/sdks/node/model/index.ts @@ -75,6 +75,10 @@ import { SignatureRequestBulkCreateEmbeddedWithTemplateRequest } from "./signatu import { SignatureRequestBulkSendWithTemplateRequest } from "./signatureRequestBulkSendWithTemplateRequest"; import { SignatureRequestCreateEmbeddedRequest } from "./signatureRequestCreateEmbeddedRequest"; import { SignatureRequestCreateEmbeddedWithTemplateRequest } from "./signatureRequestCreateEmbeddedWithTemplateRequest"; +import { SignatureRequestEditEmbeddedRequest } from "./signatureRequestEditEmbeddedRequest"; +import { SignatureRequestEditEmbeddedWithTemplateRequest } from "./signatureRequestEditEmbeddedWithTemplateRequest"; +import { SignatureRequestEditRequest } from "./signatureRequestEditRequest"; +import { SignatureRequestEditWithTemplateRequest } from "./signatureRequestEditWithTemplateRequest"; import { SignatureRequestGetResponse } from "./signatureRequestGetResponse"; import { SignatureRequestListResponse } from "./signatureRequestListResponse"; import { SignatureRequestRemindRequest } from "./signatureRequestRemindRequest"; @@ -315,6 +319,12 @@ export let typeMap: { [index: string]: any } = { SignatureRequestCreateEmbeddedRequest: SignatureRequestCreateEmbeddedRequest, SignatureRequestCreateEmbeddedWithTemplateRequest: SignatureRequestCreateEmbeddedWithTemplateRequest, + SignatureRequestEditEmbeddedRequest: SignatureRequestEditEmbeddedRequest, + SignatureRequestEditEmbeddedWithTemplateRequest: + SignatureRequestEditEmbeddedWithTemplateRequest, + SignatureRequestEditRequest: SignatureRequestEditRequest, + SignatureRequestEditWithTemplateRequest: + SignatureRequestEditWithTemplateRequest, SignatureRequestGetResponse: SignatureRequestGetResponse, SignatureRequestListResponse: SignatureRequestListResponse, SignatureRequestRemindRequest: SignatureRequestRemindRequest, @@ -547,6 +557,10 @@ export { SignatureRequestBulkSendWithTemplateRequest, SignatureRequestCreateEmbeddedRequest, SignatureRequestCreateEmbeddedWithTemplateRequest, + SignatureRequestEditEmbeddedRequest, + SignatureRequestEditEmbeddedWithTemplateRequest, + SignatureRequestEditRequest, + SignatureRequestEditWithTemplateRequest, SignatureRequestGetResponse, SignatureRequestListResponse, SignatureRequestRemindRequest, diff --git a/sdks/node/model/signatureRequestEditEmbeddedRequest.ts b/sdks/node/model/signatureRequestEditEmbeddedRequest.ts new file mode 100644 index 000000000..78b05c0ac --- /dev/null +++ b/sdks/node/model/signatureRequestEditEmbeddedRequest.ts @@ -0,0 +1,264 @@ +/** + * The MIT License (MIT) + * + * Copyright (C) 2023 dropbox.com + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +import { AttributeTypeMap, ObjectSerializer, RequestFile } from "./"; +import { SubAttachment } from "./subAttachment"; +import { SubCustomField } from "./subCustomField"; +import { SubFieldOptions } from "./subFieldOptions"; +import { SubFormFieldGroup } from "./subFormFieldGroup"; +import { SubFormFieldRule } from "./subFormFieldRule"; +import { SubFormFieldsPerDocumentBase } from "./subFormFieldsPerDocumentBase"; +import { SubSignatureRequestGroupedSigners } from "./subSignatureRequestGroupedSigners"; +import { SubSignatureRequestSigner } from "./subSignatureRequestSigner"; +import { SubSigningOptions } from "./subSigningOptions"; + +export class SignatureRequestEditEmbeddedRequest { + /** + * Client id of the app you\'re using to create this embedded signature request. Used for security purposes. + */ + "clientId": string; + /** + * Use `files[]` to indicate the uploaded file(s) to send for signature. This endpoint requires either **files** or **file_urls[]**, but not both. + */ + "files"?: Array; + /** + * Use `file_urls[]` to have Dropbox Sign download the file(s) to send for signature. This endpoint requires either **files** or **file_urls[]**, but not both. + */ + "fileUrls"?: Array; + /** + * Add Signers to your Signature Request. This endpoint requires either **signers** or **grouped_signers**, but not both. + */ + "signers"?: Array; + /** + * Add Grouped Signers to your Signature Request. This endpoint requires either **signers** or **grouped_signers**, but not both. + */ + "groupedSigners"?: Array; + /** + * Allows signers to decline to sign a document if `true`. Defaults to `false`. + */ + "allowDecline"?: boolean = false; + /** + * Allows signers to reassign their signature requests to other signers if set to `true`. Defaults to `false`. **NOTE:** Only available for Premium plan. + */ + "allowReassign"?: boolean = false; + /** + * A list describing the attachments + */ + "attachments"?: Array; + /** + * The email addresses that should be CCed. + */ + "ccEmailAddresses"?: Array; + /** + * When used together with merge fields, `custom_fields` allows users to add pre-filled data to their signature requests. Pre-filled data can be used with \"send-once\" signature requests by adding merge fields with `form_fields_per_document` or [Text Tags](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) while passing values back with `custom_fields` together in one API call. For using pre-filled on repeatable signature requests, merge fields are added to templates in the Dropbox Sign UI or by calling [/template/create_embedded_draft](/api/reference/operation/templateCreateEmbeddedDraft) and then passing `custom_fields` on subsequent signature requests referencing that template. + */ + "customFields"?: Array; + "fieldOptions"?: SubFieldOptions; + /** + * Group information for fields defined in `form_fields_per_document`. String-indexed JSON array with `group_label` and `requirement` keys. `form_fields_per_document` must contain fields referencing a group defined in `form_field_groups`. + */ + "formFieldGroups"?: Array; + /** + * Conditional Logic rules for fields defined in `form_fields_per_document`. + */ + "formFieldRules"?: Array; + /** + * The fields that should appear on the document, expressed as an array of objects. (For more details you can read about it here: [Using Form Fields per Document](/docs/openapi/form-fields-per-document).) **NOTE:** Fields like **text**, **dropdown**, **checkbox**, **radio**, and **hyperlink** have additional required and optional parameters. Check out the list of [additional parameters](/api/reference/constants/#form-fields-per-document) for these field types. * Text Field use `SubFormFieldsPerDocumentText` * Dropdown Field use `SubFormFieldsPerDocumentDropdown` * Hyperlink Field use `SubFormFieldsPerDocumentHyperlink` * Checkbox Field use `SubFormFieldsPerDocumentCheckbox` * Radio Field use `SubFormFieldsPerDocumentRadio` * Signature Field use `SubFormFieldsPerDocumentSignature` * Date Signed Field use `SubFormFieldsPerDocumentDateSigned` * Initials Field use `SubFormFieldsPerDocumentInitials` * Text Merge Field use `SubFormFieldsPerDocumentTextMerge` * Checkbox Merge Field use `SubFormFieldsPerDocumentCheckboxMerge` + */ + "formFieldsPerDocument"?: Array; + /** + * Enables automatic Text Tag removal when set to true. **NOTE:** Removing text tags this way can cause unwanted clipping. We recommend leaving this setting on `false` and instead hiding your text tags using white text or a similar approach. See the [Text Tags Walkthrough](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) for more information. + */ + "hideTextTags"?: boolean = false; + /** + * The custom message in the email that will be sent to the signers. + */ + "message"?: string; + /** + * Key-value data that should be attached to the signature request. This metadata is included in all API responses and events involving the signature request. For example, use the metadata field to store a signer\'s order number for look up when receiving events for the signature request. Each request can include up to 10 metadata keys (or 50 nested metadata keys), with key names up to 40 characters long and values up to 1000 characters long. + */ + "metadata"?: { [key: string]: any }; + "signingOptions"?: SubSigningOptions; + /** + * The subject in the email that will be sent to the signers. + */ + "subject"?: string; + /** + * Whether this is a test, the signature request will not be legally binding if set to `true`. Defaults to `false`. + */ + "testMode"?: boolean = false; + /** + * The title you want to assign to the SignatureRequest. + */ + "title"?: string; + /** + * Send with a value of `true` if you wish to enable [Text Tags](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) parsing in your document. Defaults to disabled, or `false`. + */ + "useTextTags"?: boolean = false; + /** + * Controls whether [auto fill fields](https://faq.hellosign.com/hc/en-us/articles/360051467511-Auto-Fill-Fields) can automatically populate a signer\'s information during signing. **NOTE:** Keep your signer\'s information safe by ensuring that the _signer on your signature request is the intended party_ before using this feature. + */ + "populateAutoFillFields"?: boolean = false; + /** + * When the signature request will expire. Unsigned signatures will be moved to the expired status, and no longer signable. See [Signature Request Expiration Date](https://developers.hellosign.com/docs/signature-request/expiration/) for details. + */ + "expiresAt"?: number | null; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: AttributeTypeMap = [ + { + name: "clientId", + baseName: "client_id", + type: "string", + }, + { + name: "files", + baseName: "files", + type: "Array", + }, + { + name: "fileUrls", + baseName: "file_urls", + type: "Array", + }, + { + name: "signers", + baseName: "signers", + type: "Array", + }, + { + name: "groupedSigners", + baseName: "grouped_signers", + type: "Array", + }, + { + name: "allowDecline", + baseName: "allow_decline", + type: "boolean", + }, + { + name: "allowReassign", + baseName: "allow_reassign", + type: "boolean", + }, + { + name: "attachments", + baseName: "attachments", + type: "Array", + }, + { + name: "ccEmailAddresses", + baseName: "cc_email_addresses", + type: "Array", + }, + { + name: "customFields", + baseName: "custom_fields", + type: "Array", + }, + { + name: "fieldOptions", + baseName: "field_options", + type: "SubFieldOptions", + }, + { + name: "formFieldGroups", + baseName: "form_field_groups", + type: "Array", + }, + { + name: "formFieldRules", + baseName: "form_field_rules", + type: "Array", + }, + { + name: "formFieldsPerDocument", + baseName: "form_fields_per_document", + type: "Array", + }, + { + name: "hideTextTags", + baseName: "hide_text_tags", + type: "boolean", + }, + { + name: "message", + baseName: "message", + type: "string", + }, + { + name: "metadata", + baseName: "metadata", + type: "{ [key: string]: any; }", + }, + { + name: "signingOptions", + baseName: "signing_options", + type: "SubSigningOptions", + }, + { + name: "subject", + baseName: "subject", + type: "string", + }, + { + name: "testMode", + baseName: "test_mode", + type: "boolean", + }, + { + name: "title", + baseName: "title", + type: "string", + }, + { + name: "useTextTags", + baseName: "use_text_tags", + type: "boolean", + }, + { + name: "populateAutoFillFields", + baseName: "populate_auto_fill_fields", + type: "boolean", + }, + { + name: "expiresAt", + baseName: "expires_at", + type: "number", + }, + ]; + + static getAttributeTypeMap(): AttributeTypeMap { + return SignatureRequestEditEmbeddedRequest.attributeTypeMap; + } + + /** Attempt to instantiate and hydrate a new instance of this class */ + static init(data: any): SignatureRequestEditEmbeddedRequest { + return ObjectSerializer.deserialize( + data, + "SignatureRequestEditEmbeddedRequest" + ); + } +} diff --git a/sdks/node/model/signatureRequestEditEmbeddedWithTemplateRequest.ts b/sdks/node/model/signatureRequestEditEmbeddedWithTemplateRequest.ts new file mode 100644 index 000000000..c007c76ca --- /dev/null +++ b/sdks/node/model/signatureRequestEditEmbeddedWithTemplateRequest.ts @@ -0,0 +1,181 @@ +/** + * The MIT License (MIT) + * + * Copyright (C) 2023 dropbox.com + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +import { AttributeTypeMap, ObjectSerializer, RequestFile } from "./"; +import { SubCC } from "./subCC"; +import { SubCustomField } from "./subCustomField"; +import { SubSignatureRequestTemplateSigner } from "./subSignatureRequestTemplateSigner"; +import { SubSigningOptions } from "./subSigningOptions"; + +export class SignatureRequestEditEmbeddedWithTemplateRequest { + /** + * Use `template_ids` to create a SignatureRequest from one or more templates, in the order in which the template will be used. + */ + "templateIds": Array; + /** + * Client id of the app you\'re using to create this embedded signature request. Used for security purposes. + */ + "clientId": string; + /** + * Add Signers to your Templated-based Signature Request. + */ + "signers": Array; + /** + * Allows signers to decline to sign a document if `true`. Defaults to `false`. + */ + "allowDecline"?: boolean = false; + /** + * Add CC email recipients. Required when a CC role exists for the Template. + */ + "ccs"?: Array; + /** + * An array defining values and options for custom fields. Required when a custom field exists in the Template. + */ + "customFields"?: Array; + /** + * Use `files[]` to indicate the uploaded file(s) to send for signature. This endpoint requires either **files** or **file_urls[]**, but not both. + */ + "files"?: Array; + /** + * Use `file_urls[]` to have Dropbox Sign download the file(s) to send for signature. This endpoint requires either **files** or **file_urls[]**, but not both. + */ + "fileUrls"?: Array; + /** + * The custom message in the email that will be sent to the signers. + */ + "message"?: string; + /** + * Key-value data that should be attached to the signature request. This metadata is included in all API responses and events involving the signature request. For example, use the metadata field to store a signer\'s order number for look up when receiving events for the signature request. Each request can include up to 10 metadata keys (or 50 nested metadata keys), with key names up to 40 characters long and values up to 1000 characters long. + */ + "metadata"?: { [key: string]: any }; + "signingOptions"?: SubSigningOptions; + /** + * The subject in the email that will be sent to the signers. + */ + "subject"?: string; + /** + * Whether this is a test, the signature request will not be legally binding if set to `true`. Defaults to `false`. + */ + "testMode"?: boolean = false; + /** + * The title you want to assign to the SignatureRequest. + */ + "title"?: string; + /** + * Controls whether [auto fill fields](https://faq.hellosign.com/hc/en-us/articles/360051467511-Auto-Fill-Fields) can automatically populate a signer\'s information during signing. **NOTE:** Keep your signer\'s information safe by ensuring that the _signer on your signature request is the intended party_ before using this feature. + */ + "populateAutoFillFields"?: boolean = false; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: AttributeTypeMap = [ + { + name: "templateIds", + baseName: "template_ids", + type: "Array", + }, + { + name: "clientId", + baseName: "client_id", + type: "string", + }, + { + name: "signers", + baseName: "signers", + type: "Array", + }, + { + name: "allowDecline", + baseName: "allow_decline", + type: "boolean", + }, + { + name: "ccs", + baseName: "ccs", + type: "Array", + }, + { + name: "customFields", + baseName: "custom_fields", + type: "Array", + }, + { + name: "files", + baseName: "files", + type: "Array", + }, + { + name: "fileUrls", + baseName: "file_urls", + type: "Array", + }, + { + name: "message", + baseName: "message", + type: "string", + }, + { + name: "metadata", + baseName: "metadata", + type: "{ [key: string]: any; }", + }, + { + name: "signingOptions", + baseName: "signing_options", + type: "SubSigningOptions", + }, + { + name: "subject", + baseName: "subject", + type: "string", + }, + { + name: "testMode", + baseName: "test_mode", + type: "boolean", + }, + { + name: "title", + baseName: "title", + type: "string", + }, + { + name: "populateAutoFillFields", + baseName: "populate_auto_fill_fields", + type: "boolean", + }, + ]; + + static getAttributeTypeMap(): AttributeTypeMap { + return SignatureRequestEditEmbeddedWithTemplateRequest.attributeTypeMap; + } + + /** Attempt to instantiate and hydrate a new instance of this class */ + static init(data: any): SignatureRequestEditEmbeddedWithTemplateRequest { + return ObjectSerializer.deserialize( + data, + "SignatureRequestEditEmbeddedWithTemplateRequest" + ); + } +} diff --git a/sdks/node/model/signatureRequestEditRequest.ts b/sdks/node/model/signatureRequestEditRequest.ts new file mode 100644 index 000000000..432e8fe4f --- /dev/null +++ b/sdks/node/model/signatureRequestEditRequest.ts @@ -0,0 +1,270 @@ +/** + * The MIT License (MIT) + * + * Copyright (C) 2023 dropbox.com + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +import { AttributeTypeMap, ObjectSerializer, RequestFile } from "./"; +import { SubAttachment } from "./subAttachment"; +import { SubCustomField } from "./subCustomField"; +import { SubFieldOptions } from "./subFieldOptions"; +import { SubFormFieldGroup } from "./subFormFieldGroup"; +import { SubFormFieldRule } from "./subFormFieldRule"; +import { SubFormFieldsPerDocumentBase } from "./subFormFieldsPerDocumentBase"; +import { SubSignatureRequestGroupedSigners } from "./subSignatureRequestGroupedSigners"; +import { SubSignatureRequestSigner } from "./subSignatureRequestSigner"; +import { SubSigningOptions } from "./subSigningOptions"; + +export class SignatureRequestEditRequest { + /** + * Use `files[]` to indicate the uploaded file(s) to send for signature. This endpoint requires either **files** or **file_urls[]**, but not both. + */ + "files"?: Array; + /** + * Use `file_urls[]` to have Dropbox Sign download the file(s) to send for signature. This endpoint requires either **files** or **file_urls[]**, but not both. + */ + "fileUrls"?: Array; + /** + * Add Signers to your Signature Request. This endpoint requires either **signers** or **grouped_signers**, but not both. + */ + "signers"?: Array; + /** + * Add Grouped Signers to your Signature Request. This endpoint requires either **signers** or **grouped_signers**, but not both. + */ + "groupedSigners"?: Array; + /** + * Allows signers to decline to sign a document if `true`. Defaults to `false`. + */ + "allowDecline"?: boolean = false; + /** + * Allows signers to reassign their signature requests to other signers if set to `true`. Defaults to `false`. **NOTE:** Only available for Premium plan and higher. + */ + "allowReassign"?: boolean = false; + /** + * A list describing the attachments + */ + "attachments"?: Array; + /** + * The email addresses that should be CCed. + */ + "ccEmailAddresses"?: Array; + /** + * The client id of the API App you want to associate with this request. Used to apply the branding and callback url defined for the app. + */ + "clientId"?: string; + /** + * When used together with merge fields, `custom_fields` allows users to add pre-filled data to their signature requests. Pre-filled data can be used with \"send-once\" signature requests by adding merge fields with `form_fields_per_document` or [Text Tags](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) while passing values back with `custom_fields` together in one API call. For using pre-filled on repeatable signature requests, merge fields are added to templates in the Dropbox Sign UI or by calling [/template/create_embedded_draft](/api/reference/operation/templateCreateEmbeddedDraft) and then passing `custom_fields` on subsequent signature requests referencing that template. + */ + "customFields"?: Array; + "fieldOptions"?: SubFieldOptions; + /** + * Group information for fields defined in `form_fields_per_document`. String-indexed JSON array with `group_label` and `requirement` keys. `form_fields_per_document` must contain fields referencing a group defined in `form_field_groups`. + */ + "formFieldGroups"?: Array; + /** + * Conditional Logic rules for fields defined in `form_fields_per_document`. + */ + "formFieldRules"?: Array; + /** + * The fields that should appear on the document, expressed as an array of objects. (For more details you can read about it here: [Using Form Fields per Document](/docs/openapi/form-fields-per-document).) **NOTE:** Fields like **text**, **dropdown**, **checkbox**, **radio**, and **hyperlink** have additional required and optional parameters. Check out the list of [additional parameters](/api/reference/constants/#form-fields-per-document) for these field types. * Text Field use `SubFormFieldsPerDocumentText` * Dropdown Field use `SubFormFieldsPerDocumentDropdown` * Hyperlink Field use `SubFormFieldsPerDocumentHyperlink` * Checkbox Field use `SubFormFieldsPerDocumentCheckbox` * Radio Field use `SubFormFieldsPerDocumentRadio` * Signature Field use `SubFormFieldsPerDocumentSignature` * Date Signed Field use `SubFormFieldsPerDocumentDateSigned` * Initials Field use `SubFormFieldsPerDocumentInitials` * Text Merge Field use `SubFormFieldsPerDocumentTextMerge` * Checkbox Merge Field use `SubFormFieldsPerDocumentCheckboxMerge` + */ + "formFieldsPerDocument"?: Array; + /** + * Enables automatic Text Tag removal when set to true. **NOTE:** Removing text tags this way can cause unwanted clipping. We recommend leaving this setting on `false` and instead hiding your text tags using white text or a similar approach. See the [Text Tags Walkthrough](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) for more information. + */ + "hideTextTags"?: boolean = false; + /** + * Send with a value of `true` if you wish to enable [electronic identification (eID)](https://www.hellosign.com/features/electronic-id), which requires the signer to verify their identity with an eID provider to sign a document.
**NOTE:** eID is only available on the Premium API plan. Cannot be used in `test_mode`. Only works on requests with one signer. + */ + "isEid"?: boolean = false; + /** + * The custom message in the email that will be sent to the signers. + */ + "message"?: string; + /** + * Key-value data that should be attached to the signature request. This metadata is included in all API responses and events involving the signature request. For example, use the metadata field to store a signer\'s order number for look up when receiving events for the signature request. Each request can include up to 10 metadata keys (or 50 nested metadata keys), with key names up to 40 characters long and values up to 1000 characters long. + */ + "metadata"?: { [key: string]: any }; + "signingOptions"?: SubSigningOptions; + /** + * The URL you want signers redirected to after they successfully sign. + */ + "signingRedirectUrl"?: string; + /** + * The subject in the email that will be sent to the signers. + */ + "subject"?: string; + /** + * Whether this is a test, the signature request will not be legally binding if set to `true`. Defaults to `false`. + */ + "testMode"?: boolean = false; + /** + * The title you want to assign to the SignatureRequest. + */ + "title"?: string; + /** + * Send with a value of `true` if you wish to enable [Text Tags](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) parsing in your document. Defaults to disabled, or `false`. + */ + "useTextTags"?: boolean = false; + /** + * When the signature request will expire. Unsigned signatures will be moved to the expired status, and no longer signable. See [Signature Request Expiration Date](https://developers.hellosign.com/docs/signature-request/expiration/) for details. + */ + "expiresAt"?: number | null; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: AttributeTypeMap = [ + { + name: "files", + baseName: "files", + type: "Array", + }, + { + name: "fileUrls", + baseName: "file_urls", + type: "Array", + }, + { + name: "signers", + baseName: "signers", + type: "Array", + }, + { + name: "groupedSigners", + baseName: "grouped_signers", + type: "Array", + }, + { + name: "allowDecline", + baseName: "allow_decline", + type: "boolean", + }, + { + name: "allowReassign", + baseName: "allow_reassign", + type: "boolean", + }, + { + name: "attachments", + baseName: "attachments", + type: "Array", + }, + { + name: "ccEmailAddresses", + baseName: "cc_email_addresses", + type: "Array", + }, + { + name: "clientId", + baseName: "client_id", + type: "string", + }, + { + name: "customFields", + baseName: "custom_fields", + type: "Array", + }, + { + name: "fieldOptions", + baseName: "field_options", + type: "SubFieldOptions", + }, + { + name: "formFieldGroups", + baseName: "form_field_groups", + type: "Array", + }, + { + name: "formFieldRules", + baseName: "form_field_rules", + type: "Array", + }, + { + name: "formFieldsPerDocument", + baseName: "form_fields_per_document", + type: "Array", + }, + { + name: "hideTextTags", + baseName: "hide_text_tags", + type: "boolean", + }, + { + name: "isEid", + baseName: "is_eid", + type: "boolean", + }, + { + name: "message", + baseName: "message", + type: "string", + }, + { + name: "metadata", + baseName: "metadata", + type: "{ [key: string]: any; }", + }, + { + name: "signingOptions", + baseName: "signing_options", + type: "SubSigningOptions", + }, + { + name: "signingRedirectUrl", + baseName: "signing_redirect_url", + type: "string", + }, + { + name: "subject", + baseName: "subject", + type: "string", + }, + { + name: "testMode", + baseName: "test_mode", + type: "boolean", + }, + { + name: "title", + baseName: "title", + type: "string", + }, + { + name: "useTextTags", + baseName: "use_text_tags", + type: "boolean", + }, + { + name: "expiresAt", + baseName: "expires_at", + type: "number", + }, + ]; + + static getAttributeTypeMap(): AttributeTypeMap { + return SignatureRequestEditRequest.attributeTypeMap; + } + + /** Attempt to instantiate and hydrate a new instance of this class */ + static init(data: any): SignatureRequestEditRequest { + return ObjectSerializer.deserialize(data, "SignatureRequestEditRequest"); + } +} diff --git a/sdks/node/model/signatureRequestEditWithTemplateRequest.ts b/sdks/node/model/signatureRequestEditWithTemplateRequest.ts new file mode 100644 index 000000000..f35af5999 --- /dev/null +++ b/sdks/node/model/signatureRequestEditWithTemplateRequest.ts @@ -0,0 +1,193 @@ +/** + * The MIT License (MIT) + * + * Copyright (C) 2023 dropbox.com + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +import { AttributeTypeMap, ObjectSerializer, RequestFile } from "./"; +import { SubCC } from "./subCC"; +import { SubCustomField } from "./subCustomField"; +import { SubSignatureRequestTemplateSigner } from "./subSignatureRequestTemplateSigner"; +import { SubSigningOptions } from "./subSigningOptions"; + +/** + * + */ +export class SignatureRequestEditWithTemplateRequest { + /** + * Use `template_ids` to create a SignatureRequest from one or more templates, in the order in which the template will be used. + */ + "templateIds": Array; + /** + * Add Signers to your Templated-based Signature Request. + */ + "signers": Array; + /** + * Allows signers to decline to sign a document if `true`. Defaults to `false`. + */ + "allowDecline"?: boolean = false; + /** + * Add CC email recipients. Required when a CC role exists for the Template. + */ + "ccs"?: Array; + /** + * Client id of the app to associate with the signature request. Used to apply the branding and callback url defined for the app. + */ + "clientId"?: string; + /** + * An array defining values and options for custom fields. Required when a custom field exists in the Template. + */ + "customFields"?: Array; + /** + * Use `files[]` to indicate the uploaded file(s) to send for signature. This endpoint requires either **files** or **file_urls[]**, but not both. + */ + "files"?: Array; + /** + * Use `file_urls[]` to have Dropbox Sign download the file(s) to send for signature. This endpoint requires either **files** or **file_urls[]**, but not both. + */ + "fileUrls"?: Array; + /** + * Send with a value of `true` if you wish to enable [electronic identification (eID)](https://www.hellosign.com/features/electronic-id), which requires the signer to verify their identity with an eID provider to sign a document.
**NOTE:** eID is only available on the Premium API plan. Cannot be used in `test_mode`. Only works on requests with one signer. + */ + "isEid"?: boolean = false; + /** + * The custom message in the email that will be sent to the signers. + */ + "message"?: string; + /** + * Key-value data that should be attached to the signature request. This metadata is included in all API responses and events involving the signature request. For example, use the metadata field to store a signer\'s order number for look up when receiving events for the signature request. Each request can include up to 10 metadata keys (or 50 nested metadata keys), with key names up to 40 characters long and values up to 1000 characters long. + */ + "metadata"?: { [key: string]: any }; + "signingOptions"?: SubSigningOptions; + /** + * The URL you want signers redirected to after they successfully sign. + */ + "signingRedirectUrl"?: string; + /** + * The subject in the email that will be sent to the signers. + */ + "subject"?: string; + /** + * Whether this is a test, the signature request will not be legally binding if set to `true`. Defaults to `false`. + */ + "testMode"?: boolean = false; + /** + * The title you want to assign to the SignatureRequest. + */ + "title"?: string; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: AttributeTypeMap = [ + { + name: "templateIds", + baseName: "template_ids", + type: "Array", + }, + { + name: "signers", + baseName: "signers", + type: "Array", + }, + { + name: "allowDecline", + baseName: "allow_decline", + type: "boolean", + }, + { + name: "ccs", + baseName: "ccs", + type: "Array", + }, + { + name: "clientId", + baseName: "client_id", + type: "string", + }, + { + name: "customFields", + baseName: "custom_fields", + type: "Array", + }, + { + name: "files", + baseName: "files", + type: "Array", + }, + { + name: "fileUrls", + baseName: "file_urls", + type: "Array", + }, + { + name: "isEid", + baseName: "is_eid", + type: "boolean", + }, + { + name: "message", + baseName: "message", + type: "string", + }, + { + name: "metadata", + baseName: "metadata", + type: "{ [key: string]: any; }", + }, + { + name: "signingOptions", + baseName: "signing_options", + type: "SubSigningOptions", + }, + { + name: "signingRedirectUrl", + baseName: "signing_redirect_url", + type: "string", + }, + { + name: "subject", + baseName: "subject", + type: "string", + }, + { + name: "testMode", + baseName: "test_mode", + type: "boolean", + }, + { + name: "title", + baseName: "title", + type: "string", + }, + ]; + + static getAttributeTypeMap(): AttributeTypeMap { + return SignatureRequestEditWithTemplateRequest.attributeTypeMap; + } + + /** Attempt to instantiate and hydrate a new instance of this class */ + static init(data: any): SignatureRequestEditWithTemplateRequest { + return ObjectSerializer.deserialize( + data, + "SignatureRequestEditWithTemplateRequest" + ); + } +} diff --git a/sdks/node/types/api/signatureRequestApi.d.ts b/sdks/node/types/api/signatureRequestApi.d.ts index 58a02bdcd..54c21ae91 100644 --- a/sdks/node/types/api/signatureRequestApi.d.ts +++ b/sdks/node/types/api/signatureRequestApi.d.ts @@ -1,4 +1,4 @@ -import { Authentication, BulkSendJobSendResponse, FileResponse, FileResponseDataUri, HttpBasicAuth, HttpBearerAuth, Interceptor, SignatureRequestBulkCreateEmbeddedWithTemplateRequest, SignatureRequestBulkSendWithTemplateRequest, SignatureRequestCreateEmbeddedRequest, SignatureRequestCreateEmbeddedWithTemplateRequest, SignatureRequestGetResponse, SignatureRequestListResponse, SignatureRequestRemindRequest, SignatureRequestSendRequest, SignatureRequestSendWithTemplateRequest, SignatureRequestUpdateRequest } from "../model"; +import { Authentication, BulkSendJobSendResponse, FileResponse, FileResponseDataUri, HttpBasicAuth, HttpBearerAuth, Interceptor, SignatureRequestBulkCreateEmbeddedWithTemplateRequest, SignatureRequestBulkSendWithTemplateRequest, SignatureRequestCreateEmbeddedRequest, SignatureRequestCreateEmbeddedWithTemplateRequest, SignatureRequestEditEmbeddedRequest, SignatureRequestEditEmbeddedWithTemplateRequest, SignatureRequestEditRequest, SignatureRequestEditWithTemplateRequest, SignatureRequestGetResponse, SignatureRequestListResponse, SignatureRequestRemindRequest, SignatureRequestSendRequest, SignatureRequestSendWithTemplateRequest, SignatureRequestUpdateRequest } from "../model"; import { optionsI, returnTypeI, returnTypeT } from "./"; export declare enum SignatureRequestApiApiKeys { } @@ -29,6 +29,10 @@ export declare class SignatureRequestApi { signatureRequestCancel(signatureRequestId: string, options?: optionsI): Promise; signatureRequestCreateEmbedded(signatureRequestCreateEmbeddedRequest: SignatureRequestCreateEmbeddedRequest, options?: optionsI): Promise>; signatureRequestCreateEmbeddedWithTemplate(signatureRequestCreateEmbeddedWithTemplateRequest: SignatureRequestCreateEmbeddedWithTemplateRequest, options?: optionsI): Promise>; + signatureRequestEdit(signatureRequestId: string, signatureRequestEditRequest: SignatureRequestEditRequest, options?: optionsI): Promise>; + signatureRequestEditEmbedded(signatureRequestId: string, signatureRequestEditEmbeddedRequest: SignatureRequestEditEmbeddedRequest, options?: optionsI): Promise>; + signatureRequestEditEmbeddedWithTemplate(signatureRequestId: string, signatureRequestEditEmbeddedWithTemplateRequest: SignatureRequestEditEmbeddedWithTemplateRequest, options?: optionsI): Promise>; + signatureRequestEditWithTemplate(signatureRequestId: string, signatureRequestEditWithTemplateRequest: SignatureRequestEditWithTemplateRequest, options?: optionsI): Promise>; signatureRequestFiles(signatureRequestId: string, fileType?: "pdf" | "zip", options?: optionsI): Promise>; signatureRequestFilesAsDataUri(signatureRequestId: string, options?: optionsI): Promise>; signatureRequestFilesAsFileUrl(signatureRequestId: string, forceDownload?: number, options?: optionsI): Promise>; diff --git a/sdks/node/types/model/index.d.ts b/sdks/node/types/model/index.d.ts index 664b47950..99010c62f 100644 --- a/sdks/node/types/model/index.d.ts +++ b/sdks/node/types/model/index.d.ts @@ -63,6 +63,10 @@ import { SignatureRequestBulkCreateEmbeddedWithTemplateRequest } from "./signatu import { SignatureRequestBulkSendWithTemplateRequest } from "./signatureRequestBulkSendWithTemplateRequest"; import { SignatureRequestCreateEmbeddedRequest } from "./signatureRequestCreateEmbeddedRequest"; import { SignatureRequestCreateEmbeddedWithTemplateRequest } from "./signatureRequestCreateEmbeddedWithTemplateRequest"; +import { SignatureRequestEditEmbeddedRequest } from "./signatureRequestEditEmbeddedRequest"; +import { SignatureRequestEditEmbeddedWithTemplateRequest } from "./signatureRequestEditEmbeddedWithTemplateRequest"; +import { SignatureRequestEditRequest } from "./signatureRequestEditRequest"; +import { SignatureRequestEditWithTemplateRequest } from "./signatureRequestEditWithTemplateRequest"; import { SignatureRequestGetResponse } from "./signatureRequestGetResponse"; import { SignatureRequestListResponse } from "./signatureRequestListResponse"; import { SignatureRequestRemindRequest } from "./signatureRequestRemindRequest"; @@ -194,4 +198,4 @@ export declare let enumsMap: { export declare let typeMap: { [index: string]: any; }; -export { AccountCreateRequest, AccountCreateResponse, AccountGetResponse, AccountResponse, AccountResponseQuotas, AccountResponseUsage, AccountUpdateRequest, AccountVerifyRequest, AccountVerifyResponse, AccountVerifyResponseAccount, ApiAppCreateRequest, ApiAppGetResponse, ApiAppListResponse, ApiAppResponse, ApiAppResponseOAuth, ApiAppResponseOptions, ApiAppResponseOwnerAccount, ApiAppResponseWhiteLabelingOptions, ApiAppUpdateRequest, ApiKeyAuth, AttributeTypeMap, Authentication, BulkSendJobGetResponse, BulkSendJobGetResponseSignatureRequests, BulkSendJobListResponse, BulkSendJobResponse, BulkSendJobSendResponse, EmbeddedEditUrlRequest, EmbeddedEditUrlResponse, EmbeddedEditUrlResponseEmbedded, EmbeddedSignUrlResponse, EmbeddedSignUrlResponseEmbedded, ErrorResponse, ErrorResponseError, EventCallbackHelper, EventCallbackRequest, EventCallbackRequestEvent, EventCallbackRequestEventMetadata, FaxGetResponse, FaxLineAddUserRequest, FaxLineAreaCodeGetCountryEnum, FaxLineAreaCodeGetProvinceEnum, FaxLineAreaCodeGetResponse, FaxLineAreaCodeGetStateEnum, FaxLineCreateRequest, FaxLineDeleteRequest, FaxLineListResponse, FaxLineRemoveUserRequest, FaxLineResponse, FaxLineResponseFaxLine, FaxListResponse, FaxResponse, FaxResponseTransmission, FaxSendRequest, FileResponse, FileResponseDataUri, HttpBasicAuth, HttpBearerAuth, Interceptor, ListInfoResponse, OAuth, OAuthTokenGenerateRequest, OAuthTokenRefreshRequest, OAuthTokenResponse, ObjectSerializer, ReportCreateRequest, ReportCreateResponse, ReportResponse, RequestDetailedFile, RequestFile, SignatureRequestBulkCreateEmbeddedWithTemplateRequest, SignatureRequestBulkSendWithTemplateRequest, SignatureRequestCreateEmbeddedRequest, SignatureRequestCreateEmbeddedWithTemplateRequest, SignatureRequestGetResponse, SignatureRequestListResponse, SignatureRequestRemindRequest, SignatureRequestResponse, SignatureRequestResponseAttachment, SignatureRequestResponseCustomFieldBase, SignatureRequestResponseCustomFieldCheckbox, SignatureRequestResponseCustomFieldText, SignatureRequestResponseCustomFieldTypeEnum, SignatureRequestResponseDataBase, SignatureRequestResponseDataTypeEnum, SignatureRequestResponseDataValueCheckbox, SignatureRequestResponseDataValueCheckboxMerge, SignatureRequestResponseDataValueDateSigned, SignatureRequestResponseDataValueDropdown, SignatureRequestResponseDataValueInitials, SignatureRequestResponseDataValueRadio, SignatureRequestResponseDataValueSignature, SignatureRequestResponseDataValueText, SignatureRequestResponseDataValueTextMerge, SignatureRequestResponseSignatures, SignatureRequestSendRequest, SignatureRequestSendWithTemplateRequest, SignatureRequestUpdateRequest, SubAttachment, SubBulkSignerList, SubBulkSignerListCustomField, SubCC, SubCustomField, SubEditorOptions, SubFieldOptions, SubFormFieldGroup, SubFormFieldRule, SubFormFieldRuleAction, SubFormFieldRuleTrigger, SubFormFieldsPerDocumentBase, SubFormFieldsPerDocumentCheckbox, SubFormFieldsPerDocumentCheckboxMerge, SubFormFieldsPerDocumentDateSigned, SubFormFieldsPerDocumentDropdown, SubFormFieldsPerDocumentFontEnum, SubFormFieldsPerDocumentHyperlink, SubFormFieldsPerDocumentInitials, SubFormFieldsPerDocumentRadio, SubFormFieldsPerDocumentSignature, SubFormFieldsPerDocumentText, SubFormFieldsPerDocumentTextMerge, SubFormFieldsPerDocumentTypeEnum, SubMergeField, SubOAuth, SubOptions, SubSignatureRequestGroupedSigners, SubSignatureRequestSigner, SubSignatureRequestTemplateSigner, SubSigningOptions, SubTeamResponse, SubTemplateRole, SubUnclaimedDraftSigner, SubUnclaimedDraftTemplateSigner, SubWhiteLabelingOptions, TeamAddMemberRequest, TeamCreateRequest, TeamGetInfoResponse, TeamGetResponse, TeamInfoResponse, TeamInviteResponse, TeamInvitesResponse, TeamMemberResponse, TeamMembersResponse, TeamParentResponse, TeamRemoveMemberRequest, TeamResponse, TeamSubTeamsResponse, TeamUpdateRequest, TemplateAddUserRequest, TemplateCreateEmbeddedDraftRequest, TemplateCreateEmbeddedDraftResponse, TemplateCreateEmbeddedDraftResponseTemplate, TemplateCreateRequest, TemplateCreateResponse, TemplateCreateResponseTemplate, TemplateEditResponse, TemplateGetResponse, TemplateListResponse, TemplateRemoveUserRequest, TemplateResponse, TemplateResponseAccount, TemplateResponseAccountQuota, TemplateResponseCCRole, TemplateResponseDocument, TemplateResponseDocumentCustomFieldBase, TemplateResponseDocumentCustomFieldCheckbox, TemplateResponseDocumentCustomFieldText, TemplateResponseDocumentFieldGroup, TemplateResponseDocumentFieldGroupRule, TemplateResponseDocumentFormFieldBase, TemplateResponseDocumentFormFieldCheckbox, TemplateResponseDocumentFormFieldDateSigned, TemplateResponseDocumentFormFieldDropdown, TemplateResponseDocumentFormFieldHyperlink, TemplateResponseDocumentFormFieldInitials, TemplateResponseDocumentFormFieldRadio, TemplateResponseDocumentFormFieldSignature, TemplateResponseDocumentFormFieldText, TemplateResponseDocumentStaticFieldBase, TemplateResponseDocumentStaticFieldCheckbox, TemplateResponseDocumentStaticFieldDateSigned, TemplateResponseDocumentStaticFieldDropdown, TemplateResponseDocumentStaticFieldHyperlink, TemplateResponseDocumentStaticFieldInitials, TemplateResponseDocumentStaticFieldRadio, TemplateResponseDocumentStaticFieldSignature, TemplateResponseDocumentStaticFieldText, TemplateResponseFieldAvgTextLength, TemplateResponseSignerRole, TemplateUpdateFilesRequest, TemplateUpdateFilesResponse, TemplateUpdateFilesResponseTemplate, UnclaimedDraftCreateEmbeddedRequest, UnclaimedDraftCreateEmbeddedWithTemplateRequest, UnclaimedDraftCreateRequest, UnclaimedDraftCreateResponse, UnclaimedDraftEditAndResendRequest, UnclaimedDraftResponse, VoidAuth, WarningResponse, }; +export { AccountCreateRequest, AccountCreateResponse, AccountGetResponse, AccountResponse, AccountResponseQuotas, AccountResponseUsage, AccountUpdateRequest, AccountVerifyRequest, AccountVerifyResponse, AccountVerifyResponseAccount, ApiAppCreateRequest, ApiAppGetResponse, ApiAppListResponse, ApiAppResponse, ApiAppResponseOAuth, ApiAppResponseOptions, ApiAppResponseOwnerAccount, ApiAppResponseWhiteLabelingOptions, ApiAppUpdateRequest, ApiKeyAuth, AttributeTypeMap, Authentication, BulkSendJobGetResponse, BulkSendJobGetResponseSignatureRequests, BulkSendJobListResponse, BulkSendJobResponse, BulkSendJobSendResponse, EmbeddedEditUrlRequest, EmbeddedEditUrlResponse, EmbeddedEditUrlResponseEmbedded, EmbeddedSignUrlResponse, EmbeddedSignUrlResponseEmbedded, ErrorResponse, ErrorResponseError, EventCallbackHelper, EventCallbackRequest, EventCallbackRequestEvent, EventCallbackRequestEventMetadata, FaxGetResponse, FaxLineAddUserRequest, FaxLineAreaCodeGetCountryEnum, FaxLineAreaCodeGetProvinceEnum, FaxLineAreaCodeGetResponse, FaxLineAreaCodeGetStateEnum, FaxLineCreateRequest, FaxLineDeleteRequest, FaxLineListResponse, FaxLineRemoveUserRequest, FaxLineResponse, FaxLineResponseFaxLine, FaxListResponse, FaxResponse, FaxResponseTransmission, FaxSendRequest, FileResponse, FileResponseDataUri, HttpBasicAuth, HttpBearerAuth, Interceptor, ListInfoResponse, OAuth, OAuthTokenGenerateRequest, OAuthTokenRefreshRequest, OAuthTokenResponse, ObjectSerializer, ReportCreateRequest, ReportCreateResponse, ReportResponse, RequestDetailedFile, RequestFile, SignatureRequestBulkCreateEmbeddedWithTemplateRequest, SignatureRequestBulkSendWithTemplateRequest, SignatureRequestCreateEmbeddedRequest, SignatureRequestCreateEmbeddedWithTemplateRequest, SignatureRequestEditEmbeddedRequest, SignatureRequestEditEmbeddedWithTemplateRequest, SignatureRequestEditRequest, SignatureRequestEditWithTemplateRequest, SignatureRequestGetResponse, SignatureRequestListResponse, SignatureRequestRemindRequest, SignatureRequestResponse, SignatureRequestResponseAttachment, SignatureRequestResponseCustomFieldBase, SignatureRequestResponseCustomFieldCheckbox, SignatureRequestResponseCustomFieldText, SignatureRequestResponseCustomFieldTypeEnum, SignatureRequestResponseDataBase, SignatureRequestResponseDataTypeEnum, SignatureRequestResponseDataValueCheckbox, SignatureRequestResponseDataValueCheckboxMerge, SignatureRequestResponseDataValueDateSigned, SignatureRequestResponseDataValueDropdown, SignatureRequestResponseDataValueInitials, SignatureRequestResponseDataValueRadio, SignatureRequestResponseDataValueSignature, SignatureRequestResponseDataValueText, SignatureRequestResponseDataValueTextMerge, SignatureRequestResponseSignatures, SignatureRequestSendRequest, SignatureRequestSendWithTemplateRequest, SignatureRequestUpdateRequest, SubAttachment, SubBulkSignerList, SubBulkSignerListCustomField, SubCC, SubCustomField, SubEditorOptions, SubFieldOptions, SubFormFieldGroup, SubFormFieldRule, SubFormFieldRuleAction, SubFormFieldRuleTrigger, SubFormFieldsPerDocumentBase, SubFormFieldsPerDocumentCheckbox, SubFormFieldsPerDocumentCheckboxMerge, SubFormFieldsPerDocumentDateSigned, SubFormFieldsPerDocumentDropdown, SubFormFieldsPerDocumentFontEnum, SubFormFieldsPerDocumentHyperlink, SubFormFieldsPerDocumentInitials, SubFormFieldsPerDocumentRadio, SubFormFieldsPerDocumentSignature, SubFormFieldsPerDocumentText, SubFormFieldsPerDocumentTextMerge, SubFormFieldsPerDocumentTypeEnum, SubMergeField, SubOAuth, SubOptions, SubSignatureRequestGroupedSigners, SubSignatureRequestSigner, SubSignatureRequestTemplateSigner, SubSigningOptions, SubTeamResponse, SubTemplateRole, SubUnclaimedDraftSigner, SubUnclaimedDraftTemplateSigner, SubWhiteLabelingOptions, TeamAddMemberRequest, TeamCreateRequest, TeamGetInfoResponse, TeamGetResponse, TeamInfoResponse, TeamInviteResponse, TeamInvitesResponse, TeamMemberResponse, TeamMembersResponse, TeamParentResponse, TeamRemoveMemberRequest, TeamResponse, TeamSubTeamsResponse, TeamUpdateRequest, TemplateAddUserRequest, TemplateCreateEmbeddedDraftRequest, TemplateCreateEmbeddedDraftResponse, TemplateCreateEmbeddedDraftResponseTemplate, TemplateCreateRequest, TemplateCreateResponse, TemplateCreateResponseTemplate, TemplateEditResponse, TemplateGetResponse, TemplateListResponse, TemplateRemoveUserRequest, TemplateResponse, TemplateResponseAccount, TemplateResponseAccountQuota, TemplateResponseCCRole, TemplateResponseDocument, TemplateResponseDocumentCustomFieldBase, TemplateResponseDocumentCustomFieldCheckbox, TemplateResponseDocumentCustomFieldText, TemplateResponseDocumentFieldGroup, TemplateResponseDocumentFieldGroupRule, TemplateResponseDocumentFormFieldBase, TemplateResponseDocumentFormFieldCheckbox, TemplateResponseDocumentFormFieldDateSigned, TemplateResponseDocumentFormFieldDropdown, TemplateResponseDocumentFormFieldHyperlink, TemplateResponseDocumentFormFieldInitials, TemplateResponseDocumentFormFieldRadio, TemplateResponseDocumentFormFieldSignature, TemplateResponseDocumentFormFieldText, TemplateResponseDocumentStaticFieldBase, TemplateResponseDocumentStaticFieldCheckbox, TemplateResponseDocumentStaticFieldDateSigned, TemplateResponseDocumentStaticFieldDropdown, TemplateResponseDocumentStaticFieldHyperlink, TemplateResponseDocumentStaticFieldInitials, TemplateResponseDocumentStaticFieldRadio, TemplateResponseDocumentStaticFieldSignature, TemplateResponseDocumentStaticFieldText, TemplateResponseFieldAvgTextLength, TemplateResponseSignerRole, TemplateUpdateFilesRequest, TemplateUpdateFilesResponse, TemplateUpdateFilesResponseTemplate, UnclaimedDraftCreateEmbeddedRequest, UnclaimedDraftCreateEmbeddedWithTemplateRequest, UnclaimedDraftCreateRequest, UnclaimedDraftCreateResponse, UnclaimedDraftEditAndResendRequest, UnclaimedDraftResponse, VoidAuth, WarningResponse, }; diff --git a/sdks/node/types/model/signatureRequestEditEmbeddedRequest.d.ts b/sdks/node/types/model/signatureRequestEditEmbeddedRequest.d.ts new file mode 100644 index 000000000..6c2691435 --- /dev/null +++ b/sdks/node/types/model/signatureRequestEditEmbeddedRequest.d.ts @@ -0,0 +1,42 @@ +import { AttributeTypeMap, RequestFile } from "./"; +import { SubAttachment } from "./subAttachment"; +import { SubCustomField } from "./subCustomField"; +import { SubFieldOptions } from "./subFieldOptions"; +import { SubFormFieldGroup } from "./subFormFieldGroup"; +import { SubFormFieldRule } from "./subFormFieldRule"; +import { SubFormFieldsPerDocumentBase } from "./subFormFieldsPerDocumentBase"; +import { SubSignatureRequestGroupedSigners } from "./subSignatureRequestGroupedSigners"; +import { SubSignatureRequestSigner } from "./subSignatureRequestSigner"; +import { SubSigningOptions } from "./subSigningOptions"; +export declare class SignatureRequestEditEmbeddedRequest { + "clientId": string; + "files"?: Array; + "fileUrls"?: Array; + "signers"?: Array; + "groupedSigners"?: Array; + "allowDecline"?: boolean; + "allowReassign"?: boolean; + "attachments"?: Array; + "ccEmailAddresses"?: Array; + "customFields"?: Array; + "fieldOptions"?: SubFieldOptions; + "formFieldGroups"?: Array; + "formFieldRules"?: Array; + "formFieldsPerDocument"?: Array; + "hideTextTags"?: boolean; + "message"?: string; + "metadata"?: { + [key: string]: any; + }; + "signingOptions"?: SubSigningOptions; + "subject"?: string; + "testMode"?: boolean; + "title"?: string; + "useTextTags"?: boolean; + "populateAutoFillFields"?: boolean; + "expiresAt"?: number | null; + static discriminator: string | undefined; + static attributeTypeMap: AttributeTypeMap; + static getAttributeTypeMap(): AttributeTypeMap; + static init(data: any): SignatureRequestEditEmbeddedRequest; +} diff --git a/sdks/node/types/model/signatureRequestEditEmbeddedWithTemplateRequest.d.ts b/sdks/node/types/model/signatureRequestEditEmbeddedWithTemplateRequest.d.ts new file mode 100644 index 000000000..6824ad17f --- /dev/null +++ b/sdks/node/types/model/signatureRequestEditEmbeddedWithTemplateRequest.d.ts @@ -0,0 +1,28 @@ +import { AttributeTypeMap, RequestFile } from "./"; +import { SubCC } from "./subCC"; +import { SubCustomField } from "./subCustomField"; +import { SubSignatureRequestTemplateSigner } from "./subSignatureRequestTemplateSigner"; +import { SubSigningOptions } from "./subSigningOptions"; +export declare class SignatureRequestEditEmbeddedWithTemplateRequest { + "templateIds": Array; + "clientId": string; + "signers": Array; + "allowDecline"?: boolean; + "ccs"?: Array; + "customFields"?: Array; + "files"?: Array; + "fileUrls"?: Array; + "message"?: string; + "metadata"?: { + [key: string]: any; + }; + "signingOptions"?: SubSigningOptions; + "subject"?: string; + "testMode"?: boolean; + "title"?: string; + "populateAutoFillFields"?: boolean; + static discriminator: string | undefined; + static attributeTypeMap: AttributeTypeMap; + static getAttributeTypeMap(): AttributeTypeMap; + static init(data: any): SignatureRequestEditEmbeddedWithTemplateRequest; +} diff --git a/sdks/node/types/model/signatureRequestEditRequest.d.ts b/sdks/node/types/model/signatureRequestEditRequest.d.ts new file mode 100644 index 000000000..91a01f76c --- /dev/null +++ b/sdks/node/types/model/signatureRequestEditRequest.d.ts @@ -0,0 +1,43 @@ +import { AttributeTypeMap, RequestFile } from "./"; +import { SubAttachment } from "./subAttachment"; +import { SubCustomField } from "./subCustomField"; +import { SubFieldOptions } from "./subFieldOptions"; +import { SubFormFieldGroup } from "./subFormFieldGroup"; +import { SubFormFieldRule } from "./subFormFieldRule"; +import { SubFormFieldsPerDocumentBase } from "./subFormFieldsPerDocumentBase"; +import { SubSignatureRequestGroupedSigners } from "./subSignatureRequestGroupedSigners"; +import { SubSignatureRequestSigner } from "./subSignatureRequestSigner"; +import { SubSigningOptions } from "./subSigningOptions"; +export declare class SignatureRequestEditRequest { + "files"?: Array; + "fileUrls"?: Array; + "signers"?: Array; + "groupedSigners"?: Array; + "allowDecline"?: boolean; + "allowReassign"?: boolean; + "attachments"?: Array; + "ccEmailAddresses"?: Array; + "clientId"?: string; + "customFields"?: Array; + "fieldOptions"?: SubFieldOptions; + "formFieldGroups"?: Array; + "formFieldRules"?: Array; + "formFieldsPerDocument"?: Array; + "hideTextTags"?: boolean; + "isEid"?: boolean; + "message"?: string; + "metadata"?: { + [key: string]: any; + }; + "signingOptions"?: SubSigningOptions; + "signingRedirectUrl"?: string; + "subject"?: string; + "testMode"?: boolean; + "title"?: string; + "useTextTags"?: boolean; + "expiresAt"?: number | null; + static discriminator: string | undefined; + static attributeTypeMap: AttributeTypeMap; + static getAttributeTypeMap(): AttributeTypeMap; + static init(data: any): SignatureRequestEditRequest; +} diff --git a/sdks/node/types/model/signatureRequestEditWithTemplateRequest.d.ts b/sdks/node/types/model/signatureRequestEditWithTemplateRequest.d.ts new file mode 100644 index 000000000..5dc2d730a --- /dev/null +++ b/sdks/node/types/model/signatureRequestEditWithTemplateRequest.d.ts @@ -0,0 +1,29 @@ +import { AttributeTypeMap, RequestFile } from "./"; +import { SubCC } from "./subCC"; +import { SubCustomField } from "./subCustomField"; +import { SubSignatureRequestTemplateSigner } from "./subSignatureRequestTemplateSigner"; +import { SubSigningOptions } from "./subSigningOptions"; +export declare class SignatureRequestEditWithTemplateRequest { + "templateIds": Array; + "signers": Array; + "allowDecline"?: boolean; + "ccs"?: Array; + "clientId"?: string; + "customFields"?: Array; + "files"?: Array; + "fileUrls"?: Array; + "isEid"?: boolean; + "message"?: string; + "metadata"?: { + [key: string]: any; + }; + "signingOptions"?: SubSigningOptions; + "signingRedirectUrl"?: string; + "subject"?: string; + "testMode"?: boolean; + "title"?: string; + static discriminator: string | undefined; + static attributeTypeMap: AttributeTypeMap; + static getAttributeTypeMap(): AttributeTypeMap; + static init(data: any): SignatureRequestEditWithTemplateRequest; +} diff --git a/sdks/php/README.md b/sdks/php/README.md index 946c74e1f..c2c3feb33 100644 --- a/sdks/php/README.md +++ b/sdks/php/README.md @@ -180,6 +180,10 @@ All URIs are relative to *https://api.hellosign.com/v3* | *SignatureRequestApi* | [**signatureRequestCancel**](docs/Api/SignatureRequestApi.md#signaturerequestcancel) | **POST** /signature_request/cancel/{signature_request_id} | Cancel Incomplete Signature Request | | *SignatureRequestApi* | [**signatureRequestCreateEmbedded**](docs/Api/SignatureRequestApi.md#signaturerequestcreateembedded) | **POST** /signature_request/create_embedded | Create Embedded Signature Request | | *SignatureRequestApi* | [**signatureRequestCreateEmbeddedWithTemplate**](docs/Api/SignatureRequestApi.md#signaturerequestcreateembeddedwithtemplate) | **POST** /signature_request/create_embedded_with_template | Create Embedded Signature Request with Template | +| *SignatureRequestApi* | [**signatureRequestEdit**](docs/Api/SignatureRequestApi.md#signaturerequestedit) | **PUT** /signature_request/edit/{signature_request_id} | Edit Signature Request | +| *SignatureRequestApi* | [**signatureRequestEditEmbedded**](docs/Api/SignatureRequestApi.md#signaturerequesteditembedded) | **PUT** /signature_request/edit_embedded/{signature_request_id} | Edit Embedded Signature Request | +| *SignatureRequestApi* | [**signatureRequestEditEmbeddedWithTemplate**](docs/Api/SignatureRequestApi.md#signaturerequesteditembeddedwithtemplate) | **PUT** /signature_request/edit_embedded_with_template/{signature_request_id} | Edit Embedded Signature Request with Template | +| *SignatureRequestApi* | [**signatureRequestEditWithTemplate**](docs/Api/SignatureRequestApi.md#signaturerequesteditwithtemplate) | **PUT** /signature_request/edit_with_template/{signature_request_id} | Edit Signature Request With Template | | *SignatureRequestApi* | [**signatureRequestFiles**](docs/Api/SignatureRequestApi.md#signaturerequestfiles) | **GET** /signature_request/files/{signature_request_id} | Download Files | | *SignatureRequestApi* | [**signatureRequestFilesAsDataUri**](docs/Api/SignatureRequestApi.md#signaturerequestfilesasdatauri) | **GET** /signature_request/files_as_data_uri/{signature_request_id} | Download Files as Data Uri | | *SignatureRequestApi* | [**signatureRequestFilesAsFileUrl**](docs/Api/SignatureRequestApi.md#signaturerequestfilesasfileurl) | **GET** /signature_request/files_as_file_url/{signature_request_id} | Download Files as File Url | @@ -283,6 +287,10 @@ All URIs are relative to *https://api.hellosign.com/v3* - [SignatureRequestBulkSendWithTemplateRequest](docs/Model/SignatureRequestBulkSendWithTemplateRequest.md) - [SignatureRequestCreateEmbeddedRequest](docs/Model/SignatureRequestCreateEmbeddedRequest.md) - [SignatureRequestCreateEmbeddedWithTemplateRequest](docs/Model/SignatureRequestCreateEmbeddedWithTemplateRequest.md) +- [SignatureRequestEditEmbeddedRequest](docs/Model/SignatureRequestEditEmbeddedRequest.md) +- [SignatureRequestEditEmbeddedWithTemplateRequest](docs/Model/SignatureRequestEditEmbeddedWithTemplateRequest.md) +- [SignatureRequestEditRequest](docs/Model/SignatureRequestEditRequest.md) +- [SignatureRequestEditWithTemplateRequest](docs/Model/SignatureRequestEditWithTemplateRequest.md) - [SignatureRequestGetResponse](docs/Model/SignatureRequestGetResponse.md) - [SignatureRequestListResponse](docs/Model/SignatureRequestListResponse.md) - [SignatureRequestRemindRequest](docs/Model/SignatureRequestRemindRequest.md) diff --git a/sdks/php/docs/Api/SignatureRequestApi.md b/sdks/php/docs/Api/SignatureRequestApi.md index aa4979035..7fa0c8108 100644 --- a/sdks/php/docs/Api/SignatureRequestApi.md +++ b/sdks/php/docs/Api/SignatureRequestApi.md @@ -9,6 +9,10 @@ All URIs are relative to https://api.hellosign.com/v3. | [**signatureRequestCancel()**](SignatureRequestApi.md#signatureRequestCancel) | **POST** /signature_request/cancel/{signature_request_id} | Cancel Incomplete Signature Request | | [**signatureRequestCreateEmbedded()**](SignatureRequestApi.md#signatureRequestCreateEmbedded) | **POST** /signature_request/create_embedded | Create Embedded Signature Request | | [**signatureRequestCreateEmbeddedWithTemplate()**](SignatureRequestApi.md#signatureRequestCreateEmbeddedWithTemplate) | **POST** /signature_request/create_embedded_with_template | Create Embedded Signature Request with Template | +| [**signatureRequestEdit()**](SignatureRequestApi.md#signatureRequestEdit) | **PUT** /signature_request/edit/{signature_request_id} | Edit Signature Request | +| [**signatureRequestEditEmbedded()**](SignatureRequestApi.md#signatureRequestEditEmbedded) | **PUT** /signature_request/edit_embedded/{signature_request_id} | Edit Embedded Signature Request | +| [**signatureRequestEditEmbeddedWithTemplate()**](SignatureRequestApi.md#signatureRequestEditEmbeddedWithTemplate) | **PUT** /signature_request/edit_embedded_with_template/{signature_request_id} | Edit Embedded Signature Request with Template | +| [**signatureRequestEditWithTemplate()**](SignatureRequestApi.md#signatureRequestEditWithTemplate) | **PUT** /signature_request/edit_with_template/{signature_request_id} | Edit Signature Request With Template | | [**signatureRequestFiles()**](SignatureRequestApi.md#signatureRequestFiles) | **GET** /signature_request/files/{signature_request_id} | Download Files | | [**signatureRequestFilesAsDataUri()**](SignatureRequestApi.md#signatureRequestFilesAsDataUri) | **GET** /signature_request/files_as_data_uri/{signature_request_id} | Download Files as Data Uri | | [**signatureRequestFilesAsFileUrl()**](SignatureRequestApi.md#signatureRequestFilesAsFileUrl) | **GET** /signature_request/files_as_file_url/{signature_request_id} | Download Files as File Url | @@ -453,6 +457,386 @@ try { [[Back to Model list]](../../README.md#models) [[Back to README]](../../README.md) +## `signatureRequestEdit()` + +```php +signatureRequestEdit($signature_request_id, $signature_request_edit_request): \Dropbox\Sign\Model\SignatureRequestGetResponse +``` +Edit Signature Request + +Edits and sends a SignatureRequest with the submitted documents. If `form_fields_per_document` is not specified, a signature page will be affixed where all signers will be required to add their signature, signifying their agreement to all contained documents. **NOTE:** Edit and resend will not deduct your signature request quota. + +### Example + +```php +setUsername("YOUR_API_KEY"); + +// or, configure Bearer (JWT) authorization: oauth2 +// $config->setAccessToken("YOUR_ACCESS_TOKEN"); + +$signatureRequestApi = new Dropbox\Sign\Api\SignatureRequestApi($config); + +$signer1 = new Dropbox\Sign\Model\SubSignatureRequestSigner(); +$signer1->setEmailAddress("jack@example.com") + ->setName("Jack") + ->setOrder(0); + +$signer2 = new Dropbox\Sign\Model\SubSignatureRequestSigner(); +$signer2->setEmailAddress("jill@example.com") + ->setName("Jill") + ->setOrder(1); + +$signingOptions = new Dropbox\Sign\Model\SubSigningOptions(); +$signingOptions->setDraw(true) + ->setType(true) + ->setUpload(true) + ->setPhone(false) + ->setDefaultType(Dropbox\Sign\Model\SubSigningOptions::DEFAULT_TYPE_DRAW); + +$fieldOptions = new Dropbox\Sign\Model\SubFieldOptions(); +$fieldOptions->setDateFormat(Dropbox\Sign\Model\SubFieldOptions::DATE_FORMAT_DD_MM_YYYY); + +$data = new Dropbox\Sign\Model\SignatureRequestEditRequest(); +$data->setTitle("NDA with Acme Co.") + ->setSubject("The NDA we talked about") + ->setMessage("Please sign this NDA and then we can discuss more. Let me know if you have any questions.") + ->setSigners([$signer1, $signer2]) + ->setCcEmailAddresses([ + "lawyer1@dropboxsign.com", + "lawyer2@dropboxsign.com", + ]) + ->setFiles([new SplFileObject(__DIR__ . "/example_signature_request.pdf")]) + ->setMetadata([ + "custom_id" => 1234, + "custom_text" => "NDA #9", + ]) + ->setSigningOptions($signingOptions) + ->setFieldOptions($fieldOptions) + ->setTestMode(true); + +$signatureRequestId = "2f9781e1a8e2045224d808c153c2e1d3df6f8f2f"; + +try { + $result = $signatureRequestApi->signatureRequestEdit($signatureRequestId, $data); + print_r($result); +} catch (Dropbox\Sign\ApiException $e) { + $error = $e->getResponseObject(); + echo "Exception when calling Dropbox Sign API: " + . print_r($error->getError()); +} + +``` + +### Parameters + +|Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **signature_request_id** | **string**| The id of the SignatureRequest to edit. | | +| **signature_request_edit_request** | [**\Dropbox\Sign\Model\SignatureRequestEditRequest**](../Model/SignatureRequestEditRequest.md)| | | + +### Return type + +[**\Dropbox\Sign\Model\SignatureRequestGetResponse**](../Model/SignatureRequestGetResponse.md) + +### Authorization + +[api_key](../../README.md#api_key), [oauth2](../../README.md#oauth2) + +### HTTP request headers + +- **Content-Type**: `application/json`, `multipart/form-data` +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `signatureRequestEditEmbedded()` + +```php +signatureRequestEditEmbedded($signature_request_id, $signature_request_edit_embedded_request): \Dropbox\Sign\Model\SignatureRequestGetResponse +``` +Edit Embedded Signature Request + +Edits a SignatureRequest with the submitted documents to be signed in an embedded iFrame. If form_fields_per_document is not specified, a signature page will be affixed where all signers will be required to add their signature, signifying their agreement to all contained documents. Note that embedded signature requests can only be signed in embedded iFrames whereas normal signature requests can only be signed on Dropbox Sign. + +### Example + +```php +setUsername("YOUR_API_KEY"); + +// or, configure Bearer (JWT) authorization: oauth2 +// $config->setAccessToken("YOUR_ACCESS_TOKEN"); + +$signatureRequestApi = new Dropbox\Sign\Api\SignatureRequestApi($config); + +$signer1 = new Dropbox\Sign\Model\SubSignatureRequestSigner(); +$signer1->setEmailAddress("jack@example.com") + ->setName("Jack") + ->setOrder(0); + +$signer2 = new Dropbox\Sign\Model\SubSignatureRequestSigner(); +$signer2->setEmailAddress("jill@example.com") + ->setName("Jill") + ->setOrder(1); + +$signingOptions = new Dropbox\Sign\Model\SubSigningOptions(); +$signingOptions->setDraw(true) + ->setType(true) + ->setUpload(true) + ->setPhone(true) + ->setDefaultType(Dropbox\Sign\Model\SubSigningOptions::DEFAULT_TYPE_DRAW); + +$data = new Dropbox\Sign\Model\SignatureRequestEditEmbeddedRequest(); +$data->setClientId("ec64a202072370a737edf4a0eb7f4437") + ->setTitle("NDA with Acme Co.") + ->setSubject("The NDA we talked about") + ->setMessage("Please sign this NDA and then we can discuss more. Let me know if you have any questions.") + ->setSigners([$signer1, $signer2]) + ->setCcEmailAddresses([ + "lawyer1@dropboxsign.com", + "lawyer2@dropboxsign.com", + ]) + ->setFiles([new SplFileObject(__DIR__ . "/example_signature_request.pdf")]) + ->setSigningOptions($signingOptions) + ->setTestMode(true); + +$signatureRequestId = "2f9781e1a8e2045224d808c153c2e1d3df6f8f2f"; + +try { + $result = $signatureRequestApi->signatureRequestEditEmbedded( + $signatureRequestId, + $data + ); + print_r($result); +} catch (Dropbox\Sign\ApiException $e) { + $error = $e->getResponseObject(); + echo "Exception when calling Dropbox Sign API: " + . print_r($error->getError()); +} + +``` + +### Parameters + +|Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **signature_request_id** | **string**| The id of the SignatureRequest to edit. | | +| **signature_request_edit_embedded_request** | [**\Dropbox\Sign\Model\SignatureRequestEditEmbeddedRequest**](../Model/SignatureRequestEditEmbeddedRequest.md)| | | + +### Return type + +[**\Dropbox\Sign\Model\SignatureRequestGetResponse**](../Model/SignatureRequestGetResponse.md) + +### Authorization + +[api_key](../../README.md#api_key), [oauth2](../../README.md#oauth2) + +### HTTP request headers + +- **Content-Type**: `application/json`, `multipart/form-data` +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `signatureRequestEditEmbeddedWithTemplate()` + +```php +signatureRequestEditEmbeddedWithTemplate($signature_request_id, $signature_request_edit_embedded_with_template_request): \Dropbox\Sign\Model\SignatureRequestGetResponse +``` +Edit Embedded Signature Request with Template + +Edits a SignatureRequest based on the given Template(s) to be signed in an embedded iFrame. Note that embedded signature requests can only be signed in embedded iFrames whereas normal signature requests can only be signed on Dropbox Sign. + +### Example + +```php +setUsername("YOUR_API_KEY"); + +// or, configure Bearer (JWT) authorization: oauth2 +// $config->setAccessToken("YOUR_ACCESS_TOKEN"); + +$signatureRequestApi = new Dropbox\Sign\Api\SignatureRequestApi($config); + +$signer1 = new Dropbox\Sign\Model\SubSignatureRequestTemplateSigner(); +$signer1->setRole("Client") + ->setEmailAddress("george@example.com") + ->setName("George"); + +$signingOptions = new Dropbox\Sign\Model\SubSigningOptions(); +$signingOptions->setDraw(true) + ->setType(true) + ->setUpload(true) + ->setPhone(false) + ->setDefaultType(Dropbox\Sign\Model\SubSigningOptions::DEFAULT_TYPE_DRAW); + +$data = new Dropbox\Sign\Model\SignatureRequestEditEmbeddedWithTemplateRequest(); +$data->setClientId("ec64a202072370a737edf4a0eb7f4437") + ->setTemplateIds(["c26b8a16784a872da37ea946b9ddec7c1e11dff6"]) + ->setSubject("Purchase Order") + ->setMessage("Glad we could come to an agreement.") + ->setSigners([$signer1]) + ->setSigningOptions($signingOptions) + ->setTestMode(true); + +$signatureRequestId = "2f9781e1a8e2045224d808c153c2e1d3df6f8f2f"; + +try { + $result = $signatureRequestApi->signatureRequestEditEmbeddedWithTemplate( + $signatureRequestId, + $data + ); + print_r($result); +} catch (Dropbox\Sign\ApiException $e) { + $error = $e->getResponseObject(); + echo "Exception when calling Dropbox Sign API: " + . print_r($error->getError()); +} + +``` + +### Parameters + +|Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **signature_request_id** | **string**| The id of the SignatureRequest to edit. | | +| **signature_request_edit_embedded_with_template_request** | [**\Dropbox\Sign\Model\SignatureRequestEditEmbeddedWithTemplateRequest**](../Model/SignatureRequestEditEmbeddedWithTemplateRequest.md)| | | + +### Return type + +[**\Dropbox\Sign\Model\SignatureRequestGetResponse**](../Model/SignatureRequestGetResponse.md) + +### Authorization + +[api_key](../../README.md#api_key), [oauth2](../../README.md#oauth2) + +### HTTP request headers + +- **Content-Type**: `application/json`, `multipart/form-data` +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `signatureRequestEditWithTemplate()` + +```php +signatureRequestEditWithTemplate($signature_request_id, $signature_request_edit_with_template_request): \Dropbox\Sign\Model\SignatureRequestGetResponse +``` +Edit Signature Request With Template + +Edits and sends a SignatureRequest based off of the Template(s) specified with the template_ids parameter. **NOTE:** Edit and resend will not deduct your signature request quota. + +### Example + +```php +setUsername("YOUR_API_KEY"); + +// or, configure Bearer (JWT) authorization: oauth2 +// $config->setAccessToken("YOUR_ACCESS_TOKEN"); + +$signatureRequestApi = new Dropbox\Sign\Api\SignatureRequestApi($config); + +$signer1 = new Dropbox\Sign\Model\SubSignatureRequestTemplateSigner(); +$signer1->setRole("Client") + ->setEmailAddress("george@example.com") + ->setName("George"); + +$cc1 = new Dropbox\Sign\Model\SubCC(); +$cc1->setRole("Accounting") + ->setEmailAddress("accounting@example.com"); + +$customField1 = new Dropbox\Sign\Model\SubCustomField(); +$customField1->setName("Cost") + ->setValue("$20,000") + ->setEditor("Client") + ->setRequired(true); + +$signingOptions = new Dropbox\Sign\Model\SubSigningOptions(); +$signingOptions->setDraw(true) + ->setType(true) + ->setUpload(true) + ->setPhone(false) + ->setDefaultType(Dropbox\Sign\Model\SubSigningOptions::DEFAULT_TYPE_DRAW); + +$data = new Dropbox\Sign\Model\SignatureRequestEditWithTemplateRequest(); +$data->setTemplateIds(["c26b8a16784a872da37ea946b9ddec7c1e11dff6"]) + ->setSubject("Purchase Order") + ->setMessage("Glad we could come to an agreement.") + ->setSigners([$signer1]) + ->setCcs([$cc1]) + ->setCustomFields([$customField1]) + ->setSigningOptions($signingOptions) + ->setTestMode(true); + +$signatureRequestId = "2f9781e1a8e2045224d808c153c2e1d3df6f8f2f"; + +try { + $result = $signatureRequestApi->signatureRequestEditWithTemplate($signatureRequestId, $data); + print_r($result); +} catch (Dropbox\Sign\ApiException $e) { + $error = $e->getResponseObject(); + echo "Exception when calling Dropbox Sign API: " + . print_r($error->getError()); +} + +``` + +### Parameters + +|Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **signature_request_id** | **string**| The id of the SignatureRequest to edit. | | +| **signature_request_edit_with_template_request** | [**\Dropbox\Sign\Model\SignatureRequestEditWithTemplateRequest**](../Model/SignatureRequestEditWithTemplateRequest.md)| | | + +### Return type + +[**\Dropbox\Sign\Model\SignatureRequestGetResponse**](../Model/SignatureRequestGetResponse.md) + +### Authorization + +[api_key](../../README.md#api_key), [oauth2](../../README.md#oauth2) + +### HTTP request headers + +- **Content-Type**: `application/json`, `multipart/form-data` +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + ## `signatureRequestFiles()` ```php diff --git a/sdks/php/docs/Model/SignatureRequestEditEmbeddedRequest.md b/sdks/php/docs/Model/SignatureRequestEditEmbeddedRequest.md new file mode 100644 index 000000000..b2567ac3f --- /dev/null +++ b/sdks/php/docs/Model/SignatureRequestEditEmbeddedRequest.md @@ -0,0 +1,34 @@ +# # SignatureRequestEditEmbeddedRequest + + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +| `client_id`*_required_ | ```string``` | Client id of the app you're using to create this embedded signature request. Used for security purposes. | | +| `files` | ```\SplFileObject[]``` | Use `files[]` to indicate the uploaded file(s) to send for signature.

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

This endpoint requires either **files** or **file_urls[]**, but not both. | | +| `signers` | [```\Dropbox\Sign\Model\SubSignatureRequestSigner[]```](SubSignatureRequestSigner.md) | Add Signers to your Signature Request.

This endpoint requires either **signers** or **grouped_signers**, but not both. | | +| `grouped_signers` | [```\Dropbox\Sign\Model\SubSignatureRequestGroupedSigners[]```](SubSignatureRequestGroupedSigners.md) | Add Grouped Signers to your Signature Request.

This endpoint requires either **signers** or **grouped_signers**, but not both. | | +| `allow_decline` | ```bool``` | Allows signers to decline to sign a document if `true`. Defaults to `false`. | [default to false] | +| `allow_reassign` | ```bool``` | Allows signers to reassign their signature requests to other signers if set to `true`. Defaults to `false`.

**NOTE:** Only available for Premium plan. | [default to false] | +| `attachments` | [```\Dropbox\Sign\Model\SubAttachment[]```](SubAttachment.md) | A list describing the attachments | | +| `cc_email_addresses` | ```string[]``` | The email addresses that should be CCed. | | +| `custom_fields` | [```\Dropbox\Sign\Model\SubCustomField[]```](SubCustomField.md) | When used together with merge fields, `custom_fields` allows users to add pre-filled data to their signature requests.

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

For using pre-filled on repeatable signature requests, merge fields are added to templates in the Dropbox Sign UI or by calling [/template/create_embedded_draft](/api/reference/operation/templateCreateEmbeddedDraft) and then passing `custom_fields` on subsequent signature requests referencing that template. | | +| `field_options` | [```\Dropbox\Sign\Model\SubFieldOptions```](SubFieldOptions.md) | | | +| `form_field_groups` | [```\Dropbox\Sign\Model\SubFormFieldGroup[]```](SubFormFieldGroup.md) | Group information for fields defined in `form_fields_per_document`. String-indexed JSON array with `group_label` and `requirement` keys. `form_fields_per_document` must contain fields referencing a group defined in `form_field_groups`. | | +| `form_field_rules` | [```\Dropbox\Sign\Model\SubFormFieldRule[]```](SubFormFieldRule.md) | Conditional Logic rules for fields defined in `form_fields_per_document`. | | +| `form_fields_per_document` | [```\Dropbox\Sign\Model\SubFormFieldsPerDocumentBase[]```](SubFormFieldsPerDocumentBase.md) | The fields that should appear on the document, expressed as an array of objects. (For more details you can read about it here: [Using Form Fields per Document](/docs/openapi/form-fields-per-document).)

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

* Text Field use `SubFormFieldsPerDocumentText`
* Dropdown Field use `SubFormFieldsPerDocumentDropdown`
* Hyperlink Field use `SubFormFieldsPerDocumentHyperlink`
* Checkbox Field use `SubFormFieldsPerDocumentCheckbox`
* Radio Field use `SubFormFieldsPerDocumentRadio`
* Signature Field use `SubFormFieldsPerDocumentSignature`
* Date Signed Field use `SubFormFieldsPerDocumentDateSigned`
* Initials Field use `SubFormFieldsPerDocumentInitials`
* Text Merge Field use `SubFormFieldsPerDocumentTextMerge`
* Checkbox Merge Field use `SubFormFieldsPerDocumentCheckboxMerge` | | +| `hide_text_tags` | ```bool``` | Enables automatic Text Tag removal when set to true.

**NOTE:** Removing text tags this way can cause unwanted clipping. We recommend leaving this setting on `false` and instead hiding your text tags using white text or a similar approach. See the [Text Tags Walkthrough](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) for more information. | [default to false] | +| `message` | ```string``` | The custom message in the email that will be sent to the signers. | | +| `metadata` | ```array``` | Key-value data that should be attached to the signature request. This metadata is included in all API responses and events involving the signature request. For example, use the metadata field to store a signer's order number for look up when receiving events for the signature request.

Each request can include up to 10 metadata keys (or 50 nested metadata keys), with key names up to 40 characters long and values up to 1000 characters long. | | +| `signing_options` | [```\Dropbox\Sign\Model\SubSigningOptions```](SubSigningOptions.md) | | | +| `subject` | ```string``` | The subject in the email that will be sent to the signers. | | +| `test_mode` | ```bool``` | Whether this is a test, the signature request will not be legally binding if set to `true`. Defaults to `false`. | [default to false] | +| `title` | ```string``` | The title you want to assign to the SignatureRequest. | | +| `use_text_tags` | ```bool``` | Send with a value of `true` if you wish to enable [Text Tags](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) parsing in your document. Defaults to disabled, or `false`. | [default to false] | +| `populate_auto_fill_fields` | ```bool``` | Controls whether [auto fill fields](https://faq.hellosign.com/hc/en-us/articles/360051467511-Auto-Fill-Fields) can automatically populate a signer's information during signing.

**NOTE:** Keep your signer's information safe by ensuring that the _signer on your signature request is the intended party_ before using this feature. | [default to false] | +| `expires_at` | ```int``` | When the signature request will expire. Unsigned signatures will be moved to the expired status, and no longer signable. See [Signature Request Expiration Date](https://developers.hellosign.com/docs/signature-request/expiration/) for details. | | + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/sdks/php/docs/Model/SignatureRequestEditEmbeddedWithTemplateRequest.md b/sdks/php/docs/Model/SignatureRequestEditEmbeddedWithTemplateRequest.md new file mode 100644 index 000000000..3b9df4cac --- /dev/null +++ b/sdks/php/docs/Model/SignatureRequestEditEmbeddedWithTemplateRequest.md @@ -0,0 +1,25 @@ +# # SignatureRequestEditEmbeddedWithTemplateRequest + + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +| `template_ids`*_required_ | ```string[]``` | Use `template_ids` to create a SignatureRequest from one or more templates, in the order in which the template will be used. | | +| `client_id`*_required_ | ```string``` | Client id of the app you're using to create this embedded signature request. Used for security purposes. | | +| `signers`*_required_ | [```\Dropbox\Sign\Model\SubSignatureRequestTemplateSigner[]```](SubSignatureRequestTemplateSigner.md) | Add Signers to your Templated-based Signature Request. | | +| `allow_decline` | ```bool``` | Allows signers to decline to sign a document if `true`. Defaults to `false`. | [default to false] | +| `ccs` | [```\Dropbox\Sign\Model\SubCC[]```](SubCC.md) | Add CC email recipients. Required when a CC role exists for the Template. | | +| `custom_fields` | [```\Dropbox\Sign\Model\SubCustomField[]```](SubCustomField.md) | An array defining values and options for custom fields. Required when a custom field exists in the Template. | | +| `files` | ```\SplFileObject[]``` | Use `files[]` to indicate the uploaded file(s) to send for signature.

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

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

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

**NOTE:** Keep your signer's information safe by ensuring that the _signer on your signature request is the intended party_ before using this feature. | [default to false] | + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/sdks/php/docs/Model/SignatureRequestEditRequest.md b/sdks/php/docs/Model/SignatureRequestEditRequest.md new file mode 100644 index 000000000..0d3ca23ce --- /dev/null +++ b/sdks/php/docs/Model/SignatureRequestEditRequest.md @@ -0,0 +1,35 @@ +# # SignatureRequestEditRequest + + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +| `files` | ```\SplFileObject[]``` | Use `files[]` to indicate the uploaded file(s) to send for signature.

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

This endpoint requires either **files** or **file_urls[]**, but not both. | | +| `signers` | [```\Dropbox\Sign\Model\SubSignatureRequestSigner[]```](SubSignatureRequestSigner.md) | Add Signers to your Signature Request.

This endpoint requires either **signers** or **grouped_signers**, but not both. | | +| `grouped_signers` | [```\Dropbox\Sign\Model\SubSignatureRequestGroupedSigners[]```](SubSignatureRequestGroupedSigners.md) | Add Grouped Signers to your Signature Request.

This endpoint requires either **signers** or **grouped_signers**, but not both. | | +| `allow_decline` | ```bool``` | Allows signers to decline to sign a document if `true`. Defaults to `false`. | [default to false] | +| `allow_reassign` | ```bool``` | Allows signers to reassign their signature requests to other signers if set to `true`. Defaults to `false`.

**NOTE:** Only available for Premium plan and higher. | [default to false] | +| `attachments` | [```\Dropbox\Sign\Model\SubAttachment[]```](SubAttachment.md) | A list describing the attachments | | +| `cc_email_addresses` | ```string[]``` | The email addresses that should be CCed. | | +| `client_id` | ```string``` | The client id of the API App you want to associate with this request. Used to apply the branding and callback url defined for the app. | | +| `custom_fields` | [```\Dropbox\Sign\Model\SubCustomField[]```](SubCustomField.md) | When used together with merge fields, `custom_fields` allows users to add pre-filled data to their signature requests.

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

For using pre-filled on repeatable signature requests, merge fields are added to templates in the Dropbox Sign UI or by calling [/template/create_embedded_draft](/api/reference/operation/templateCreateEmbeddedDraft) and then passing `custom_fields` on subsequent signature requests referencing that template. | | +| `field_options` | [```\Dropbox\Sign\Model\SubFieldOptions```](SubFieldOptions.md) | | | +| `form_field_groups` | [```\Dropbox\Sign\Model\SubFormFieldGroup[]```](SubFormFieldGroup.md) | Group information for fields defined in `form_fields_per_document`. String-indexed JSON array with `group_label` and `requirement` keys. `form_fields_per_document` must contain fields referencing a group defined in `form_field_groups`. | | +| `form_field_rules` | [```\Dropbox\Sign\Model\SubFormFieldRule[]```](SubFormFieldRule.md) | Conditional Logic rules for fields defined in `form_fields_per_document`. | | +| `form_fields_per_document` | [```\Dropbox\Sign\Model\SubFormFieldsPerDocumentBase[]```](SubFormFieldsPerDocumentBase.md) | The fields that should appear on the document, expressed as an array of objects. (For more details you can read about it here: [Using Form Fields per Document](/docs/openapi/form-fields-per-document).)

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

* Text Field use `SubFormFieldsPerDocumentText`
* Dropdown Field use `SubFormFieldsPerDocumentDropdown`
* Hyperlink Field use `SubFormFieldsPerDocumentHyperlink`
* Checkbox Field use `SubFormFieldsPerDocumentCheckbox`
* Radio Field use `SubFormFieldsPerDocumentRadio`
* Signature Field use `SubFormFieldsPerDocumentSignature`
* Date Signed Field use `SubFormFieldsPerDocumentDateSigned`
* Initials Field use `SubFormFieldsPerDocumentInitials`
* Text Merge Field use `SubFormFieldsPerDocumentTextMerge`
* Checkbox Merge Field use `SubFormFieldsPerDocumentCheckboxMerge` | | +| `hide_text_tags` | ```bool``` | Enables automatic Text Tag removal when set to true.

**NOTE:** Removing text tags this way can cause unwanted clipping. We recommend leaving this setting on `false` and instead hiding your text tags using white text or a similar approach. See the [Text Tags Walkthrough](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) for more information. | [default to false] | +| `is_eid` | ```bool``` | Send with a value of `true` if you wish to enable [electronic identification (eID)](https://www.hellosign.com/features/electronic-id), which requires the signer to verify their identity with an eID provider to sign a document.<br>
**NOTE:** eID is only available on the Premium API plan. Cannot be used in `test_mode`. Only works on requests with one signer. | [default to false] | +| `message` | ```string``` | The custom message in the email that will be sent to the signers. | | +| `metadata` | ```array``` | Key-value data that should be attached to the signature request. This metadata is included in all API responses and events involving the signature request. For example, use the metadata field to store a signer's order number for look up when receiving events for the signature request.

Each request can include up to 10 metadata keys (or 50 nested metadata keys), with key names up to 40 characters long and values up to 1000 characters long. | | +| `signing_options` | [```\Dropbox\Sign\Model\SubSigningOptions```](SubSigningOptions.md) | | | +| `signing_redirect_url` | ```string``` | The URL you want signers redirected to after they successfully sign. | | +| `subject` | ```string``` | The subject in the email that will be sent to the signers. | | +| `test_mode` | ```bool``` | Whether this is a test, the signature request will not be legally binding if set to `true`. Defaults to `false`. | [default to false] | +| `title` | ```string``` | The title you want to assign to the SignatureRequest. | | +| `use_text_tags` | ```bool``` | Send with a value of `true` if you wish to enable [Text Tags](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) parsing in your document. Defaults to disabled, or `false`. | [default to false] | +| `expires_at` | ```int``` | When the signature request will expire. Unsigned signatures will be moved to the expired status, and no longer signable. See [Signature Request Expiration Date](https://developers.hellosign.com/docs/signature-request/expiration/) for details. | | + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/sdks/php/docs/Model/SignatureRequestEditWithTemplateRequest.md b/sdks/php/docs/Model/SignatureRequestEditWithTemplateRequest.md new file mode 100644 index 000000000..072fdc080 --- /dev/null +++ b/sdks/php/docs/Model/SignatureRequestEditWithTemplateRequest.md @@ -0,0 +1,26 @@ +# # SignatureRequestEditWithTemplateRequest + + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +| `template_ids`*_required_ | ```string[]``` | Use `template_ids` to create a SignatureRequest from one or more templates, in the order in which the template will be used. | | +| `signers`*_required_ | [```\Dropbox\Sign\Model\SubSignatureRequestTemplateSigner[]```](SubSignatureRequestTemplateSigner.md) | Add Signers to your Templated-based Signature Request. | | +| `allow_decline` | ```bool``` | Allows signers to decline to sign a document if `true`. Defaults to `false`. | [default to false] | +| `ccs` | [```\Dropbox\Sign\Model\SubCC[]```](SubCC.md) | Add CC email recipients. Required when a CC role exists for the Template. | | +| `client_id` | ```string``` | Client id of the app to associate with the signature request. Used to apply the branding and callback url defined for the app. | | +| `custom_fields` | [```\Dropbox\Sign\Model\SubCustomField[]```](SubCustomField.md) | An array defining values and options for custom fields. Required when a custom field exists in the Template. | | +| `files` | ```\SplFileObject[]``` | Use `files[]` to indicate the uploaded file(s) to send for signature.

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

This endpoint requires either **files** or **file_urls[]**, but not both. | | +| `is_eid` | ```bool``` | Send with a value of `true` if you wish to enable [electronic identification (eID)](https://www.hellosign.com/features/electronic-id), which requires the signer to verify their identity with an eID provider to sign a document.<br>
**NOTE:** eID is only available on the Premium API plan. Cannot be used in `test_mode`. Only works on requests with one signer. | [default to false] | +| `message` | ```string``` | The custom message in the email that will be sent to the signers. | | +| `metadata` | ```array``` | Key-value data that should be attached to the signature request. This metadata is included in all API responses and events involving the signature request. For example, use the metadata field to store a signer's order number for look up when receiving events for the signature request.

Each request can include up to 10 metadata keys (or 50 nested metadata keys), with key names up to 40 characters long and values up to 1000 characters long. | | +| `signing_options` | [```\Dropbox\Sign\Model\SubSigningOptions```](SubSigningOptions.md) | | | +| `signing_redirect_url` | ```string``` | The URL you want signers redirected to after they successfully sign. | | +| `subject` | ```string``` | The subject in the email that will be sent to the signers. | | +| `test_mode` | ```bool``` | Whether this is a test, the signature request will not be legally binding if set to `true`. Defaults to `false`. | [default to false] | +| `title` | ```string``` | The title you want to assign to the SignatureRequest. | | + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/sdks/php/src/Api/SignatureRequestApi.php b/sdks/php/src/Api/SignatureRequestApi.php index e8da69d75..38947f821 100644 --- a/sdks/php/src/Api/SignatureRequestApi.php +++ b/sdks/php/src/Api/SignatureRequestApi.php @@ -87,6 +87,22 @@ class SignatureRequestApi 'application/json', 'multipart/form-data', ], + 'signatureRequestEdit' => [ + 'application/json', + 'multipart/form-data', + ], + 'signatureRequestEditEmbedded' => [ + 'application/json', + 'multipart/form-data', + ], + 'signatureRequestEditEmbeddedWithTemplate' => [ + 'application/json', + 'multipart/form-data', + ], + 'signatureRequestEditWithTemplate' => [ + 'application/json', + 'multipart/form-data', + ], 'signatureRequestFiles' => [ 'application/json', ], @@ -1776,6 +1792,1446 @@ public function signatureRequestCreateEmbeddedWithTemplateRequest(Model\Signatur ); } + /** + * Operation signatureRequestEdit + * + * Edit Signature Request + * + * @param string $signature_request_id The id of the SignatureRequest to edit. (required) + * @param Model\SignatureRequestEditRequest $signature_request_edit_request signature_request_edit_request (required) + * + * @return Model\SignatureRequestGetResponse + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + */ + public function signatureRequestEdit(string $signature_request_id, Model\SignatureRequestEditRequest $signature_request_edit_request) + { + list($response) = $this->signatureRequestEditWithHttpInfo($signature_request_id, $signature_request_edit_request); + return $response; + } + + /** + * Operation signatureRequestEditWithHttpInfo + * + * Edit Signature Request + * + * @param string $signature_request_id The id of the SignatureRequest to edit. (required) + * @param Model\SignatureRequestEditRequest $signature_request_edit_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['signatureRequestEdit'] to see the possible values for this operation + * + * @return array of Model\SignatureRequestGetResponse, HTTP status code, HTTP response headers (array of strings) + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @deprecated Prefer to use ::signatureRequestEdit. This method will eventually become unavailable + */ + public function signatureRequestEditWithHttpInfo(string $signature_request_id, Model\SignatureRequestEditRequest $signature_request_edit_request, string $contentType = self::contentTypes['signatureRequestEdit'][0]) + { + $request = $this->signatureRequestEditRequest($signature_request_id, $signature_request_edit_request, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + $this->response = $response; + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int)$e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string)$e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int)$e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string)$request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string)$response->getBody() + ); + } + + $result = $this->handleRangeCodeResponse( + $response, + '4XX', + '\Dropbox\Sign\Model\ErrorResponse' + ); + if ($result) { + return $result; + } + + switch ($statusCode) { + case 200: + if ('\Dropbox\Sign\Model\SignatureRequestGetResponse' === '\SplFileObject') { + $content = $response->getBody(); // stream goes to serializer + } else { + $content = (string)$response->getBody(); + if ('\Dropbox\Sign\Model\SignatureRequestGetResponse' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\Dropbox\Sign\Model\SignatureRequestGetResponse', []), + $response->getStatusCode(), + $response->getHeaders(), + ]; + } + + $returnType = '\Dropbox\Sign\Model\SignatureRequestGetResponse'; + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); // stream goes to serializer + } else { + $content = (string)$response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders(), + ]; + } catch (ApiException $e) { + if ($this->handleRangeCodeException($e, '4XX', '\Dropbox\Sign\Model\ErrorResponse')) { + throw $e; + } + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Dropbox\Sign\Model\SignatureRequestGetResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation signatureRequestEditAsync + * + * Edit Signature Request + * + * @param string $signature_request_id The id of the SignatureRequest to edit. (required) + * @param Model\SignatureRequestEditRequest $signature_request_edit_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['signatureRequestEdit'] to see the possible values for this operation + * + * @return \GuzzleHttp\Promise\PromiseInterface + * @throws InvalidArgumentException + * @deprecated Prefer to use ::signatureRequestEdit. This method will eventually become unavailable + */ + public function signatureRequestEditAsync(string $signature_request_id, Model\SignatureRequestEditRequest $signature_request_edit_request, string $contentType = self::contentTypes['signatureRequestEdit'][0]) + { + return $this->signatureRequestEditAsyncWithHttpInfo($signature_request_id, $signature_request_edit_request, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation signatureRequestEditAsyncWithHttpInfo + * + * Edit Signature Request + * + * @param string $signature_request_id The id of the SignatureRequest to edit. (required) + * @param Model\SignatureRequestEditRequest $signature_request_edit_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['signatureRequestEdit'] to see the possible values for this operation + * + * @return \GuzzleHttp\Promise\PromiseInterface + * @throws InvalidArgumentException + * @deprecated Prefer to use ::signatureRequestEdit. This method will eventually become unavailable + */ + public function signatureRequestEditAsyncWithHttpInfo(string $signature_request_id, Model\SignatureRequestEditRequest $signature_request_edit_request, string $contentType = self::contentTypes['signatureRequestEdit'][0]) + { + $returnType = '\Dropbox\Sign\Model\SignatureRequestGetResponse'; + $request = $this->signatureRequestEditRequest($signature_request_id, $signature_request_edit_request, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); // stream goes to serializer + } else { + $content = (string)$response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders(), + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string)$response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'signatureRequestEdit' + * + * @param string $signature_request_id The id of the SignatureRequest to edit. (required) + * @param Model\SignatureRequestEditRequest $signature_request_edit_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['signatureRequestEdit'] to see the possible values for this operation + * + * @return Request + * @throws InvalidArgumentException + * @deprecated Prefer to use ::signatureRequestEdit. This method will eventually become unavailable + */ + public function signatureRequestEditRequest(string $signature_request_id, Model\SignatureRequestEditRequest $signature_request_edit_request, string $contentType = self::contentTypes['signatureRequestEdit'][0]) + { + // verify the required parameter 'signature_request_id' is set + if ($signature_request_id === null || (is_array($signature_request_id) && count($signature_request_id) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $signature_request_id when calling signatureRequestEdit' + ); + } + + // verify the required parameter 'signature_request_edit_request' is set + if ($signature_request_edit_request === null || (is_array($signature_request_edit_request) && count($signature_request_edit_request) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $signature_request_edit_request when calling signatureRequestEdit' + ); + } + + $resourcePath = '/signature_request/edit/{signature_request_id}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + $formParams = ObjectSerializer::getFormParams( + $signature_request_edit_request + ); + + $multipart = !empty($formParams); + + // path params + if ($signature_request_id !== null) { + $resourcePath = str_replace( + '{signature_request_id}', + ObjectSerializer::toPathValue($signature_request_id), + $resourcePath + ); + } + + $headers = $this->headerSelector->selectHeaders( + $multipart ? ['multipart/form-data'] : ['application/json'], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) === 0) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + // if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($signature_request_edit_request)); + } else { + $httpBody = $signature_request_edit_request; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem, + ]; + } + } + // for HTTP post (form) + if (!empty($body)) { + $multipartContents[] = [ + 'name' => 'body', + 'contents' => $body, + 'headers' => ['Content-Type' => 'application/json'], + ]; + } + + if ($payloadHook = $this->config->getPayloadHook()) { + $payloadHook('multipart', $multipartContents, $signature_request_edit_request); + } + $httpBody = new MultipartStream($multipartContents); + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + // if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername())) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ':'); + } + // this endpoint requires Bearer (JWT) authentication (access token) + if (!empty($this->config->getAccessToken())) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'PUT', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation signatureRequestEditEmbedded + * + * Edit Embedded Signature Request + * + * @param string $signature_request_id The id of the SignatureRequest to edit. (required) + * @param Model\SignatureRequestEditEmbeddedRequest $signature_request_edit_embedded_request signature_request_edit_embedded_request (required) + * + * @return Model\SignatureRequestGetResponse + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + */ + public function signatureRequestEditEmbedded(string $signature_request_id, Model\SignatureRequestEditEmbeddedRequest $signature_request_edit_embedded_request) + { + list($response) = $this->signatureRequestEditEmbeddedWithHttpInfo($signature_request_id, $signature_request_edit_embedded_request); + return $response; + } + + /** + * Operation signatureRequestEditEmbeddedWithHttpInfo + * + * Edit Embedded Signature Request + * + * @param string $signature_request_id The id of the SignatureRequest to edit. (required) + * @param Model\SignatureRequestEditEmbeddedRequest $signature_request_edit_embedded_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['signatureRequestEditEmbedded'] to see the possible values for this operation + * + * @return array of Model\SignatureRequestGetResponse, HTTP status code, HTTP response headers (array of strings) + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @deprecated Prefer to use ::signatureRequestEditEmbedded. This method will eventually become unavailable + */ + public function signatureRequestEditEmbeddedWithHttpInfo(string $signature_request_id, Model\SignatureRequestEditEmbeddedRequest $signature_request_edit_embedded_request, string $contentType = self::contentTypes['signatureRequestEditEmbedded'][0]) + { + $request = $this->signatureRequestEditEmbeddedRequest($signature_request_id, $signature_request_edit_embedded_request, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + $this->response = $response; + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int)$e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string)$e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int)$e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string)$request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string)$response->getBody() + ); + } + + $result = $this->handleRangeCodeResponse( + $response, + '4XX', + '\Dropbox\Sign\Model\ErrorResponse' + ); + if ($result) { + return $result; + } + + switch ($statusCode) { + case 200: + if ('\Dropbox\Sign\Model\SignatureRequestGetResponse' === '\SplFileObject') { + $content = $response->getBody(); // stream goes to serializer + } else { + $content = (string)$response->getBody(); + if ('\Dropbox\Sign\Model\SignatureRequestGetResponse' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\Dropbox\Sign\Model\SignatureRequestGetResponse', []), + $response->getStatusCode(), + $response->getHeaders(), + ]; + } + + $returnType = '\Dropbox\Sign\Model\SignatureRequestGetResponse'; + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); // stream goes to serializer + } else { + $content = (string)$response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders(), + ]; + } catch (ApiException $e) { + if ($this->handleRangeCodeException($e, '4XX', '\Dropbox\Sign\Model\ErrorResponse')) { + throw $e; + } + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Dropbox\Sign\Model\SignatureRequestGetResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation signatureRequestEditEmbeddedAsync + * + * Edit Embedded Signature Request + * + * @param string $signature_request_id The id of the SignatureRequest to edit. (required) + * @param Model\SignatureRequestEditEmbeddedRequest $signature_request_edit_embedded_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['signatureRequestEditEmbedded'] to see the possible values for this operation + * + * @return \GuzzleHttp\Promise\PromiseInterface + * @throws InvalidArgumentException + * @deprecated Prefer to use ::signatureRequestEditEmbedded. This method will eventually become unavailable + */ + public function signatureRequestEditEmbeddedAsync(string $signature_request_id, Model\SignatureRequestEditEmbeddedRequest $signature_request_edit_embedded_request, string $contentType = self::contentTypes['signatureRequestEditEmbedded'][0]) + { + return $this->signatureRequestEditEmbeddedAsyncWithHttpInfo($signature_request_id, $signature_request_edit_embedded_request, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation signatureRequestEditEmbeddedAsyncWithHttpInfo + * + * Edit Embedded Signature Request + * + * @param string $signature_request_id The id of the SignatureRequest to edit. (required) + * @param Model\SignatureRequestEditEmbeddedRequest $signature_request_edit_embedded_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['signatureRequestEditEmbedded'] to see the possible values for this operation + * + * @return \GuzzleHttp\Promise\PromiseInterface + * @throws InvalidArgumentException + * @deprecated Prefer to use ::signatureRequestEditEmbedded. This method will eventually become unavailable + */ + public function signatureRequestEditEmbeddedAsyncWithHttpInfo(string $signature_request_id, Model\SignatureRequestEditEmbeddedRequest $signature_request_edit_embedded_request, string $contentType = self::contentTypes['signatureRequestEditEmbedded'][0]) + { + $returnType = '\Dropbox\Sign\Model\SignatureRequestGetResponse'; + $request = $this->signatureRequestEditEmbeddedRequest($signature_request_id, $signature_request_edit_embedded_request, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); // stream goes to serializer + } else { + $content = (string)$response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders(), + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string)$response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'signatureRequestEditEmbedded' + * + * @param string $signature_request_id The id of the SignatureRequest to edit. (required) + * @param Model\SignatureRequestEditEmbeddedRequest $signature_request_edit_embedded_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['signatureRequestEditEmbedded'] to see the possible values for this operation + * + * @return Request + * @throws InvalidArgumentException + * @deprecated Prefer to use ::signatureRequestEditEmbedded. This method will eventually become unavailable + */ + public function signatureRequestEditEmbeddedRequest(string $signature_request_id, Model\SignatureRequestEditEmbeddedRequest $signature_request_edit_embedded_request, string $contentType = self::contentTypes['signatureRequestEditEmbedded'][0]) + { + // verify the required parameter 'signature_request_id' is set + if ($signature_request_id === null || (is_array($signature_request_id) && count($signature_request_id) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $signature_request_id when calling signatureRequestEditEmbedded' + ); + } + + // verify the required parameter 'signature_request_edit_embedded_request' is set + if ($signature_request_edit_embedded_request === null || (is_array($signature_request_edit_embedded_request) && count($signature_request_edit_embedded_request) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $signature_request_edit_embedded_request when calling signatureRequestEditEmbedded' + ); + } + + $resourcePath = '/signature_request/edit_embedded/{signature_request_id}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + $formParams = ObjectSerializer::getFormParams( + $signature_request_edit_embedded_request + ); + + $multipart = !empty($formParams); + + // path params + if ($signature_request_id !== null) { + $resourcePath = str_replace( + '{signature_request_id}', + ObjectSerializer::toPathValue($signature_request_id), + $resourcePath + ); + } + + $headers = $this->headerSelector->selectHeaders( + $multipart ? ['multipart/form-data'] : ['application/json'], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) === 0) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + // if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($signature_request_edit_embedded_request)); + } else { + $httpBody = $signature_request_edit_embedded_request; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem, + ]; + } + } + // for HTTP post (form) + if (!empty($body)) { + $multipartContents[] = [ + 'name' => 'body', + 'contents' => $body, + 'headers' => ['Content-Type' => 'application/json'], + ]; + } + + if ($payloadHook = $this->config->getPayloadHook()) { + $payloadHook('multipart', $multipartContents, $signature_request_edit_embedded_request); + } + $httpBody = new MultipartStream($multipartContents); + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + // if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername())) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ':'); + } + // this endpoint requires Bearer (JWT) authentication (access token) + if (!empty($this->config->getAccessToken())) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'PUT', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation signatureRequestEditEmbeddedWithTemplate + * + * Edit Embedded Signature Request with Template + * + * @param string $signature_request_id The id of the SignatureRequest to edit. (required) + * @param Model\SignatureRequestEditEmbeddedWithTemplateRequest $signature_request_edit_embedded_with_template_request signature_request_edit_embedded_with_template_request (required) + * + * @return Model\SignatureRequestGetResponse + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + */ + public function signatureRequestEditEmbeddedWithTemplate(string $signature_request_id, Model\SignatureRequestEditEmbeddedWithTemplateRequest $signature_request_edit_embedded_with_template_request) + { + list($response) = $this->signatureRequestEditEmbeddedWithTemplateWithHttpInfo($signature_request_id, $signature_request_edit_embedded_with_template_request); + return $response; + } + + /** + * Operation signatureRequestEditEmbeddedWithTemplateWithHttpInfo + * + * Edit Embedded Signature Request with Template + * + * @param string $signature_request_id The id of the SignatureRequest to edit. (required) + * @param Model\SignatureRequestEditEmbeddedWithTemplateRequest $signature_request_edit_embedded_with_template_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['signatureRequestEditEmbeddedWithTemplate'] to see the possible values for this operation + * + * @return array of Model\SignatureRequestGetResponse, HTTP status code, HTTP response headers (array of strings) + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @deprecated Prefer to use ::signatureRequestEditEmbeddedWithTemplate. This method will eventually become unavailable + */ + public function signatureRequestEditEmbeddedWithTemplateWithHttpInfo(string $signature_request_id, Model\SignatureRequestEditEmbeddedWithTemplateRequest $signature_request_edit_embedded_with_template_request, string $contentType = self::contentTypes['signatureRequestEditEmbeddedWithTemplate'][0]) + { + $request = $this->signatureRequestEditEmbeddedWithTemplateRequest($signature_request_id, $signature_request_edit_embedded_with_template_request, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + $this->response = $response; + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int)$e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string)$e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int)$e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string)$request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string)$response->getBody() + ); + } + + $result = $this->handleRangeCodeResponse( + $response, + '4XX', + '\Dropbox\Sign\Model\ErrorResponse' + ); + if ($result) { + return $result; + } + + switch ($statusCode) { + case 200: + if ('\Dropbox\Sign\Model\SignatureRequestGetResponse' === '\SplFileObject') { + $content = $response->getBody(); // stream goes to serializer + } else { + $content = (string)$response->getBody(); + if ('\Dropbox\Sign\Model\SignatureRequestGetResponse' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\Dropbox\Sign\Model\SignatureRequestGetResponse', []), + $response->getStatusCode(), + $response->getHeaders(), + ]; + } + + $returnType = '\Dropbox\Sign\Model\SignatureRequestGetResponse'; + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); // stream goes to serializer + } else { + $content = (string)$response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders(), + ]; + } catch (ApiException $e) { + if ($this->handleRangeCodeException($e, '4XX', '\Dropbox\Sign\Model\ErrorResponse')) { + throw $e; + } + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Dropbox\Sign\Model\SignatureRequestGetResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation signatureRequestEditEmbeddedWithTemplateAsync + * + * Edit Embedded Signature Request with Template + * + * @param string $signature_request_id The id of the SignatureRequest to edit. (required) + * @param Model\SignatureRequestEditEmbeddedWithTemplateRequest $signature_request_edit_embedded_with_template_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['signatureRequestEditEmbeddedWithTemplate'] to see the possible values for this operation + * + * @return \GuzzleHttp\Promise\PromiseInterface + * @throws InvalidArgumentException + * @deprecated Prefer to use ::signatureRequestEditEmbeddedWithTemplate. This method will eventually become unavailable + */ + public function signatureRequestEditEmbeddedWithTemplateAsync(string $signature_request_id, Model\SignatureRequestEditEmbeddedWithTemplateRequest $signature_request_edit_embedded_with_template_request, string $contentType = self::contentTypes['signatureRequestEditEmbeddedWithTemplate'][0]) + { + return $this->signatureRequestEditEmbeddedWithTemplateAsyncWithHttpInfo($signature_request_id, $signature_request_edit_embedded_with_template_request, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation signatureRequestEditEmbeddedWithTemplateAsyncWithHttpInfo + * + * Edit Embedded Signature Request with Template + * + * @param string $signature_request_id The id of the SignatureRequest to edit. (required) + * @param Model\SignatureRequestEditEmbeddedWithTemplateRequest $signature_request_edit_embedded_with_template_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['signatureRequestEditEmbeddedWithTemplate'] to see the possible values for this operation + * + * @return \GuzzleHttp\Promise\PromiseInterface + * @throws InvalidArgumentException + * @deprecated Prefer to use ::signatureRequestEditEmbeddedWithTemplate. This method will eventually become unavailable + */ + public function signatureRequestEditEmbeddedWithTemplateAsyncWithHttpInfo(string $signature_request_id, Model\SignatureRequestEditEmbeddedWithTemplateRequest $signature_request_edit_embedded_with_template_request, string $contentType = self::contentTypes['signatureRequestEditEmbeddedWithTemplate'][0]) + { + $returnType = '\Dropbox\Sign\Model\SignatureRequestGetResponse'; + $request = $this->signatureRequestEditEmbeddedWithTemplateRequest($signature_request_id, $signature_request_edit_embedded_with_template_request, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); // stream goes to serializer + } else { + $content = (string)$response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders(), + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string)$response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'signatureRequestEditEmbeddedWithTemplate' + * + * @param string $signature_request_id The id of the SignatureRequest to edit. (required) + * @param Model\SignatureRequestEditEmbeddedWithTemplateRequest $signature_request_edit_embedded_with_template_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['signatureRequestEditEmbeddedWithTemplate'] to see the possible values for this operation + * + * @return Request + * @throws InvalidArgumentException + * @deprecated Prefer to use ::signatureRequestEditEmbeddedWithTemplate. This method will eventually become unavailable + */ + public function signatureRequestEditEmbeddedWithTemplateRequest(string $signature_request_id, Model\SignatureRequestEditEmbeddedWithTemplateRequest $signature_request_edit_embedded_with_template_request, string $contentType = self::contentTypes['signatureRequestEditEmbeddedWithTemplate'][0]) + { + // verify the required parameter 'signature_request_id' is set + if ($signature_request_id === null || (is_array($signature_request_id) && count($signature_request_id) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $signature_request_id when calling signatureRequestEditEmbeddedWithTemplate' + ); + } + + // verify the required parameter 'signature_request_edit_embedded_with_template_request' is set + if ($signature_request_edit_embedded_with_template_request === null || (is_array($signature_request_edit_embedded_with_template_request) && count($signature_request_edit_embedded_with_template_request) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $signature_request_edit_embedded_with_template_request when calling signatureRequestEditEmbeddedWithTemplate' + ); + } + + $resourcePath = '/signature_request/edit_embedded_with_template/{signature_request_id}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + $formParams = ObjectSerializer::getFormParams( + $signature_request_edit_embedded_with_template_request + ); + + $multipart = !empty($formParams); + + // path params + if ($signature_request_id !== null) { + $resourcePath = str_replace( + '{signature_request_id}', + ObjectSerializer::toPathValue($signature_request_id), + $resourcePath + ); + } + + $headers = $this->headerSelector->selectHeaders( + $multipart ? ['multipart/form-data'] : ['application/json'], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) === 0) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + // if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($signature_request_edit_embedded_with_template_request)); + } else { + $httpBody = $signature_request_edit_embedded_with_template_request; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem, + ]; + } + } + // for HTTP post (form) + if (!empty($body)) { + $multipartContents[] = [ + 'name' => 'body', + 'contents' => $body, + 'headers' => ['Content-Type' => 'application/json'], + ]; + } + + if ($payloadHook = $this->config->getPayloadHook()) { + $payloadHook('multipart', $multipartContents, $signature_request_edit_embedded_with_template_request); + } + $httpBody = new MultipartStream($multipartContents); + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + // if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername())) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ':'); + } + // this endpoint requires Bearer (JWT) authentication (access token) + if (!empty($this->config->getAccessToken())) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'PUT', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation signatureRequestEditWithTemplate + * + * Edit Signature Request With Template + * + * @param string $signature_request_id The id of the SignatureRequest to edit. (required) + * @param Model\SignatureRequestEditWithTemplateRequest $signature_request_edit_with_template_request signature_request_edit_with_template_request (required) + * + * @return Model\SignatureRequestGetResponse + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + */ + public function signatureRequestEditWithTemplate(string $signature_request_id, Model\SignatureRequestEditWithTemplateRequest $signature_request_edit_with_template_request) + { + list($response) = $this->signatureRequestEditWithTemplateWithHttpInfo($signature_request_id, $signature_request_edit_with_template_request); + return $response; + } + + /** + * Operation signatureRequestEditWithTemplateWithHttpInfo + * + * Edit Signature Request With Template + * + * @param string $signature_request_id The id of the SignatureRequest to edit. (required) + * @param Model\SignatureRequestEditWithTemplateRequest $signature_request_edit_with_template_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['signatureRequestEditWithTemplate'] to see the possible values for this operation + * + * @return array of Model\SignatureRequestGetResponse, HTTP status code, HTTP response headers (array of strings) + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @deprecated Prefer to use ::signatureRequestEditWithTemplate. This method will eventually become unavailable + */ + public function signatureRequestEditWithTemplateWithHttpInfo(string $signature_request_id, Model\SignatureRequestEditWithTemplateRequest $signature_request_edit_with_template_request, string $contentType = self::contentTypes['signatureRequestEditWithTemplate'][0]) + { + $request = $this->signatureRequestEditWithTemplateRequest($signature_request_id, $signature_request_edit_with_template_request, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + $this->response = $response; + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int)$e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string)$e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int)$e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string)$request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string)$response->getBody() + ); + } + + $result = $this->handleRangeCodeResponse( + $response, + '4XX', + '\Dropbox\Sign\Model\ErrorResponse' + ); + if ($result) { + return $result; + } + + switch ($statusCode) { + case 200: + if ('\Dropbox\Sign\Model\SignatureRequestGetResponse' === '\SplFileObject') { + $content = $response->getBody(); // stream goes to serializer + } else { + $content = (string)$response->getBody(); + if ('\Dropbox\Sign\Model\SignatureRequestGetResponse' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\Dropbox\Sign\Model\SignatureRequestGetResponse', []), + $response->getStatusCode(), + $response->getHeaders(), + ]; + } + + $returnType = '\Dropbox\Sign\Model\SignatureRequestGetResponse'; + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); // stream goes to serializer + } else { + $content = (string)$response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders(), + ]; + } catch (ApiException $e) { + if ($this->handleRangeCodeException($e, '4XX', '\Dropbox\Sign\Model\ErrorResponse')) { + throw $e; + } + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Dropbox\Sign\Model\SignatureRequestGetResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation signatureRequestEditWithTemplateAsync + * + * Edit Signature Request With Template + * + * @param string $signature_request_id The id of the SignatureRequest to edit. (required) + * @param Model\SignatureRequestEditWithTemplateRequest $signature_request_edit_with_template_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['signatureRequestEditWithTemplate'] to see the possible values for this operation + * + * @return \GuzzleHttp\Promise\PromiseInterface + * @throws InvalidArgumentException + * @deprecated Prefer to use ::signatureRequestEditWithTemplate. This method will eventually become unavailable + */ + public function signatureRequestEditWithTemplateAsync(string $signature_request_id, Model\SignatureRequestEditWithTemplateRequest $signature_request_edit_with_template_request, string $contentType = self::contentTypes['signatureRequestEditWithTemplate'][0]) + { + return $this->signatureRequestEditWithTemplateAsyncWithHttpInfo($signature_request_id, $signature_request_edit_with_template_request, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation signatureRequestEditWithTemplateAsyncWithHttpInfo + * + * Edit Signature Request With Template + * + * @param string $signature_request_id The id of the SignatureRequest to edit. (required) + * @param Model\SignatureRequestEditWithTemplateRequest $signature_request_edit_with_template_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['signatureRequestEditWithTemplate'] to see the possible values for this operation + * + * @return \GuzzleHttp\Promise\PromiseInterface + * @throws InvalidArgumentException + * @deprecated Prefer to use ::signatureRequestEditWithTemplate. This method will eventually become unavailable + */ + public function signatureRequestEditWithTemplateAsyncWithHttpInfo(string $signature_request_id, Model\SignatureRequestEditWithTemplateRequest $signature_request_edit_with_template_request, string $contentType = self::contentTypes['signatureRequestEditWithTemplate'][0]) + { + $returnType = '\Dropbox\Sign\Model\SignatureRequestGetResponse'; + $request = $this->signatureRequestEditWithTemplateRequest($signature_request_id, $signature_request_edit_with_template_request, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); // stream goes to serializer + } else { + $content = (string)$response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders(), + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string)$response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'signatureRequestEditWithTemplate' + * + * @param string $signature_request_id The id of the SignatureRequest to edit. (required) + * @param Model\SignatureRequestEditWithTemplateRequest $signature_request_edit_with_template_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['signatureRequestEditWithTemplate'] to see the possible values for this operation + * + * @return Request + * @throws InvalidArgumentException + * @deprecated Prefer to use ::signatureRequestEditWithTemplate. This method will eventually become unavailable + */ + public function signatureRequestEditWithTemplateRequest(string $signature_request_id, Model\SignatureRequestEditWithTemplateRequest $signature_request_edit_with_template_request, string $contentType = self::contentTypes['signatureRequestEditWithTemplate'][0]) + { + // verify the required parameter 'signature_request_id' is set + if ($signature_request_id === null || (is_array($signature_request_id) && count($signature_request_id) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $signature_request_id when calling signatureRequestEditWithTemplate' + ); + } + + // verify the required parameter 'signature_request_edit_with_template_request' is set + if ($signature_request_edit_with_template_request === null || (is_array($signature_request_edit_with_template_request) && count($signature_request_edit_with_template_request) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $signature_request_edit_with_template_request when calling signatureRequestEditWithTemplate' + ); + } + + $resourcePath = '/signature_request/edit_with_template/{signature_request_id}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + $formParams = ObjectSerializer::getFormParams( + $signature_request_edit_with_template_request + ); + + $multipart = !empty($formParams); + + // path params + if ($signature_request_id !== null) { + $resourcePath = str_replace( + '{signature_request_id}', + ObjectSerializer::toPathValue($signature_request_id), + $resourcePath + ); + } + + $headers = $this->headerSelector->selectHeaders( + $multipart ? ['multipart/form-data'] : ['application/json'], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) === 0) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + // if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($signature_request_edit_with_template_request)); + } else { + $httpBody = $signature_request_edit_with_template_request; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem, + ]; + } + } + // for HTTP post (form) + if (!empty($body)) { + $multipartContents[] = [ + 'name' => 'body', + 'contents' => $body, + 'headers' => ['Content-Type' => 'application/json'], + ]; + } + + if ($payloadHook = $this->config->getPayloadHook()) { + $payloadHook('multipart', $multipartContents, $signature_request_edit_with_template_request); + } + $httpBody = new MultipartStream($multipartContents); + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + // if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername())) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ':'); + } + // this endpoint requires Bearer (JWT) authentication (access token) + if (!empty($this->config->getAccessToken())) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'PUT', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + /** * Operation signatureRequestFiles * diff --git a/sdks/php/src/Model/SignatureRequestEditEmbeddedRequest.php b/sdks/php/src/Model/SignatureRequestEditEmbeddedRequest.php new file mode 100644 index 000000000..fcc387bc3 --- /dev/null +++ b/sdks/php/src/Model/SignatureRequestEditEmbeddedRequest.php @@ -0,0 +1,1231 @@ + + */ +class SignatureRequestEditEmbeddedRequest implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'SignatureRequestEditEmbeddedRequest'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'client_id' => 'string', + 'files' => '\SplFileObject[]', + 'file_urls' => 'string[]', + 'signers' => '\Dropbox\Sign\Model\SubSignatureRequestSigner[]', + 'grouped_signers' => '\Dropbox\Sign\Model\SubSignatureRequestGroupedSigners[]', + 'allow_decline' => 'bool', + 'allow_reassign' => 'bool', + 'attachments' => '\Dropbox\Sign\Model\SubAttachment[]', + 'cc_email_addresses' => 'string[]', + 'custom_fields' => '\Dropbox\Sign\Model\SubCustomField[]', + 'field_options' => '\Dropbox\Sign\Model\SubFieldOptions', + 'form_field_groups' => '\Dropbox\Sign\Model\SubFormFieldGroup[]', + 'form_field_rules' => '\Dropbox\Sign\Model\SubFormFieldRule[]', + 'form_fields_per_document' => '\Dropbox\Sign\Model\SubFormFieldsPerDocumentBase[]', + 'hide_text_tags' => 'bool', + 'message' => 'string', + 'metadata' => 'array', + 'signing_options' => '\Dropbox\Sign\Model\SubSigningOptions', + 'subject' => 'string', + 'test_mode' => 'bool', + 'title' => 'string', + 'use_text_tags' => 'bool', + 'populate_auto_fill_fields' => 'bool', + 'expires_at' => 'int', + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'client_id' => null, + 'files' => 'binary', + 'file_urls' => null, + 'signers' => null, + 'grouped_signers' => null, + 'allow_decline' => null, + 'allow_reassign' => null, + 'attachments' => null, + 'cc_email_addresses' => 'email', + 'custom_fields' => null, + 'field_options' => null, + 'form_field_groups' => null, + 'form_field_rules' => null, + 'form_fields_per_document' => null, + 'hide_text_tags' => null, + 'message' => null, + 'metadata' => null, + 'signing_options' => null, + 'subject' => null, + 'test_mode' => null, + 'title' => null, + 'use_text_tags' => null, + 'populate_auto_fill_fields' => null, + 'expires_at' => null, + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var bool[] + */ + protected static array $openAPINullables = [ + 'client_id' => false, + 'files' => false, + 'file_urls' => false, + 'signers' => false, + 'grouped_signers' => false, + 'allow_decline' => false, + 'allow_reassign' => false, + 'attachments' => false, + 'cc_email_addresses' => false, + 'custom_fields' => false, + 'field_options' => false, + 'form_field_groups' => false, + 'form_field_rules' => false, + 'form_fields_per_document' => false, + 'hide_text_tags' => false, + 'message' => false, + 'metadata' => false, + 'signing_options' => false, + 'subject' => false, + 'test_mode' => false, + 'title' => false, + 'use_text_tags' => false, + 'populate_auto_fill_fields' => false, + 'expires_at' => true, + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var bool[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return bool[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param bool[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'client_id' => 'client_id', + 'files' => 'files', + 'file_urls' => 'file_urls', + 'signers' => 'signers', + 'grouped_signers' => 'grouped_signers', + 'allow_decline' => 'allow_decline', + 'allow_reassign' => 'allow_reassign', + 'attachments' => 'attachments', + 'cc_email_addresses' => 'cc_email_addresses', + 'custom_fields' => 'custom_fields', + 'field_options' => 'field_options', + 'form_field_groups' => 'form_field_groups', + 'form_field_rules' => 'form_field_rules', + 'form_fields_per_document' => 'form_fields_per_document', + 'hide_text_tags' => 'hide_text_tags', + 'message' => 'message', + 'metadata' => 'metadata', + 'signing_options' => 'signing_options', + 'subject' => 'subject', + 'test_mode' => 'test_mode', + 'title' => 'title', + 'use_text_tags' => 'use_text_tags', + 'populate_auto_fill_fields' => 'populate_auto_fill_fields', + 'expires_at' => 'expires_at', + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'client_id' => 'setClientId', + 'files' => 'setFiles', + 'file_urls' => 'setFileUrls', + 'signers' => 'setSigners', + 'grouped_signers' => 'setGroupedSigners', + 'allow_decline' => 'setAllowDecline', + 'allow_reassign' => 'setAllowReassign', + 'attachments' => 'setAttachments', + 'cc_email_addresses' => 'setCcEmailAddresses', + 'custom_fields' => 'setCustomFields', + 'field_options' => 'setFieldOptions', + 'form_field_groups' => 'setFormFieldGroups', + 'form_field_rules' => 'setFormFieldRules', + 'form_fields_per_document' => 'setFormFieldsPerDocument', + 'hide_text_tags' => 'setHideTextTags', + 'message' => 'setMessage', + 'metadata' => 'setMetadata', + 'signing_options' => 'setSigningOptions', + 'subject' => 'setSubject', + 'test_mode' => 'setTestMode', + 'title' => 'setTitle', + 'use_text_tags' => 'setUseTextTags', + 'populate_auto_fill_fields' => 'setPopulateAutoFillFields', + 'expires_at' => 'setExpiresAt', + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'client_id' => 'getClientId', + 'files' => 'getFiles', + 'file_urls' => 'getFileUrls', + 'signers' => 'getSigners', + 'grouped_signers' => 'getGroupedSigners', + 'allow_decline' => 'getAllowDecline', + 'allow_reassign' => 'getAllowReassign', + 'attachments' => 'getAttachments', + 'cc_email_addresses' => 'getCcEmailAddresses', + 'custom_fields' => 'getCustomFields', + 'field_options' => 'getFieldOptions', + 'form_field_groups' => 'getFormFieldGroups', + 'form_field_rules' => 'getFormFieldRules', + 'form_fields_per_document' => 'getFormFieldsPerDocument', + 'hide_text_tags' => 'getHideTextTags', + 'message' => 'getMessage', + 'metadata' => 'getMetadata', + 'signing_options' => 'getSigningOptions', + 'subject' => 'getSubject', + 'test_mode' => 'getTestMode', + 'title' => 'getTitle', + 'use_text_tags' => 'getUseTextTags', + 'populate_auto_fill_fields' => 'getPopulateAutoFillFields', + 'expires_at' => 'getExpiresAt', + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('client_id', $data ?? [], null); + $this->setIfExists('files', $data ?? [], null); + $this->setIfExists('file_urls', $data ?? [], null); + $this->setIfExists('signers', $data ?? [], null); + $this->setIfExists('grouped_signers', $data ?? [], null); + $this->setIfExists('allow_decline', $data ?? [], false); + $this->setIfExists('allow_reassign', $data ?? [], false); + $this->setIfExists('attachments', $data ?? [], null); + $this->setIfExists('cc_email_addresses', $data ?? [], null); + $this->setIfExists('custom_fields', $data ?? [], null); + $this->setIfExists('field_options', $data ?? [], null); + $this->setIfExists('form_field_groups', $data ?? [], null); + $this->setIfExists('form_field_rules', $data ?? [], null); + $this->setIfExists('form_fields_per_document', $data ?? [], null); + $this->setIfExists('hide_text_tags', $data ?? [], false); + $this->setIfExists('message', $data ?? [], null); + $this->setIfExists('metadata', $data ?? [], null); + $this->setIfExists('signing_options', $data ?? [], null); + $this->setIfExists('subject', $data ?? [], null); + $this->setIfExists('test_mode', $data ?? [], false); + $this->setIfExists('title', $data ?? [], null); + $this->setIfExists('use_text_tags', $data ?? [], false); + $this->setIfExists('populate_auto_fill_fields', $data ?? [], false); + $this->setIfExists('expires_at', $data ?? [], null); + } + + /** + * @deprecated use ::init() + */ + public static function fromArray(array $data): SignatureRequestEditEmbeddedRequest + { + return self::init($data); + } + + /** + * Attempt to instantiate and hydrate a new instance of this class + */ + public static function init(array $data): SignatureRequestEditEmbeddedRequest + { + /** @var SignatureRequestEditEmbeddedRequest */ + return ObjectSerializer::deserialize( + $data, + SignatureRequestEditEmbeddedRequest::class, + ); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string|int|object|array|mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['client_id'] === null) { + $invalidProperties[] = "'client_id' can't be null"; + } + if (!is_null($this->container['message']) && (mb_strlen($this->container['message']) > 5000)) { + $invalidProperties[] = "invalid value for 'message', the character length must be smaller than or equal to 5000."; + } + + if (!is_null($this->container['subject']) && (mb_strlen($this->container['subject']) > 255)) { + $invalidProperties[] = "invalid value for 'subject', the character length must be smaller than or equal to 255."; + } + + if (!is_null($this->container['title']) && (mb_strlen($this->container['title']) > 255)) { + $invalidProperties[] = "invalid value for 'title', the character length must be smaller than or equal to 255."; + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + /** + * Gets client_id + * + * @return string + */ + public function getClientId() + { + return $this->container['client_id']; + } + + /** + * Sets client_id + * + * @param string $client_id Client id of the app you're using to create this embedded signature request. Used for security purposes. + * + * @return self + */ + public function setClientId(string $client_id) + { + if (is_null($client_id)) { + throw new InvalidArgumentException('non-nullable client_id cannot be null'); + } + $this->container['client_id'] = $client_id; + + return $this; + } + + /** + * Gets files + * + * @return SplFileObject[]|null + */ + public function getFiles() + { + return $this->container['files']; + } + + /** + * Sets files + * + * @param SplFileObject[]|null $files Use `files[]` to indicate the uploaded file(s) to send for signature. This endpoint requires either **files** or **file_urls[]**, but not both. + * + * @return self + */ + public function setFiles(?array $files) + { + if (is_null($files)) { + throw new InvalidArgumentException('non-nullable files cannot be null'); + } + $this->container['files'] = $files; + + return $this; + } + + /** + * Gets file_urls + * + * @return string[]|null + */ + public function getFileUrls() + { + return $this->container['file_urls']; + } + + /** + * Sets file_urls + * + * @param string[]|null $file_urls Use `file_urls[]` to have Dropbox Sign download the file(s) to send for signature. This endpoint requires either **files** or **file_urls[]**, but not both. + * + * @return self + */ + public function setFileUrls(?array $file_urls) + { + if (is_null($file_urls)) { + throw new InvalidArgumentException('non-nullable file_urls cannot be null'); + } + $this->container['file_urls'] = $file_urls; + + return $this; + } + + /** + * Gets signers + * + * @return SubSignatureRequestSigner[]|null + */ + public function getSigners() + { + return $this->container['signers']; + } + + /** + * Sets signers + * + * @param SubSignatureRequestSigner[]|null $signers Add Signers to your Signature Request. This endpoint requires either **signers** or **grouped_signers**, but not both. + * + * @return self + */ + public function setSigners(?array $signers) + { + if (is_null($signers)) { + throw new InvalidArgumentException('non-nullable signers cannot be null'); + } + $this->container['signers'] = $signers; + + return $this; + } + + /** + * Gets grouped_signers + * + * @return SubSignatureRequestGroupedSigners[]|null + */ + public function getGroupedSigners() + { + return $this->container['grouped_signers']; + } + + /** + * Sets grouped_signers + * + * @param SubSignatureRequestGroupedSigners[]|null $grouped_signers Add Grouped Signers to your Signature Request. This endpoint requires either **signers** or **grouped_signers**, but not both. + * + * @return self + */ + public function setGroupedSigners(?array $grouped_signers) + { + if (is_null($grouped_signers)) { + throw new InvalidArgumentException('non-nullable grouped_signers cannot be null'); + } + $this->container['grouped_signers'] = $grouped_signers; + + return $this; + } + + /** + * Gets allow_decline + * + * @return bool|null + */ + public function getAllowDecline() + { + return $this->container['allow_decline']; + } + + /** + * Sets allow_decline + * + * @param bool|null $allow_decline Allows signers to decline to sign a document if `true`. Defaults to `false`. + * + * @return self + */ + public function setAllowDecline(?bool $allow_decline) + { + if (is_null($allow_decline)) { + throw new InvalidArgumentException('non-nullable allow_decline cannot be null'); + } + $this->container['allow_decline'] = $allow_decline; + + return $this; + } + + /** + * Gets allow_reassign + * + * @return bool|null + */ + public function getAllowReassign() + { + return $this->container['allow_reassign']; + } + + /** + * Sets allow_reassign + * + * @param bool|null $allow_reassign Allows signers to reassign their signature requests to other signers if set to `true`. Defaults to `false`. **NOTE:** Only available for Premium plan. + * + * @return self + */ + public function setAllowReassign(?bool $allow_reassign) + { + if (is_null($allow_reassign)) { + throw new InvalidArgumentException('non-nullable allow_reassign cannot be null'); + } + $this->container['allow_reassign'] = $allow_reassign; + + return $this; + } + + /** + * Gets attachments + * + * @return SubAttachment[]|null + */ + public function getAttachments() + { + return $this->container['attachments']; + } + + /** + * Sets attachments + * + * @param SubAttachment[]|null $attachments A list describing the attachments + * + * @return self + */ + public function setAttachments(?array $attachments) + { + if (is_null($attachments)) { + throw new InvalidArgumentException('non-nullable attachments cannot be null'); + } + $this->container['attachments'] = $attachments; + + return $this; + } + + /** + * Gets cc_email_addresses + * + * @return string[]|null + */ + public function getCcEmailAddresses() + { + return $this->container['cc_email_addresses']; + } + + /** + * Sets cc_email_addresses + * + * @param string[]|null $cc_email_addresses the email addresses that should be CCed + * + * @return self + */ + public function setCcEmailAddresses(?array $cc_email_addresses) + { + if (is_null($cc_email_addresses)) { + throw new InvalidArgumentException('non-nullable cc_email_addresses cannot be null'); + } + $this->container['cc_email_addresses'] = $cc_email_addresses; + + return $this; + } + + /** + * Gets custom_fields + * + * @return SubCustomField[]|null + */ + public function getCustomFields() + { + return $this->container['custom_fields']; + } + + /** + * Sets custom_fields + * + * @param SubCustomField[]|null $custom_fields When used together with merge fields, `custom_fields` allows users to add pre-filled data to their signature requests. Pre-filled data can be used with \"send-once\" signature requests by adding merge fields with `form_fields_per_document` or [Text Tags](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) while passing values back with `custom_fields` together in one API call. For using pre-filled on repeatable signature requests, merge fields are added to templates in the Dropbox Sign UI or by calling [/template/create_embedded_draft](/api/reference/operation/templateCreateEmbeddedDraft) and then passing `custom_fields` on subsequent signature requests referencing that template. + * + * @return self + */ + public function setCustomFields(?array $custom_fields) + { + if (is_null($custom_fields)) { + throw new InvalidArgumentException('non-nullable custom_fields cannot be null'); + } + $this->container['custom_fields'] = $custom_fields; + + return $this; + } + + /** + * Gets field_options + * + * @return SubFieldOptions|null + */ + public function getFieldOptions() + { + return $this->container['field_options']; + } + + /** + * Sets field_options + * + * @param SubFieldOptions|null $field_options field_options + * + * @return self + */ + public function setFieldOptions(?SubFieldOptions $field_options) + { + if (is_null($field_options)) { + throw new InvalidArgumentException('non-nullable field_options cannot be null'); + } + $this->container['field_options'] = $field_options; + + return $this; + } + + /** + * Gets form_field_groups + * + * @return SubFormFieldGroup[]|null + */ + public function getFormFieldGroups() + { + return $this->container['form_field_groups']; + } + + /** + * Sets form_field_groups + * + * @param SubFormFieldGroup[]|null $form_field_groups Group information for fields defined in `form_fields_per_document`. String-indexed JSON array with `group_label` and `requirement` keys. `form_fields_per_document` must contain fields referencing a group defined in `form_field_groups`. + * + * @return self + */ + public function setFormFieldGroups(?array $form_field_groups) + { + if (is_null($form_field_groups)) { + throw new InvalidArgumentException('non-nullable form_field_groups cannot be null'); + } + $this->container['form_field_groups'] = $form_field_groups; + + return $this; + } + + /** + * Gets form_field_rules + * + * @return SubFormFieldRule[]|null + */ + public function getFormFieldRules() + { + return $this->container['form_field_rules']; + } + + /** + * Sets form_field_rules + * + * @param SubFormFieldRule[]|null $form_field_rules conditional Logic rules for fields defined in `form_fields_per_document` + * + * @return self + */ + public function setFormFieldRules(?array $form_field_rules) + { + if (is_null($form_field_rules)) { + throw new InvalidArgumentException('non-nullable form_field_rules cannot be null'); + } + $this->container['form_field_rules'] = $form_field_rules; + + return $this; + } + + /** + * Gets form_fields_per_document + * + * @return SubFormFieldsPerDocumentBase[]|null + */ + public function getFormFieldsPerDocument() + { + return $this->container['form_fields_per_document']; + } + + /** + * Sets form_fields_per_document + * + * @param SubFormFieldsPerDocumentBase[]|null $form_fields_per_document The fields that should appear on the document, expressed as an array of objects. (For more details you can read about it here: [Using Form Fields per Document](/docs/openapi/form-fields-per-document).) **NOTE:** Fields like **text**, **dropdown**, **checkbox**, **radio**, and **hyperlink** have additional required and optional parameters. Check out the list of [additional parameters](/api/reference/constants/#form-fields-per-document) for these field types. * Text Field use `SubFormFieldsPerDocumentText` * Dropdown Field use `SubFormFieldsPerDocumentDropdown` * Hyperlink Field use `SubFormFieldsPerDocumentHyperlink` * Checkbox Field use `SubFormFieldsPerDocumentCheckbox` * Radio Field use `SubFormFieldsPerDocumentRadio` * Signature Field use `SubFormFieldsPerDocumentSignature` * Date Signed Field use `SubFormFieldsPerDocumentDateSigned` * Initials Field use `SubFormFieldsPerDocumentInitials` * Text Merge Field use `SubFormFieldsPerDocumentTextMerge` * Checkbox Merge Field use `SubFormFieldsPerDocumentCheckboxMerge` + * + * @return self + */ + public function setFormFieldsPerDocument(?array $form_fields_per_document) + { + if (is_null($form_fields_per_document)) { + throw new InvalidArgumentException('non-nullable form_fields_per_document cannot be null'); + } + $this->container['form_fields_per_document'] = $form_fields_per_document; + + return $this; + } + + /** + * Gets hide_text_tags + * + * @return bool|null + */ + public function getHideTextTags() + { + return $this->container['hide_text_tags']; + } + + /** + * Sets hide_text_tags + * + * @param bool|null $hide_text_tags Enables automatic Text Tag removal when set to true. **NOTE:** Removing text tags this way can cause unwanted clipping. We recommend leaving this setting on `false` and instead hiding your text tags using white text or a similar approach. See the [Text Tags Walkthrough](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) for more information. + * + * @return self + */ + public function setHideTextTags(?bool $hide_text_tags) + { + if (is_null($hide_text_tags)) { + throw new InvalidArgumentException('non-nullable hide_text_tags cannot be null'); + } + $this->container['hide_text_tags'] = $hide_text_tags; + + return $this; + } + + /** + * Gets message + * + * @return string|null + */ + public function getMessage() + { + return $this->container['message']; + } + + /** + * Sets message + * + * @param string|null $message the custom message in the email that will be sent to the signers + * + * @return self + */ + public function setMessage(?string $message) + { + if (is_null($message)) { + throw new InvalidArgumentException('non-nullable message cannot be null'); + } + if (mb_strlen($message) > 5000) { + throw new InvalidArgumentException('invalid length for $message when calling SignatureRequestEditEmbeddedRequest., must be smaller than or equal to 5000.'); + } + + $this->container['message'] = $message; + + return $this; + } + + /** + * Gets metadata + * + * @return array|null + */ + public function getMetadata() + { + return $this->container['metadata']; + } + + /** + * Sets metadata + * + * @param array|null $metadata Key-value data that should be attached to the signature request. This metadata is included in all API responses and events involving the signature request. For example, use the metadata field to store a signer's order number for look up when receiving events for the signature request. Each request can include up to 10 metadata keys (or 50 nested metadata keys), with key names up to 40 characters long and values up to 1000 characters long. + * + * @return self + */ + public function setMetadata(?array $metadata) + { + if (is_null($metadata)) { + throw new InvalidArgumentException('non-nullable metadata cannot be null'); + } + + $this->container['metadata'] = $metadata; + + return $this; + } + + /** + * Gets signing_options + * + * @return SubSigningOptions|null + */ + public function getSigningOptions() + { + return $this->container['signing_options']; + } + + /** + * Sets signing_options + * + * @param SubSigningOptions|null $signing_options signing_options + * + * @return self + */ + public function setSigningOptions(?SubSigningOptions $signing_options) + { + if (is_null($signing_options)) { + throw new InvalidArgumentException('non-nullable signing_options cannot be null'); + } + $this->container['signing_options'] = $signing_options; + + return $this; + } + + /** + * Gets subject + * + * @return string|null + */ + public function getSubject() + { + return $this->container['subject']; + } + + /** + * Sets subject + * + * @param string|null $subject the subject in the email that will be sent to the signers + * + * @return self + */ + public function setSubject(?string $subject) + { + if (is_null($subject)) { + throw new InvalidArgumentException('non-nullable subject cannot be null'); + } + if (mb_strlen($subject) > 255) { + throw new InvalidArgumentException('invalid length for $subject when calling SignatureRequestEditEmbeddedRequest., must be smaller than or equal to 255.'); + } + + $this->container['subject'] = $subject; + + return $this; + } + + /** + * Gets test_mode + * + * @return bool|null + */ + public function getTestMode() + { + return $this->container['test_mode']; + } + + /** + * Sets test_mode + * + * @param bool|null $test_mode Whether this is a test, the signature request will not be legally binding if set to `true`. Defaults to `false`. + * + * @return self + */ + public function setTestMode(?bool $test_mode) + { + if (is_null($test_mode)) { + throw new InvalidArgumentException('non-nullable test_mode cannot be null'); + } + $this->container['test_mode'] = $test_mode; + + return $this; + } + + /** + * Gets title + * + * @return string|null + */ + public function getTitle() + { + return $this->container['title']; + } + + /** + * Sets title + * + * @param string|null $title the title you want to assign to the SignatureRequest + * + * @return self + */ + public function setTitle(?string $title) + { + if (is_null($title)) { + throw new InvalidArgumentException('non-nullable title cannot be null'); + } + if (mb_strlen($title) > 255) { + throw new InvalidArgumentException('invalid length for $title when calling SignatureRequestEditEmbeddedRequest., must be smaller than or equal to 255.'); + } + + $this->container['title'] = $title; + + return $this; + } + + /** + * Gets use_text_tags + * + * @return bool|null + */ + public function getUseTextTags() + { + return $this->container['use_text_tags']; + } + + /** + * Sets use_text_tags + * + * @param bool|null $use_text_tags Send with a value of `true` if you wish to enable [Text Tags](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) parsing in your document. Defaults to disabled, or `false`. + * + * @return self + */ + public function setUseTextTags(?bool $use_text_tags) + { + if (is_null($use_text_tags)) { + throw new InvalidArgumentException('non-nullable use_text_tags cannot be null'); + } + $this->container['use_text_tags'] = $use_text_tags; + + return $this; + } + + /** + * Gets populate_auto_fill_fields + * + * @return bool|null + */ + public function getPopulateAutoFillFields() + { + return $this->container['populate_auto_fill_fields']; + } + + /** + * Sets populate_auto_fill_fields + * + * @param bool|null $populate_auto_fill_fields 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. + * + * @return self + */ + public function setPopulateAutoFillFields(?bool $populate_auto_fill_fields) + { + if (is_null($populate_auto_fill_fields)) { + throw new InvalidArgumentException('non-nullable populate_auto_fill_fields cannot be null'); + } + $this->container['populate_auto_fill_fields'] = $populate_auto_fill_fields; + + return $this; + } + + /** + * Gets expires_at + * + * @return int|null + */ + public function getExpiresAt() + { + return $this->container['expires_at']; + } + + /** + * Sets expires_at + * + * @param int|null $expires_at When the signature request will expire. Unsigned signatures will be moved to the expired status, and no longer signable. See [Signature Request Expiration Date](https://developers.hellosign.com/docs/signature-request/expiration/) for details. + * + * @return self + */ + public function setExpiresAt(?int $expires_at) + { + if (is_null($expires_at)) { + array_push($this->openAPINullablesSetToNull, 'expires_at'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('expires_at', $nullablesSetToNull); + if ($index !== false) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['expires_at'] = $expires_at; + + return $this; + } + + /** + * Returns true if offset exists. False otherwise. + * + * @param int $offset Offset + */ + #[ReturnTypeWillChange] + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param int $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + */ + #[ReturnTypeWillChange] + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param int $offset Offset + */ + #[ReturnTypeWillChange] + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @see https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource + */ + #[ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_UNESCAPED_SLASHES + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} diff --git a/sdks/php/src/Model/SignatureRequestEditEmbeddedWithTemplateRequest.php b/sdks/php/src/Model/SignatureRequestEditEmbeddedWithTemplateRequest.php new file mode 100644 index 000000000..07d174a7a --- /dev/null +++ b/sdks/php/src/Model/SignatureRequestEditEmbeddedWithTemplateRequest.php @@ -0,0 +1,924 @@ + + */ +class SignatureRequestEditEmbeddedWithTemplateRequest implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'SignatureRequestEditEmbeddedWithTemplateRequest'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'template_ids' => 'string[]', + 'client_id' => 'string', + 'signers' => '\Dropbox\Sign\Model\SubSignatureRequestTemplateSigner[]', + 'allow_decline' => 'bool', + 'ccs' => '\Dropbox\Sign\Model\SubCC[]', + 'custom_fields' => '\Dropbox\Sign\Model\SubCustomField[]', + 'files' => '\SplFileObject[]', + 'file_urls' => 'string[]', + 'message' => 'string', + 'metadata' => 'array', + 'signing_options' => '\Dropbox\Sign\Model\SubSigningOptions', + 'subject' => 'string', + 'test_mode' => 'bool', + 'title' => 'string', + 'populate_auto_fill_fields' => 'bool', + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'template_ids' => null, + 'client_id' => null, + 'signers' => null, + 'allow_decline' => null, + 'ccs' => null, + 'custom_fields' => null, + 'files' => 'binary', + 'file_urls' => null, + 'message' => null, + 'metadata' => null, + 'signing_options' => null, + 'subject' => null, + 'test_mode' => null, + 'title' => null, + 'populate_auto_fill_fields' => null, + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var bool[] + */ + protected static array $openAPINullables = [ + 'template_ids' => false, + 'client_id' => false, + 'signers' => false, + 'allow_decline' => false, + 'ccs' => false, + 'custom_fields' => false, + 'files' => false, + 'file_urls' => false, + 'message' => false, + 'metadata' => false, + 'signing_options' => false, + 'subject' => false, + 'test_mode' => false, + 'title' => false, + 'populate_auto_fill_fields' => false, + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var bool[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return bool[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param bool[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'template_ids' => 'template_ids', + 'client_id' => 'client_id', + 'signers' => 'signers', + 'allow_decline' => 'allow_decline', + 'ccs' => 'ccs', + 'custom_fields' => 'custom_fields', + 'files' => 'files', + 'file_urls' => 'file_urls', + 'message' => 'message', + 'metadata' => 'metadata', + 'signing_options' => 'signing_options', + 'subject' => 'subject', + 'test_mode' => 'test_mode', + 'title' => 'title', + 'populate_auto_fill_fields' => 'populate_auto_fill_fields', + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'template_ids' => 'setTemplateIds', + 'client_id' => 'setClientId', + 'signers' => 'setSigners', + 'allow_decline' => 'setAllowDecline', + 'ccs' => 'setCcs', + 'custom_fields' => 'setCustomFields', + 'files' => 'setFiles', + 'file_urls' => 'setFileUrls', + 'message' => 'setMessage', + 'metadata' => 'setMetadata', + 'signing_options' => 'setSigningOptions', + 'subject' => 'setSubject', + 'test_mode' => 'setTestMode', + 'title' => 'setTitle', + 'populate_auto_fill_fields' => 'setPopulateAutoFillFields', + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'template_ids' => 'getTemplateIds', + 'client_id' => 'getClientId', + 'signers' => 'getSigners', + 'allow_decline' => 'getAllowDecline', + 'ccs' => 'getCcs', + 'custom_fields' => 'getCustomFields', + 'files' => 'getFiles', + 'file_urls' => 'getFileUrls', + 'message' => 'getMessage', + 'metadata' => 'getMetadata', + 'signing_options' => 'getSigningOptions', + 'subject' => 'getSubject', + 'test_mode' => 'getTestMode', + 'title' => 'getTitle', + 'populate_auto_fill_fields' => 'getPopulateAutoFillFields', + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('template_ids', $data ?? [], null); + $this->setIfExists('client_id', $data ?? [], null); + $this->setIfExists('signers', $data ?? [], null); + $this->setIfExists('allow_decline', $data ?? [], false); + $this->setIfExists('ccs', $data ?? [], null); + $this->setIfExists('custom_fields', $data ?? [], null); + $this->setIfExists('files', $data ?? [], null); + $this->setIfExists('file_urls', $data ?? [], null); + $this->setIfExists('message', $data ?? [], null); + $this->setIfExists('metadata', $data ?? [], null); + $this->setIfExists('signing_options', $data ?? [], null); + $this->setIfExists('subject', $data ?? [], null); + $this->setIfExists('test_mode', $data ?? [], false); + $this->setIfExists('title', $data ?? [], null); + $this->setIfExists('populate_auto_fill_fields', $data ?? [], false); + } + + /** + * @deprecated use ::init() + */ + public static function fromArray(array $data): SignatureRequestEditEmbeddedWithTemplateRequest + { + return self::init($data); + } + + /** + * Attempt to instantiate and hydrate a new instance of this class + */ + public static function init(array $data): SignatureRequestEditEmbeddedWithTemplateRequest + { + /** @var SignatureRequestEditEmbeddedWithTemplateRequest */ + return ObjectSerializer::deserialize( + $data, + SignatureRequestEditEmbeddedWithTemplateRequest::class, + ); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string|int|object|array|mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['template_ids'] === null) { + $invalidProperties[] = "'template_ids' can't be null"; + } + if ($this->container['client_id'] === null) { + $invalidProperties[] = "'client_id' can't be null"; + } + if ($this->container['signers'] === null) { + $invalidProperties[] = "'signers' can't be null"; + } + if (!is_null($this->container['message']) && (mb_strlen($this->container['message']) > 5000)) { + $invalidProperties[] = "invalid value for 'message', the character length must be smaller than or equal to 5000."; + } + + if (!is_null($this->container['subject']) && (mb_strlen($this->container['subject']) > 255)) { + $invalidProperties[] = "invalid value for 'subject', the character length must be smaller than or equal to 255."; + } + + if (!is_null($this->container['title']) && (mb_strlen($this->container['title']) > 255)) { + $invalidProperties[] = "invalid value for 'title', the character length must be smaller than or equal to 255."; + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + /** + * Gets template_ids + * + * @return string[] + */ + public function getTemplateIds() + { + return $this->container['template_ids']; + } + + /** + * Sets template_ids + * + * @param string[] $template_ids use `template_ids` to create a SignatureRequest from one or more templates, in the order in which the template will be used + * + * @return self + */ + public function setTemplateIds(array $template_ids) + { + if (is_null($template_ids)) { + throw new InvalidArgumentException('non-nullable template_ids cannot be null'); + } + $this->container['template_ids'] = $template_ids; + + return $this; + } + + /** + * Gets client_id + * + * @return string + */ + public function getClientId() + { + return $this->container['client_id']; + } + + /** + * Sets client_id + * + * @param string $client_id Client id of the app you're using to create this embedded signature request. Used for security purposes. + * + * @return self + */ + public function setClientId(string $client_id) + { + if (is_null($client_id)) { + throw new InvalidArgumentException('non-nullable client_id cannot be null'); + } + $this->container['client_id'] = $client_id; + + return $this; + } + + /** + * Gets signers + * + * @return SubSignatureRequestTemplateSigner[] + */ + public function getSigners() + { + return $this->container['signers']; + } + + /** + * Sets signers + * + * @param SubSignatureRequestTemplateSigner[] $signers add Signers to your Templated-based Signature Request + * + * @return self + */ + public function setSigners(array $signers) + { + if (is_null($signers)) { + throw new InvalidArgumentException('non-nullable signers cannot be null'); + } + $this->container['signers'] = $signers; + + return $this; + } + + /** + * Gets allow_decline + * + * @return bool|null + */ + public function getAllowDecline() + { + return $this->container['allow_decline']; + } + + /** + * Sets allow_decline + * + * @param bool|null $allow_decline Allows signers to decline to sign a document if `true`. Defaults to `false`. + * + * @return self + */ + public function setAllowDecline(?bool $allow_decline) + { + if (is_null($allow_decline)) { + throw new InvalidArgumentException('non-nullable allow_decline cannot be null'); + } + $this->container['allow_decline'] = $allow_decline; + + return $this; + } + + /** + * Gets ccs + * + * @return SubCC[]|null + */ + public function getCcs() + { + return $this->container['ccs']; + } + + /** + * Sets ccs + * + * @param SubCC[]|null $ccs Add CC email recipients. Required when a CC role exists for the Template. + * + * @return self + */ + public function setCcs(?array $ccs) + { + if (is_null($ccs)) { + throw new InvalidArgumentException('non-nullable ccs cannot be null'); + } + $this->container['ccs'] = $ccs; + + return $this; + } + + /** + * Gets custom_fields + * + * @return SubCustomField[]|null + */ + public function getCustomFields() + { + return $this->container['custom_fields']; + } + + /** + * Sets custom_fields + * + * @param SubCustomField[]|null $custom_fields An array defining values and options for custom fields. Required when a custom field exists in the Template. + * + * @return self + */ + public function setCustomFields(?array $custom_fields) + { + if (is_null($custom_fields)) { + throw new InvalidArgumentException('non-nullable custom_fields cannot be null'); + } + $this->container['custom_fields'] = $custom_fields; + + return $this; + } + + /** + * Gets files + * + * @return SplFileObject[]|null + */ + public function getFiles() + { + return $this->container['files']; + } + + /** + * Sets files + * + * @param SplFileObject[]|null $files Use `files[]` to indicate the uploaded file(s) to send for signature. This endpoint requires either **files** or **file_urls[]**, but not both. + * + * @return self + */ + public function setFiles(?array $files) + { + if (is_null($files)) { + throw new InvalidArgumentException('non-nullable files cannot be null'); + } + $this->container['files'] = $files; + + return $this; + } + + /** + * Gets file_urls + * + * @return string[]|null + */ + public function getFileUrls() + { + return $this->container['file_urls']; + } + + /** + * Sets file_urls + * + * @param string[]|null $file_urls Use `file_urls[]` to have Dropbox Sign download the file(s) to send for signature. This endpoint requires either **files** or **file_urls[]**, but not both. + * + * @return self + */ + public function setFileUrls(?array $file_urls) + { + if (is_null($file_urls)) { + throw new InvalidArgumentException('non-nullable file_urls cannot be null'); + } + $this->container['file_urls'] = $file_urls; + + return $this; + } + + /** + * Gets message + * + * @return string|null + */ + public function getMessage() + { + return $this->container['message']; + } + + /** + * Sets message + * + * @param string|null $message the custom message in the email that will be sent to the signers + * + * @return self + */ + public function setMessage(?string $message) + { + if (is_null($message)) { + throw new InvalidArgumentException('non-nullable message cannot be null'); + } + if (mb_strlen($message) > 5000) { + throw new InvalidArgumentException('invalid length for $message when calling SignatureRequestEditEmbeddedWithTemplateRequest., must be smaller than or equal to 5000.'); + } + + $this->container['message'] = $message; + + return $this; + } + + /** + * Gets metadata + * + * @return array|null + */ + public function getMetadata() + { + return $this->container['metadata']; + } + + /** + * Sets metadata + * + * @param array|null $metadata Key-value data that should be attached to the signature request. This metadata is included in all API responses and events involving the signature request. For example, use the metadata field to store a signer's order number for look up when receiving events for the signature request. Each request can include up to 10 metadata keys (or 50 nested metadata keys), with key names up to 40 characters long and values up to 1000 characters long. + * + * @return self + */ + public function setMetadata(?array $metadata) + { + if (is_null($metadata)) { + throw new InvalidArgumentException('non-nullable metadata cannot be null'); + } + + $this->container['metadata'] = $metadata; + + return $this; + } + + /** + * Gets signing_options + * + * @return SubSigningOptions|null + */ + public function getSigningOptions() + { + return $this->container['signing_options']; + } + + /** + * Sets signing_options + * + * @param SubSigningOptions|null $signing_options signing_options + * + * @return self + */ + public function setSigningOptions(?SubSigningOptions $signing_options) + { + if (is_null($signing_options)) { + throw new InvalidArgumentException('non-nullable signing_options cannot be null'); + } + $this->container['signing_options'] = $signing_options; + + return $this; + } + + /** + * Gets subject + * + * @return string|null + */ + public function getSubject() + { + return $this->container['subject']; + } + + /** + * Sets subject + * + * @param string|null $subject the subject in the email that will be sent to the signers + * + * @return self + */ + public function setSubject(?string $subject) + { + if (is_null($subject)) { + throw new InvalidArgumentException('non-nullable subject cannot be null'); + } + if (mb_strlen($subject) > 255) { + throw new InvalidArgumentException('invalid length for $subject when calling SignatureRequestEditEmbeddedWithTemplateRequest., must be smaller than or equal to 255.'); + } + + $this->container['subject'] = $subject; + + return $this; + } + + /** + * Gets test_mode + * + * @return bool|null + */ + public function getTestMode() + { + return $this->container['test_mode']; + } + + /** + * Sets test_mode + * + * @param bool|null $test_mode Whether this is a test, the signature request will not be legally binding if set to `true`. Defaults to `false`. + * + * @return self + */ + public function setTestMode(?bool $test_mode) + { + if (is_null($test_mode)) { + throw new InvalidArgumentException('non-nullable test_mode cannot be null'); + } + $this->container['test_mode'] = $test_mode; + + return $this; + } + + /** + * Gets title + * + * @return string|null + */ + public function getTitle() + { + return $this->container['title']; + } + + /** + * Sets title + * + * @param string|null $title the title you want to assign to the SignatureRequest + * + * @return self + */ + public function setTitle(?string $title) + { + if (is_null($title)) { + throw new InvalidArgumentException('non-nullable title cannot be null'); + } + if (mb_strlen($title) > 255) { + throw new InvalidArgumentException('invalid length for $title when calling SignatureRequestEditEmbeddedWithTemplateRequest., must be smaller than or equal to 255.'); + } + + $this->container['title'] = $title; + + return $this; + } + + /** + * Gets populate_auto_fill_fields + * + * @return bool|null + */ + public function getPopulateAutoFillFields() + { + return $this->container['populate_auto_fill_fields']; + } + + /** + * Sets populate_auto_fill_fields + * + * @param bool|null $populate_auto_fill_fields 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. + * + * @return self + */ + public function setPopulateAutoFillFields(?bool $populate_auto_fill_fields) + { + if (is_null($populate_auto_fill_fields)) { + throw new InvalidArgumentException('non-nullable populate_auto_fill_fields cannot be null'); + } + $this->container['populate_auto_fill_fields'] = $populate_auto_fill_fields; + + return $this; + } + + /** + * Returns true if offset exists. False otherwise. + * + * @param int $offset Offset + */ + #[ReturnTypeWillChange] + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param int $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + */ + #[ReturnTypeWillChange] + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param int $offset Offset + */ + #[ReturnTypeWillChange] + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @see https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource + */ + #[ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_UNESCAPED_SLASHES + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} diff --git a/sdks/php/src/Model/SignatureRequestEditRequest.php b/sdks/php/src/Model/SignatureRequestEditRequest.php new file mode 100644 index 000000000..bc1be125a --- /dev/null +++ b/sdks/php/src/Model/SignatureRequestEditRequest.php @@ -0,0 +1,1262 @@ + + */ +class SignatureRequestEditRequest implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'SignatureRequestEditRequest'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'files' => '\SplFileObject[]', + 'file_urls' => 'string[]', + 'signers' => '\Dropbox\Sign\Model\SubSignatureRequestSigner[]', + 'grouped_signers' => '\Dropbox\Sign\Model\SubSignatureRequestGroupedSigners[]', + 'allow_decline' => 'bool', + 'allow_reassign' => 'bool', + 'attachments' => '\Dropbox\Sign\Model\SubAttachment[]', + 'cc_email_addresses' => 'string[]', + 'client_id' => 'string', + 'custom_fields' => '\Dropbox\Sign\Model\SubCustomField[]', + 'field_options' => '\Dropbox\Sign\Model\SubFieldOptions', + 'form_field_groups' => '\Dropbox\Sign\Model\SubFormFieldGroup[]', + 'form_field_rules' => '\Dropbox\Sign\Model\SubFormFieldRule[]', + 'form_fields_per_document' => '\Dropbox\Sign\Model\SubFormFieldsPerDocumentBase[]', + 'hide_text_tags' => 'bool', + 'is_eid' => 'bool', + 'message' => 'string', + 'metadata' => 'array', + 'signing_options' => '\Dropbox\Sign\Model\SubSigningOptions', + 'signing_redirect_url' => 'string', + 'subject' => 'string', + 'test_mode' => 'bool', + 'title' => 'string', + 'use_text_tags' => 'bool', + 'expires_at' => 'int', + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'files' => 'binary', + 'file_urls' => null, + 'signers' => null, + 'grouped_signers' => null, + 'allow_decline' => null, + 'allow_reassign' => null, + 'attachments' => null, + 'cc_email_addresses' => 'email', + 'client_id' => null, + 'custom_fields' => null, + 'field_options' => null, + 'form_field_groups' => null, + 'form_field_rules' => null, + 'form_fields_per_document' => null, + 'hide_text_tags' => null, + 'is_eid' => null, + 'message' => null, + 'metadata' => null, + 'signing_options' => null, + 'signing_redirect_url' => null, + 'subject' => null, + 'test_mode' => null, + 'title' => null, + 'use_text_tags' => null, + 'expires_at' => null, + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var bool[] + */ + protected static array $openAPINullables = [ + 'files' => false, + 'file_urls' => false, + 'signers' => false, + 'grouped_signers' => false, + 'allow_decline' => false, + 'allow_reassign' => false, + 'attachments' => false, + 'cc_email_addresses' => false, + 'client_id' => false, + 'custom_fields' => false, + 'field_options' => false, + 'form_field_groups' => false, + 'form_field_rules' => false, + 'form_fields_per_document' => false, + 'hide_text_tags' => false, + 'is_eid' => false, + 'message' => false, + 'metadata' => false, + 'signing_options' => false, + 'signing_redirect_url' => false, + 'subject' => false, + 'test_mode' => false, + 'title' => false, + 'use_text_tags' => false, + 'expires_at' => true, + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var bool[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return bool[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param bool[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'files' => 'files', + 'file_urls' => 'file_urls', + 'signers' => 'signers', + 'grouped_signers' => 'grouped_signers', + 'allow_decline' => 'allow_decline', + 'allow_reassign' => 'allow_reassign', + 'attachments' => 'attachments', + 'cc_email_addresses' => 'cc_email_addresses', + 'client_id' => 'client_id', + 'custom_fields' => 'custom_fields', + 'field_options' => 'field_options', + 'form_field_groups' => 'form_field_groups', + 'form_field_rules' => 'form_field_rules', + 'form_fields_per_document' => 'form_fields_per_document', + 'hide_text_tags' => 'hide_text_tags', + 'is_eid' => 'is_eid', + 'message' => 'message', + 'metadata' => 'metadata', + 'signing_options' => 'signing_options', + 'signing_redirect_url' => 'signing_redirect_url', + 'subject' => 'subject', + 'test_mode' => 'test_mode', + 'title' => 'title', + 'use_text_tags' => 'use_text_tags', + 'expires_at' => 'expires_at', + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'files' => 'setFiles', + 'file_urls' => 'setFileUrls', + 'signers' => 'setSigners', + 'grouped_signers' => 'setGroupedSigners', + 'allow_decline' => 'setAllowDecline', + 'allow_reassign' => 'setAllowReassign', + 'attachments' => 'setAttachments', + 'cc_email_addresses' => 'setCcEmailAddresses', + 'client_id' => 'setClientId', + 'custom_fields' => 'setCustomFields', + 'field_options' => 'setFieldOptions', + 'form_field_groups' => 'setFormFieldGroups', + 'form_field_rules' => 'setFormFieldRules', + 'form_fields_per_document' => 'setFormFieldsPerDocument', + 'hide_text_tags' => 'setHideTextTags', + 'is_eid' => 'setIsEid', + 'message' => 'setMessage', + 'metadata' => 'setMetadata', + 'signing_options' => 'setSigningOptions', + 'signing_redirect_url' => 'setSigningRedirectUrl', + 'subject' => 'setSubject', + 'test_mode' => 'setTestMode', + 'title' => 'setTitle', + 'use_text_tags' => 'setUseTextTags', + 'expires_at' => 'setExpiresAt', + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'files' => 'getFiles', + 'file_urls' => 'getFileUrls', + 'signers' => 'getSigners', + 'grouped_signers' => 'getGroupedSigners', + 'allow_decline' => 'getAllowDecline', + 'allow_reassign' => 'getAllowReassign', + 'attachments' => 'getAttachments', + 'cc_email_addresses' => 'getCcEmailAddresses', + 'client_id' => 'getClientId', + 'custom_fields' => 'getCustomFields', + 'field_options' => 'getFieldOptions', + 'form_field_groups' => 'getFormFieldGroups', + 'form_field_rules' => 'getFormFieldRules', + 'form_fields_per_document' => 'getFormFieldsPerDocument', + 'hide_text_tags' => 'getHideTextTags', + 'is_eid' => 'getIsEid', + 'message' => 'getMessage', + 'metadata' => 'getMetadata', + 'signing_options' => 'getSigningOptions', + 'signing_redirect_url' => 'getSigningRedirectUrl', + 'subject' => 'getSubject', + 'test_mode' => 'getTestMode', + 'title' => 'getTitle', + 'use_text_tags' => 'getUseTextTags', + 'expires_at' => 'getExpiresAt', + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('files', $data ?? [], null); + $this->setIfExists('file_urls', $data ?? [], null); + $this->setIfExists('signers', $data ?? [], null); + $this->setIfExists('grouped_signers', $data ?? [], null); + $this->setIfExists('allow_decline', $data ?? [], false); + $this->setIfExists('allow_reassign', $data ?? [], false); + $this->setIfExists('attachments', $data ?? [], null); + $this->setIfExists('cc_email_addresses', $data ?? [], null); + $this->setIfExists('client_id', $data ?? [], null); + $this->setIfExists('custom_fields', $data ?? [], null); + $this->setIfExists('field_options', $data ?? [], null); + $this->setIfExists('form_field_groups', $data ?? [], null); + $this->setIfExists('form_field_rules', $data ?? [], null); + $this->setIfExists('form_fields_per_document', $data ?? [], null); + $this->setIfExists('hide_text_tags', $data ?? [], false); + $this->setIfExists('is_eid', $data ?? [], false); + $this->setIfExists('message', $data ?? [], null); + $this->setIfExists('metadata', $data ?? [], null); + $this->setIfExists('signing_options', $data ?? [], null); + $this->setIfExists('signing_redirect_url', $data ?? [], null); + $this->setIfExists('subject', $data ?? [], null); + $this->setIfExists('test_mode', $data ?? [], false); + $this->setIfExists('title', $data ?? [], null); + $this->setIfExists('use_text_tags', $data ?? [], false); + $this->setIfExists('expires_at', $data ?? [], null); + } + + /** + * @deprecated use ::init() + */ + public static function fromArray(array $data): SignatureRequestEditRequest + { + return self::init($data); + } + + /** + * Attempt to instantiate and hydrate a new instance of this class + */ + public static function init(array $data): SignatureRequestEditRequest + { + /** @var SignatureRequestEditRequest */ + return ObjectSerializer::deserialize( + $data, + SignatureRequestEditRequest::class, + ); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string|int|object|array|mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if (!is_null($this->container['message']) && (mb_strlen($this->container['message']) > 5000)) { + $invalidProperties[] = "invalid value for 'message', the character length must be smaller than or equal to 5000."; + } + + if (!is_null($this->container['subject']) && (mb_strlen($this->container['subject']) > 255)) { + $invalidProperties[] = "invalid value for 'subject', the character length must be smaller than or equal to 255."; + } + + if (!is_null($this->container['title']) && (mb_strlen($this->container['title']) > 255)) { + $invalidProperties[] = "invalid value for 'title', the character length must be smaller than or equal to 255."; + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + /** + * Gets files + * + * @return SplFileObject[]|null + */ + public function getFiles() + { + return $this->container['files']; + } + + /** + * Sets files + * + * @param SplFileObject[]|null $files Use `files[]` to indicate the uploaded file(s) to send for signature. This endpoint requires either **files** or **file_urls[]**, but not both. + * + * @return self + */ + public function setFiles(?array $files) + { + if (is_null($files)) { + throw new InvalidArgumentException('non-nullable files cannot be null'); + } + $this->container['files'] = $files; + + return $this; + } + + /** + * Gets file_urls + * + * @return string[]|null + */ + public function getFileUrls() + { + return $this->container['file_urls']; + } + + /** + * Sets file_urls + * + * @param string[]|null $file_urls Use `file_urls[]` to have Dropbox Sign download the file(s) to send for signature. This endpoint requires either **files** or **file_urls[]**, but not both. + * + * @return self + */ + public function setFileUrls(?array $file_urls) + { + if (is_null($file_urls)) { + throw new InvalidArgumentException('non-nullable file_urls cannot be null'); + } + $this->container['file_urls'] = $file_urls; + + return $this; + } + + /** + * Gets signers + * + * @return SubSignatureRequestSigner[]|null + */ + public function getSigners() + { + return $this->container['signers']; + } + + /** + * Sets signers + * + * @param SubSignatureRequestSigner[]|null $signers Add Signers to your Signature Request. This endpoint requires either **signers** or **grouped_signers**, but not both. + * + * @return self + */ + public function setSigners(?array $signers) + { + if (is_null($signers)) { + throw new InvalidArgumentException('non-nullable signers cannot be null'); + } + $this->container['signers'] = $signers; + + return $this; + } + + /** + * Gets grouped_signers + * + * @return SubSignatureRequestGroupedSigners[]|null + */ + public function getGroupedSigners() + { + return $this->container['grouped_signers']; + } + + /** + * Sets grouped_signers + * + * @param SubSignatureRequestGroupedSigners[]|null $grouped_signers Add Grouped Signers to your Signature Request. This endpoint requires either **signers** or **grouped_signers**, but not both. + * + * @return self + */ + public function setGroupedSigners(?array $grouped_signers) + { + if (is_null($grouped_signers)) { + throw new InvalidArgumentException('non-nullable grouped_signers cannot be null'); + } + $this->container['grouped_signers'] = $grouped_signers; + + return $this; + } + + /** + * Gets allow_decline + * + * @return bool|null + */ + public function getAllowDecline() + { + return $this->container['allow_decline']; + } + + /** + * Sets allow_decline + * + * @param bool|null $allow_decline Allows signers to decline to sign a document if `true`. Defaults to `false`. + * + * @return self + */ + public function setAllowDecline(?bool $allow_decline) + { + if (is_null($allow_decline)) { + throw new InvalidArgumentException('non-nullable allow_decline cannot be null'); + } + $this->container['allow_decline'] = $allow_decline; + + return $this; + } + + /** + * Gets allow_reassign + * + * @return bool|null + */ + public function getAllowReassign() + { + return $this->container['allow_reassign']; + } + + /** + * Sets allow_reassign + * + * @param bool|null $allow_reassign Allows signers to reassign their signature requests to other signers if set to `true`. Defaults to `false`. **NOTE:** Only available for Premium plan and higher. + * + * @return self + */ + public function setAllowReassign(?bool $allow_reassign) + { + if (is_null($allow_reassign)) { + throw new InvalidArgumentException('non-nullable allow_reassign cannot be null'); + } + $this->container['allow_reassign'] = $allow_reassign; + + return $this; + } + + /** + * Gets attachments + * + * @return SubAttachment[]|null + */ + public function getAttachments() + { + return $this->container['attachments']; + } + + /** + * Sets attachments + * + * @param SubAttachment[]|null $attachments A list describing the attachments + * + * @return self + */ + public function setAttachments(?array $attachments) + { + if (is_null($attachments)) { + throw new InvalidArgumentException('non-nullable attachments cannot be null'); + } + $this->container['attachments'] = $attachments; + + return $this; + } + + /** + * Gets cc_email_addresses + * + * @return string[]|null + */ + public function getCcEmailAddresses() + { + return $this->container['cc_email_addresses']; + } + + /** + * Sets cc_email_addresses + * + * @param string[]|null $cc_email_addresses the email addresses that should be CCed + * + * @return self + */ + public function setCcEmailAddresses(?array $cc_email_addresses) + { + if (is_null($cc_email_addresses)) { + throw new InvalidArgumentException('non-nullable cc_email_addresses cannot be null'); + } + $this->container['cc_email_addresses'] = $cc_email_addresses; + + return $this; + } + + /** + * Gets client_id + * + * @return string|null + */ + public function getClientId() + { + return $this->container['client_id']; + } + + /** + * Sets client_id + * + * @param string|null $client_id The client id of the API App you want to associate with this request. Used to apply the branding and callback url defined for the app. + * + * @return self + */ + public function setClientId(?string $client_id) + { + if (is_null($client_id)) { + throw new InvalidArgumentException('non-nullable client_id cannot be null'); + } + $this->container['client_id'] = $client_id; + + return $this; + } + + /** + * Gets custom_fields + * + * @return SubCustomField[]|null + */ + public function getCustomFields() + { + return $this->container['custom_fields']; + } + + /** + * Sets custom_fields + * + * @param SubCustomField[]|null $custom_fields When used together with merge fields, `custom_fields` allows users to add pre-filled data to their signature requests. Pre-filled data can be used with \"send-once\" signature requests by adding merge fields with `form_fields_per_document` or [Text Tags](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) while passing values back with `custom_fields` together in one API call. For using pre-filled on repeatable signature requests, merge fields are added to templates in the Dropbox Sign UI or by calling [/template/create_embedded_draft](/api/reference/operation/templateCreateEmbeddedDraft) and then passing `custom_fields` on subsequent signature requests referencing that template. + * + * @return self + */ + public function setCustomFields(?array $custom_fields) + { + if (is_null($custom_fields)) { + throw new InvalidArgumentException('non-nullable custom_fields cannot be null'); + } + $this->container['custom_fields'] = $custom_fields; + + return $this; + } + + /** + * Gets field_options + * + * @return SubFieldOptions|null + */ + public function getFieldOptions() + { + return $this->container['field_options']; + } + + /** + * Sets field_options + * + * @param SubFieldOptions|null $field_options field_options + * + * @return self + */ + public function setFieldOptions(?SubFieldOptions $field_options) + { + if (is_null($field_options)) { + throw new InvalidArgumentException('non-nullable field_options cannot be null'); + } + $this->container['field_options'] = $field_options; + + return $this; + } + + /** + * Gets form_field_groups + * + * @return SubFormFieldGroup[]|null + */ + public function getFormFieldGroups() + { + return $this->container['form_field_groups']; + } + + /** + * Sets form_field_groups + * + * @param SubFormFieldGroup[]|null $form_field_groups Group information for fields defined in `form_fields_per_document`. String-indexed JSON array with `group_label` and `requirement` keys. `form_fields_per_document` must contain fields referencing a group defined in `form_field_groups`. + * + * @return self + */ + public function setFormFieldGroups(?array $form_field_groups) + { + if (is_null($form_field_groups)) { + throw new InvalidArgumentException('non-nullable form_field_groups cannot be null'); + } + $this->container['form_field_groups'] = $form_field_groups; + + return $this; + } + + /** + * Gets form_field_rules + * + * @return SubFormFieldRule[]|null + */ + public function getFormFieldRules() + { + return $this->container['form_field_rules']; + } + + /** + * Sets form_field_rules + * + * @param SubFormFieldRule[]|null $form_field_rules conditional Logic rules for fields defined in `form_fields_per_document` + * + * @return self + */ + public function setFormFieldRules(?array $form_field_rules) + { + if (is_null($form_field_rules)) { + throw new InvalidArgumentException('non-nullable form_field_rules cannot be null'); + } + $this->container['form_field_rules'] = $form_field_rules; + + return $this; + } + + /** + * Gets form_fields_per_document + * + * @return SubFormFieldsPerDocumentBase[]|null + */ + public function getFormFieldsPerDocument() + { + return $this->container['form_fields_per_document']; + } + + /** + * Sets form_fields_per_document + * + * @param SubFormFieldsPerDocumentBase[]|null $form_fields_per_document The fields that should appear on the document, expressed as an array of objects. (For more details you can read about it here: [Using Form Fields per Document](/docs/openapi/form-fields-per-document).) **NOTE:** Fields like **text**, **dropdown**, **checkbox**, **radio**, and **hyperlink** have additional required and optional parameters. Check out the list of [additional parameters](/api/reference/constants/#form-fields-per-document) for these field types. * Text Field use `SubFormFieldsPerDocumentText` * Dropdown Field use `SubFormFieldsPerDocumentDropdown` * Hyperlink Field use `SubFormFieldsPerDocumentHyperlink` * Checkbox Field use `SubFormFieldsPerDocumentCheckbox` * Radio Field use `SubFormFieldsPerDocumentRadio` * Signature Field use `SubFormFieldsPerDocumentSignature` * Date Signed Field use `SubFormFieldsPerDocumentDateSigned` * Initials Field use `SubFormFieldsPerDocumentInitials` * Text Merge Field use `SubFormFieldsPerDocumentTextMerge` * Checkbox Merge Field use `SubFormFieldsPerDocumentCheckboxMerge` + * + * @return self + */ + public function setFormFieldsPerDocument(?array $form_fields_per_document) + { + if (is_null($form_fields_per_document)) { + throw new InvalidArgumentException('non-nullable form_fields_per_document cannot be null'); + } + $this->container['form_fields_per_document'] = $form_fields_per_document; + + return $this; + } + + /** + * Gets hide_text_tags + * + * @return bool|null + */ + public function getHideTextTags() + { + return $this->container['hide_text_tags']; + } + + /** + * Sets hide_text_tags + * + * @param bool|null $hide_text_tags Enables automatic Text Tag removal when set to true. **NOTE:** Removing text tags this way can cause unwanted clipping. We recommend leaving this setting on `false` and instead hiding your text tags using white text or a similar approach. See the [Text Tags Walkthrough](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) for more information. + * + * @return self + */ + public function setHideTextTags(?bool $hide_text_tags) + { + if (is_null($hide_text_tags)) { + throw new InvalidArgumentException('non-nullable hide_text_tags cannot be null'); + } + $this->container['hide_text_tags'] = $hide_text_tags; + + return $this; + } + + /** + * Gets is_eid + * + * @return bool|null + */ + public function getIsEid() + { + return $this->container['is_eid']; + } + + /** + * Sets is_eid + * + * @param bool|null $is_eid Send with a value of `true` if you wish to enable [electronic identification (eID)](https://www.hellosign.com/features/electronic-id), which requires the signer to verify their identity with an eID provider to sign a document.
**NOTE:** eID is only available on the Premium API plan. Cannot be used in `test_mode`. Only works on requests with one signer. + * + * @return self + */ + public function setIsEid(?bool $is_eid) + { + if (is_null($is_eid)) { + throw new InvalidArgumentException('non-nullable is_eid cannot be null'); + } + $this->container['is_eid'] = $is_eid; + + return $this; + } + + /** + * Gets message + * + * @return string|null + */ + public function getMessage() + { + return $this->container['message']; + } + + /** + * Sets message + * + * @param string|null $message the custom message in the email that will be sent to the signers + * + * @return self + */ + public function setMessage(?string $message) + { + if (is_null($message)) { + throw new InvalidArgumentException('non-nullable message cannot be null'); + } + if (mb_strlen($message) > 5000) { + throw new InvalidArgumentException('invalid length for $message when calling SignatureRequestEditRequest., must be smaller than or equal to 5000.'); + } + + $this->container['message'] = $message; + + return $this; + } + + /** + * Gets metadata + * + * @return array|null + */ + public function getMetadata() + { + return $this->container['metadata']; + } + + /** + * Sets metadata + * + * @param array|null $metadata Key-value data that should be attached to the signature request. This metadata is included in all API responses and events involving the signature request. For example, use the metadata field to store a signer's order number for look up when receiving events for the signature request. Each request can include up to 10 metadata keys (or 50 nested metadata keys), with key names up to 40 characters long and values up to 1000 characters long. + * + * @return self + */ + public function setMetadata(?array $metadata) + { + if (is_null($metadata)) { + throw new InvalidArgumentException('non-nullable metadata cannot be null'); + } + + $this->container['metadata'] = $metadata; + + return $this; + } + + /** + * Gets signing_options + * + * @return SubSigningOptions|null + */ + public function getSigningOptions() + { + return $this->container['signing_options']; + } + + /** + * Sets signing_options + * + * @param SubSigningOptions|null $signing_options signing_options + * + * @return self + */ + public function setSigningOptions(?SubSigningOptions $signing_options) + { + if (is_null($signing_options)) { + throw new InvalidArgumentException('non-nullable signing_options cannot be null'); + } + $this->container['signing_options'] = $signing_options; + + return $this; + } + + /** + * Gets signing_redirect_url + * + * @return string|null + */ + public function getSigningRedirectUrl() + { + return $this->container['signing_redirect_url']; + } + + /** + * Sets signing_redirect_url + * + * @param string|null $signing_redirect_url the URL you want signers redirected to after they successfully sign + * + * @return self + */ + public function setSigningRedirectUrl(?string $signing_redirect_url) + { + if (is_null($signing_redirect_url)) { + throw new InvalidArgumentException('non-nullable signing_redirect_url cannot be null'); + } + $this->container['signing_redirect_url'] = $signing_redirect_url; + + return $this; + } + + /** + * Gets subject + * + * @return string|null + */ + public function getSubject() + { + return $this->container['subject']; + } + + /** + * Sets subject + * + * @param string|null $subject the subject in the email that will be sent to the signers + * + * @return self + */ + public function setSubject(?string $subject) + { + if (is_null($subject)) { + throw new InvalidArgumentException('non-nullable subject cannot be null'); + } + if (mb_strlen($subject) > 255) { + throw new InvalidArgumentException('invalid length for $subject when calling SignatureRequestEditRequest., must be smaller than or equal to 255.'); + } + + $this->container['subject'] = $subject; + + return $this; + } + + /** + * Gets test_mode + * + * @return bool|null + */ + public function getTestMode() + { + return $this->container['test_mode']; + } + + /** + * Sets test_mode + * + * @param bool|null $test_mode Whether this is a test, the signature request will not be legally binding if set to `true`. Defaults to `false`. + * + * @return self + */ + public function setTestMode(?bool $test_mode) + { + if (is_null($test_mode)) { + throw new InvalidArgumentException('non-nullable test_mode cannot be null'); + } + $this->container['test_mode'] = $test_mode; + + return $this; + } + + /** + * Gets title + * + * @return string|null + */ + public function getTitle() + { + return $this->container['title']; + } + + /** + * Sets title + * + * @param string|null $title the title you want to assign to the SignatureRequest + * + * @return self + */ + public function setTitle(?string $title) + { + if (is_null($title)) { + throw new InvalidArgumentException('non-nullable title cannot be null'); + } + if (mb_strlen($title) > 255) { + throw new InvalidArgumentException('invalid length for $title when calling SignatureRequestEditRequest., must be smaller than or equal to 255.'); + } + + $this->container['title'] = $title; + + return $this; + } + + /** + * Gets use_text_tags + * + * @return bool|null + */ + public function getUseTextTags() + { + return $this->container['use_text_tags']; + } + + /** + * Sets use_text_tags + * + * @param bool|null $use_text_tags Send with a value of `true` if you wish to enable [Text Tags](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) parsing in your document. Defaults to disabled, or `false`. + * + * @return self + */ + public function setUseTextTags(?bool $use_text_tags) + { + if (is_null($use_text_tags)) { + throw new InvalidArgumentException('non-nullable use_text_tags cannot be null'); + } + $this->container['use_text_tags'] = $use_text_tags; + + return $this; + } + + /** + * Gets expires_at + * + * @return int|null + */ + public function getExpiresAt() + { + return $this->container['expires_at']; + } + + /** + * Sets expires_at + * + * @param int|null $expires_at When the signature request will expire. Unsigned signatures will be moved to the expired status, and no longer signable. See [Signature Request Expiration Date](https://developers.hellosign.com/docs/signature-request/expiration/) for details. + * + * @return self + */ + public function setExpiresAt(?int $expires_at) + { + if (is_null($expires_at)) { + array_push($this->openAPINullablesSetToNull, 'expires_at'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('expires_at', $nullablesSetToNull); + if ($index !== false) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['expires_at'] = $expires_at; + + return $this; + } + + /** + * Returns true if offset exists. False otherwise. + * + * @param int $offset Offset + */ + #[ReturnTypeWillChange] + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param int $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + */ + #[ReturnTypeWillChange] + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param int $offset Offset + */ + #[ReturnTypeWillChange] + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @see https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource + */ + #[ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_UNESCAPED_SLASHES + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} diff --git a/sdks/php/src/Model/SignatureRequestEditWithTemplateRequest.php b/sdks/php/src/Model/SignatureRequestEditWithTemplateRequest.php new file mode 100644 index 000000000..cda7360db --- /dev/null +++ b/sdks/php/src/Model/SignatureRequestEditWithTemplateRequest.php @@ -0,0 +1,956 @@ + + */ +class SignatureRequestEditWithTemplateRequest implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'SignatureRequestEditWithTemplateRequest'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'template_ids' => 'string[]', + 'signers' => '\Dropbox\Sign\Model\SubSignatureRequestTemplateSigner[]', + 'allow_decline' => 'bool', + 'ccs' => '\Dropbox\Sign\Model\SubCC[]', + 'client_id' => 'string', + 'custom_fields' => '\Dropbox\Sign\Model\SubCustomField[]', + 'files' => '\SplFileObject[]', + 'file_urls' => 'string[]', + 'is_eid' => 'bool', + 'message' => 'string', + 'metadata' => 'array', + 'signing_options' => '\Dropbox\Sign\Model\SubSigningOptions', + 'signing_redirect_url' => 'string', + 'subject' => 'string', + 'test_mode' => 'bool', + 'title' => 'string', + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'template_ids' => null, + 'signers' => null, + 'allow_decline' => null, + 'ccs' => null, + 'client_id' => null, + 'custom_fields' => null, + 'files' => 'binary', + 'file_urls' => null, + 'is_eid' => null, + 'message' => null, + 'metadata' => null, + 'signing_options' => null, + 'signing_redirect_url' => null, + 'subject' => null, + 'test_mode' => null, + 'title' => null, + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var bool[] + */ + protected static array $openAPINullables = [ + 'template_ids' => false, + 'signers' => false, + 'allow_decline' => false, + 'ccs' => false, + 'client_id' => false, + 'custom_fields' => false, + 'files' => false, + 'file_urls' => false, + 'is_eid' => false, + 'message' => false, + 'metadata' => false, + 'signing_options' => false, + 'signing_redirect_url' => false, + 'subject' => false, + 'test_mode' => false, + 'title' => false, + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var bool[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return bool[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param bool[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'template_ids' => 'template_ids', + 'signers' => 'signers', + 'allow_decline' => 'allow_decline', + 'ccs' => 'ccs', + 'client_id' => 'client_id', + 'custom_fields' => 'custom_fields', + 'files' => 'files', + 'file_urls' => 'file_urls', + 'is_eid' => 'is_eid', + 'message' => 'message', + 'metadata' => 'metadata', + 'signing_options' => 'signing_options', + 'signing_redirect_url' => 'signing_redirect_url', + 'subject' => 'subject', + 'test_mode' => 'test_mode', + 'title' => 'title', + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'template_ids' => 'setTemplateIds', + 'signers' => 'setSigners', + 'allow_decline' => 'setAllowDecline', + 'ccs' => 'setCcs', + 'client_id' => 'setClientId', + 'custom_fields' => 'setCustomFields', + 'files' => 'setFiles', + 'file_urls' => 'setFileUrls', + 'is_eid' => 'setIsEid', + 'message' => 'setMessage', + 'metadata' => 'setMetadata', + 'signing_options' => 'setSigningOptions', + 'signing_redirect_url' => 'setSigningRedirectUrl', + 'subject' => 'setSubject', + 'test_mode' => 'setTestMode', + 'title' => 'setTitle', + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'template_ids' => 'getTemplateIds', + 'signers' => 'getSigners', + 'allow_decline' => 'getAllowDecline', + 'ccs' => 'getCcs', + 'client_id' => 'getClientId', + 'custom_fields' => 'getCustomFields', + 'files' => 'getFiles', + 'file_urls' => 'getFileUrls', + 'is_eid' => 'getIsEid', + 'message' => 'getMessage', + 'metadata' => 'getMetadata', + 'signing_options' => 'getSigningOptions', + 'signing_redirect_url' => 'getSigningRedirectUrl', + 'subject' => 'getSubject', + 'test_mode' => 'getTestMode', + 'title' => 'getTitle', + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('template_ids', $data ?? [], null); + $this->setIfExists('signers', $data ?? [], null); + $this->setIfExists('allow_decline', $data ?? [], false); + $this->setIfExists('ccs', $data ?? [], null); + $this->setIfExists('client_id', $data ?? [], null); + $this->setIfExists('custom_fields', $data ?? [], null); + $this->setIfExists('files', $data ?? [], null); + $this->setIfExists('file_urls', $data ?? [], null); + $this->setIfExists('is_eid', $data ?? [], false); + $this->setIfExists('message', $data ?? [], null); + $this->setIfExists('metadata', $data ?? [], null); + $this->setIfExists('signing_options', $data ?? [], null); + $this->setIfExists('signing_redirect_url', $data ?? [], null); + $this->setIfExists('subject', $data ?? [], null); + $this->setIfExists('test_mode', $data ?? [], false); + $this->setIfExists('title', $data ?? [], null); + } + + /** + * @deprecated use ::init() + */ + public static function fromArray(array $data): SignatureRequestEditWithTemplateRequest + { + return self::init($data); + } + + /** + * Attempt to instantiate and hydrate a new instance of this class + */ + public static function init(array $data): SignatureRequestEditWithTemplateRequest + { + /** @var SignatureRequestEditWithTemplateRequest */ + return ObjectSerializer::deserialize( + $data, + SignatureRequestEditWithTemplateRequest::class, + ); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string|int|object|array|mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['template_ids'] === null) { + $invalidProperties[] = "'template_ids' can't be null"; + } + if ($this->container['signers'] === null) { + $invalidProperties[] = "'signers' can't be null"; + } + if (!is_null($this->container['message']) && (mb_strlen($this->container['message']) > 5000)) { + $invalidProperties[] = "invalid value for 'message', the character length must be smaller than or equal to 5000."; + } + + if (!is_null($this->container['subject']) && (mb_strlen($this->container['subject']) > 255)) { + $invalidProperties[] = "invalid value for 'subject', the character length must be smaller than or equal to 255."; + } + + if (!is_null($this->container['title']) && (mb_strlen($this->container['title']) > 255)) { + $invalidProperties[] = "invalid value for 'title', the character length must be smaller than or equal to 255."; + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + /** + * Gets template_ids + * + * @return string[] + */ + public function getTemplateIds() + { + return $this->container['template_ids']; + } + + /** + * Sets template_ids + * + * @param string[] $template_ids use `template_ids` to create a SignatureRequest from one or more templates, in the order in which the template will be used + * + * @return self + */ + public function setTemplateIds(array $template_ids) + { + if (is_null($template_ids)) { + throw new InvalidArgumentException('non-nullable template_ids cannot be null'); + } + $this->container['template_ids'] = $template_ids; + + return $this; + } + + /** + * Gets signers + * + * @return SubSignatureRequestTemplateSigner[] + */ + public function getSigners() + { + return $this->container['signers']; + } + + /** + * Sets signers + * + * @param SubSignatureRequestTemplateSigner[] $signers add Signers to your Templated-based Signature Request + * + * @return self + */ + public function setSigners(array $signers) + { + if (is_null($signers)) { + throw new InvalidArgumentException('non-nullable signers cannot be null'); + } + $this->container['signers'] = $signers; + + return $this; + } + + /** + * Gets allow_decline + * + * @return bool|null + */ + public function getAllowDecline() + { + return $this->container['allow_decline']; + } + + /** + * Sets allow_decline + * + * @param bool|null $allow_decline Allows signers to decline to sign a document if `true`. Defaults to `false`. + * + * @return self + */ + public function setAllowDecline(?bool $allow_decline) + { + if (is_null($allow_decline)) { + throw new InvalidArgumentException('non-nullable allow_decline cannot be null'); + } + $this->container['allow_decline'] = $allow_decline; + + return $this; + } + + /** + * Gets ccs + * + * @return SubCC[]|null + */ + public function getCcs() + { + return $this->container['ccs']; + } + + /** + * Sets ccs + * + * @param SubCC[]|null $ccs Add CC email recipients. Required when a CC role exists for the Template. + * + * @return self + */ + public function setCcs(?array $ccs) + { + if (is_null($ccs)) { + throw new InvalidArgumentException('non-nullable ccs cannot be null'); + } + $this->container['ccs'] = $ccs; + + return $this; + } + + /** + * Gets client_id + * + * @return string|null + */ + public function getClientId() + { + return $this->container['client_id']; + } + + /** + * Sets client_id + * + * @param string|null $client_id Client id of the app to associate with the signature request. Used to apply the branding and callback url defined for the app. + * + * @return self + */ + public function setClientId(?string $client_id) + { + if (is_null($client_id)) { + throw new InvalidArgumentException('non-nullable client_id cannot be null'); + } + $this->container['client_id'] = $client_id; + + return $this; + } + + /** + * Gets custom_fields + * + * @return SubCustomField[]|null + */ + public function getCustomFields() + { + return $this->container['custom_fields']; + } + + /** + * Sets custom_fields + * + * @param SubCustomField[]|null $custom_fields An array defining values and options for custom fields. Required when a custom field exists in the Template. + * + * @return self + */ + public function setCustomFields(?array $custom_fields) + { + if (is_null($custom_fields)) { + throw new InvalidArgumentException('non-nullable custom_fields cannot be null'); + } + $this->container['custom_fields'] = $custom_fields; + + return $this; + } + + /** + * Gets files + * + * @return SplFileObject[]|null + */ + public function getFiles() + { + return $this->container['files']; + } + + /** + * Sets files + * + * @param SplFileObject[]|null $files Use `files[]` to indicate the uploaded file(s) to send for signature. This endpoint requires either **files** or **file_urls[]**, but not both. + * + * @return self + */ + public function setFiles(?array $files) + { + if (is_null($files)) { + throw new InvalidArgumentException('non-nullable files cannot be null'); + } + $this->container['files'] = $files; + + return $this; + } + + /** + * Gets file_urls + * + * @return string[]|null + */ + public function getFileUrls() + { + return $this->container['file_urls']; + } + + /** + * Sets file_urls + * + * @param string[]|null $file_urls Use `file_urls[]` to have Dropbox Sign download the file(s) to send for signature. This endpoint requires either **files** or **file_urls[]**, but not both. + * + * @return self + */ + public function setFileUrls(?array $file_urls) + { + if (is_null($file_urls)) { + throw new InvalidArgumentException('non-nullable file_urls cannot be null'); + } + $this->container['file_urls'] = $file_urls; + + return $this; + } + + /** + * Gets is_eid + * + * @return bool|null + */ + public function getIsEid() + { + return $this->container['is_eid']; + } + + /** + * Sets is_eid + * + * @param bool|null $is_eid Send with a value of `true` if you wish to enable [electronic identification (eID)](https://www.hellosign.com/features/electronic-id), which requires the signer to verify their identity with an eID provider to sign a document.
**NOTE:** eID is only available on the Premium API plan. Cannot be used in `test_mode`. Only works on requests with one signer. + * + * @return self + */ + public function setIsEid(?bool $is_eid) + { + if (is_null($is_eid)) { + throw new InvalidArgumentException('non-nullable is_eid cannot be null'); + } + $this->container['is_eid'] = $is_eid; + + return $this; + } + + /** + * Gets message + * + * @return string|null + */ + public function getMessage() + { + return $this->container['message']; + } + + /** + * Sets message + * + * @param string|null $message the custom message in the email that will be sent to the signers + * + * @return self + */ + public function setMessage(?string $message) + { + if (is_null($message)) { + throw new InvalidArgumentException('non-nullable message cannot be null'); + } + if (mb_strlen($message) > 5000) { + throw new InvalidArgumentException('invalid length for $message when calling SignatureRequestEditWithTemplateRequest., must be smaller than or equal to 5000.'); + } + + $this->container['message'] = $message; + + return $this; + } + + /** + * Gets metadata + * + * @return array|null + */ + public function getMetadata() + { + return $this->container['metadata']; + } + + /** + * Sets metadata + * + * @param array|null $metadata Key-value data that should be attached to the signature request. This metadata is included in all API responses and events involving the signature request. For example, use the metadata field to store a signer's order number for look up when receiving events for the signature request. Each request can include up to 10 metadata keys (or 50 nested metadata keys), with key names up to 40 characters long and values up to 1000 characters long. + * + * @return self + */ + public function setMetadata(?array $metadata) + { + if (is_null($metadata)) { + throw new InvalidArgumentException('non-nullable metadata cannot be null'); + } + + $this->container['metadata'] = $metadata; + + return $this; + } + + /** + * Gets signing_options + * + * @return SubSigningOptions|null + */ + public function getSigningOptions() + { + return $this->container['signing_options']; + } + + /** + * Sets signing_options + * + * @param SubSigningOptions|null $signing_options signing_options + * + * @return self + */ + public function setSigningOptions(?SubSigningOptions $signing_options) + { + if (is_null($signing_options)) { + throw new InvalidArgumentException('non-nullable signing_options cannot be null'); + } + $this->container['signing_options'] = $signing_options; + + return $this; + } + + /** + * Gets signing_redirect_url + * + * @return string|null + */ + public function getSigningRedirectUrl() + { + return $this->container['signing_redirect_url']; + } + + /** + * Sets signing_redirect_url + * + * @param string|null $signing_redirect_url the URL you want signers redirected to after they successfully sign + * + * @return self + */ + public function setSigningRedirectUrl(?string $signing_redirect_url) + { + if (is_null($signing_redirect_url)) { + throw new InvalidArgumentException('non-nullable signing_redirect_url cannot be null'); + } + $this->container['signing_redirect_url'] = $signing_redirect_url; + + return $this; + } + + /** + * Gets subject + * + * @return string|null + */ + public function getSubject() + { + return $this->container['subject']; + } + + /** + * Sets subject + * + * @param string|null $subject the subject in the email that will be sent to the signers + * + * @return self + */ + public function setSubject(?string $subject) + { + if (is_null($subject)) { + throw new InvalidArgumentException('non-nullable subject cannot be null'); + } + if (mb_strlen($subject) > 255) { + throw new InvalidArgumentException('invalid length for $subject when calling SignatureRequestEditWithTemplateRequest., must be smaller than or equal to 255.'); + } + + $this->container['subject'] = $subject; + + return $this; + } + + /** + * Gets test_mode + * + * @return bool|null + */ + public function getTestMode() + { + return $this->container['test_mode']; + } + + /** + * Sets test_mode + * + * @param bool|null $test_mode Whether this is a test, the signature request will not be legally binding if set to `true`. Defaults to `false`. + * + * @return self + */ + public function setTestMode(?bool $test_mode) + { + if (is_null($test_mode)) { + throw new InvalidArgumentException('non-nullable test_mode cannot be null'); + } + $this->container['test_mode'] = $test_mode; + + return $this; + } + + /** + * Gets title + * + * @return string|null + */ + public function getTitle() + { + return $this->container['title']; + } + + /** + * Sets title + * + * @param string|null $title the title you want to assign to the SignatureRequest + * + * @return self + */ + public function setTitle(?string $title) + { + if (is_null($title)) { + throw new InvalidArgumentException('non-nullable title cannot be null'); + } + if (mb_strlen($title) > 255) { + throw new InvalidArgumentException('invalid length for $title when calling SignatureRequestEditWithTemplateRequest., must be smaller than or equal to 255.'); + } + + $this->container['title'] = $title; + + return $this; + } + + /** + * Returns true if offset exists. False otherwise. + * + * @param int $offset Offset + */ + #[ReturnTypeWillChange] + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param int $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + */ + #[ReturnTypeWillChange] + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param int $offset Offset + */ + #[ReturnTypeWillChange] + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @see https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource + */ + #[ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_UNESCAPED_SLASHES + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} diff --git a/sdks/python/README.md b/sdks/python/README.md index c74588445..574b1bc36 100644 --- a/sdks/python/README.md +++ b/sdks/python/README.md @@ -135,6 +135,10 @@ Class | Method | HTTP request | Description ```SignatureRequestApi``` | [```signature_request_cancel```](docs/SignatureRequestApi.md#signature_request_cancel) | ```POST /signature_request/cancel/{signature_request_id}``` | Cancel Incomplete Signature Request| ```SignatureRequestApi``` | [```signature_request_create_embedded```](docs/SignatureRequestApi.md#signature_request_create_embedded) | ```POST /signature_request/create_embedded``` | Create Embedded Signature Request| ```SignatureRequestApi``` | [```signature_request_create_embedded_with_template```](docs/SignatureRequestApi.md#signature_request_create_embedded_with_template) | ```POST /signature_request/create_embedded_with_template``` | Create Embedded Signature Request with Template| +```SignatureRequestApi``` | [```signature_request_edit```](docs/SignatureRequestApi.md#signature_request_edit) | ```PUT /signature_request/edit/{signature_request_id}``` | Edit Signature Request| +```SignatureRequestApi``` | [```signature_request_edit_embedded```](docs/SignatureRequestApi.md#signature_request_edit_embedded) | ```PUT /signature_request/edit_embedded/{signature_request_id}``` | Edit Embedded Signature Request| +```SignatureRequestApi``` | [```signature_request_edit_embedded_with_template```](docs/SignatureRequestApi.md#signature_request_edit_embedded_with_template) | ```PUT /signature_request/edit_embedded_with_template/{signature_request_id}``` | Edit Embedded Signature Request with Template| +```SignatureRequestApi``` | [```signature_request_edit_with_template```](docs/SignatureRequestApi.md#signature_request_edit_with_template) | ```PUT /signature_request/edit_with_template/{signature_request_id}``` | Edit Signature Request With Template| ```SignatureRequestApi``` | [```signature_request_files```](docs/SignatureRequestApi.md#signature_request_files) | ```GET /signature_request/files/{signature_request_id}``` | Download Files| ```SignatureRequestApi``` | [```signature_request_files_as_data_uri```](docs/SignatureRequestApi.md#signature_request_files_as_data_uri) | ```GET /signature_request/files_as_data_uri/{signature_request_id}``` | Download Files as Data Uri| ```SignatureRequestApi``` | [```signature_request_files_as_file_url```](docs/SignatureRequestApi.md#signature_request_files_as_file_url) | ```GET /signature_request/files_as_file_url/{signature_request_id}``` | Download Files as File Url| @@ -238,6 +242,10 @@ Class | Method | HTTP request | Description - [SignatureRequestBulkSendWithTemplateRequest](docs/SignatureRequestBulkSendWithTemplateRequest.md) - [SignatureRequestCreateEmbeddedRequest](docs/SignatureRequestCreateEmbeddedRequest.md) - [SignatureRequestCreateEmbeddedWithTemplateRequest](docs/SignatureRequestCreateEmbeddedWithTemplateRequest.md) + - [SignatureRequestEditEmbeddedRequest](docs/SignatureRequestEditEmbeddedRequest.md) + - [SignatureRequestEditEmbeddedWithTemplateRequest](docs/SignatureRequestEditEmbeddedWithTemplateRequest.md) + - [SignatureRequestEditRequest](docs/SignatureRequestEditRequest.md) + - [SignatureRequestEditWithTemplateRequest](docs/SignatureRequestEditWithTemplateRequest.md) - [SignatureRequestGetResponse](docs/SignatureRequestGetResponse.md) - [SignatureRequestListResponse](docs/SignatureRequestListResponse.md) - [SignatureRequestRemindRequest](docs/SignatureRequestRemindRequest.md) diff --git a/sdks/python/docs/SignatureRequestApi.md b/sdks/python/docs/SignatureRequestApi.md index 2db45f1a5..1141fb8ee 100644 --- a/sdks/python/docs/SignatureRequestApi.md +++ b/sdks/python/docs/SignatureRequestApi.md @@ -9,6 +9,10 @@ Method | HTTP request | Description |[```signature_request_cancel```](SignatureRequestApi.md#signature_request_cancel) | ```POST /signature_request/cancel/{signature_request_id}``` | Cancel Incomplete Signature Request| |[```signature_request_create_embedded```](SignatureRequestApi.md#signature_request_create_embedded) | ```POST /signature_request/create_embedded``` | Create Embedded Signature Request| |[```signature_request_create_embedded_with_template```](SignatureRequestApi.md#signature_request_create_embedded_with_template) | ```POST /signature_request/create_embedded_with_template``` | Create Embedded Signature Request with Template| +|[```signature_request_edit```](SignatureRequestApi.md#signature_request_edit) | ```PUT /signature_request/edit/{signature_request_id}``` | Edit Signature Request| +|[```signature_request_edit_embedded```](SignatureRequestApi.md#signature_request_edit_embedded) | ```PUT /signature_request/edit_embedded/{signature_request_id}``` | Edit Embedded Signature Request| +|[```signature_request_edit_embedded_with_template```](SignatureRequestApi.md#signature_request_edit_embedded_with_template) | ```PUT /signature_request/edit_embedded_with_template/{signature_request_id}``` | Edit Embedded Signature Request with Template| +|[```signature_request_edit_with_template```](SignatureRequestApi.md#signature_request_edit_with_template) | ```PUT /signature_request/edit_with_template/{signature_request_id}``` | Edit Signature Request With Template| |[```signature_request_files```](SignatureRequestApi.md#signature_request_files) | ```GET /signature_request/files/{signature_request_id}``` | Download Files| |[```signature_request_files_as_data_uri```](SignatureRequestApi.md#signature_request_files_as_data_uri) | ```GET /signature_request/files_as_data_uri/{signature_request_id}``` | Download Files as Data Uri| |[```signature_request_files_as_file_url```](SignatureRequestApi.md#signature_request_files_as_file_url) | ```GET /signature_request/files_as_file_url/{signature_request_id}``` | Download Files as File Url| @@ -494,6 +498,414 @@ with ApiClient(configuration) as api_client: [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +# ```signature_request_edit``` +> ```SignatureRequestGetResponse signature_request_edit(signature_request_id, signature_request_edit_request)``` + +Edit Signature Request + +Edits and sends a SignatureRequest with the submitted documents. If `form_fields_per_document` is not specified, a signature page will be affixed where all signers will be required to add their signature, signifying their agreement to all contained documents. **NOTE:** Edit and resend will not deduct your signature request quota. + +### Example + +* Basic Authentication (api_key): +* Bearer (JWT) Authentication (oauth2): + +```python +from pprint import pprint + +from dropbox_sign import ApiClient, ApiException, Configuration, apis, models + +configuration = Configuration( + # Configure HTTP basic authorization: api_key + username="YOUR_API_KEY", + # or, configure Bearer (JWT) authorization: oauth2 + # access_token="YOUR_ACCESS_TOKEN", +) + +with ApiClient(configuration) as api_client: + signature_request_api = apis.SignatureRequestApi(api_client) + + signer_1 = models.SubSignatureRequestSigner( + email_address="jack@example.com", + name="Jack", + order=0, + ) + + signer_2 = models.SubSignatureRequestSigner( + email_address="jill@example.com", + name="Jill", + order=1, + ) + + signing_options = models.SubSigningOptions( + draw=True, + type=True, + upload=True, + phone=True, + default_type="draw", + ) + + field_options = models.SubFieldOptions( + date_format="DD - MM - YYYY", + ) + + data = models.SignatureRequestEditRequest( + title="NDA with Acme Co.", + subject="The NDA we talked about", + message="Please sign this NDA and then we can discuss more. Let me know if you have any questions.", + signers=[signer_1, signer_2], + cc_email_addresses=[ + "lawyer1@dropboxsign.com", + "lawyer2@dropboxsign.com", + ], + files=[open("example_signature_request.pdf", "rb")], + metadata={ + "custom_id": 1234, + "custom_text": "NDA #9", + }, + signing_options=signing_options, + field_options=field_options, + test_mode=True, + ) + + signature_request_id = "2f9781e1a8e2045224d808c153c2e1d3df6f8f2f" + + try: + response = signature_request_api.signature_request_edit( + signature_request_id, data + ) + pprint(response) + except ApiException as e: + print("Exception when calling Dropbox Sign API: %s\n" % e) + +``` +``` + +### Parameters +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| `signature_request_id` | **str** | The id of the SignatureRequest to edit. | | +| `signature_request_edit_request` | [**SignatureRequestEditRequest**](SignatureRequestEditRequest.md) | | | + +### Return type + +[**SignatureRequestGetResponse**](SignatureRequestGetResponse.md) + +### Authorization + +[api_key](../README.md#api_key), [oauth2](../README.md#oauth2) + +### HTTP request headers + + - **Content-Type**: application/json, multipart/form-data + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | successful operation | * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
| +**4XX** | failed_operation | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# ```signature_request_edit_embedded``` +> ```SignatureRequestGetResponse signature_request_edit_embedded(signature_request_id, signature_request_edit_embedded_request)``` + +Edit Embedded Signature Request + +Edits a SignatureRequest with the submitted documents to be signed in an embedded iFrame. If form_fields_per_document is not specified, a signature page will be affixed where all signers will be required to add their signature, signifying their agreement to all contained documents. Note that embedded signature requests can only be signed in embedded iFrames whereas normal signature requests can only be signed on Dropbox Sign. + +### Example + +* Basic Authentication (api_key): +* Bearer (JWT) Authentication (oauth2): + +```python +from pprint import pprint + +from dropbox_sign import ApiClient, ApiException, Configuration, apis, models + +configuration = Configuration( + # Configure HTTP basic authorization: api_key + username="YOUR_API_KEY", + # or, configure Bearer (JWT) authorization: oauth2 + # access_token="YOUR_ACCESS_TOKEN", +) + +with ApiClient(configuration) as api_client: + signature_request_api = apis.SignatureRequestApi(api_client) + + signer_1 = models.SubSignatureRequestSigner( + email_address="jack@example.com", + name="Jack", + order=0, + ) + + signer_2 = models.SubSignatureRequestSigner( + email_address="jill@example.com", + name="Jill", + order=1, + ) + + signing_options = models.SubSigningOptions( + draw=True, + type=True, + upload=True, + phone=True, + default_type="draw", + ) + + data = models.SignatureRequestEditEmbeddedRequest( + client_id="ec64a202072370a737edf4a0eb7f4437", + title="NDA with Acme Co.", + subject="The NDA we talked about", + message="Please sign this NDA and then we can discuss more. Let me know if you have any questions.", + signers=[signer_1, signer_2], + cc_email_addresses=["lawyer1@dropboxsign.com", "lawyer2@dropboxsign.com"], + files=[open("example_signature_request.pdf", "rb")], + signing_options=signing_options, + test_mode=True, + ) + + signature_request_id = "2f9781e1a8e2045224d808c153c2e1d3df6f8f2f" + + try: + response = signature_request_api.signature_request_edit_embedded( + signature_request_id, data + ) + pprint(response) + except ApiException as e: + print("Exception when calling Dropbox Sign API: %s\n" % e) + +``` +``` + +### Parameters +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| `signature_request_id` | **str** | The id of the SignatureRequest to edit. | | +| `signature_request_edit_embedded_request` | [**SignatureRequestEditEmbeddedRequest**](SignatureRequestEditEmbeddedRequest.md) | | | + +### Return type + +[**SignatureRequestGetResponse**](SignatureRequestGetResponse.md) + +### Authorization + +[api_key](../README.md#api_key), [oauth2](../README.md#oauth2) + +### HTTP request headers + + - **Content-Type**: application/json, multipart/form-data + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | successful operation | * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
| +**4XX** | failed_operation | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# ```signature_request_edit_embedded_with_template``` +> ```SignatureRequestGetResponse signature_request_edit_embedded_with_template(signature_request_id, signature_request_edit_embedded_with_template_request)``` + +Edit Embedded Signature Request with Template + +Edits a SignatureRequest based on the given Template(s) to be signed in an embedded iFrame. Note that embedded signature requests can only be signed in embedded iFrames whereas normal signature requests can only be signed on Dropbox Sign. + +### Example + +* Basic Authentication (api_key): +* Bearer (JWT) Authentication (oauth2): + +```python +from pprint import pprint + +from dropbox_sign import ApiClient, ApiException, Configuration, apis, models + +configuration = Configuration( + # Configure HTTP basic authorization: api_key + username="YOUR_API_KEY", + # or, configure Bearer (JWT) authorization: oauth2 + # access_token="YOUR_ACCESS_TOKEN", +) + +with ApiClient(configuration) as api_client: + signature_request_api = apis.SignatureRequestApi(api_client) + + signer_1 = models.SubSignatureRequestTemplateSigner( + role="Client", + email_address="jack@example.com", + name="Jack", + ) + + signing_options = models.SubSigningOptions( + draw=True, + type=True, + upload=True, + phone=True, + default_type="draw", + ) + + data = models.SignatureRequestEditEmbeddedWithTemplateRequest( + client_id="ec64a202072370a737edf4a0eb7f4437", + template_ids=["c26b8a16784a872da37ea946b9ddec7c1e11dff6"], + subject="Purchase Order", + message="Glad we could come to an agreement.", + signers=[signer_1], + signing_options=signing_options, + test_mode=True, + ) + + signature_request_id = "2f9781e1a8e2045224d808c153c2e1d3df6f8f2f" + + try: + response = signature_request_api.signature_request_edit_embedded_with_template( + signature_request_id, data + ) + pprint(response) + except ApiException as e: + print("Exception when calling Dropbox Sign API: %s\n" % e) + +``` +``` + +### Parameters +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| `signature_request_id` | **str** | The id of the SignatureRequest to edit. | | +| `signature_request_edit_embedded_with_template_request` | [**SignatureRequestEditEmbeddedWithTemplateRequest**](SignatureRequestEditEmbeddedWithTemplateRequest.md) | | | + +### Return type + +[**SignatureRequestGetResponse**](SignatureRequestGetResponse.md) + +### Authorization + +[api_key](../README.md#api_key), [oauth2](../README.md#oauth2) + +### HTTP request headers + + - **Content-Type**: application/json, multipart/form-data + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | successful operation | * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
| +**4XX** | failed_operation | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# ```signature_request_edit_with_template``` +> ```SignatureRequestGetResponse signature_request_edit_with_template(signature_request_id, signature_request_edit_with_template_request)``` + +Edit Signature Request With Template + +Edits and sends a SignatureRequest based off of the Template(s) specified with the template_ids parameter. **NOTE:** Edit and resend will not deduct your signature request quota. + +### Example + +* Basic Authentication (api_key): +* Bearer (JWT) Authentication (oauth2): + +```python +from pprint import pprint + +from dropbox_sign import ApiClient, ApiException, Configuration, apis, models + +configuration = Configuration( + # Configure HTTP basic authorization: api_key + username="YOUR_API_KEY", + # or, configure Bearer (JWT) authorization: oauth2 + # access_token="YOUR_ACCESS_TOKEN", +) + +with ApiClient(configuration) as api_client: + signature_request_api = apis.SignatureRequestApi(api_client) + + signer_1 = models.SubSignatureRequestTemplateSigner( + role="Client", + email_address="george@example.com", + name="George", + ) + + cc_1 = models.SubCC( + role="Accounting", + email_address="accounting@example.com", + ) + + custom_field_1 = models.SubCustomField( + name="Cost", + value="$20,000", + editor="Client", + required=True, + ) + + signing_options = models.SubSigningOptions( + draw=True, + type=True, + upload=True, + phone=False, + default_type="draw", + ) + + data = models.SignatureRequestSendWithTemplateRequest( + template_ids=["c26b8a16784a872da37ea946b9ddec7c1e11dff6"], + subject="Purchase Order", + message="Glad we could come to an agreement.", + signers=[signer_1], + ccs=[cc_1], + custom_fields=[custom_field_1], + signing_options=signing_options, + test_mode=True, + ) + + signature_request_id = "2f9781e1a8e2045224d808c153c2e1d3df6f8f2f" + + try: + response = signature_request_api.signature_request_edit_with_template( + signature_request_id, data + ) + pprint(response) + except ApiException as e: + print("Exception when calling Dropbox Sign API: %s\n" % e) + +``` +``` + +### Parameters +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| `signature_request_id` | **str** | The id of the SignatureRequest to edit. | | +| `signature_request_edit_with_template_request` | [**SignatureRequestEditWithTemplateRequest**](SignatureRequestEditWithTemplateRequest.md) | | | + +### Return type + +[**SignatureRequestGetResponse**](SignatureRequestGetResponse.md) + +### Authorization + +[api_key](../README.md#api_key), [oauth2](../README.md#oauth2) + +### HTTP request headers + + - **Content-Type**: application/json, multipart/form-data + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | successful operation | * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
| +**4XX** | failed_operation | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + # ```signature_request_files``` > ```io.IOBase signature_request_files(signature_request_id)``` diff --git a/sdks/python/docs/SignatureRequestEditEmbeddedRequest.md b/sdks/python/docs/SignatureRequestEditEmbeddedRequest.md new file mode 100644 index 000000000..5fdb45e26 --- /dev/null +++ b/sdks/python/docs/SignatureRequestEditEmbeddedRequest.md @@ -0,0 +1,34 @@ +# SignatureRequestEditEmbeddedRequest + + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +| `client_id`*_required_ | ```str``` | Client id of the app you're using to create this embedded signature request. Used for security purposes. | | +| `files` | ```List[io.IOBase]``` | Use `files[]` to indicate the uploaded file(s) to send for signature.

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

This endpoint requires either **files** or **file_urls[]**, but not both. | | +| `signers` | [```List[SubSignatureRequestSigner]```](SubSignatureRequestSigner.md) | Add Signers to your Signature Request.

This endpoint requires either **signers** or **grouped_signers**, but not both. | | +| `grouped_signers` | [```List[SubSignatureRequestGroupedSigners]```](SubSignatureRequestGroupedSigners.md) | Add Grouped Signers to your Signature Request.

This endpoint requires either **signers** or **grouped_signers**, but not both. | | +| `allow_decline` | ```bool``` | Allows signers to decline to sign a document if `true`. Defaults to `false`. | [default to False] | +| `allow_reassign` | ```bool``` | Allows signers to reassign their signature requests to other signers if set to `true`. Defaults to `false`.

**NOTE:** Only available for Premium plan. | [default to False] | +| `attachments` | [```List[SubAttachment]```](SubAttachment.md) | A list describing the attachments | | +| `cc_email_addresses` | ```List[str]``` | The email addresses that should be CCed. | | +| `custom_fields` | [```List[SubCustomField]```](SubCustomField.md) | When used together with merge fields, `custom_fields` allows users to add pre-filled data to their signature requests.

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

For using pre-filled on repeatable signature requests, merge fields are added to templates in the Dropbox Sign UI or by calling [/template/create_embedded_draft](/api/reference/operation/templateCreateEmbeddedDraft) and then passing `custom_fields` on subsequent signature requests referencing that template. | | +| `field_options` | [```SubFieldOptions```](SubFieldOptions.md) | | | +| `form_field_groups` | [```List[SubFormFieldGroup]```](SubFormFieldGroup.md) | Group information for fields defined in `form_fields_per_document`. String-indexed JSON array with `group_label` and `requirement` keys. `form_fields_per_document` must contain fields referencing a group defined in `form_field_groups`. | | +| `form_field_rules` | [```List[SubFormFieldRule]```](SubFormFieldRule.md) | Conditional Logic rules for fields defined in `form_fields_per_document`. | | +| `form_fields_per_document` | [```List[SubFormFieldsPerDocumentBase]```](SubFormFieldsPerDocumentBase.md) | The fields that should appear on the document, expressed as an array of objects. (For more details you can read about it here: [Using Form Fields per Document](/docs/openapi/form-fields-per-document).)

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

* Text Field use `SubFormFieldsPerDocumentText`
* Dropdown Field use `SubFormFieldsPerDocumentDropdown`
* Hyperlink Field use `SubFormFieldsPerDocumentHyperlink`
* Checkbox Field use `SubFormFieldsPerDocumentCheckbox`
* Radio Field use `SubFormFieldsPerDocumentRadio`
* Signature Field use `SubFormFieldsPerDocumentSignature`
* Date Signed Field use `SubFormFieldsPerDocumentDateSigned`
* Initials Field use `SubFormFieldsPerDocumentInitials`
* Text Merge Field use `SubFormFieldsPerDocumentTextMerge`
* Checkbox Merge Field use `SubFormFieldsPerDocumentCheckboxMerge` | | +| `hide_text_tags` | ```bool``` | Enables automatic Text Tag removal when set to true.

**NOTE:** Removing text tags this way can cause unwanted clipping. We recommend leaving this setting on `false` and instead hiding your text tags using white text or a similar approach. See the [Text Tags Walkthrough](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) for more information. | [default to False] | +| `message` | ```str``` | The custom message in the email that will be sent to the signers. | | +| `metadata` | ```Dict[str, object]``` | Key-value data that should be attached to the signature request. This metadata is included in all API responses and events involving the signature request. For example, use the metadata field to store a signer's order number for look up when receiving events for the signature request.

Each request can include up to 10 metadata keys (or 50 nested metadata keys), with key names up to 40 characters long and values up to 1000 characters long. | | +| `signing_options` | [```SubSigningOptions```](SubSigningOptions.md) | | | +| `subject` | ```str``` | The subject in the email that will be sent to the signers. | | +| `test_mode` | ```bool``` | Whether this is a test, the signature request will not be legally binding if set to `true`. Defaults to `false`. | [default to False] | +| `title` | ```str``` | The title you want to assign to the SignatureRequest. | | +| `use_text_tags` | ```bool``` | Send with a value of `true` if you wish to enable [Text Tags](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) parsing in your document. Defaults to disabled, or `false`. | [default to False] | +| `populate_auto_fill_fields` | ```bool``` | Controls whether [auto fill fields](https://faq.hellosign.com/hc/en-us/articles/360051467511-Auto-Fill-Fields) can automatically populate a signer's information during signing.

**NOTE:** Keep your signer's information safe by ensuring that the _signer on your signature request is the intended party_ before using this feature. | [default to False] | +| `expires_at` | ```int``` | When the signature request will expire. Unsigned signatures will be moved to the expired status, and no longer signable. See [Signature Request Expiration Date](https://developers.hellosign.com/docs/signature-request/expiration/) for details. | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/sdks/python/docs/SignatureRequestEditEmbeddedWithTemplateRequest.md b/sdks/python/docs/SignatureRequestEditEmbeddedWithTemplateRequest.md new file mode 100644 index 000000000..9b5c9eb7d --- /dev/null +++ b/sdks/python/docs/SignatureRequestEditEmbeddedWithTemplateRequest.md @@ -0,0 +1,25 @@ +# SignatureRequestEditEmbeddedWithTemplateRequest + + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +| `template_ids`*_required_ | ```List[str]``` | Use `template_ids` to create a SignatureRequest from one or more templates, in the order in which the template will be used. | | +| `client_id`*_required_ | ```str``` | Client id of the app you're using to create this embedded signature request. Used for security purposes. | | +| `signers`*_required_ | [```List[SubSignatureRequestTemplateSigner]```](SubSignatureRequestTemplateSigner.md) | Add Signers to your Templated-based Signature Request. | | +| `allow_decline` | ```bool``` | Allows signers to decline to sign a document if `true`. Defaults to `false`. | [default to False] | +| `ccs` | [```List[SubCC]```](SubCC.md) | Add CC email recipients. Required when a CC role exists for the Template. | | +| `custom_fields` | [```List[SubCustomField]```](SubCustomField.md) | An array defining values and options for custom fields. Required when a custom field exists in the Template. | | +| `files` | ```List[io.IOBase]``` | Use `files[]` to indicate the uploaded file(s) to send for signature.

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

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

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

**NOTE:** Keep your signer's information safe by ensuring that the _signer on your signature request is the intended party_ before using this feature. | [default to False] | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/sdks/python/docs/SignatureRequestEditRequest.md b/sdks/python/docs/SignatureRequestEditRequest.md new file mode 100644 index 000000000..24aefcd32 --- /dev/null +++ b/sdks/python/docs/SignatureRequestEditRequest.md @@ -0,0 +1,35 @@ +# SignatureRequestEditRequest + + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +| `files` | ```List[io.IOBase]``` | Use `files[]` to indicate the uploaded file(s) to send for signature.

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

This endpoint requires either **files** or **file_urls[]**, but not both. | | +| `signers` | [```List[SubSignatureRequestSigner]```](SubSignatureRequestSigner.md) | Add Signers to your Signature Request.

This endpoint requires either **signers** or **grouped_signers**, but not both. | | +| `grouped_signers` | [```List[SubSignatureRequestGroupedSigners]```](SubSignatureRequestGroupedSigners.md) | Add Grouped Signers to your Signature Request.

This endpoint requires either **signers** or **grouped_signers**, but not both. | | +| `allow_decline` | ```bool``` | Allows signers to decline to sign a document if `true`. Defaults to `false`. | [default to False] | +| `allow_reassign` | ```bool``` | Allows signers to reassign their signature requests to other signers if set to `true`. Defaults to `false`.

**NOTE:** Only available for Premium plan and higher. | [default to False] | +| `attachments` | [```List[SubAttachment]```](SubAttachment.md) | A list describing the attachments | | +| `cc_email_addresses` | ```List[str]``` | The email addresses that should be CCed. | | +| `client_id` | ```str``` | The client id of the API App you want to associate with this request. Used to apply the branding and callback url defined for the app. | | +| `custom_fields` | [```List[SubCustomField]```](SubCustomField.md) | When used together with merge fields, `custom_fields` allows users to add pre-filled data to their signature requests.

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

For using pre-filled on repeatable signature requests, merge fields are added to templates in the Dropbox Sign UI or by calling [/template/create_embedded_draft](/api/reference/operation/templateCreateEmbeddedDraft) and then passing `custom_fields` on subsequent signature requests referencing that template. | | +| `field_options` | [```SubFieldOptions```](SubFieldOptions.md) | | | +| `form_field_groups` | [```List[SubFormFieldGroup]```](SubFormFieldGroup.md) | Group information for fields defined in `form_fields_per_document`. String-indexed JSON array with `group_label` and `requirement` keys. `form_fields_per_document` must contain fields referencing a group defined in `form_field_groups`. | | +| `form_field_rules` | [```List[SubFormFieldRule]```](SubFormFieldRule.md) | Conditional Logic rules for fields defined in `form_fields_per_document`. | | +| `form_fields_per_document` | [```List[SubFormFieldsPerDocumentBase]```](SubFormFieldsPerDocumentBase.md) | The fields that should appear on the document, expressed as an array of objects. (For more details you can read about it here: [Using Form Fields per Document](/docs/openapi/form-fields-per-document).)

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

* Text Field use `SubFormFieldsPerDocumentText`
* Dropdown Field use `SubFormFieldsPerDocumentDropdown`
* Hyperlink Field use `SubFormFieldsPerDocumentHyperlink`
* Checkbox Field use `SubFormFieldsPerDocumentCheckbox`
* Radio Field use `SubFormFieldsPerDocumentRadio`
* Signature Field use `SubFormFieldsPerDocumentSignature`
* Date Signed Field use `SubFormFieldsPerDocumentDateSigned`
* Initials Field use `SubFormFieldsPerDocumentInitials`
* Text Merge Field use `SubFormFieldsPerDocumentTextMerge`
* Checkbox Merge Field use `SubFormFieldsPerDocumentCheckboxMerge` | | +| `hide_text_tags` | ```bool``` | Enables automatic Text Tag removal when set to true.

**NOTE:** Removing text tags this way can cause unwanted clipping. We recommend leaving this setting on `false` and instead hiding your text tags using white text or a similar approach. See the [Text Tags Walkthrough](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) for more information. | [default to False] | +| `is_eid` | ```bool``` | Send with a value of `true` if you wish to enable [electronic identification (eID)](https://www.hellosign.com/features/electronic-id), which requires the signer to verify their identity with an eID provider to sign a document.<br>
**NOTE:** eID is only available on the Premium API plan. Cannot be used in `test_mode`. Only works on requests with one signer. | [default to False] | +| `message` | ```str``` | The custom message in the email that will be sent to the signers. | | +| `metadata` | ```Dict[str, object]``` | Key-value data that should be attached to the signature request. This metadata is included in all API responses and events involving the signature request. For example, use the metadata field to store a signer's order number for look up when receiving events for the signature request.

Each request can include up to 10 metadata keys (or 50 nested metadata keys), with key names up to 40 characters long and values up to 1000 characters long. | | +| `signing_options` | [```SubSigningOptions```](SubSigningOptions.md) | | | +| `signing_redirect_url` | ```str``` | The URL you want signers redirected to after they successfully sign. | | +| `subject` | ```str``` | The subject in the email that will be sent to the signers. | | +| `test_mode` | ```bool``` | Whether this is a test, the signature request will not be legally binding if set to `true`. Defaults to `false`. | [default to False] | +| `title` | ```str``` | The title you want to assign to the SignatureRequest. | | +| `use_text_tags` | ```bool``` | Send with a value of `true` if you wish to enable [Text Tags](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) parsing in your document. Defaults to disabled, or `false`. | [default to False] | +| `expires_at` | ```int``` | When the signature request will expire. Unsigned signatures will be moved to the expired status, and no longer signable. See [Signature Request Expiration Date](https://developers.hellosign.com/docs/signature-request/expiration/) for details. | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/sdks/python/docs/SignatureRequestEditWithTemplateRequest.md b/sdks/python/docs/SignatureRequestEditWithTemplateRequest.md new file mode 100644 index 000000000..bf3b21f36 --- /dev/null +++ b/sdks/python/docs/SignatureRequestEditWithTemplateRequest.md @@ -0,0 +1,26 @@ +# SignatureRequestEditWithTemplateRequest + + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +| `template_ids`*_required_ | ```List[str]``` | Use `template_ids` to create a SignatureRequest from one or more templates, in the order in which the template will be used. | | +| `signers`*_required_ | [```List[SubSignatureRequestTemplateSigner]```](SubSignatureRequestTemplateSigner.md) | Add Signers to your Templated-based Signature Request. | | +| `allow_decline` | ```bool``` | Allows signers to decline to sign a document if `true`. Defaults to `false`. | [default to False] | +| `ccs` | [```List[SubCC]```](SubCC.md) | Add CC email recipients. Required when a CC role exists for the Template. | | +| `client_id` | ```str``` | Client id of the app to associate with the signature request. Used to apply the branding and callback url defined for the app. | | +| `custom_fields` | [```List[SubCustomField]```](SubCustomField.md) | An array defining values and options for custom fields. Required when a custom field exists in the Template. | | +| `files` | ```List[io.IOBase]``` | Use `files[]` to indicate the uploaded file(s) to send for signature.

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

This endpoint requires either **files** or **file_urls[]**, but not both. | | +| `is_eid` | ```bool``` | Send with a value of `true` if you wish to enable [electronic identification (eID)](https://www.hellosign.com/features/electronic-id), which requires the signer to verify their identity with an eID provider to sign a document.<br>
**NOTE:** eID is only available on the Premium API plan. Cannot be used in `test_mode`. Only works on requests with one signer. | [default to False] | +| `message` | ```str``` | The custom message in the email that will be sent to the signers. | | +| `metadata` | ```Dict[str, object]``` | Key-value data that should be attached to the signature request. This metadata is included in all API responses and events involving the signature request. For example, use the metadata field to store a signer's order number for look up when receiving events for the signature request.

Each request can include up to 10 metadata keys (or 50 nested metadata keys), with key names up to 40 characters long and values up to 1000 characters long. | | +| `signing_options` | [```SubSigningOptions```](SubSigningOptions.md) | | | +| `signing_redirect_url` | ```str``` | The URL you want signers redirected to after they successfully sign. | | +| `subject` | ```str``` | The subject in the email that will be sent to the signers. | | +| `test_mode` | ```bool``` | Whether this is a test, the signature request will not be legally binding if set to `true`. Defaults to `false`. | [default to False] | +| `title` | ```str``` | The title you want to assign to the SignatureRequest. | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/sdks/python/dropbox_sign/__init__.py b/sdks/python/dropbox_sign/__init__.py index 53deb8f21..d280fc547 100644 --- a/sdks/python/dropbox_sign/__init__.py +++ b/sdks/python/dropbox_sign/__init__.py @@ -125,6 +125,18 @@ from dropbox_sign.models.signature_request_create_embedded_with_template_request import ( SignatureRequestCreateEmbeddedWithTemplateRequest, ) +from dropbox_sign.models.signature_request_edit_embedded_request import ( + SignatureRequestEditEmbeddedRequest, +) +from dropbox_sign.models.signature_request_edit_embedded_with_template_request import ( + SignatureRequestEditEmbeddedWithTemplateRequest, +) +from dropbox_sign.models.signature_request_edit_request import ( + SignatureRequestEditRequest, +) +from dropbox_sign.models.signature_request_edit_with_template_request import ( + SignatureRequestEditWithTemplateRequest, +) from dropbox_sign.models.signature_request_get_response import ( SignatureRequestGetResponse, ) diff --git a/sdks/python/dropbox_sign/api/signature_request_api.py b/sdks/python/dropbox_sign/api/signature_request_api.py index 98f08aed8..9f02599d5 100644 --- a/sdks/python/dropbox_sign/api/signature_request_api.py +++ b/sdks/python/dropbox_sign/api/signature_request_api.py @@ -35,6 +35,18 @@ from dropbox_sign.models.signature_request_create_embedded_with_template_request import ( SignatureRequestCreateEmbeddedWithTemplateRequest, ) +from dropbox_sign.models.signature_request_edit_embedded_request import ( + SignatureRequestEditEmbeddedRequest, +) +from dropbox_sign.models.signature_request_edit_embedded_with_template_request import ( + SignatureRequestEditEmbeddedWithTemplateRequest, +) +from dropbox_sign.models.signature_request_edit_request import ( + SignatureRequestEditRequest, +) +from dropbox_sign.models.signature_request_edit_with_template_request import ( + SignatureRequestEditWithTemplateRequest, +) from dropbox_sign.models.signature_request_get_response import ( SignatureRequestGetResponse, ) @@ -1433,6 +1445,1196 @@ def _signature_request_create_embedded_with_template_serialize( _request_auth=_request_auth, ) + @validate_call + def signature_request_edit( + self, + signature_request_id: Annotated[ + StrictStr, Field(description="The id of the SignatureRequest to edit.") + ], + signature_request_edit_request: SignatureRequestEditRequest, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> SignatureRequestGetResponse: + """Edit Signature Request + + Edits and sends a SignatureRequest with the submitted documents. If `form_fields_per_document` is not specified, a signature page will be affixed where all signers will be required to add their signature, signifying their agreement to all contained documents. **NOTE:** Edit and resend will not deduct your signature request quota. + + :param signature_request_id: The id of the SignatureRequest to edit. (required) + :type signature_request_id: str + :param signature_request_edit_request: (required) + :type signature_request_edit_request: SignatureRequestEditRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._signature_request_edit_serialize( + signature_request_id=signature_request_id, + signature_request_edit_request=signature_request_edit_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "SignatureRequestGetResponse", + "4XX": "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + @validate_call + def signature_request_edit_with_http_info( + self, + signature_request_id: Annotated[ + StrictStr, Field(description="The id of the SignatureRequest to edit.") + ], + signature_request_edit_request: SignatureRequestEditRequest, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[SignatureRequestGetResponse]: + """Edit Signature Request + + Edits and sends a SignatureRequest with the submitted documents. If `form_fields_per_document` is not specified, a signature page will be affixed where all signers will be required to add their signature, signifying their agreement to all contained documents. **NOTE:** Edit and resend will not deduct your signature request quota. + + :param signature_request_id: The id of the SignatureRequest to edit. (required) + :type signature_request_id: str + :param signature_request_edit_request: (required) + :type signature_request_edit_request: SignatureRequestEditRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._signature_request_edit_serialize( + signature_request_id=signature_request_id, + signature_request_edit_request=signature_request_edit_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "SignatureRequestGetResponse", + "4XX": "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + @validate_call + def signature_request_edit_without_preload_content( + self, + signature_request_id: Annotated[ + StrictStr, Field(description="The id of the SignatureRequest to edit.") + ], + signature_request_edit_request: SignatureRequestEditRequest, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Edit Signature Request + + Edits and sends a SignatureRequest with the submitted documents. If `form_fields_per_document` is not specified, a signature page will be affixed where all signers will be required to add their signature, signifying their agreement to all contained documents. **NOTE:** Edit and resend will not deduct your signature request quota. + + :param signature_request_id: The id of the SignatureRequest to edit. (required) + :type signature_request_id: str + :param signature_request_edit_request: (required) + :type signature_request_edit_request: SignatureRequestEditRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._signature_request_edit_serialize( + signature_request_id=signature_request_id, + signature_request_edit_request=signature_request_edit_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "SignatureRequestGetResponse", + "4XX": "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + return response_data.response + + def _signature_request_edit_serialize( + self, + signature_request_id, + signature_request_edit_request, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = {} + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + has_files = False + body_param = signature_request_edit_request + excluded_json_fields = set([]) + for param_name, param_type in body_param.openapi_types().items(): + param_value = getattr(body_param, param_name) + if param_value is None: + continue + + if "io.IOBase" in param_type: + has_files = True + _content_type = "multipart/form-data" + excluded_json_fields.add(param_name) + + if isinstance(param_value, list): + for index, item in enumerate(param_value): + _files[f"{param_name}[{index}]"] = item + else: + _files[param_name] = param_value + + if has_files is True: + _form_params = body_param.to_json_form_params(excluded_json_fields) + + # process the path parameters + if signature_request_id is not None: + _path_params["signature_request_id"] = signature_request_id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if signature_request_edit_request is not None and has_files is False: + _body_params = signature_request_edit_request + + # set the HTTP header `Accept` + if "Accept" not in _header_params: + _header_params["Accept"] = self.api_client.select_header_accept( + ["application/json"] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params["Content-Type"] = _content_type + else: + _default_content_type = self.api_client.select_header_content_type( + ["application/json", "multipart/form-data"] + ) + if _default_content_type is not None: + _header_params["Content-Type"] = _default_content_type + + # authentication setting + _auth_settings: List[str] = ["api_key", "oauth2"] + + return self.api_client.param_serialize( + method="PUT", + resource_path="/signature_request/edit/{signature_request_id}", + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth, + ) + + @validate_call + def signature_request_edit_embedded( + self, + signature_request_id: Annotated[ + StrictStr, Field(description="The id of the SignatureRequest to edit.") + ], + signature_request_edit_embedded_request: SignatureRequestEditEmbeddedRequest, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> SignatureRequestGetResponse: + """Edit Embedded Signature Request + + Edits a SignatureRequest with the submitted documents to be signed in an embedded iFrame. If form_fields_per_document is not specified, a signature page will be affixed where all signers will be required to add their signature, signifying their agreement to all contained documents. Note that embedded signature requests can only be signed in embedded iFrames whereas normal signature requests can only be signed on Dropbox Sign. + + :param signature_request_id: The id of the SignatureRequest to edit. (required) + :type signature_request_id: str + :param signature_request_edit_embedded_request: (required) + :type signature_request_edit_embedded_request: SignatureRequestEditEmbeddedRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._signature_request_edit_embedded_serialize( + signature_request_id=signature_request_id, + signature_request_edit_embedded_request=signature_request_edit_embedded_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "SignatureRequestGetResponse", + "4XX": "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + @validate_call + def signature_request_edit_embedded_with_http_info( + self, + signature_request_id: Annotated[ + StrictStr, Field(description="The id of the SignatureRequest to edit.") + ], + signature_request_edit_embedded_request: SignatureRequestEditEmbeddedRequest, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[SignatureRequestGetResponse]: + """Edit Embedded Signature Request + + Edits a SignatureRequest with the submitted documents to be signed in an embedded iFrame. If form_fields_per_document is not specified, a signature page will be affixed where all signers will be required to add their signature, signifying their agreement to all contained documents. Note that embedded signature requests can only be signed in embedded iFrames whereas normal signature requests can only be signed on Dropbox Sign. + + :param signature_request_id: The id of the SignatureRequest to edit. (required) + :type signature_request_id: str + :param signature_request_edit_embedded_request: (required) + :type signature_request_edit_embedded_request: SignatureRequestEditEmbeddedRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._signature_request_edit_embedded_serialize( + signature_request_id=signature_request_id, + signature_request_edit_embedded_request=signature_request_edit_embedded_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "SignatureRequestGetResponse", + "4XX": "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + @validate_call + def signature_request_edit_embedded_without_preload_content( + self, + signature_request_id: Annotated[ + StrictStr, Field(description="The id of the SignatureRequest to edit.") + ], + signature_request_edit_embedded_request: SignatureRequestEditEmbeddedRequest, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Edit Embedded Signature Request + + Edits a SignatureRequest with the submitted documents to be signed in an embedded iFrame. If form_fields_per_document is not specified, a signature page will be affixed where all signers will be required to add their signature, signifying their agreement to all contained documents. Note that embedded signature requests can only be signed in embedded iFrames whereas normal signature requests can only be signed on Dropbox Sign. + + :param signature_request_id: The id of the SignatureRequest to edit. (required) + :type signature_request_id: str + :param signature_request_edit_embedded_request: (required) + :type signature_request_edit_embedded_request: SignatureRequestEditEmbeddedRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._signature_request_edit_embedded_serialize( + signature_request_id=signature_request_id, + signature_request_edit_embedded_request=signature_request_edit_embedded_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "SignatureRequestGetResponse", + "4XX": "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + return response_data.response + + def _signature_request_edit_embedded_serialize( + self, + signature_request_id, + signature_request_edit_embedded_request, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = {} + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + has_files = False + body_param = signature_request_edit_embedded_request + excluded_json_fields = set([]) + for param_name, param_type in body_param.openapi_types().items(): + param_value = getattr(body_param, param_name) + if param_value is None: + continue + + if "io.IOBase" in param_type: + has_files = True + _content_type = "multipart/form-data" + excluded_json_fields.add(param_name) + + if isinstance(param_value, list): + for index, item in enumerate(param_value): + _files[f"{param_name}[{index}]"] = item + else: + _files[param_name] = param_value + + if has_files is True: + _form_params = body_param.to_json_form_params(excluded_json_fields) + + # process the path parameters + if signature_request_id is not None: + _path_params["signature_request_id"] = signature_request_id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if signature_request_edit_embedded_request is not None and has_files is False: + _body_params = signature_request_edit_embedded_request + + # set the HTTP header `Accept` + if "Accept" not in _header_params: + _header_params["Accept"] = self.api_client.select_header_accept( + ["application/json"] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params["Content-Type"] = _content_type + else: + _default_content_type = self.api_client.select_header_content_type( + ["application/json", "multipart/form-data"] + ) + if _default_content_type is not None: + _header_params["Content-Type"] = _default_content_type + + # authentication setting + _auth_settings: List[str] = ["api_key", "oauth2"] + + return self.api_client.param_serialize( + method="PUT", + resource_path="/signature_request/edit_embedded/{signature_request_id}", + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth, + ) + + @validate_call + def signature_request_edit_embedded_with_template( + self, + signature_request_id: Annotated[ + StrictStr, Field(description="The id of the SignatureRequest to edit.") + ], + signature_request_edit_embedded_with_template_request: SignatureRequestEditEmbeddedWithTemplateRequest, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> SignatureRequestGetResponse: + """Edit Embedded Signature Request with Template + + Edits a SignatureRequest based on the given Template(s) to be signed in an embedded iFrame. Note that embedded signature requests can only be signed in embedded iFrames whereas normal signature requests can only be signed on Dropbox Sign. + + :param signature_request_id: The id of the SignatureRequest to edit. (required) + :type signature_request_id: str + :param signature_request_edit_embedded_with_template_request: (required) + :type signature_request_edit_embedded_with_template_request: SignatureRequestEditEmbeddedWithTemplateRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._signature_request_edit_embedded_with_template_serialize( + signature_request_id=signature_request_id, + signature_request_edit_embedded_with_template_request=signature_request_edit_embedded_with_template_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "SignatureRequestGetResponse", + "4XX": "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + @validate_call + def signature_request_edit_embedded_with_template_with_http_info( + self, + signature_request_id: Annotated[ + StrictStr, Field(description="The id of the SignatureRequest to edit.") + ], + signature_request_edit_embedded_with_template_request: SignatureRequestEditEmbeddedWithTemplateRequest, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[SignatureRequestGetResponse]: + """Edit Embedded Signature Request with Template + + Edits a SignatureRequest based on the given Template(s) to be signed in an embedded iFrame. Note that embedded signature requests can only be signed in embedded iFrames whereas normal signature requests can only be signed on Dropbox Sign. + + :param signature_request_id: The id of the SignatureRequest to edit. (required) + :type signature_request_id: str + :param signature_request_edit_embedded_with_template_request: (required) + :type signature_request_edit_embedded_with_template_request: SignatureRequestEditEmbeddedWithTemplateRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._signature_request_edit_embedded_with_template_serialize( + signature_request_id=signature_request_id, + signature_request_edit_embedded_with_template_request=signature_request_edit_embedded_with_template_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "SignatureRequestGetResponse", + "4XX": "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + @validate_call + def signature_request_edit_embedded_with_template_without_preload_content( + self, + signature_request_id: Annotated[ + StrictStr, Field(description="The id of the SignatureRequest to edit.") + ], + signature_request_edit_embedded_with_template_request: SignatureRequestEditEmbeddedWithTemplateRequest, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Edit Embedded Signature Request with Template + + Edits a SignatureRequest based on the given Template(s) to be signed in an embedded iFrame. Note that embedded signature requests can only be signed in embedded iFrames whereas normal signature requests can only be signed on Dropbox Sign. + + :param signature_request_id: The id of the SignatureRequest to edit. (required) + :type signature_request_id: str + :param signature_request_edit_embedded_with_template_request: (required) + :type signature_request_edit_embedded_with_template_request: SignatureRequestEditEmbeddedWithTemplateRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._signature_request_edit_embedded_with_template_serialize( + signature_request_id=signature_request_id, + signature_request_edit_embedded_with_template_request=signature_request_edit_embedded_with_template_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "SignatureRequestGetResponse", + "4XX": "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + return response_data.response + + def _signature_request_edit_embedded_with_template_serialize( + self, + signature_request_id, + signature_request_edit_embedded_with_template_request, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = {} + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + has_files = False + body_param = signature_request_edit_embedded_with_template_request + excluded_json_fields = set([]) + for param_name, param_type in body_param.openapi_types().items(): + param_value = getattr(body_param, param_name) + if param_value is None: + continue + + if "io.IOBase" in param_type: + has_files = True + _content_type = "multipart/form-data" + excluded_json_fields.add(param_name) + + if isinstance(param_value, list): + for index, item in enumerate(param_value): + _files[f"{param_name}[{index}]"] = item + else: + _files[param_name] = param_value + + if has_files is True: + _form_params = body_param.to_json_form_params(excluded_json_fields) + + # process the path parameters + if signature_request_id is not None: + _path_params["signature_request_id"] = signature_request_id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if ( + signature_request_edit_embedded_with_template_request is not None + and has_files is False + ): + _body_params = signature_request_edit_embedded_with_template_request + + # set the HTTP header `Accept` + if "Accept" not in _header_params: + _header_params["Accept"] = self.api_client.select_header_accept( + ["application/json"] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params["Content-Type"] = _content_type + else: + _default_content_type = self.api_client.select_header_content_type( + ["application/json", "multipart/form-data"] + ) + if _default_content_type is not None: + _header_params["Content-Type"] = _default_content_type + + # authentication setting + _auth_settings: List[str] = ["api_key", "oauth2"] + + return self.api_client.param_serialize( + method="PUT", + resource_path="/signature_request/edit_embedded_with_template/{signature_request_id}", + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth, + ) + + @validate_call + def signature_request_edit_with_template( + self, + signature_request_id: Annotated[ + StrictStr, Field(description="The id of the SignatureRequest to edit.") + ], + signature_request_edit_with_template_request: SignatureRequestEditWithTemplateRequest, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> SignatureRequestGetResponse: + """Edit Signature Request With Template + + Edits and sends a SignatureRequest based off of the Template(s) specified with the template_ids parameter. **NOTE:** Edit and resend will not deduct your signature request quota. + + :param signature_request_id: The id of the SignatureRequest to edit. (required) + :type signature_request_id: str + :param signature_request_edit_with_template_request: (required) + :type signature_request_edit_with_template_request: SignatureRequestEditWithTemplateRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._signature_request_edit_with_template_serialize( + signature_request_id=signature_request_id, + signature_request_edit_with_template_request=signature_request_edit_with_template_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "SignatureRequestGetResponse", + "4XX": "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + @validate_call + def signature_request_edit_with_template_with_http_info( + self, + signature_request_id: Annotated[ + StrictStr, Field(description="The id of the SignatureRequest to edit.") + ], + signature_request_edit_with_template_request: SignatureRequestEditWithTemplateRequest, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[SignatureRequestGetResponse]: + """Edit Signature Request With Template + + Edits and sends a SignatureRequest based off of the Template(s) specified with the template_ids parameter. **NOTE:** Edit and resend will not deduct your signature request quota. + + :param signature_request_id: The id of the SignatureRequest to edit. (required) + :type signature_request_id: str + :param signature_request_edit_with_template_request: (required) + :type signature_request_edit_with_template_request: SignatureRequestEditWithTemplateRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._signature_request_edit_with_template_serialize( + signature_request_id=signature_request_id, + signature_request_edit_with_template_request=signature_request_edit_with_template_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "SignatureRequestGetResponse", + "4XX": "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + @validate_call + def signature_request_edit_with_template_without_preload_content( + self, + signature_request_id: Annotated[ + StrictStr, Field(description="The id of the SignatureRequest to edit.") + ], + signature_request_edit_with_template_request: SignatureRequestEditWithTemplateRequest, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Edit Signature Request With Template + + Edits and sends a SignatureRequest based off of the Template(s) specified with the template_ids parameter. **NOTE:** Edit and resend will not deduct your signature request quota. + + :param signature_request_id: The id of the SignatureRequest to edit. (required) + :type signature_request_id: str + :param signature_request_edit_with_template_request: (required) + :type signature_request_edit_with_template_request: SignatureRequestEditWithTemplateRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._signature_request_edit_with_template_serialize( + signature_request_id=signature_request_id, + signature_request_edit_with_template_request=signature_request_edit_with_template_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "SignatureRequestGetResponse", + "4XX": "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + return response_data.response + + def _signature_request_edit_with_template_serialize( + self, + signature_request_id, + signature_request_edit_with_template_request, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = {} + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + has_files = False + body_param = signature_request_edit_with_template_request + excluded_json_fields = set([]) + for param_name, param_type in body_param.openapi_types().items(): + param_value = getattr(body_param, param_name) + if param_value is None: + continue + + if "io.IOBase" in param_type: + has_files = True + _content_type = "multipart/form-data" + excluded_json_fields.add(param_name) + + if isinstance(param_value, list): + for index, item in enumerate(param_value): + _files[f"{param_name}[{index}]"] = item + else: + _files[param_name] = param_value + + if has_files is True: + _form_params = body_param.to_json_form_params(excluded_json_fields) + + # process the path parameters + if signature_request_id is not None: + _path_params["signature_request_id"] = signature_request_id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if ( + signature_request_edit_with_template_request is not None + and has_files is False + ): + _body_params = signature_request_edit_with_template_request + + # set the HTTP header `Accept` + if "Accept" not in _header_params: + _header_params["Accept"] = self.api_client.select_header_accept( + ["application/json"] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params["Content-Type"] = _content_type + else: + _default_content_type = self.api_client.select_header_content_type( + ["application/json", "multipart/form-data"] + ) + if _default_content_type is not None: + _header_params["Content-Type"] = _default_content_type + + # authentication setting + _auth_settings: List[str] = ["api_key", "oauth2"] + + return self.api_client.param_serialize( + method="PUT", + resource_path="/signature_request/edit_with_template/{signature_request_id}", + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth, + ) + @validate_call def signature_request_files( self, diff --git a/sdks/python/dropbox_sign/models/__init__.py b/sdks/python/dropbox_sign/models/__init__.py index 71b8e6f5b..fd5331ae1 100644 --- a/sdks/python/dropbox_sign/models/__init__.py +++ b/sdks/python/dropbox_sign/models/__init__.py @@ -108,6 +108,18 @@ from dropbox_sign.models.signature_request_create_embedded_with_template_request import ( SignatureRequestCreateEmbeddedWithTemplateRequest, ) +from dropbox_sign.models.signature_request_edit_embedded_request import ( + SignatureRequestEditEmbeddedRequest, +) +from dropbox_sign.models.signature_request_edit_embedded_with_template_request import ( + SignatureRequestEditEmbeddedWithTemplateRequest, +) +from dropbox_sign.models.signature_request_edit_request import ( + SignatureRequestEditRequest, +) +from dropbox_sign.models.signature_request_edit_with_template_request import ( + SignatureRequestEditWithTemplateRequest, +) from dropbox_sign.models.signature_request_get_response import ( SignatureRequestGetResponse, ) diff --git a/sdks/python/dropbox_sign/models/signature_request_edit_embedded_request.py b/sdks/python/dropbox_sign/models/signature_request_edit_embedded_request.py new file mode 100644 index 000000000..761134fe9 --- /dev/null +++ b/sdks/python/dropbox_sign/models/signature_request_edit_embedded_request.py @@ -0,0 +1,442 @@ +# coding: utf-8 + +""" +Dropbox Sign API + +Dropbox Sign v3 API + +The version of the OpenAPI document: 3.0.0 +Contact: apisupport@hellosign.com +Generated by OpenAPI Generator (https://openapi-generator.tech) + +Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import ( + BaseModel, + ConfigDict, + Field, + StrictBool, + StrictBytes, + StrictInt, + StrictStr, +) +from typing import Any, ClassVar, Dict, List, Optional, Union +from typing_extensions import Annotated +from dropbox_sign.models.sub_attachment import SubAttachment +from dropbox_sign.models.sub_custom_field import SubCustomField +from dropbox_sign.models.sub_field_options import SubFieldOptions +from dropbox_sign.models.sub_form_field_group import SubFormFieldGroup +from dropbox_sign.models.sub_form_field_rule import SubFormFieldRule +from dropbox_sign.models.sub_form_fields_per_document_base import ( + SubFormFieldsPerDocumentBase, +) +from dropbox_sign.models.sub_signature_request_grouped_signers import ( + SubSignatureRequestGroupedSigners, +) +from dropbox_sign.models.sub_signature_request_signer import SubSignatureRequestSigner +from dropbox_sign.models.sub_signing_options import SubSigningOptions +from typing import Optional, Set, Tuple +from typing_extensions import Self +import io +from pydantic import StrictBool +from typing import Union + + +class SignatureRequestEditEmbeddedRequest(BaseModel): + """ + SignatureRequestEditEmbeddedRequest + """ # noqa: E501 + + client_id: StrictStr = Field( + description="Client id of the app you're using to create this embedded signature request. Used for security purposes." + ) + files: Optional[List[Union[StrictBytes, StrictStr, io.IOBase]]] = Field( + default=None, + description="Use `files[]` to indicate the uploaded file(s) to send for signature. This endpoint requires either **files** or **file_urls[]**, but not both.", + ) + file_urls: Optional[List[StrictStr]] = Field( + default=None, + description="Use `file_urls[]` to have Dropbox Sign download the file(s) to send for signature. This endpoint requires either **files** or **file_urls[]**, but not both.", + ) + signers: Optional[List[SubSignatureRequestSigner]] = Field( + default=None, + description="Add Signers to your Signature Request. This endpoint requires either **signers** or **grouped_signers**, but not both.", + ) + grouped_signers: Optional[List[SubSignatureRequestGroupedSigners]] = Field( + default=None, + description="Add Grouped Signers to your Signature Request. This endpoint requires either **signers** or **grouped_signers**, but not both.", + ) + allow_decline: Optional[StrictBool] = Field( + default=False, + description="Allows signers to decline to sign a document if `true`. Defaults to `false`.", + ) + allow_reassign: Optional[StrictBool] = Field( + default=False, + description="Allows signers to reassign their signature requests to other signers if set to `true`. Defaults to `false`. **NOTE:** Only available for Premium plan.", + ) + attachments: Optional[List[SubAttachment]] = Field( + default=None, description="A list describing the attachments" + ) + cc_email_addresses: Optional[List[StrictStr]] = Field( + default=None, description="The email addresses that should be CCed." + ) + custom_fields: Optional[List[SubCustomField]] = Field( + default=None, + description='When used together with merge fields, `custom_fields` allows users to add pre-filled data to their signature requests. Pre-filled data can be used with "send-once" signature requests by adding merge fields with `form_fields_per_document` or [Text Tags](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) while passing values back with `custom_fields` together in one API call. For using pre-filled on repeatable signature requests, merge fields are added to templates in the Dropbox Sign UI or by calling [/template/create_embedded_draft](/api/reference/operation/templateCreateEmbeddedDraft) and then passing `custom_fields` on subsequent signature requests referencing that template.', + ) + field_options: Optional[SubFieldOptions] = None + form_field_groups: Optional[List[SubFormFieldGroup]] = Field( + default=None, + 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`.", + ) + form_field_rules: Optional[List[SubFormFieldRule]] = Field( + default=None, + description="Conditional Logic rules for fields defined in `form_fields_per_document`.", + ) + form_fields_per_document: Optional[List[SubFormFieldsPerDocumentBase]] = Field( + default=None, + 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`", + ) + hide_text_tags: Optional[StrictBool] = Field( + default=False, + description="Enables automatic Text Tag removal when set to true. **NOTE:** Removing text tags this way can cause unwanted clipping. We recommend leaving this setting on `false` and instead hiding your text tags using white text or a similar approach. See the [Text Tags Walkthrough](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) for more information.", + ) + message: Optional[Annotated[str, Field(strict=True, max_length=5000)]] = Field( + default=None, + description="The custom message in the email that will be sent to the signers.", + ) + metadata: Optional[Dict[str, Any]] = Field( + default=None, + description="Key-value data that should be attached to the signature request. This metadata is included in all API responses and events involving the signature request. For example, use the metadata field to store a signer's order number for look up when receiving events for the signature request. Each request can include up to 10 metadata keys (or 50 nested metadata keys), with key names up to 40 characters long and values up to 1000 characters long.", + ) + signing_options: Optional[SubSigningOptions] = None + subject: Optional[Annotated[str, Field(strict=True, max_length=255)]] = Field( + default=None, + description="The subject in the email that will be sent to the signers.", + ) + test_mode: Optional[StrictBool] = Field( + default=False, + description="Whether this is a test, the signature request will not be legally binding if set to `true`. Defaults to `false`.", + ) + title: Optional[Annotated[str, Field(strict=True, max_length=255)]] = Field( + default=None, + description="The title you want to assign to the SignatureRequest.", + ) + use_text_tags: Optional[StrictBool] = Field( + default=False, + description="Send with a value of `true` if you wish to enable [Text Tags](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) parsing in your document. Defaults to disabled, or `false`.", + ) + populate_auto_fill_fields: Optional[StrictBool] = Field( + default=False, + description="Controls whether [auto fill fields](https://faq.hellosign.com/hc/en-us/articles/360051467511-Auto-Fill-Fields) can automatically populate a signer's information during signing. **NOTE:** Keep your signer's information safe by ensuring that the _signer on your signature request is the intended party_ before using this feature.", + ) + expires_at: Optional[StrictInt] = Field( + default=None, + description="When the signature request will expire. Unsigned signatures will be moved to the expired status, and no longer signable. See [Signature Request Expiration Date](https://developers.hellosign.com/docs/signature-request/expiration/) for details.", + ) + __properties: ClassVar[List[str]] = [ + "client_id", + "files", + "file_urls", + "signers", + "grouped_signers", + "allow_decline", + "allow_reassign", + "attachments", + "cc_email_addresses", + "custom_fields", + "field_options", + "form_field_groups", + "form_field_rules", + "form_fields_per_document", + "hide_text_tags", + "message", + "metadata", + "signing_options", + "subject", + "test_mode", + "title", + "use_text_tags", + "populate_auto_fill_fields", + "expires_at", + ] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + arbitrary_types_allowed=True, + ) + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + def to_json_form_params( + self, excluded_fields: Set[str] = None + ) -> List[Tuple[str, str]]: + data: List[Tuple[str, str]] = [] + + for key, value in self.to_dict(excluded_fields).items(): + if isinstance(value, (int, str, bool)): + data.append((key, value)) + else: + data.append((key, json.dumps(value, ensure_ascii=False))) + + return data + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of SignatureRequestEditEmbeddedRequest from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self, excluded_fields: Set[str] = None) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in signers (list) + _items = [] + if self.signers: + for _item_signers in self.signers: + if _item_signers: + _items.append(_item_signers.to_dict()) + _dict["signers"] = _items + # override the default output from pydantic by calling `to_dict()` of each item in grouped_signers (list) + _items = [] + if self.grouped_signers: + for _item_grouped_signers in self.grouped_signers: + if _item_grouped_signers: + _items.append(_item_grouped_signers.to_dict()) + _dict["grouped_signers"] = _items + # override the default output from pydantic by calling `to_dict()` of each item in attachments (list) + _items = [] + if self.attachments: + for _item_attachments in self.attachments: + if _item_attachments: + _items.append(_item_attachments.to_dict()) + _dict["attachments"] = _items + # override the default output from pydantic by calling `to_dict()` of each item in custom_fields (list) + _items = [] + if self.custom_fields: + for _item_custom_fields in self.custom_fields: + if _item_custom_fields: + _items.append(_item_custom_fields.to_dict()) + _dict["custom_fields"] = _items + # override the default output from pydantic by calling `to_dict()` of field_options + if self.field_options: + _dict["field_options"] = self.field_options.to_dict() + # override the default output from pydantic by calling `to_dict()` of each item in form_field_groups (list) + _items = [] + if self.form_field_groups: + for _item_form_field_groups in self.form_field_groups: + if _item_form_field_groups: + _items.append(_item_form_field_groups.to_dict()) + _dict["form_field_groups"] = _items + # override the default output from pydantic by calling `to_dict()` of each item in form_field_rules (list) + _items = [] + if self.form_field_rules: + for _item_form_field_rules in self.form_field_rules: + if _item_form_field_rules: + _items.append(_item_form_field_rules.to_dict()) + _dict["form_field_rules"] = _items + # override the default output from pydantic by calling `to_dict()` of each item in form_fields_per_document (list) + _items = [] + if self.form_fields_per_document: + for _item_form_fields_per_document in self.form_fields_per_document: + if _item_form_fields_per_document: + _items.append(_item_form_fields_per_document.to_dict()) + _dict["form_fields_per_document"] = _items + # override the default output from pydantic by calling `to_dict()` of signing_options + if self.signing_options: + _dict["signing_options"] = self.signing_options.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of SignatureRequestEditEmbeddedRequest from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate( + { + "client_id": obj.get("client_id"), + "files": obj.get("files"), + "file_urls": obj.get("file_urls"), + "signers": ( + [ + SubSignatureRequestSigner.from_dict(_item) + for _item in obj["signers"] + ] + if obj.get("signers") is not None + else None + ), + "grouped_signers": ( + [ + SubSignatureRequestGroupedSigners.from_dict(_item) + for _item in obj["grouped_signers"] + ] + if obj.get("grouped_signers") is not None + else None + ), + "allow_decline": ( + obj.get("allow_decline") + if obj.get("allow_decline") is not None + else False + ), + "allow_reassign": ( + obj.get("allow_reassign") + if obj.get("allow_reassign") is not None + else False + ), + "attachments": ( + [SubAttachment.from_dict(_item) for _item in obj["attachments"]] + if obj.get("attachments") is not None + else None + ), + "cc_email_addresses": obj.get("cc_email_addresses"), + "custom_fields": ( + [SubCustomField.from_dict(_item) for _item in obj["custom_fields"]] + if obj.get("custom_fields") is not None + else None + ), + "field_options": ( + SubFieldOptions.from_dict(obj["field_options"]) + if obj.get("field_options") is not None + else None + ), + "form_field_groups": ( + [ + SubFormFieldGroup.from_dict(_item) + for _item in obj["form_field_groups"] + ] + if obj.get("form_field_groups") is not None + else None + ), + "form_field_rules": ( + [ + SubFormFieldRule.from_dict(_item) + for _item in obj["form_field_rules"] + ] + if obj.get("form_field_rules") is not None + else None + ), + "form_fields_per_document": ( + [ + SubFormFieldsPerDocumentBase.from_dict(_item) + for _item in obj["form_fields_per_document"] + ] + if obj.get("form_fields_per_document") is not None + else None + ), + "hide_text_tags": ( + obj.get("hide_text_tags") + if obj.get("hide_text_tags") is not None + else False + ), + "message": obj.get("message"), + "metadata": obj.get("metadata"), + "signing_options": ( + SubSigningOptions.from_dict(obj["signing_options"]) + if obj.get("signing_options") is not None + else None + ), + "subject": obj.get("subject"), + "test_mode": ( + obj.get("test_mode") if obj.get("test_mode") is not None else False + ), + "title": obj.get("title"), + "use_text_tags": ( + obj.get("use_text_tags") + if obj.get("use_text_tags") is not None + else False + ), + "populate_auto_fill_fields": ( + obj.get("populate_auto_fill_fields") + if obj.get("populate_auto_fill_fields") is not None + else False + ), + "expires_at": obj.get("expires_at"), + } + ) + return _obj + + @classmethod + def init(cls, data: Any) -> Self: + """ + Attempt to instantiate and hydrate a new instance of this class + """ + if isinstance(data, str): + data = json.loads(data) + + return cls.from_dict(data) + + @classmethod + def openapi_types(cls) -> Dict[str, str]: + return { + "client_id": "(str,)", + "files": "(List[io.IOBase],)", + "file_urls": "(List[str],)", + "signers": "(List[SubSignatureRequestSigner],)", + "grouped_signers": "(List[SubSignatureRequestGroupedSigners],)", + "allow_decline": "(bool,)", + "allow_reassign": "(bool,)", + "attachments": "(List[SubAttachment],)", + "cc_email_addresses": "(List[str],)", + "custom_fields": "(List[SubCustomField],)", + "field_options": "(SubFieldOptions,)", + "form_field_groups": "(List[SubFormFieldGroup],)", + "form_field_rules": "(List[SubFormFieldRule],)", + "form_fields_per_document": "(List[SubFormFieldsPerDocumentBase],)", + "hide_text_tags": "(bool,)", + "message": "(str,)", + "metadata": "(Dict[str, object],)", + "signing_options": "(SubSigningOptions,)", + "subject": "(str,)", + "test_mode": "(bool,)", + "title": "(str,)", + "use_text_tags": "(bool,)", + "populate_auto_fill_fields": "(bool,)", + "expires_at": "(int,)", + } + + @classmethod + def openapi_type_is_array(cls, property_name: str) -> bool: + return property_name in [ + "files", + "file_urls", + "signers", + "grouped_signers", + "attachments", + "cc_email_addresses", + "custom_fields", + "form_field_groups", + "form_field_rules", + "form_fields_per_document", + ] diff --git a/sdks/python/dropbox_sign/models/signature_request_edit_embedded_with_template_request.py b/sdks/python/dropbox_sign/models/signature_request_edit_embedded_with_template_request.py new file mode 100644 index 000000000..932165f3b --- /dev/null +++ b/sdks/python/dropbox_sign/models/signature_request_edit_embedded_with_template_request.py @@ -0,0 +1,288 @@ +# coding: utf-8 + +""" +Dropbox Sign API + +Dropbox Sign v3 API + +The version of the OpenAPI document: 3.0.0 +Contact: apisupport@hellosign.com +Generated by OpenAPI Generator (https://openapi-generator.tech) + +Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictBytes, StrictStr +from typing import Any, ClassVar, Dict, List, Optional, Union +from typing_extensions import Annotated +from dropbox_sign.models.sub_cc import SubCC +from dropbox_sign.models.sub_custom_field import SubCustomField +from dropbox_sign.models.sub_signature_request_template_signer import ( + SubSignatureRequestTemplateSigner, +) +from dropbox_sign.models.sub_signing_options import SubSigningOptions +from typing import Optional, Set, Tuple +from typing_extensions import Self +import io +from pydantic import StrictBool +from typing import Union + + +class SignatureRequestEditEmbeddedWithTemplateRequest(BaseModel): + """ + SignatureRequestEditEmbeddedWithTemplateRequest + """ # noqa: E501 + + template_ids: List[StrictStr] = Field( + description="Use `template_ids` to create a SignatureRequest from one or more templates, in the order in which the template will be used." + ) + client_id: StrictStr = Field( + description="Client id of the app you're using to create this embedded signature request. Used for security purposes." + ) + signers: List[SubSignatureRequestTemplateSigner] = Field( + description="Add Signers to your Templated-based Signature Request." + ) + allow_decline: Optional[StrictBool] = Field( + default=False, + description="Allows signers to decline to sign a document if `true`. Defaults to `false`.", + ) + ccs: Optional[List[SubCC]] = Field( + default=None, + description="Add CC email recipients. Required when a CC role exists for the Template.", + ) + custom_fields: Optional[List[SubCustomField]] = Field( + default=None, + description="An array defining values and options for custom fields. Required when a custom field exists in the Template.", + ) + files: Optional[List[Union[StrictBytes, StrictStr, io.IOBase]]] = Field( + default=None, + description="Use `files[]` to indicate the uploaded file(s) to send for signature. This endpoint requires either **files** or **file_urls[]**, but not both.", + ) + file_urls: Optional[List[StrictStr]] = Field( + default=None, + description="Use `file_urls[]` to have Dropbox Sign download the file(s) to send for signature. This endpoint requires either **files** or **file_urls[]**, but not both.", + ) + message: Optional[Annotated[str, Field(strict=True, max_length=5000)]] = Field( + default=None, + description="The custom message in the email that will be sent to the signers.", + ) + metadata: Optional[Dict[str, Any]] = Field( + default=None, + description="Key-value data that should be attached to the signature request. This metadata is included in all API responses and events involving the signature request. For example, use the metadata field to store a signer's order number for look up when receiving events for the signature request. Each request can include up to 10 metadata keys (or 50 nested metadata keys), with key names up to 40 characters long and values up to 1000 characters long.", + ) + signing_options: Optional[SubSigningOptions] = None + subject: Optional[Annotated[str, Field(strict=True, max_length=255)]] = Field( + default=None, + description="The subject in the email that will be sent to the signers.", + ) + test_mode: Optional[StrictBool] = Field( + default=False, + description="Whether this is a test, the signature request will not be legally binding if set to `true`. Defaults to `false`.", + ) + title: Optional[Annotated[str, Field(strict=True, max_length=255)]] = Field( + default=None, + description="The title you want to assign to the SignatureRequest.", + ) + populate_auto_fill_fields: Optional[StrictBool] = Field( + default=False, + description="Controls whether [auto fill fields](https://faq.hellosign.com/hc/en-us/articles/360051467511-Auto-Fill-Fields) can automatically populate a signer's information during signing. **NOTE:** Keep your signer's information safe by ensuring that the _signer on your signature request is the intended party_ before using this feature.", + ) + __properties: ClassVar[List[str]] = [ + "template_ids", + "client_id", + "signers", + "allow_decline", + "ccs", + "custom_fields", + "files", + "file_urls", + "message", + "metadata", + "signing_options", + "subject", + "test_mode", + "title", + "populate_auto_fill_fields", + ] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + arbitrary_types_allowed=True, + ) + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + def to_json_form_params( + self, excluded_fields: Set[str] = None + ) -> List[Tuple[str, str]]: + data: List[Tuple[str, str]] = [] + + for key, value in self.to_dict(excluded_fields).items(): + if isinstance(value, (int, str, bool)): + data.append((key, value)) + else: + data.append((key, json.dumps(value, ensure_ascii=False))) + + return data + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of SignatureRequestEditEmbeddedWithTemplateRequest from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self, excluded_fields: Set[str] = None) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in signers (list) + _items = [] + if self.signers: + for _item_signers in self.signers: + if _item_signers: + _items.append(_item_signers.to_dict()) + _dict["signers"] = _items + # override the default output from pydantic by calling `to_dict()` of each item in ccs (list) + _items = [] + if self.ccs: + for _item_ccs in self.ccs: + if _item_ccs: + _items.append(_item_ccs.to_dict()) + _dict["ccs"] = _items + # override the default output from pydantic by calling `to_dict()` of each item in custom_fields (list) + _items = [] + if self.custom_fields: + for _item_custom_fields in self.custom_fields: + if _item_custom_fields: + _items.append(_item_custom_fields.to_dict()) + _dict["custom_fields"] = _items + # override the default output from pydantic by calling `to_dict()` of signing_options + if self.signing_options: + _dict["signing_options"] = self.signing_options.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of SignatureRequestEditEmbeddedWithTemplateRequest from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate( + { + "template_ids": obj.get("template_ids"), + "client_id": obj.get("client_id"), + "signers": ( + [ + SubSignatureRequestTemplateSigner.from_dict(_item) + for _item in obj["signers"] + ] + if obj.get("signers") is not None + else None + ), + "allow_decline": ( + obj.get("allow_decline") + if obj.get("allow_decline") is not None + else False + ), + "ccs": ( + [SubCC.from_dict(_item) for _item in obj["ccs"]] + if obj.get("ccs") is not None + else None + ), + "custom_fields": ( + [SubCustomField.from_dict(_item) for _item in obj["custom_fields"]] + if obj.get("custom_fields") is not None + else None + ), + "files": obj.get("files"), + "file_urls": obj.get("file_urls"), + "message": obj.get("message"), + "metadata": obj.get("metadata"), + "signing_options": ( + SubSigningOptions.from_dict(obj["signing_options"]) + if obj.get("signing_options") is not None + else None + ), + "subject": obj.get("subject"), + "test_mode": ( + obj.get("test_mode") if obj.get("test_mode") is not None else False + ), + "title": obj.get("title"), + "populate_auto_fill_fields": ( + obj.get("populate_auto_fill_fields") + if obj.get("populate_auto_fill_fields") is not None + else False + ), + } + ) + return _obj + + @classmethod + def init(cls, data: Any) -> Self: + """ + Attempt to instantiate and hydrate a new instance of this class + """ + if isinstance(data, str): + data = json.loads(data) + + return cls.from_dict(data) + + @classmethod + def openapi_types(cls) -> Dict[str, str]: + return { + "template_ids": "(List[str],)", + "client_id": "(str,)", + "signers": "(List[SubSignatureRequestTemplateSigner],)", + "allow_decline": "(bool,)", + "ccs": "(List[SubCC],)", + "custom_fields": "(List[SubCustomField],)", + "files": "(List[io.IOBase],)", + "file_urls": "(List[str],)", + "message": "(str,)", + "metadata": "(Dict[str, object],)", + "signing_options": "(SubSigningOptions,)", + "subject": "(str,)", + "test_mode": "(bool,)", + "title": "(str,)", + "populate_auto_fill_fields": "(bool,)", + } + + @classmethod + def openapi_type_is_array(cls, property_name: str) -> bool: + return property_name in [ + "template_ids", + "signers", + "ccs", + "custom_fields", + "files", + "file_urls", + ] diff --git a/sdks/python/dropbox_sign/models/signature_request_edit_request.py b/sdks/python/dropbox_sign/models/signature_request_edit_request.py new file mode 100644 index 000000000..7b3a96db4 --- /dev/null +++ b/sdks/python/dropbox_sign/models/signature_request_edit_request.py @@ -0,0 +1,446 @@ +# coding: utf-8 + +""" +Dropbox Sign API + +Dropbox Sign v3 API + +The version of the OpenAPI document: 3.0.0 +Contact: apisupport@hellosign.com +Generated by OpenAPI Generator (https://openapi-generator.tech) + +Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import ( + BaseModel, + ConfigDict, + Field, + StrictBool, + StrictBytes, + StrictInt, + StrictStr, +) +from typing import Any, ClassVar, Dict, List, Optional, Union +from typing_extensions import Annotated +from dropbox_sign.models.sub_attachment import SubAttachment +from dropbox_sign.models.sub_custom_field import SubCustomField +from dropbox_sign.models.sub_field_options import SubFieldOptions +from dropbox_sign.models.sub_form_field_group import SubFormFieldGroup +from dropbox_sign.models.sub_form_field_rule import SubFormFieldRule +from dropbox_sign.models.sub_form_fields_per_document_base import ( + SubFormFieldsPerDocumentBase, +) +from dropbox_sign.models.sub_signature_request_grouped_signers import ( + SubSignatureRequestGroupedSigners, +) +from dropbox_sign.models.sub_signature_request_signer import SubSignatureRequestSigner +from dropbox_sign.models.sub_signing_options import SubSigningOptions +from typing import Optional, Set, Tuple +from typing_extensions import Self +import io +from pydantic import StrictBool +from typing import Union + + +class SignatureRequestEditRequest(BaseModel): + """ + SignatureRequestEditRequest + """ # noqa: E501 + + files: Optional[List[Union[StrictBytes, StrictStr, io.IOBase]]] = Field( + default=None, + description="Use `files[]` to indicate the uploaded file(s) to send for signature. This endpoint requires either **files** or **file_urls[]**, but not both.", + ) + file_urls: Optional[List[StrictStr]] = Field( + default=None, + description="Use `file_urls[]` to have Dropbox Sign download the file(s) to send for signature. This endpoint requires either **files** or **file_urls[]**, but not both.", + ) + signers: Optional[List[SubSignatureRequestSigner]] = Field( + default=None, + description="Add Signers to your Signature Request. This endpoint requires either **signers** or **grouped_signers**, but not both.", + ) + grouped_signers: Optional[List[SubSignatureRequestGroupedSigners]] = Field( + default=None, + description="Add Grouped Signers to your Signature Request. This endpoint requires either **signers** or **grouped_signers**, but not both.", + ) + allow_decline: Optional[StrictBool] = Field( + default=False, + description="Allows signers to decline to sign a document if `true`. Defaults to `false`.", + ) + allow_reassign: Optional[StrictBool] = Field( + default=False, + description="Allows signers to reassign their signature requests to other signers if set to `true`. Defaults to `false`. **NOTE:** Only available for Premium plan and higher.", + ) + attachments: Optional[List[SubAttachment]] = Field( + default=None, description="A list describing the attachments" + ) + cc_email_addresses: Optional[List[StrictStr]] = Field( + default=None, description="The email addresses that should be CCed." + ) + client_id: Optional[StrictStr] = Field( + default=None, + description="The client id of the API App you want to associate with this request. Used to apply the branding and callback url defined for the app.", + ) + custom_fields: Optional[List[SubCustomField]] = Field( + default=None, + description='When used together with merge fields, `custom_fields` allows users to add pre-filled data to their signature requests. Pre-filled data can be used with "send-once" signature requests by adding merge fields with `form_fields_per_document` or [Text Tags](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) while passing values back with `custom_fields` together in one API call. For using pre-filled on repeatable signature requests, merge fields are added to templates in the Dropbox Sign UI or by calling [/template/create_embedded_draft](/api/reference/operation/templateCreateEmbeddedDraft) and then passing `custom_fields` on subsequent signature requests referencing that template.', + ) + field_options: Optional[SubFieldOptions] = None + form_field_groups: Optional[List[SubFormFieldGroup]] = Field( + default=None, + 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`.", + ) + form_field_rules: Optional[List[SubFormFieldRule]] = Field( + default=None, + description="Conditional Logic rules for fields defined in `form_fields_per_document`.", + ) + form_fields_per_document: Optional[List[SubFormFieldsPerDocumentBase]] = Field( + default=None, + 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`", + ) + hide_text_tags: Optional[StrictBool] = Field( + default=False, + description="Enables automatic Text Tag removal when set to true. **NOTE:** Removing text tags this way can cause unwanted clipping. We recommend leaving this setting on `false` and instead hiding your text tags using white text or a similar approach. See the [Text Tags Walkthrough](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) for more information.", + ) + is_eid: Optional[StrictBool] = Field( + default=False, + description="Send with a value of `true` if you wish to enable [electronic identification (eID)](https://www.hellosign.com/features/electronic-id), which requires the signer to verify their identity with an eID provider to sign a document.
**NOTE:** eID is only available on the Premium API plan. Cannot be used in `test_mode`. Only works on requests with one signer.", + ) + message: Optional[Annotated[str, Field(strict=True, max_length=5000)]] = Field( + default=None, + description="The custom message in the email that will be sent to the signers.", + ) + metadata: Optional[Dict[str, Any]] = Field( + default=None, + description="Key-value data that should be attached to the signature request. This metadata is included in all API responses and events involving the signature request. For example, use the metadata field to store a signer's order number for look up when receiving events for the signature request. Each request can include up to 10 metadata keys (or 50 nested metadata keys), with key names up to 40 characters long and values up to 1000 characters long.", + ) + signing_options: Optional[SubSigningOptions] = None + signing_redirect_url: Optional[StrictStr] = Field( + default=None, + description="The URL you want signers redirected to after they successfully sign.", + ) + subject: Optional[Annotated[str, Field(strict=True, max_length=255)]] = Field( + default=None, + description="The subject in the email that will be sent to the signers.", + ) + test_mode: Optional[StrictBool] = Field( + default=False, + description="Whether this is a test, the signature request will not be legally binding if set to `true`. Defaults to `false`.", + ) + title: Optional[Annotated[str, Field(strict=True, max_length=255)]] = Field( + default=None, + description="The title you want to assign to the SignatureRequest.", + ) + use_text_tags: Optional[StrictBool] = Field( + default=False, + description="Send with a value of `true` if you wish to enable [Text Tags](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) parsing in your document. Defaults to disabled, or `false`.", + ) + expires_at: Optional[StrictInt] = Field( + default=None, + description="When the signature request will expire. Unsigned signatures will be moved to the expired status, and no longer signable. See [Signature Request Expiration Date](https://developers.hellosign.com/docs/signature-request/expiration/) for details.", + ) + __properties: ClassVar[List[str]] = [ + "files", + "file_urls", + "signers", + "grouped_signers", + "allow_decline", + "allow_reassign", + "attachments", + "cc_email_addresses", + "client_id", + "custom_fields", + "field_options", + "form_field_groups", + "form_field_rules", + "form_fields_per_document", + "hide_text_tags", + "is_eid", + "message", + "metadata", + "signing_options", + "signing_redirect_url", + "subject", + "test_mode", + "title", + "use_text_tags", + "expires_at", + ] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + arbitrary_types_allowed=True, + ) + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + def to_json_form_params( + self, excluded_fields: Set[str] = None + ) -> List[Tuple[str, str]]: + data: List[Tuple[str, str]] = [] + + for key, value in self.to_dict(excluded_fields).items(): + if isinstance(value, (int, str, bool)): + data.append((key, value)) + else: + data.append((key, json.dumps(value, ensure_ascii=False))) + + return data + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of SignatureRequestEditRequest from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self, excluded_fields: Set[str] = None) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in signers (list) + _items = [] + if self.signers: + for _item_signers in self.signers: + if _item_signers: + _items.append(_item_signers.to_dict()) + _dict["signers"] = _items + # override the default output from pydantic by calling `to_dict()` of each item in grouped_signers (list) + _items = [] + if self.grouped_signers: + for _item_grouped_signers in self.grouped_signers: + if _item_grouped_signers: + _items.append(_item_grouped_signers.to_dict()) + _dict["grouped_signers"] = _items + # override the default output from pydantic by calling `to_dict()` of each item in attachments (list) + _items = [] + if self.attachments: + for _item_attachments in self.attachments: + if _item_attachments: + _items.append(_item_attachments.to_dict()) + _dict["attachments"] = _items + # override the default output from pydantic by calling `to_dict()` of each item in custom_fields (list) + _items = [] + if self.custom_fields: + for _item_custom_fields in self.custom_fields: + if _item_custom_fields: + _items.append(_item_custom_fields.to_dict()) + _dict["custom_fields"] = _items + # override the default output from pydantic by calling `to_dict()` of field_options + if self.field_options: + _dict["field_options"] = self.field_options.to_dict() + # override the default output from pydantic by calling `to_dict()` of each item in form_field_groups (list) + _items = [] + if self.form_field_groups: + for _item_form_field_groups in self.form_field_groups: + if _item_form_field_groups: + _items.append(_item_form_field_groups.to_dict()) + _dict["form_field_groups"] = _items + # override the default output from pydantic by calling `to_dict()` of each item in form_field_rules (list) + _items = [] + if self.form_field_rules: + for _item_form_field_rules in self.form_field_rules: + if _item_form_field_rules: + _items.append(_item_form_field_rules.to_dict()) + _dict["form_field_rules"] = _items + # override the default output from pydantic by calling `to_dict()` of each item in form_fields_per_document (list) + _items = [] + if self.form_fields_per_document: + for _item_form_fields_per_document in self.form_fields_per_document: + if _item_form_fields_per_document: + _items.append(_item_form_fields_per_document.to_dict()) + _dict["form_fields_per_document"] = _items + # override the default output from pydantic by calling `to_dict()` of signing_options + if self.signing_options: + _dict["signing_options"] = self.signing_options.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of SignatureRequestEditRequest from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate( + { + "files": obj.get("files"), + "file_urls": obj.get("file_urls"), + "signers": ( + [ + SubSignatureRequestSigner.from_dict(_item) + for _item in obj["signers"] + ] + if obj.get("signers") is not None + else None + ), + "grouped_signers": ( + [ + SubSignatureRequestGroupedSigners.from_dict(_item) + for _item in obj["grouped_signers"] + ] + if obj.get("grouped_signers") is not None + else None + ), + "allow_decline": ( + obj.get("allow_decline") + if obj.get("allow_decline") is not None + else False + ), + "allow_reassign": ( + obj.get("allow_reassign") + if obj.get("allow_reassign") is not None + else False + ), + "attachments": ( + [SubAttachment.from_dict(_item) for _item in obj["attachments"]] + if obj.get("attachments") is not None + else None + ), + "cc_email_addresses": obj.get("cc_email_addresses"), + "client_id": obj.get("client_id"), + "custom_fields": ( + [SubCustomField.from_dict(_item) for _item in obj["custom_fields"]] + if obj.get("custom_fields") is not None + else None + ), + "field_options": ( + SubFieldOptions.from_dict(obj["field_options"]) + if obj.get("field_options") is not None + else None + ), + "form_field_groups": ( + [ + SubFormFieldGroup.from_dict(_item) + for _item in obj["form_field_groups"] + ] + if obj.get("form_field_groups") is not None + else None + ), + "form_field_rules": ( + [ + SubFormFieldRule.from_dict(_item) + for _item in obj["form_field_rules"] + ] + if obj.get("form_field_rules") is not None + else None + ), + "form_fields_per_document": ( + [ + SubFormFieldsPerDocumentBase.from_dict(_item) + for _item in obj["form_fields_per_document"] + ] + if obj.get("form_fields_per_document") is not None + else None + ), + "hide_text_tags": ( + obj.get("hide_text_tags") + if obj.get("hide_text_tags") is not None + else False + ), + "is_eid": obj.get("is_eid") if obj.get("is_eid") is not None else False, + "message": obj.get("message"), + "metadata": obj.get("metadata"), + "signing_options": ( + SubSigningOptions.from_dict(obj["signing_options"]) + if obj.get("signing_options") is not None + else None + ), + "signing_redirect_url": obj.get("signing_redirect_url"), + "subject": obj.get("subject"), + "test_mode": ( + obj.get("test_mode") if obj.get("test_mode") is not None else False + ), + "title": obj.get("title"), + "use_text_tags": ( + obj.get("use_text_tags") + if obj.get("use_text_tags") is not None + else False + ), + "expires_at": obj.get("expires_at"), + } + ) + return _obj + + @classmethod + def init(cls, data: Any) -> Self: + """ + Attempt to instantiate and hydrate a new instance of this class + """ + if isinstance(data, str): + data = json.loads(data) + + return cls.from_dict(data) + + @classmethod + def openapi_types(cls) -> Dict[str, str]: + return { + "files": "(List[io.IOBase],)", + "file_urls": "(List[str],)", + "signers": "(List[SubSignatureRequestSigner],)", + "grouped_signers": "(List[SubSignatureRequestGroupedSigners],)", + "allow_decline": "(bool,)", + "allow_reassign": "(bool,)", + "attachments": "(List[SubAttachment],)", + "cc_email_addresses": "(List[str],)", + "client_id": "(str,)", + "custom_fields": "(List[SubCustomField],)", + "field_options": "(SubFieldOptions,)", + "form_field_groups": "(List[SubFormFieldGroup],)", + "form_field_rules": "(List[SubFormFieldRule],)", + "form_fields_per_document": "(List[SubFormFieldsPerDocumentBase],)", + "hide_text_tags": "(bool,)", + "is_eid": "(bool,)", + "message": "(str,)", + "metadata": "(Dict[str, object],)", + "signing_options": "(SubSigningOptions,)", + "signing_redirect_url": "(str,)", + "subject": "(str,)", + "test_mode": "(bool,)", + "title": "(str,)", + "use_text_tags": "(bool,)", + "expires_at": "(int,)", + } + + @classmethod + def openapi_type_is_array(cls, property_name: str) -> bool: + return property_name in [ + "files", + "file_urls", + "signers", + "grouped_signers", + "attachments", + "cc_email_addresses", + "custom_fields", + "form_field_groups", + "form_field_rules", + "form_fields_per_document", + ] diff --git a/sdks/python/dropbox_sign/models/signature_request_edit_with_template_request.py b/sdks/python/dropbox_sign/models/signature_request_edit_with_template_request.py new file mode 100644 index 000000000..8a9948136 --- /dev/null +++ b/sdks/python/dropbox_sign/models/signature_request_edit_with_template_request.py @@ -0,0 +1,290 @@ +# coding: utf-8 + +""" +Dropbox Sign API + +Dropbox Sign v3 API + +The version of the OpenAPI document: 3.0.0 +Contact: apisupport@hellosign.com +Generated by OpenAPI Generator (https://openapi-generator.tech) + +Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictBytes, StrictStr +from typing import Any, ClassVar, Dict, List, Optional, Union +from typing_extensions import Annotated +from dropbox_sign.models.sub_cc import SubCC +from dropbox_sign.models.sub_custom_field import SubCustomField +from dropbox_sign.models.sub_signature_request_template_signer import ( + SubSignatureRequestTemplateSigner, +) +from dropbox_sign.models.sub_signing_options import SubSigningOptions +from typing import Optional, Set, Tuple +from typing_extensions import Self +import io +from pydantic import StrictBool +from typing import Union + + +class SignatureRequestEditWithTemplateRequest(BaseModel): + """ """ # noqa: E501 + + template_ids: List[StrictStr] = Field( + description="Use `template_ids` to create a SignatureRequest from one or more templates, in the order in which the template will be used." + ) + signers: List[SubSignatureRequestTemplateSigner] = Field( + description="Add Signers to your Templated-based Signature Request." + ) + allow_decline: Optional[StrictBool] = Field( + default=False, + description="Allows signers to decline to sign a document if `true`. Defaults to `false`.", + ) + ccs: Optional[List[SubCC]] = Field( + default=None, + description="Add CC email recipients. Required when a CC role exists for the Template.", + ) + client_id: Optional[StrictStr] = Field( + default=None, + description="Client id of the app to associate with the signature request. Used to apply the branding and callback url defined for the app.", + ) + custom_fields: Optional[List[SubCustomField]] = Field( + default=None, + description="An array defining values and options for custom fields. Required when a custom field exists in the Template.", + ) + files: Optional[List[Union[StrictBytes, StrictStr, io.IOBase]]] = Field( + default=None, + description="Use `files[]` to indicate the uploaded file(s) to send for signature. This endpoint requires either **files** or **file_urls[]**, but not both.", + ) + file_urls: Optional[List[StrictStr]] = Field( + default=None, + description="Use `file_urls[]` to have Dropbox Sign download the file(s) to send for signature. This endpoint requires either **files** or **file_urls[]**, but not both.", + ) + is_eid: Optional[StrictBool] = Field( + default=False, + description="Send with a value of `true` if you wish to enable [electronic identification (eID)](https://www.hellosign.com/features/electronic-id), which requires the signer to verify their identity with an eID provider to sign a document.
**NOTE:** eID is only available on the Premium API plan. Cannot be used in `test_mode`. Only works on requests with one signer.", + ) + message: Optional[Annotated[str, Field(strict=True, max_length=5000)]] = Field( + default=None, + description="The custom message in the email that will be sent to the signers.", + ) + metadata: Optional[Dict[str, Any]] = Field( + default=None, + description="Key-value data that should be attached to the signature request. This metadata is included in all API responses and events involving the signature request. For example, use the metadata field to store a signer's order number for look up when receiving events for the signature request. Each request can include up to 10 metadata keys (or 50 nested metadata keys), with key names up to 40 characters long and values up to 1000 characters long.", + ) + signing_options: Optional[SubSigningOptions] = None + signing_redirect_url: Optional[StrictStr] = Field( + default=None, + description="The URL you want signers redirected to after they successfully sign.", + ) + subject: Optional[Annotated[str, Field(strict=True, max_length=255)]] = Field( + default=None, + description="The subject in the email that will be sent to the signers.", + ) + test_mode: Optional[StrictBool] = Field( + default=False, + description="Whether this is a test, the signature request will not be legally binding if set to `true`. Defaults to `false`.", + ) + title: Optional[Annotated[str, Field(strict=True, max_length=255)]] = Field( + default=None, + description="The title you want to assign to the SignatureRequest.", + ) + __properties: ClassVar[List[str]] = [ + "template_ids", + "signers", + "allow_decline", + "ccs", + "client_id", + "custom_fields", + "files", + "file_urls", + "is_eid", + "message", + "metadata", + "signing_options", + "signing_redirect_url", + "subject", + "test_mode", + "title", + ] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + arbitrary_types_allowed=True, + ) + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + def to_json_form_params( + self, excluded_fields: Set[str] = None + ) -> List[Tuple[str, str]]: + data: List[Tuple[str, str]] = [] + + for key, value in self.to_dict(excluded_fields).items(): + if isinstance(value, (int, str, bool)): + data.append((key, value)) + else: + data.append((key, json.dumps(value, ensure_ascii=False))) + + return data + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of SignatureRequestEditWithTemplateRequest from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self, excluded_fields: Set[str] = None) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in signers (list) + _items = [] + if self.signers: + for _item_signers in self.signers: + if _item_signers: + _items.append(_item_signers.to_dict()) + _dict["signers"] = _items + # override the default output from pydantic by calling `to_dict()` of each item in ccs (list) + _items = [] + if self.ccs: + for _item_ccs in self.ccs: + if _item_ccs: + _items.append(_item_ccs.to_dict()) + _dict["ccs"] = _items + # override the default output from pydantic by calling `to_dict()` of each item in custom_fields (list) + _items = [] + if self.custom_fields: + for _item_custom_fields in self.custom_fields: + if _item_custom_fields: + _items.append(_item_custom_fields.to_dict()) + _dict["custom_fields"] = _items + # override the default output from pydantic by calling `to_dict()` of signing_options + if self.signing_options: + _dict["signing_options"] = self.signing_options.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of SignatureRequestEditWithTemplateRequest from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate( + { + "template_ids": obj.get("template_ids"), + "signers": ( + [ + SubSignatureRequestTemplateSigner.from_dict(_item) + for _item in obj["signers"] + ] + if obj.get("signers") is not None + else None + ), + "allow_decline": ( + obj.get("allow_decline") + if obj.get("allow_decline") is not None + else False + ), + "ccs": ( + [SubCC.from_dict(_item) for _item in obj["ccs"]] + if obj.get("ccs") is not None + else None + ), + "client_id": obj.get("client_id"), + "custom_fields": ( + [SubCustomField.from_dict(_item) for _item in obj["custom_fields"]] + if obj.get("custom_fields") is not None + else None + ), + "files": obj.get("files"), + "file_urls": obj.get("file_urls"), + "is_eid": obj.get("is_eid") if obj.get("is_eid") is not None else False, + "message": obj.get("message"), + "metadata": obj.get("metadata"), + "signing_options": ( + SubSigningOptions.from_dict(obj["signing_options"]) + if obj.get("signing_options") is not None + else None + ), + "signing_redirect_url": obj.get("signing_redirect_url"), + "subject": obj.get("subject"), + "test_mode": ( + obj.get("test_mode") if obj.get("test_mode") is not None else False + ), + "title": obj.get("title"), + } + ) + return _obj + + @classmethod + def init(cls, data: Any) -> Self: + """ + Attempt to instantiate and hydrate a new instance of this class + """ + if isinstance(data, str): + data = json.loads(data) + + return cls.from_dict(data) + + @classmethod + def openapi_types(cls) -> Dict[str, str]: + return { + "template_ids": "(List[str],)", + "signers": "(List[SubSignatureRequestTemplateSigner],)", + "allow_decline": "(bool,)", + "ccs": "(List[SubCC],)", + "client_id": "(str,)", + "custom_fields": "(List[SubCustomField],)", + "files": "(List[io.IOBase],)", + "file_urls": "(List[str],)", + "is_eid": "(bool,)", + "message": "(str,)", + "metadata": "(Dict[str, object],)", + "signing_options": "(SubSigningOptions,)", + "signing_redirect_url": "(str,)", + "subject": "(str,)", + "test_mode": "(bool,)", + "title": "(str,)", + } + + @classmethod + def openapi_type_is_array(cls, property_name: str) -> bool: + return property_name in [ + "template_ids", + "signers", + "ccs", + "custom_fields", + "files", + "file_urls", + ] diff --git a/sdks/ruby/README.md b/sdks/ruby/README.md index 87678fae4..a7d3b1847 100644 --- a/sdks/ruby/README.md +++ b/sdks/ruby/README.md @@ -141,6 +141,10 @@ All URIs are relative to *https://api.hellosign.com/v3* |*Dropbox::Sign::SignatureRequestApi* | [**signature_request_cancel**](docs/SignatureRequestApi.md#signature_request_cancel) | **POST** /signature_request/cancel/{signature_request_id} | Cancel Incomplete Signature Request | |*Dropbox::Sign::SignatureRequestApi* | [**signature_request_create_embedded**](docs/SignatureRequestApi.md#signature_request_create_embedded) | **POST** /signature_request/create_embedded | Create Embedded Signature Request | |*Dropbox::Sign::SignatureRequestApi* | [**signature_request_create_embedded_with_template**](docs/SignatureRequestApi.md#signature_request_create_embedded_with_template) | **POST** /signature_request/create_embedded_with_template | Create Embedded Signature Request with Template | +|*Dropbox::Sign::SignatureRequestApi* | [**signature_request_edit**](docs/SignatureRequestApi.md#signature_request_edit) | **PUT** /signature_request/edit/{signature_request_id} | Edit Signature Request | +|*Dropbox::Sign::SignatureRequestApi* | [**signature_request_edit_embedded**](docs/SignatureRequestApi.md#signature_request_edit_embedded) | **PUT** /signature_request/edit_embedded/{signature_request_id} | Edit Embedded Signature Request | +|*Dropbox::Sign::SignatureRequestApi* | [**signature_request_edit_embedded_with_template**](docs/SignatureRequestApi.md#signature_request_edit_embedded_with_template) | **PUT** /signature_request/edit_embedded_with_template/{signature_request_id} | Edit Embedded Signature Request with Template | +|*Dropbox::Sign::SignatureRequestApi* | [**signature_request_edit_with_template**](docs/SignatureRequestApi.md#signature_request_edit_with_template) | **PUT** /signature_request/edit_with_template/{signature_request_id} | Edit Signature Request With Template | |*Dropbox::Sign::SignatureRequestApi* | [**signature_request_files**](docs/SignatureRequestApi.md#signature_request_files) | **GET** /signature_request/files/{signature_request_id} | Download Files | |*Dropbox::Sign::SignatureRequestApi* | [**signature_request_files_as_data_uri**](docs/SignatureRequestApi.md#signature_request_files_as_data_uri) | **GET** /signature_request/files_as_data_uri/{signature_request_id} | Download Files as Data Uri | |*Dropbox::Sign::SignatureRequestApi* | [**signature_request_files_as_file_url**](docs/SignatureRequestApi.md#signature_request_files_as_file_url) | **GET** /signature_request/files_as_file_url/{signature_request_id} | Download Files as File Url | @@ -244,6 +248,10 @@ All URIs are relative to *https://api.hellosign.com/v3* - [Dropbox::Sign::SignatureRequestBulkSendWithTemplateRequest](docs/SignatureRequestBulkSendWithTemplateRequest.md) - [Dropbox::Sign::SignatureRequestCreateEmbeddedRequest](docs/SignatureRequestCreateEmbeddedRequest.md) - [Dropbox::Sign::SignatureRequestCreateEmbeddedWithTemplateRequest](docs/SignatureRequestCreateEmbeddedWithTemplateRequest.md) + - [Dropbox::Sign::SignatureRequestEditEmbeddedRequest](docs/SignatureRequestEditEmbeddedRequest.md) + - [Dropbox::Sign::SignatureRequestEditEmbeddedWithTemplateRequest](docs/SignatureRequestEditEmbeddedWithTemplateRequest.md) + - [Dropbox::Sign::SignatureRequestEditRequest](docs/SignatureRequestEditRequest.md) + - [Dropbox::Sign::SignatureRequestEditWithTemplateRequest](docs/SignatureRequestEditWithTemplateRequest.md) - [Dropbox::Sign::SignatureRequestGetResponse](docs/SignatureRequestGetResponse.md) - [Dropbox::Sign::SignatureRequestListResponse](docs/SignatureRequestListResponse.md) - [Dropbox::Sign::SignatureRequestRemindRequest](docs/SignatureRequestRemindRequest.md) diff --git a/sdks/ruby/docs/SignatureRequestApi.md b/sdks/ruby/docs/SignatureRequestApi.md index 0261ffa5c..6e7299b54 100644 --- a/sdks/ruby/docs/SignatureRequestApi.md +++ b/sdks/ruby/docs/SignatureRequestApi.md @@ -9,6 +9,10 @@ All URIs are relative to *https://api.hellosign.com/v3* | [`signature_request_cancel`](SignatureRequestApi.md#signature_request_cancel) | **POST** `/signature_request/cancel/{signature_request_id}` | Cancel Incomplete Signature Request | | [`signature_request_create_embedded`](SignatureRequestApi.md#signature_request_create_embedded) | **POST** `/signature_request/create_embedded` | Create Embedded Signature Request | | [`signature_request_create_embedded_with_template`](SignatureRequestApi.md#signature_request_create_embedded_with_template) | **POST** `/signature_request/create_embedded_with_template` | Create Embedded Signature Request with Template | +| [`signature_request_edit`](SignatureRequestApi.md#signature_request_edit) | **PUT** `/signature_request/edit/{signature_request_id}` | Edit Signature Request | +| [`signature_request_edit_embedded`](SignatureRequestApi.md#signature_request_edit_embedded) | **PUT** `/signature_request/edit_embedded/{signature_request_id}` | Edit Embedded Signature Request | +| [`signature_request_edit_embedded_with_template`](SignatureRequestApi.md#signature_request_edit_embedded_with_template) | **PUT** `/signature_request/edit_embedded_with_template/{signature_request_id}` | Edit Embedded Signature Request with Template | +| [`signature_request_edit_with_template`](SignatureRequestApi.md#signature_request_edit_with_template) | **PUT** `/signature_request/edit_with_template/{signature_request_id}` | Edit Signature Request With Template | | [`signature_request_files`](SignatureRequestApi.md#signature_request_files) | **GET** `/signature_request/files/{signature_request_id}` | Download Files | | [`signature_request_files_as_data_uri`](SignatureRequestApi.md#signature_request_files_as_data_uri) | **GET** `/signature_request/files_as_data_uri/{signature_request_id}` | Download Files as Data Uri | | [`signature_request_files_as_file_url`](SignatureRequestApi.md#signature_request_files_as_file_url) | **GET** `/signature_request/files_as_file_url/{signature_request_id}` | Download Files as File Url | @@ -504,6 +508,417 @@ end - **Accept**: application/json +## `signature_request_edit` + +> ` signature_request_edit(signature_request_id, signature_request_edit_request)` + +Edit Signature Request + +Edits and sends a SignatureRequest with the submitted documents. If `form_fields_per_document` is not specified, a signature page will be affixed where all signers will be required to add their signature, signifying their agreement to all contained documents. **NOTE:** Edit and resend will not deduct your signature request quota. + +### Examples + +```ruby +require "dropbox-sign" + +Dropbox::Sign.configure do |config| + # Configure HTTP basic authorization: api_key + config.username = "YOUR_API_KEY" + + # or, configure Bearer (JWT) authorization: oauth2 + # config.access_token = "YOUR_ACCESS_TOKEN" +end + +signature_request_api = Dropbox::Sign::SignatureRequestApi.new + +signer_1 = Dropbox::Sign::SubSignatureRequestSigner.new +signer_1.email_address = "jack@example.com" +signer_1.name = "Jack" +signer_1.order = 0 + +signer_2 = Dropbox::Sign::SubSignatureRequestSigner.new +signer_2.email_address = "jill@example.com" +signer_2.name = "Jill" +signer_2.order = 1 + +signing_options = Dropbox::Sign::SubSigningOptions.new +signing_options.draw = true +signing_options.type = true +signing_options.upload = true +signing_options.phone = true +signing_options.default_type = "draw" + +field_options = Dropbox::Sign::SubFieldOptions.new +field_options.date_format = "DD - MM - YYYY" + +data = Dropbox::Sign::SignatureRequestEditRequest.new +data.title = "NDA with Acme Co." +data.subject = "The NDA we talked about" +data.message = "Please sign this NDA and then we can discuss more. Let me know if you have any questions." +data.signers = [signer_1, signer_2] +data.cc_email_addresses = [ + "lawyer1@dropboxsign.com", + "lawyer2@dropboxsign.com", +] +data.files = [File.new("example_signature_request.pdf", "r")] +data.metadata = { + custom_id: 1234, + custom_text: "NDA #9", +} +data.signing_options = signing_options +data.field_options = field_options +data.test_mode = true + +signature_request_id = "2f9781e1a8e2045224d808c153c2e1d3df6f8f2f" + +begin + result = signature_request_api.signature_request_edit(signature_request_id, data) + p result +rescue Dropbox::Sign::ApiError => e + puts "Exception when calling Dropbox Sign API: #{e}" +end + +``` + +#### Using the `signature_request_edit_with_http_info` variant + +This returns an Array which contains the response data, status code and headers. + +> `, Integer, Hash)> signature_request_edit_with_http_info(signature_request_id, signature_request_edit_request)` + +```ruby +begin + # Edit Signature Request + data, status_code, headers = api_instance.signature_request_edit_with_http_info(signature_request_id, signature_request_edit_request) + p status_code # => 2xx + p headers # => { ... } + p data # => +rescue Dropbox::Sign::ApiError => e + puts "Error when calling SignatureRequestApi->signature_request_edit_with_http_info: #{e}" +end +``` + +### Parameters + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| `signature_request_id` | **String** | The id of the SignatureRequest to edit. | | +| `signature_request_edit_request` | [**SignatureRequestEditRequest**](SignatureRequestEditRequest.md) | | | + +### Return type + +[**SignatureRequestGetResponse**](SignatureRequestGetResponse.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 + + +## `signature_request_edit_embedded` + +> ` signature_request_edit_embedded(signature_request_id, signature_request_edit_embedded_request)` + +Edit Embedded Signature Request + +Edits a SignatureRequest with the submitted documents to be signed in an embedded iFrame. If form_fields_per_document is not specified, a signature page will be affixed where all signers will be required to add their signature, signifying their agreement to all contained documents. Note that embedded signature requests can only be signed in embedded iFrames whereas normal signature requests can only be signed on Dropbox Sign. + +### Examples + +```ruby +require "dropbox-sign" + +Dropbox::Sign.configure do |config| + # Configure HTTP basic authorization: api_key + config.username = "YOUR_API_KEY" + + # or, configure Bearer (JWT) authorization: oauth2 + # config.access_token = "YOUR_ACCESS_TOKEN" +end + +signature_request_api = Dropbox::Sign::SignatureRequestApi.new + +signer_1 = Dropbox::Sign::SubSignatureRequestSigner.new +signer_1.email_address = "jack@example.com" +signer_1.name = "Jack" +signer_1.order = 0 + +signer_2 = Dropbox::Sign::SubSignatureRequestSigner.new +signer_2.email_address = "jill@example.com" +signer_2.name = "Jill" +signer_2.order = 1 + +signing_options = Dropbox::Sign::SubSigningOptions.new +signing_options.draw = true +signing_options.type = true +signing_options.upload = true +signing_options.phone = true +signing_options.default_type = "draw" + +data = Dropbox::Sign::SignatureRequestEditEmbeddedRequest.new +data.client_id = "ec64a202072370a737edf4a0eb7f4437" +data.title = "NDA with Acme Co." +data.subject = "The NDA we talked about" +data.message = "Please sign this NDA and then we can discuss more. Let me know if you have any questions." +data.signers = [signer_1, signer_2] +data.cc_email_addresses = ["lawyer1@dropboxsign.com", "lawyer2@dropboxsign.com"] +data.files = [File.new("example_signature_request.pdf", "r")] +data.signing_options = signing_options +data.test_mode = true + +signature_request_id = "2f9781e1a8e2045224d808c153c2e1d3df6f8f2f" + +begin + result = signature_request_api.signature_request_edit_embedded(signature_request_id, data) + p result +rescue Dropbox::Sign::ApiError => e + puts "Exception when calling Dropbox Sign API: #{e}" +end + +``` + +#### Using the `signature_request_edit_embedded_with_http_info` variant + +This returns an Array which contains the response data, status code and headers. + +> `, Integer, Hash)> signature_request_edit_embedded_with_http_info(signature_request_id, signature_request_edit_embedded_request)` + +```ruby +begin + # Edit Embedded Signature Request + data, status_code, headers = api_instance.signature_request_edit_embedded_with_http_info(signature_request_id, signature_request_edit_embedded_request) + p status_code # => 2xx + p headers # => { ... } + p data # => +rescue Dropbox::Sign::ApiError => e + puts "Error when calling SignatureRequestApi->signature_request_edit_embedded_with_http_info: #{e}" +end +``` + +### Parameters + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| `signature_request_id` | **String** | The id of the SignatureRequest to edit. | | +| `signature_request_edit_embedded_request` | [**SignatureRequestEditEmbeddedRequest**](SignatureRequestEditEmbeddedRequest.md) | | | + +### Return type + +[**SignatureRequestGetResponse**](SignatureRequestGetResponse.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 + + +## `signature_request_edit_embedded_with_template` + +> ` signature_request_edit_embedded_with_template(signature_request_id, signature_request_edit_embedded_with_template_request)` + +Edit Embedded Signature Request with Template + +Edits a SignatureRequest based on the given Template(s) to be signed in an embedded iFrame. Note that embedded signature requests can only be signed in embedded iFrames whereas normal signature requests can only be signed on Dropbox Sign. + +### Examples + +```ruby +require "dropbox-sign" + +Dropbox::Sign.configure do |config| + # Configure HTTP basic authorization: api_key + config.username = "YOUR_API_KEY" + + # or, configure Bearer (JWT) authorization: oauth2 + # config.access_token = "YOUR_ACCESS_TOKEN" +end + +signature_request_api = Dropbox::Sign::SignatureRequestApi.new + +signer_1 = Dropbox::Sign::SubSignatureRequestTemplateSigner.new +signer_1.role = "Client" +signer_1.email_address = "jack@example.com" +signer_1.name = "Jack" + +signing_options = Dropbox::Sign::SubSigningOptions.new +signing_options.draw = true +signing_options.type = true +signing_options.upload = true +signing_options.phone = true +signing_options.default_type = "draw" + +data = Dropbox::Sign::SignatureRequestEditEmbeddedWithTemplateRequest.new +data.client_id = "ec64a202072370a737edf4a0eb7f4437" +data.template_ids = ["c26b8a16784a872da37ea946b9ddec7c1e11dff6"] +data.subject = "Purchase Order" +data.message = "Glad we could come to an agreement." +data.signers = [signer_1] +data.signing_options = signing_options +data.test_mode = true + +signature_request_id = "2f9781e1a8e2045224d808c153c2e1d3df6f8f2f" + +begin + result = signature_request_api.signature_request_edit_embedded_with_template(signature_request_id, data) + p result +rescue Dropbox::Sign::ApiError => e + puts "Exception when calling Dropbox Sign API: #{e}" +end + +``` + +#### Using the `signature_request_edit_embedded_with_template_with_http_info` variant + +This returns an Array which contains the response data, status code and headers. + +> `, Integer, Hash)> signature_request_edit_embedded_with_template_with_http_info(signature_request_id, signature_request_edit_embedded_with_template_request)` + +```ruby +begin + # Edit Embedded Signature Request with Template + data, status_code, headers = api_instance.signature_request_edit_embedded_with_template_with_http_info(signature_request_id, signature_request_edit_embedded_with_template_request) + p status_code # => 2xx + p headers # => { ... } + p data # => +rescue Dropbox::Sign::ApiError => e + puts "Error when calling SignatureRequestApi->signature_request_edit_embedded_with_template_with_http_info: #{e}" +end +``` + +### Parameters + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| `signature_request_id` | **String** | The id of the SignatureRequest to edit. | | +| `signature_request_edit_embedded_with_template_request` | [**SignatureRequestEditEmbeddedWithTemplateRequest**](SignatureRequestEditEmbeddedWithTemplateRequest.md) | | | + +### Return type + +[**SignatureRequestGetResponse**](SignatureRequestGetResponse.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 + + +## `signature_request_edit_with_template` + +> ` signature_request_edit_with_template(signature_request_id, signature_request_edit_with_template_request)` + +Edit Signature Request With Template + +Edits and sends a SignatureRequest based off of the Template(s) specified with the template_ids parameter. **NOTE:** Edit and resend will not deduct your signature request quota. + +### Examples + +```ruby +require "dropbox-sign" + +Dropbox::Sign.configure do |config| + # Configure HTTP basic authorization: api_key + config.username = "YOUR_API_KEY" + + # or, configure Bearer (JWT) authorization: oauth2 + # config.access_token = "YOUR_ACCESS_TOKEN" +end + +signature_request_api = Dropbox::Sign::SignatureRequestApi.new + +signer_1 = Dropbox::Sign::SubSignatureRequestTemplateSigner.new +signer_1.role = "Client" +signer_1.email_address = "george@example.com" +signer_1.name = "George" + +cc_1 = Dropbox::Sign::SubCC.new +cc_1.role = "Accounting" +cc_1.email_address = "accounting@example.com" + +custom_field_1 = Dropbox::Sign::SubCustomField.new +custom_field_1.name = "Cost" +custom_field_1.value = "$20,000" +custom_field_1.editor = "Client" +custom_field_1.required = true + +signing_options = Dropbox::Sign::SubSigningOptions.new +signing_options.draw = true +signing_options.type = true +signing_options.upload = true +signing_options.phone = false +signing_options.default_type = "draw" + +data = Dropbox::Sign::SignatureRequestSendWithTemplateRequest.new +data.template_ids = ["c26b8a16784a872da37ea946b9ddec7c1e11dff6"] +data.subject = "Purchase Order" +data.message = "Glad we could come to an agreement." +data.signers = [signer_1] +data.ccs = [cc_1] +data.custom_fields = [custom_field_1] +data.signing_options = signing_options +data.test_mode = true + +signature_request_id = "2f9781e1a8e2045224d808c153c2e1d3df6f8f2f" + +begin + result = signature_request_api.signature_request_edit_with_template(signature_request_id, data) + p result +rescue Dropbox::Sign::ApiError => e + puts "Exception when calling Dropbox Sign API: #{e}" +end + +``` + +#### Using the `signature_request_edit_with_template_with_http_info` variant + +This returns an Array which contains the response data, status code and headers. + +> `, Integer, Hash)> signature_request_edit_with_template_with_http_info(signature_request_id, signature_request_edit_with_template_request)` + +```ruby +begin + # Edit Signature Request With Template + data, status_code, headers = api_instance.signature_request_edit_with_template_with_http_info(signature_request_id, signature_request_edit_with_template_request) + p status_code # => 2xx + p headers # => { ... } + p data # => +rescue Dropbox::Sign::ApiError => e + puts "Error when calling SignatureRequestApi->signature_request_edit_with_template_with_http_info: #{e}" +end +``` + +### Parameters + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| `signature_request_id` | **String** | The id of the SignatureRequest to edit. | | +| `signature_request_edit_with_template_request` | [**SignatureRequestEditWithTemplateRequest**](SignatureRequestEditWithTemplateRequest.md) | | | + +### Return type + +[**SignatureRequestGetResponse**](SignatureRequestGetResponse.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 + + ## `signature_request_files` > `File signature_request_files(signature_request_id, opts)` diff --git a/sdks/ruby/docs/SignatureRequestEditEmbeddedRequest.md b/sdks/ruby/docs/SignatureRequestEditEmbeddedRequest.md new file mode 100644 index 000000000..383cd8e89 --- /dev/null +++ b/sdks/ruby/docs/SignatureRequestEditEmbeddedRequest.md @@ -0,0 +1,33 @@ +# Dropbox::Sign::SignatureRequestEditEmbeddedRequest + + + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| `client_id`*_required_ | ```String``` | Client id of the app you're using to create this embedded signature request. Used for security purposes. | | +| `files` | ```Array``` | Use `files[]` to indicate the uploaded file(s) to send for signature.

This endpoint requires either **files** or **file_urls[]**, but not both. | | +| `file_urls` | ```Array``` | Use `file_urls[]` to have Dropbox Sign download the file(s) to send for signature.

This endpoint requires either **files** or **file_urls[]**, but not both. | | +| `signers` | [```Array```](SubSignatureRequestSigner.md) | Add Signers to your Signature Request.

This endpoint requires either **signers** or **grouped_signers**, but not both. | | +| `grouped_signers` | [```Array```](SubSignatureRequestGroupedSigners.md) | Add Grouped Signers to your Signature Request.

This endpoint requires either **signers** or **grouped_signers**, but not both. | | +| `allow_decline` | ```Boolean``` | Allows signers to decline to sign a document if `true`. Defaults to `false`. | [default to false] | +| `allow_reassign` | ```Boolean``` | Allows signers to reassign their signature requests to other signers if set to `true`. Defaults to `false`.

**NOTE:** Only available for Premium plan. | [default to false] | +| `attachments` | [```Array```](SubAttachment.md) | A list describing the attachments | | +| `cc_email_addresses` | ```Array``` | The email addresses that should be CCed. | | +| `custom_fields` | [```Array```](SubCustomField.md) | When used together with merge fields, `custom_fields` allows users to add pre-filled data to their signature requests.

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

For using pre-filled on repeatable signature requests, merge fields are added to templates in the Dropbox Sign UI or by calling [/template/create_embedded_draft](/api/reference/operation/templateCreateEmbeddedDraft) and then passing `custom_fields` on subsequent signature requests referencing that template. | | +| `field_options` | [```SubFieldOptions```](SubFieldOptions.md) | | | +| `form_field_groups` | [```Array```](SubFormFieldGroup.md) | Group information for fields defined in `form_fields_per_document`. String-indexed JSON array with `group_label` and `requirement` keys. `form_fields_per_document` must contain fields referencing a group defined in `form_field_groups`. | | +| `form_field_rules` | [```Array```](SubFormFieldRule.md) | Conditional Logic rules for fields defined in `form_fields_per_document`. | | +| `form_fields_per_document` | [```Array```](SubFormFieldsPerDocumentBase.md) | The fields that should appear on the document, expressed as an array of objects. (For more details you can read about it here: [Using Form Fields per Document](/docs/openapi/form-fields-per-document).)

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

* Text Field use `SubFormFieldsPerDocumentText`
* Dropdown Field use `SubFormFieldsPerDocumentDropdown`
* Hyperlink Field use `SubFormFieldsPerDocumentHyperlink`
* Checkbox Field use `SubFormFieldsPerDocumentCheckbox`
* Radio Field use `SubFormFieldsPerDocumentRadio`
* Signature Field use `SubFormFieldsPerDocumentSignature`
* Date Signed Field use `SubFormFieldsPerDocumentDateSigned`
* Initials Field use `SubFormFieldsPerDocumentInitials`
* Text Merge Field use `SubFormFieldsPerDocumentTextMerge`
* Checkbox Merge Field use `SubFormFieldsPerDocumentCheckboxMerge` | | +| `hide_text_tags` | ```Boolean``` | Enables automatic Text Tag removal when set to true.

**NOTE:** Removing text tags this way can cause unwanted clipping. We recommend leaving this setting on `false` and instead hiding your text tags using white text or a similar approach. See the [Text Tags Walkthrough](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) for more information. | [default to false] | +| `message` | ```String``` | The custom message in the email that will be sent to the signers. | | +| `metadata` | ```Hash``` | Key-value data that should be attached to the signature request. This metadata is included in all API responses and events involving the signature request. For example, use the metadata field to store a signer's order number for look up when receiving events for the signature request.

Each request can include up to 10 metadata keys (or 50 nested metadata keys), with key names up to 40 characters long and values up to 1000 characters long. | | +| `signing_options` | [```SubSigningOptions```](SubSigningOptions.md) | | | +| `subject` | ```String``` | The subject in the email that will be sent to the signers. | | +| `test_mode` | ```Boolean``` | Whether this is a test, the signature request will not be legally binding if set to `true`. Defaults to `false`. | [default to false] | +| `title` | ```String``` | The title you want to assign to the SignatureRequest. | | +| `use_text_tags` | ```Boolean``` | Send with a value of `true` if you wish to enable [Text Tags](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) parsing in your document. Defaults to disabled, or `false`. | [default to false] | +| `populate_auto_fill_fields` | ```Boolean``` | Controls whether [auto fill fields](https://faq.hellosign.com/hc/en-us/articles/360051467511-Auto-Fill-Fields) can automatically populate a signer's information during signing.

**NOTE:** Keep your signer's information safe by ensuring that the _signer on your signature request is the intended party_ before using this feature. | [default to false] | +| `expires_at` | ```Integer``` | When the signature request will expire. Unsigned signatures will be moved to the expired status, and no longer signable. See [Signature Request Expiration Date](https://developers.hellosign.com/docs/signature-request/expiration/) for details. | | + diff --git a/sdks/ruby/docs/SignatureRequestEditEmbeddedWithTemplateRequest.md b/sdks/ruby/docs/SignatureRequestEditEmbeddedWithTemplateRequest.md new file mode 100644 index 000000000..736cbf786 --- /dev/null +++ b/sdks/ruby/docs/SignatureRequestEditEmbeddedWithTemplateRequest.md @@ -0,0 +1,24 @@ +# Dropbox::Sign::SignatureRequestEditEmbeddedWithTemplateRequest + + + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| `template_ids`*_required_ | ```Array``` | Use `template_ids` to create a SignatureRequest from one or more templates, in the order in which the template will be used. | | +| `client_id`*_required_ | ```String``` | Client id of the app you're using to create this embedded signature request. Used for security purposes. | | +| `signers`*_required_ | [```Array```](SubSignatureRequestTemplateSigner.md) | Add Signers to your Templated-based Signature Request. | | +| `allow_decline` | ```Boolean``` | Allows signers to decline to sign a document if `true`. Defaults to `false`. | [default to false] | +| `ccs` | [```Array```](SubCC.md) | Add CC email recipients. Required when a CC role exists for the Template. | | +| `custom_fields` | [```Array```](SubCustomField.md) | An array defining values and options for custom fields. Required when a custom field exists in the Template. | | +| `files` | ```Array``` | Use `files[]` to indicate the uploaded file(s) to send for signature.

This endpoint requires either **files** or **file_urls[]**, but not both. | | +| `file_urls` | ```Array``` | Use `file_urls[]` to have Dropbox Sign download the file(s) to send for signature.

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

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

**NOTE:** Keep your signer's information safe by ensuring that the _signer on your signature request is the intended party_ before using this feature. | [default to false] | + diff --git a/sdks/ruby/docs/SignatureRequestEditRequest.md b/sdks/ruby/docs/SignatureRequestEditRequest.md new file mode 100644 index 000000000..39d575aa3 --- /dev/null +++ b/sdks/ruby/docs/SignatureRequestEditRequest.md @@ -0,0 +1,34 @@ +# Dropbox::Sign::SignatureRequestEditRequest + + + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| `files` | ```Array``` | Use `files[]` to indicate the uploaded file(s) to send for signature.

This endpoint requires either **files** or **file_urls[]**, but not both. | | +| `file_urls` | ```Array``` | Use `file_urls[]` to have Dropbox Sign download the file(s) to send for signature.

This endpoint requires either **files** or **file_urls[]**, but not both. | | +| `signers` | [```Array```](SubSignatureRequestSigner.md) | Add Signers to your Signature Request.

This endpoint requires either **signers** or **grouped_signers**, but not both. | | +| `grouped_signers` | [```Array```](SubSignatureRequestGroupedSigners.md) | Add Grouped Signers to your Signature Request.

This endpoint requires either **signers** or **grouped_signers**, but not both. | | +| `allow_decline` | ```Boolean``` | Allows signers to decline to sign a document if `true`. Defaults to `false`. | [default to false] | +| `allow_reassign` | ```Boolean``` | Allows signers to reassign their signature requests to other signers if set to `true`. Defaults to `false`.

**NOTE:** Only available for Premium plan and higher. | [default to false] | +| `attachments` | [```Array```](SubAttachment.md) | A list describing the attachments | | +| `cc_email_addresses` | ```Array``` | The email addresses that should be CCed. | | +| `client_id` | ```String``` | The client id of the API App you want to associate with this request. Used to apply the branding and callback url defined for the app. | | +| `custom_fields` | [```Array```](SubCustomField.md) | When used together with merge fields, `custom_fields` allows users to add pre-filled data to their signature requests.

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

For using pre-filled on repeatable signature requests, merge fields are added to templates in the Dropbox Sign UI or by calling [/template/create_embedded_draft](/api/reference/operation/templateCreateEmbeddedDraft) and then passing `custom_fields` on subsequent signature requests referencing that template. | | +| `field_options` | [```SubFieldOptions```](SubFieldOptions.md) | | | +| `form_field_groups` | [```Array```](SubFormFieldGroup.md) | Group information for fields defined in `form_fields_per_document`. String-indexed JSON array with `group_label` and `requirement` keys. `form_fields_per_document` must contain fields referencing a group defined in `form_field_groups`. | | +| `form_field_rules` | [```Array```](SubFormFieldRule.md) | Conditional Logic rules for fields defined in `form_fields_per_document`. | | +| `form_fields_per_document` | [```Array```](SubFormFieldsPerDocumentBase.md) | The fields that should appear on the document, expressed as an array of objects. (For more details you can read about it here: [Using Form Fields per Document](/docs/openapi/form-fields-per-document).)

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

* Text Field use `SubFormFieldsPerDocumentText`
* Dropdown Field use `SubFormFieldsPerDocumentDropdown`
* Hyperlink Field use `SubFormFieldsPerDocumentHyperlink`
* Checkbox Field use `SubFormFieldsPerDocumentCheckbox`
* Radio Field use `SubFormFieldsPerDocumentRadio`
* Signature Field use `SubFormFieldsPerDocumentSignature`
* Date Signed Field use `SubFormFieldsPerDocumentDateSigned`
* Initials Field use `SubFormFieldsPerDocumentInitials`
* Text Merge Field use `SubFormFieldsPerDocumentTextMerge`
* Checkbox Merge Field use `SubFormFieldsPerDocumentCheckboxMerge` | | +| `hide_text_tags` | ```Boolean``` | Enables automatic Text Tag removal when set to true.

**NOTE:** Removing text tags this way can cause unwanted clipping. We recommend leaving this setting on `false` and instead hiding your text tags using white text or a similar approach. See the [Text Tags Walkthrough](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) for more information. | [default to false] | +| `is_eid` | ```Boolean``` | Send with a value of `true` if you wish to enable [electronic identification (eID)](https://www.hellosign.com/features/electronic-id), which requires the signer to verify their identity with an eID provider to sign a document.<br>
**NOTE:** eID is only available on the Premium API plan. Cannot be used in `test_mode`. Only works on requests with one signer. | [default to false] | +| `message` | ```String``` | The custom message in the email that will be sent to the signers. | | +| `metadata` | ```Hash``` | Key-value data that should be attached to the signature request. This metadata is included in all API responses and events involving the signature request. For example, use the metadata field to store a signer's order number for look up when receiving events for the signature request.

Each request can include up to 10 metadata keys (or 50 nested metadata keys), with key names up to 40 characters long and values up to 1000 characters long. | | +| `signing_options` | [```SubSigningOptions```](SubSigningOptions.md) | | | +| `signing_redirect_url` | ```String``` | The URL you want signers redirected to after they successfully sign. | | +| `subject` | ```String``` | The subject in the email that will be sent to the signers. | | +| `test_mode` | ```Boolean``` | Whether this is a test, the signature request will not be legally binding if set to `true`. Defaults to `false`. | [default to false] | +| `title` | ```String``` | The title you want to assign to the SignatureRequest. | | +| `use_text_tags` | ```Boolean``` | Send with a value of `true` if you wish to enable [Text Tags](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) parsing in your document. Defaults to disabled, or `false`. | [default to false] | +| `expires_at` | ```Integer``` | When the signature request will expire. Unsigned signatures will be moved to the expired status, and no longer signable. See [Signature Request Expiration Date](https://developers.hellosign.com/docs/signature-request/expiration/) for details. | | + diff --git a/sdks/ruby/docs/SignatureRequestEditWithTemplateRequest.md b/sdks/ruby/docs/SignatureRequestEditWithTemplateRequest.md new file mode 100644 index 000000000..12b4bee82 --- /dev/null +++ b/sdks/ruby/docs/SignatureRequestEditWithTemplateRequest.md @@ -0,0 +1,25 @@ +# Dropbox::Sign::SignatureRequestEditWithTemplateRequest + + + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| `template_ids`*_required_ | ```Array``` | Use `template_ids` to create a SignatureRequest from one or more templates, in the order in which the template will be used. | | +| `signers`*_required_ | [```Array```](SubSignatureRequestTemplateSigner.md) | Add Signers to your Templated-based Signature Request. | | +| `allow_decline` | ```Boolean``` | Allows signers to decline to sign a document if `true`. Defaults to `false`. | [default to false] | +| `ccs` | [```Array```](SubCC.md) | Add CC email recipients. Required when a CC role exists for the Template. | | +| `client_id` | ```String``` | Client id of the app to associate with the signature request. Used to apply the branding and callback url defined for the app. | | +| `custom_fields` | [```Array```](SubCustomField.md) | An array defining values and options for custom fields. Required when a custom field exists in the Template. | | +| `files` | ```Array``` | Use `files[]` to indicate the uploaded file(s) to send for signature.

This endpoint requires either **files** or **file_urls[]**, but not both. | | +| `file_urls` | ```Array``` | Use `file_urls[]` to have Dropbox Sign download the file(s) to send for signature.

This endpoint requires either **files** or **file_urls[]**, but not both. | | +| `is_eid` | ```Boolean``` | Send with a value of `true` if you wish to enable [electronic identification (eID)](https://www.hellosign.com/features/electronic-id), which requires the signer to verify their identity with an eID provider to sign a document.<br>
**NOTE:** eID is only available on the Premium API plan. Cannot be used in `test_mode`. Only works on requests with one signer. | [default to false] | +| `message` | ```String``` | The custom message in the email that will be sent to the signers. | | +| `metadata` | ```Hash``` | Key-value data that should be attached to the signature request. This metadata is included in all API responses and events involving the signature request. For example, use the metadata field to store a signer's order number for look up when receiving events for the signature request.

Each request can include up to 10 metadata keys (or 50 nested metadata keys), with key names up to 40 characters long and values up to 1000 characters long. | | +| `signing_options` | [```SubSigningOptions```](SubSigningOptions.md) | | | +| `signing_redirect_url` | ```String``` | The URL you want signers redirected to after they successfully sign. | | +| `subject` | ```String``` | The subject in the email that will be sent to the signers. | | +| `test_mode` | ```Boolean``` | Whether this is a test, the signature request will not be legally binding if set to `true`. Defaults to `false`. | [default to false] | +| `title` | ```String``` | The title you want to assign to the SignatureRequest. | | + diff --git a/sdks/ruby/lib/dropbox-sign.rb b/sdks/ruby/lib/dropbox-sign.rb index 0921573f8..cd2a8b7ce 100644 --- a/sdks/ruby/lib/dropbox-sign.rb +++ b/sdks/ruby/lib/dropbox-sign.rb @@ -80,6 +80,10 @@ require 'dropbox-sign/models/signature_request_bulk_send_with_template_request' require 'dropbox-sign/models/signature_request_create_embedded_request' require 'dropbox-sign/models/signature_request_create_embedded_with_template_request' +require 'dropbox-sign/models/signature_request_edit_embedded_request' +require 'dropbox-sign/models/signature_request_edit_embedded_with_template_request' +require 'dropbox-sign/models/signature_request_edit_request' +require 'dropbox-sign/models/signature_request_edit_with_template_request' require 'dropbox-sign/models/signature_request_get_response' require 'dropbox-sign/models/signature_request_list_response' require 'dropbox-sign/models/signature_request_remind_request' diff --git a/sdks/ruby/lib/dropbox-sign/api/signature_request_api.rb b/sdks/ruby/lib/dropbox-sign/api/signature_request_api.rb index d61d27b46..6698e776f 100644 --- a/sdks/ruby/lib/dropbox-sign/api/signature_request_api.rb +++ b/sdks/ruby/lib/dropbox-sign/api/signature_request_api.rb @@ -525,6 +525,466 @@ def signature_request_create_embedded_with_template_with_http_info(signature_req return data, status_code, headers end + # Edit Signature Request + # Edits and sends a SignatureRequest with the submitted documents. If `form_fields_per_document` is not specified, a signature page will be affixed where all signers will be required to add their signature, signifying their agreement to all contained documents. **NOTE:** Edit and resend will not deduct your signature request quota. + # @param signature_request_id [String] The id of the SignatureRequest to edit. + # @param signature_request_edit_request [SignatureRequestEditRequest] + # @param [Hash] opts the optional parameters + # @return [SignatureRequestGetResponse] + def signature_request_edit(signature_request_id, signature_request_edit_request, opts = {}) + data, _status_code, _headers = signature_request_edit_with_http_info(signature_request_id, signature_request_edit_request, opts) + data + end + + # Edit Signature Request + # Edits and sends a SignatureRequest with the submitted documents. If `form_fields_per_document` is not specified, a signature page will be affixed where all signers will be required to add their signature, signifying their agreement to all contained documents. **NOTE:** Edit and resend will not deduct your signature request quota. + # @param signature_request_id [String] The id of the SignatureRequest to edit. + # @param signature_request_edit_request [SignatureRequestEditRequest] + # @param [Hash] opts the optional parameters + # @return [Array<(SignatureRequestGetResponse, Integer, Hash)>] SignatureRequestGetResponse data, response status code and response headers + def signature_request_edit_with_http_info(signature_request_id, signature_request_edit_request, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: SignatureRequestApi.signature_request_edit ...' + end + # verify the required parameter 'signature_request_id' is set + if @api_client.config.client_side_validation && signature_request_id.nil? + fail ArgumentError, "Missing the required parameter 'signature_request_id' when calling SignatureRequestApi.signature_request_edit" + end + # verify the required parameter 'signature_request_edit_request' is set + if @api_client.config.client_side_validation && signature_request_edit_request.nil? + fail ArgumentError, "Missing the required parameter 'signature_request_edit_request' when calling SignatureRequestApi.signature_request_edit" + end + # resource path + local_var_path = '/signature_request/edit/{signature_request_id}'.sub('{' + 'signature_request_id' + '}', CGI.escape(signature_request_id.to_s)) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] + # HTTP header 'Content-Type' + content_type = @api_client.select_header_content_type(['application/json', 'multipart/form-data']) + if !content_type.nil? + header_params['Content-Type'] = content_type + end + + post_body = {} + form_params = opts[:form_params] || {} + result = @api_client.generate_form_data( + signature_request_edit_request, + Dropbox::Sign::SignatureRequestEditRequest.openapi_types + ) + + # form parameters + if result[:has_file] + form_params = opts[:form_params] || result[:params] + header_params['Content-Type'] = 'multipart/form-data' + else + # http body (model) + post_body = opts[:debug_body] || result[:params] + end + + # return_type + return_type = opts[:debug_return_type] || 'SignatureRequestGetResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || ['api_key', 'oauth2'] + + new_options = opts.merge( + :operation => :"SignatureRequestApi.signature_request_edit", + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + begin + data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options) + rescue Dropbox::Sign::ApiError => e + if e.code === 200 + body = @api_client.convert_to_type( + JSON.parse("[#{e.response_body}]", :symbolize_names => true)[0], + "Dropbox::Sign::SignatureRequestGetResponse" + ) + + fail ApiError.new(:code => e.code, + :response_headers => e.response_headers, + :response_body => body), + e.message + end + + range_code = "4XX".split('').first + range_code_left = "#{range_code}00".to_i + range_code_right = "#{range_code}99".to_i + if e.code >= range_code_left && e.code <= range_code_right + body = @api_client.convert_to_type( + JSON.parse("[#{e.response_body}]", :symbolize_names => true)[0], + "Dropbox::Sign::ErrorResponse" + ) + + fail ApiError.new(:code => e.code, + :response_headers => e.response_headers, + :response_body => body), + e.message + end + + end + + if @api_client.config.debugging + @api_client.config.logger.debug "API called: SignatureRequestApi#signature_request_edit\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Edit Embedded Signature Request + # Edits a SignatureRequest with the submitted documents to be signed in an embedded iFrame. If form_fields_per_document is not specified, a signature page will be affixed where all signers will be required to add their signature, signifying their agreement to all contained documents. Note that embedded signature requests can only be signed in embedded iFrames whereas normal signature requests can only be signed on Dropbox Sign. + # @param signature_request_id [String] The id of the SignatureRequest to edit. + # @param signature_request_edit_embedded_request [SignatureRequestEditEmbeddedRequest] + # @param [Hash] opts the optional parameters + # @return [SignatureRequestGetResponse] + def signature_request_edit_embedded(signature_request_id, signature_request_edit_embedded_request, opts = {}) + data, _status_code, _headers = signature_request_edit_embedded_with_http_info(signature_request_id, signature_request_edit_embedded_request, opts) + data + end + + # Edit Embedded Signature Request + # Edits a SignatureRequest with the submitted documents to be signed in an embedded iFrame. If form_fields_per_document is not specified, a signature page will be affixed where all signers will be required to add their signature, signifying their agreement to all contained documents. Note that embedded signature requests can only be signed in embedded iFrames whereas normal signature requests can only be signed on Dropbox Sign. + # @param signature_request_id [String] The id of the SignatureRequest to edit. + # @param signature_request_edit_embedded_request [SignatureRequestEditEmbeddedRequest] + # @param [Hash] opts the optional parameters + # @return [Array<(SignatureRequestGetResponse, Integer, Hash)>] SignatureRequestGetResponse data, response status code and response headers + def signature_request_edit_embedded_with_http_info(signature_request_id, signature_request_edit_embedded_request, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: SignatureRequestApi.signature_request_edit_embedded ...' + end + # verify the required parameter 'signature_request_id' is set + if @api_client.config.client_side_validation && signature_request_id.nil? + fail ArgumentError, "Missing the required parameter 'signature_request_id' when calling SignatureRequestApi.signature_request_edit_embedded" + end + # verify the required parameter 'signature_request_edit_embedded_request' is set + if @api_client.config.client_side_validation && signature_request_edit_embedded_request.nil? + fail ArgumentError, "Missing the required parameter 'signature_request_edit_embedded_request' when calling SignatureRequestApi.signature_request_edit_embedded" + end + # resource path + local_var_path = '/signature_request/edit_embedded/{signature_request_id}'.sub('{' + 'signature_request_id' + '}', CGI.escape(signature_request_id.to_s)) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] + # HTTP header 'Content-Type' + content_type = @api_client.select_header_content_type(['application/json', 'multipart/form-data']) + if !content_type.nil? + header_params['Content-Type'] = content_type + end + + post_body = {} + form_params = opts[:form_params] || {} + result = @api_client.generate_form_data( + signature_request_edit_embedded_request, + Dropbox::Sign::SignatureRequestEditEmbeddedRequest.openapi_types + ) + + # form parameters + if result[:has_file] + form_params = opts[:form_params] || result[:params] + header_params['Content-Type'] = 'multipart/form-data' + else + # http body (model) + post_body = opts[:debug_body] || result[:params] + end + + # return_type + return_type = opts[:debug_return_type] || 'SignatureRequestGetResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || ['api_key', 'oauth2'] + + new_options = opts.merge( + :operation => :"SignatureRequestApi.signature_request_edit_embedded", + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + begin + data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options) + rescue Dropbox::Sign::ApiError => e + if e.code === 200 + body = @api_client.convert_to_type( + JSON.parse("[#{e.response_body}]", :symbolize_names => true)[0], + "Dropbox::Sign::SignatureRequestGetResponse" + ) + + fail ApiError.new(:code => e.code, + :response_headers => e.response_headers, + :response_body => body), + e.message + end + + range_code = "4XX".split('').first + range_code_left = "#{range_code}00".to_i + range_code_right = "#{range_code}99".to_i + if e.code >= range_code_left && e.code <= range_code_right + body = @api_client.convert_to_type( + JSON.parse("[#{e.response_body}]", :symbolize_names => true)[0], + "Dropbox::Sign::ErrorResponse" + ) + + fail ApiError.new(:code => e.code, + :response_headers => e.response_headers, + :response_body => body), + e.message + end + + end + + if @api_client.config.debugging + @api_client.config.logger.debug "API called: SignatureRequestApi#signature_request_edit_embedded\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Edit Embedded Signature Request with Template + # Edits a SignatureRequest based on the given Template(s) to be signed in an embedded iFrame. Note that embedded signature requests can only be signed in embedded iFrames whereas normal signature requests can only be signed on Dropbox Sign. + # @param signature_request_id [String] The id of the SignatureRequest to edit. + # @param signature_request_edit_embedded_with_template_request [SignatureRequestEditEmbeddedWithTemplateRequest] + # @param [Hash] opts the optional parameters + # @return [SignatureRequestGetResponse] + def signature_request_edit_embedded_with_template(signature_request_id, signature_request_edit_embedded_with_template_request, opts = {}) + data, _status_code, _headers = signature_request_edit_embedded_with_template_with_http_info(signature_request_id, signature_request_edit_embedded_with_template_request, opts) + data + end + + # Edit Embedded Signature Request with Template + # Edits a SignatureRequest based on the given Template(s) to be signed in an embedded iFrame. Note that embedded signature requests can only be signed in embedded iFrames whereas normal signature requests can only be signed on Dropbox Sign. + # @param signature_request_id [String] The id of the SignatureRequest to edit. + # @param signature_request_edit_embedded_with_template_request [SignatureRequestEditEmbeddedWithTemplateRequest] + # @param [Hash] opts the optional parameters + # @return [Array<(SignatureRequestGetResponse, Integer, Hash)>] SignatureRequestGetResponse data, response status code and response headers + def signature_request_edit_embedded_with_template_with_http_info(signature_request_id, signature_request_edit_embedded_with_template_request, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: SignatureRequestApi.signature_request_edit_embedded_with_template ...' + end + # verify the required parameter 'signature_request_id' is set + if @api_client.config.client_side_validation && signature_request_id.nil? + fail ArgumentError, "Missing the required parameter 'signature_request_id' when calling SignatureRequestApi.signature_request_edit_embedded_with_template" + end + # verify the required parameter 'signature_request_edit_embedded_with_template_request' is set + if @api_client.config.client_side_validation && signature_request_edit_embedded_with_template_request.nil? + fail ArgumentError, "Missing the required parameter 'signature_request_edit_embedded_with_template_request' when calling SignatureRequestApi.signature_request_edit_embedded_with_template" + end + # resource path + local_var_path = '/signature_request/edit_embedded_with_template/{signature_request_id}'.sub('{' + 'signature_request_id' + '}', CGI.escape(signature_request_id.to_s)) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] + # HTTP header 'Content-Type' + content_type = @api_client.select_header_content_type(['application/json', 'multipart/form-data']) + if !content_type.nil? + header_params['Content-Type'] = content_type + end + + post_body = {} + form_params = opts[:form_params] || {} + result = @api_client.generate_form_data( + signature_request_edit_embedded_with_template_request, + Dropbox::Sign::SignatureRequestEditEmbeddedWithTemplateRequest.openapi_types + ) + + # form parameters + if result[:has_file] + form_params = opts[:form_params] || result[:params] + header_params['Content-Type'] = 'multipart/form-data' + else + # http body (model) + post_body = opts[:debug_body] || result[:params] + end + + # return_type + return_type = opts[:debug_return_type] || 'SignatureRequestGetResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || ['api_key', 'oauth2'] + + new_options = opts.merge( + :operation => :"SignatureRequestApi.signature_request_edit_embedded_with_template", + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + begin + data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options) + rescue Dropbox::Sign::ApiError => e + if e.code === 200 + body = @api_client.convert_to_type( + JSON.parse("[#{e.response_body}]", :symbolize_names => true)[0], + "Dropbox::Sign::SignatureRequestGetResponse" + ) + + fail ApiError.new(:code => e.code, + :response_headers => e.response_headers, + :response_body => body), + e.message + end + + range_code = "4XX".split('').first + range_code_left = "#{range_code}00".to_i + range_code_right = "#{range_code}99".to_i + if e.code >= range_code_left && e.code <= range_code_right + body = @api_client.convert_to_type( + JSON.parse("[#{e.response_body}]", :symbolize_names => true)[0], + "Dropbox::Sign::ErrorResponse" + ) + + fail ApiError.new(:code => e.code, + :response_headers => e.response_headers, + :response_body => body), + e.message + end + + end + + if @api_client.config.debugging + @api_client.config.logger.debug "API called: SignatureRequestApi#signature_request_edit_embedded_with_template\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Edit Signature Request With Template + # Edits and sends a SignatureRequest based off of the Template(s) specified with the template_ids parameter. **NOTE:** Edit and resend will not deduct your signature request quota. + # @param signature_request_id [String] The id of the SignatureRequest to edit. + # @param signature_request_edit_with_template_request [SignatureRequestEditWithTemplateRequest] + # @param [Hash] opts the optional parameters + # @return [SignatureRequestGetResponse] + def signature_request_edit_with_template(signature_request_id, signature_request_edit_with_template_request, opts = {}) + data, _status_code, _headers = signature_request_edit_with_template_with_http_info(signature_request_id, signature_request_edit_with_template_request, opts) + data + end + + # Edit Signature Request With Template + # Edits and sends a SignatureRequest based off of the Template(s) specified with the template_ids parameter. **NOTE:** Edit and resend will not deduct your signature request quota. + # @param signature_request_id [String] The id of the SignatureRequest to edit. + # @param signature_request_edit_with_template_request [SignatureRequestEditWithTemplateRequest] + # @param [Hash] opts the optional parameters + # @return [Array<(SignatureRequestGetResponse, Integer, Hash)>] SignatureRequestGetResponse data, response status code and response headers + def signature_request_edit_with_template_with_http_info(signature_request_id, signature_request_edit_with_template_request, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: SignatureRequestApi.signature_request_edit_with_template ...' + end + # verify the required parameter 'signature_request_id' is set + if @api_client.config.client_side_validation && signature_request_id.nil? + fail ArgumentError, "Missing the required parameter 'signature_request_id' when calling SignatureRequestApi.signature_request_edit_with_template" + end + # verify the required parameter 'signature_request_edit_with_template_request' is set + if @api_client.config.client_side_validation && signature_request_edit_with_template_request.nil? + fail ArgumentError, "Missing the required parameter 'signature_request_edit_with_template_request' when calling SignatureRequestApi.signature_request_edit_with_template" + end + # resource path + local_var_path = '/signature_request/edit_with_template/{signature_request_id}'.sub('{' + 'signature_request_id' + '}', CGI.escape(signature_request_id.to_s)) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] + # HTTP header 'Content-Type' + content_type = @api_client.select_header_content_type(['application/json', 'multipart/form-data']) + if !content_type.nil? + header_params['Content-Type'] = content_type + end + + post_body = {} + form_params = opts[:form_params] || {} + result = @api_client.generate_form_data( + signature_request_edit_with_template_request, + Dropbox::Sign::SignatureRequestEditWithTemplateRequest.openapi_types + ) + + # form parameters + if result[:has_file] + form_params = opts[:form_params] || result[:params] + header_params['Content-Type'] = 'multipart/form-data' + else + # http body (model) + post_body = opts[:debug_body] || result[:params] + end + + # return_type + return_type = opts[:debug_return_type] || 'SignatureRequestGetResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || ['api_key', 'oauth2'] + + new_options = opts.merge( + :operation => :"SignatureRequestApi.signature_request_edit_with_template", + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + begin + data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options) + rescue Dropbox::Sign::ApiError => e + if e.code === 200 + body = @api_client.convert_to_type( + JSON.parse("[#{e.response_body}]", :symbolize_names => true)[0], + "Dropbox::Sign::SignatureRequestGetResponse" + ) + + fail ApiError.new(:code => e.code, + :response_headers => e.response_headers, + :response_body => body), + e.message + end + + range_code = "4XX".split('').first + range_code_left = "#{range_code}00".to_i + range_code_right = "#{range_code}99".to_i + if e.code >= range_code_left && e.code <= range_code_right + body = @api_client.convert_to_type( + JSON.parse("[#{e.response_body}]", :symbolize_names => true)[0], + "Dropbox::Sign::ErrorResponse" + ) + + fail ApiError.new(:code => e.code, + :response_headers => e.response_headers, + :response_body => body), + e.message + end + + end + + if @api_client.config.debugging + @api_client.config.logger.debug "API called: SignatureRequestApi#signature_request_edit_with_template\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + # Download Files # Obtain a copy of the current documents specified by the `signature_request_id` parameter. Returns a PDF or ZIP file. If the files are currently being prepared, a status code of `409` will be returned instead. # @param signature_request_id [String] The id of the SignatureRequest to retrieve. diff --git a/sdks/ruby/lib/dropbox-sign/models/signature_request_edit_embedded_request.rb b/sdks/ruby/lib/dropbox-sign/models/signature_request_edit_embedded_request.rb new file mode 100644 index 000000000..266c043b9 --- /dev/null +++ b/sdks/ruby/lib/dropbox-sign/models/signature_request_edit_embedded_request.rb @@ -0,0 +1,588 @@ +=begin +#Dropbox Sign API + +#Dropbox Sign v3 API + +The version of the OpenAPI document: 3.0.0 +Contact: apisupport@hellosign.com +Generated by: https://openapi-generator.tech +Generator version: 7.8.0 + +=end + +require 'date' +require 'time' + +module Dropbox +end + +module Dropbox::Sign + class SignatureRequestEditEmbeddedRequest + # Client id of the app you're using to create this embedded signature request. Used for security purposes. + # @return [String] + attr_accessor :client_id + + # Use `files[]` to indicate the uploaded file(s) to send for signature. This endpoint requires either **files** or **file_urls[]**, but not both. + # @return [Array] + attr_accessor :files + + # Use `file_urls[]` to have Dropbox Sign download the file(s) to send for signature. This endpoint requires either **files** or **file_urls[]**, but not both. + # @return [Array] + attr_accessor :file_urls + + # Add Signers to your Signature Request. This endpoint requires either **signers** or **grouped_signers**, but not both. + # @return [Array] + attr_accessor :signers + + # Add Grouped Signers to your Signature Request. This endpoint requires either **signers** or **grouped_signers**, but not both. + # @return [Array] + attr_accessor :grouped_signers + + # Allows signers to decline to sign a document if `true`. Defaults to `false`. + # @return [Boolean] + attr_accessor :allow_decline + + # Allows signers to reassign their signature requests to other signers if set to `true`. Defaults to `false`. **NOTE:** Only available for Premium plan. + # @return [Boolean] + attr_accessor :allow_reassign + + # A list describing the attachments + # @return [Array] + attr_accessor :attachments + + # The email addresses that should be CCed. + # @return [Array] + attr_accessor :cc_email_addresses + + # When used together with merge fields, `custom_fields` allows users to add pre-filled data to their signature requests. Pre-filled data can be used with \"send-once\" signature requests by adding merge fields with `form_fields_per_document` or [Text Tags](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) while passing values back with `custom_fields` together in one API call. For using pre-filled on repeatable signature requests, merge fields are added to templates in the Dropbox Sign UI or by calling [/template/create_embedded_draft](/api/reference/operation/templateCreateEmbeddedDraft) and then passing `custom_fields` on subsequent signature requests referencing that template. + # @return [Array] + attr_accessor :custom_fields + + # @return [SubFieldOptions] + attr_accessor :field_options + + # Group information for fields defined in `form_fields_per_document`. String-indexed JSON array with `group_label` and `requirement` keys. `form_fields_per_document` must contain fields referencing a group defined in `form_field_groups`. + # @return [Array] + attr_accessor :form_field_groups + + # Conditional Logic rules for fields defined in `form_fields_per_document`. + # @return [Array] + attr_accessor :form_field_rules + + # The fields that should appear on the document, expressed as an array of objects. (For more details you can read about it here: [Using Form Fields per Document](/docs/openapi/form-fields-per-document).) **NOTE:** Fields like **text**, **dropdown**, **checkbox**, **radio**, and **hyperlink** have additional required and optional parameters. Check out the list of [additional parameters](/api/reference/constants/#form-fields-per-document) for these field types. * Text Field use `SubFormFieldsPerDocumentText` * Dropdown Field use `SubFormFieldsPerDocumentDropdown` * Hyperlink Field use `SubFormFieldsPerDocumentHyperlink` * Checkbox Field use `SubFormFieldsPerDocumentCheckbox` * Radio Field use `SubFormFieldsPerDocumentRadio` * Signature Field use `SubFormFieldsPerDocumentSignature` * Date Signed Field use `SubFormFieldsPerDocumentDateSigned` * Initials Field use `SubFormFieldsPerDocumentInitials` * Text Merge Field use `SubFormFieldsPerDocumentTextMerge` * Checkbox Merge Field use `SubFormFieldsPerDocumentCheckboxMerge` + # @return [Array] + attr_accessor :form_fields_per_document + + # Enables automatic Text Tag removal when set to true. **NOTE:** Removing text tags this way can cause unwanted clipping. We recommend leaving this setting on `false` and instead hiding your text tags using white text or a similar approach. See the [Text Tags Walkthrough](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) for more information. + # @return [Boolean] + attr_accessor :hide_text_tags + + # The custom message in the email that will be sent to the signers. + # @return [String] + attr_accessor :message + + # Key-value data that should be attached to the signature request. This metadata is included in all API responses and events involving the signature request. For example, use the metadata field to store a signer's order number for look up when receiving events for the signature request. Each request can include up to 10 metadata keys (or 50 nested metadata keys), with key names up to 40 characters long and values up to 1000 characters long. + # @return [Hash] + attr_accessor :metadata + + # @return [SubSigningOptions] + attr_accessor :signing_options + + # The subject in the email that will be sent to the signers. + # @return [String] + attr_accessor :subject + + # Whether this is a test, the signature request will not be legally binding if set to `true`. Defaults to `false`. + # @return [Boolean] + attr_accessor :test_mode + + # The title you want to assign to the SignatureRequest. + # @return [String] + attr_accessor :title + + # Send with a value of `true` if you wish to enable [Text Tags](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) parsing in your document. Defaults to disabled, or `false`. + # @return [Boolean] + attr_accessor :use_text_tags + + # 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. + # @return [Boolean] + attr_accessor :populate_auto_fill_fields + + # When the signature request will expire. Unsigned signatures will be moved to the expired status, and no longer signable. See [Signature Request Expiration Date](https://developers.hellosign.com/docs/signature-request/expiration/) for details. + # @return [Integer, nil] + attr_accessor :expires_at + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'client_id' => :'client_id', + :'files' => :'files', + :'file_urls' => :'file_urls', + :'signers' => :'signers', + :'grouped_signers' => :'grouped_signers', + :'allow_decline' => :'allow_decline', + :'allow_reassign' => :'allow_reassign', + :'attachments' => :'attachments', + :'cc_email_addresses' => :'cc_email_addresses', + :'custom_fields' => :'custom_fields', + :'field_options' => :'field_options', + :'form_field_groups' => :'form_field_groups', + :'form_field_rules' => :'form_field_rules', + :'form_fields_per_document' => :'form_fields_per_document', + :'hide_text_tags' => :'hide_text_tags', + :'message' => :'message', + :'metadata' => :'metadata', + :'signing_options' => :'signing_options', + :'subject' => :'subject', + :'test_mode' => :'test_mode', + :'title' => :'title', + :'use_text_tags' => :'use_text_tags', + :'populate_auto_fill_fields' => :'populate_auto_fill_fields', + :'expires_at' => :'expires_at' + } + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'client_id' => :'String', + :'files' => :'Array', + :'file_urls' => :'Array', + :'signers' => :'Array', + :'grouped_signers' => :'Array', + :'allow_decline' => :'Boolean', + :'allow_reassign' => :'Boolean', + :'attachments' => :'Array', + :'cc_email_addresses' => :'Array', + :'custom_fields' => :'Array', + :'field_options' => :'SubFieldOptions', + :'form_field_groups' => :'Array', + :'form_field_rules' => :'Array', + :'form_fields_per_document' => :'Array', + :'hide_text_tags' => :'Boolean', + :'message' => :'String', + :'metadata' => :'Hash', + :'signing_options' => :'SubSigningOptions', + :'subject' => :'String', + :'test_mode' => :'Boolean', + :'title' => :'String', + :'use_text_tags' => :'Boolean', + :'populate_auto_fill_fields' => :'Boolean', + :'expires_at' => :'Integer' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + :'expires_at' + ]) + end + + # Returns attribute map of this model + parent + def self.merged_attributes + self.attribute_map + end + + # Attribute type mapping of this model + parent + def self.merged_types + self.openapi_types + end + + # Returns list of attributes with nullable: true of this model + parent + def self.merged_nullable + self.openapi_nullable + end + + # Attempt to instantiate and hydrate a new instance of this class + # @param [Object] data Data to be converted + # @return [SignatureRequestEditEmbeddedRequest] + def self.init(data) + ApiClient.default.convert_to_type( + data, + "SignatureRequestEditEmbeddedRequest" + ) || SignatureRequestEditEmbeddedRequest.new + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `Dropbox::Sign::SignatureRequestEditEmbeddedRequest` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.merged_attributes.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `Dropbox::Sign::SignatureRequestEditEmbeddedRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'client_id') + self.client_id = attributes[:'client_id'] + end + + if attributes.key?(:'files') + if (value = attributes[:'files']).is_a?(Array) + self.files = value + end + end + + if attributes.key?(:'file_urls') + if (value = attributes[:'file_urls']).is_a?(Array) + self.file_urls = value + end + end + + if attributes.key?(:'signers') + if (value = attributes[:'signers']).is_a?(Array) + self.signers = value + end + end + + if attributes.key?(:'grouped_signers') + if (value = attributes[:'grouped_signers']).is_a?(Array) + self.grouped_signers = value + end + end + + if attributes.key?(:'allow_decline') + self.allow_decline = attributes[:'allow_decline'] + else + self.allow_decline = false + end + + if attributes.key?(:'allow_reassign') + self.allow_reassign = attributes[:'allow_reassign'] + else + self.allow_reassign = false + end + + if attributes.key?(:'attachments') + if (value = attributes[:'attachments']).is_a?(Array) + self.attachments = value + end + end + + if attributes.key?(:'cc_email_addresses') + if (value = attributes[:'cc_email_addresses']).is_a?(Array) + self.cc_email_addresses = value + end + end + + if attributes.key?(:'custom_fields') + if (value = attributes[:'custom_fields']).is_a?(Array) + self.custom_fields = value + end + end + + if attributes.key?(:'field_options') + self.field_options = attributes[:'field_options'] + end + + if attributes.key?(:'form_field_groups') + if (value = attributes[:'form_field_groups']).is_a?(Array) + self.form_field_groups = value + end + end + + if attributes.key?(:'form_field_rules') + if (value = attributes[:'form_field_rules']).is_a?(Array) + self.form_field_rules = value + end + end + + if attributes.key?(:'form_fields_per_document') + if (value = attributes[:'form_fields_per_document']).is_a?(Array) + self.form_fields_per_document = value + end + end + + if attributes.key?(:'hide_text_tags') + self.hide_text_tags = attributes[:'hide_text_tags'] + else + self.hide_text_tags = false + end + + if attributes.key?(:'message') + self.message = attributes[:'message'] + end + + if attributes.key?(:'metadata') + if (value = attributes[:'metadata']).is_a?(Hash) + self.metadata = value + end + end + + if attributes.key?(:'signing_options') + self.signing_options = attributes[:'signing_options'] + end + + if attributes.key?(:'subject') + self.subject = attributes[:'subject'] + end + + if attributes.key?(:'test_mode') + self.test_mode = attributes[:'test_mode'] + else + self.test_mode = false + end + + if attributes.key?(:'title') + self.title = attributes[:'title'] + end + + if attributes.key?(:'use_text_tags') + self.use_text_tags = attributes[:'use_text_tags'] + else + self.use_text_tags = false + end + + if attributes.key?(:'populate_auto_fill_fields') + self.populate_auto_fill_fields = attributes[:'populate_auto_fill_fields'] + else + self.populate_auto_fill_fields = false + end + + if attributes.key?(:'expires_at') + self.expires_at = attributes[:'expires_at'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + if @client_id.nil? + invalid_properties.push('invalid value for "client_id", client_id cannot be nil.') + end + + if !@message.nil? && @message.to_s.length > 5000 + invalid_properties.push('invalid value for "message", the character length must be smaller than or equal to 5000.') + end + + if !@subject.nil? && @subject.to_s.length > 255 + invalid_properties.push('invalid value for "subject", the character length must be smaller than or equal to 255.') + end + + if !@title.nil? && @title.to_s.length > 255 + invalid_properties.push('invalid value for "title", the character length must be smaller than or equal to 255.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + return false if @client_id.nil? + return false if !@message.nil? && @message.to_s.length > 5000 + return false if !@subject.nil? && @subject.to_s.length > 255 + return false if !@title.nil? && @title.to_s.length > 255 + true + end + + # Custom attribute writer method with validation + # @param [Object] message Value to be assigned + def message=(message) + if message.to_s.length > 5000 + fail ArgumentError, 'invalid value for "message", the character length must be smaller than or equal to 5000.' + end + + @message = message + end + + # Custom attribute writer method with validation + # @param [Object] metadata Value to be assigned + def metadata=(metadata) + @metadata = metadata + end + + # Custom attribute writer method with validation + # @param [Object] subject Value to be assigned + def subject=(subject) + if subject.to_s.length > 255 + fail ArgumentError, 'invalid value for "subject", the character length must be smaller than or equal to 255.' + end + + @subject = subject + end + + # Custom attribute writer method with validation + # @param [Object] title Value to be assigned + def title=(title) + if title.to_s.length > 255 + fail ArgumentError, 'invalid value for "title", the character length must be smaller than or equal to 255.' + end + + @title = title + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + client_id == o.client_id && + files == o.files && + file_urls == o.file_urls && + signers == o.signers && + grouped_signers == o.grouped_signers && + allow_decline == o.allow_decline && + allow_reassign == o.allow_reassign && + attachments == o.attachments && + cc_email_addresses == o.cc_email_addresses && + custom_fields == o.custom_fields && + field_options == o.field_options && + form_field_groups == o.form_field_groups && + form_field_rules == o.form_field_rules && + form_fields_per_document == o.form_fields_per_document && + hide_text_tags == o.hide_text_tags && + message == o.message && + metadata == o.metadata && + signing_options == o.signing_options && + subject == o.subject && + test_mode == o.test_mode && + title == o.title && + use_text_tags == o.use_text_tags && + populate_auto_fill_fields == o.populate_auto_fill_fields && + expires_at == o.expires_at + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [client_id, files, file_urls, signers, grouped_signers, allow_decline, allow_reassign, attachments, cc_email_addresses, custom_fields, field_options, form_field_groups, form_field_rules, form_fields_per_document, hide_text_tags, message, metadata, signing_options, subject, test_mode, title, use_text_tags, populate_auto_fill_fields, expires_at].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attribute_map = self.class.merged_attributes + + self.class.merged_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[attribute_map[key]])) + end + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + klass = Dropbox::Sign.const_get(type) + klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash(include_nil = true) + hash = {} + self.class.merged_attributes.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + next unless include_nil + is_nullable = self.class.merged_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value, include_nil) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value, include_nil = true) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v, include_nil) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v, include_nil) } + end + elsif value.respond_to? :to_hash + value.to_hash(include_nil) + else + value + end + end + end +end diff --git a/sdks/ruby/lib/dropbox-sign/models/signature_request_edit_embedded_with_template_request.rb b/sdks/ruby/lib/dropbox-sign/models/signature_request_edit_embedded_with_template_request.rb new file mode 100644 index 000000000..dfb0a6995 --- /dev/null +++ b/sdks/ruby/lib/dropbox-sign/models/signature_request_edit_embedded_with_template_request.rb @@ -0,0 +1,485 @@ +=begin +#Dropbox Sign API + +#Dropbox Sign v3 API + +The version of the OpenAPI document: 3.0.0 +Contact: apisupport@hellosign.com +Generated by: https://openapi-generator.tech +Generator version: 7.8.0 + +=end + +require 'date' +require 'time' + +module Dropbox +end + +module Dropbox::Sign + class SignatureRequestEditEmbeddedWithTemplateRequest + # Use `template_ids` to create a SignatureRequest from one or more templates, in the order in which the template will be used. + # @return [Array] + attr_accessor :template_ids + + # Client id of the app you're using to create this embedded signature request. Used for security purposes. + # @return [String] + attr_accessor :client_id + + # Add Signers to your Templated-based Signature Request. + # @return [Array] + attr_accessor :signers + + # Allows signers to decline to sign a document if `true`. Defaults to `false`. + # @return [Boolean] + attr_accessor :allow_decline + + # Add CC email recipients. Required when a CC role exists for the Template. + # @return [Array] + attr_accessor :ccs + + # An array defining values and options for custom fields. Required when a custom field exists in the Template. + # @return [Array] + attr_accessor :custom_fields + + # Use `files[]` to indicate the uploaded file(s) to send for signature. This endpoint requires either **files** or **file_urls[]**, but not both. + # @return [Array] + attr_accessor :files + + # Use `file_urls[]` to have Dropbox Sign download the file(s) to send for signature. This endpoint requires either **files** or **file_urls[]**, but not both. + # @return [Array] + attr_accessor :file_urls + + # The custom message in the email that will be sent to the signers. + # @return [String] + attr_accessor :message + + # Key-value data that should be attached to the signature request. This metadata is included in all API responses and events involving the signature request. For example, use the metadata field to store a signer's order number for look up when receiving events for the signature request. Each request can include up to 10 metadata keys (or 50 nested metadata keys), with key names up to 40 characters long and values up to 1000 characters long. + # @return [Hash] + attr_accessor :metadata + + # @return [SubSigningOptions] + attr_accessor :signing_options + + # The subject in the email that will be sent to the signers. + # @return [String] + attr_accessor :subject + + # Whether this is a test, the signature request will not be legally binding if set to `true`. Defaults to `false`. + # @return [Boolean] + attr_accessor :test_mode + + # The title you want to assign to the SignatureRequest. + # @return [String] + attr_accessor :title + + # 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. + # @return [Boolean] + attr_accessor :populate_auto_fill_fields + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'template_ids' => :'template_ids', + :'client_id' => :'client_id', + :'signers' => :'signers', + :'allow_decline' => :'allow_decline', + :'ccs' => :'ccs', + :'custom_fields' => :'custom_fields', + :'files' => :'files', + :'file_urls' => :'file_urls', + :'message' => :'message', + :'metadata' => :'metadata', + :'signing_options' => :'signing_options', + :'subject' => :'subject', + :'test_mode' => :'test_mode', + :'title' => :'title', + :'populate_auto_fill_fields' => :'populate_auto_fill_fields' + } + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'template_ids' => :'Array', + :'client_id' => :'String', + :'signers' => :'Array', + :'allow_decline' => :'Boolean', + :'ccs' => :'Array', + :'custom_fields' => :'Array', + :'files' => :'Array', + :'file_urls' => :'Array', + :'message' => :'String', + :'metadata' => :'Hash', + :'signing_options' => :'SubSigningOptions', + :'subject' => :'String', + :'test_mode' => :'Boolean', + :'title' => :'String', + :'populate_auto_fill_fields' => :'Boolean' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Returns attribute map of this model + parent + def self.merged_attributes + self.attribute_map + end + + # Attribute type mapping of this model + parent + def self.merged_types + self.openapi_types + end + + # Returns list of attributes with nullable: true of this model + parent + def self.merged_nullable + self.openapi_nullable + end + + # Attempt to instantiate and hydrate a new instance of this class + # @param [Object] data Data to be converted + # @return [SignatureRequestEditEmbeddedWithTemplateRequest] + def self.init(data) + ApiClient.default.convert_to_type( + data, + "SignatureRequestEditEmbeddedWithTemplateRequest" + ) || SignatureRequestEditEmbeddedWithTemplateRequest.new + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `Dropbox::Sign::SignatureRequestEditEmbeddedWithTemplateRequest` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.merged_attributes.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `Dropbox::Sign::SignatureRequestEditEmbeddedWithTemplateRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'template_ids') + if (value = attributes[:'template_ids']).is_a?(Array) + self.template_ids = value + end + end + + if attributes.key?(:'client_id') + self.client_id = attributes[:'client_id'] + end + + if attributes.key?(:'signers') + if (value = attributes[:'signers']).is_a?(Array) + self.signers = value + end + end + + if attributes.key?(:'allow_decline') + self.allow_decline = attributes[:'allow_decline'] + else + self.allow_decline = false + end + + if attributes.key?(:'ccs') + if (value = attributes[:'ccs']).is_a?(Array) + self.ccs = value + end + end + + if attributes.key?(:'custom_fields') + if (value = attributes[:'custom_fields']).is_a?(Array) + self.custom_fields = value + end + end + + if attributes.key?(:'files') + if (value = attributes[:'files']).is_a?(Array) + self.files = value + end + end + + if attributes.key?(:'file_urls') + if (value = attributes[:'file_urls']).is_a?(Array) + self.file_urls = value + end + end + + if attributes.key?(:'message') + self.message = attributes[:'message'] + end + + if attributes.key?(:'metadata') + if (value = attributes[:'metadata']).is_a?(Hash) + self.metadata = value + end + end + + if attributes.key?(:'signing_options') + self.signing_options = attributes[:'signing_options'] + end + + if attributes.key?(:'subject') + self.subject = attributes[:'subject'] + end + + if attributes.key?(:'test_mode') + self.test_mode = attributes[:'test_mode'] + else + self.test_mode = false + end + + if attributes.key?(:'title') + self.title = attributes[:'title'] + end + + if attributes.key?(:'populate_auto_fill_fields') + self.populate_auto_fill_fields = attributes[:'populate_auto_fill_fields'] + else + self.populate_auto_fill_fields = false + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + if @template_ids.nil? + invalid_properties.push('invalid value for "template_ids", template_ids cannot be nil.') + end + + if @client_id.nil? + invalid_properties.push('invalid value for "client_id", client_id cannot be nil.') + end + + if @signers.nil? + invalid_properties.push('invalid value for "signers", signers cannot be nil.') + end + + if !@message.nil? && @message.to_s.length > 5000 + invalid_properties.push('invalid value for "message", the character length must be smaller than or equal to 5000.') + end + + if !@subject.nil? && @subject.to_s.length > 255 + invalid_properties.push('invalid value for "subject", the character length must be smaller than or equal to 255.') + end + + if !@title.nil? && @title.to_s.length > 255 + invalid_properties.push('invalid value for "title", the character length must be smaller than or equal to 255.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + return false if @template_ids.nil? + return false if @client_id.nil? + return false if @signers.nil? + return false if !@message.nil? && @message.to_s.length > 5000 + return false if !@subject.nil? && @subject.to_s.length > 255 + return false if !@title.nil? && @title.to_s.length > 255 + true + end + + # Custom attribute writer method with validation + # @param [Object] message Value to be assigned + def message=(message) + if message.to_s.length > 5000 + fail ArgumentError, 'invalid value for "message", the character length must be smaller than or equal to 5000.' + end + + @message = message + end + + # Custom attribute writer method with validation + # @param [Object] metadata Value to be assigned + def metadata=(metadata) + @metadata = metadata + end + + # Custom attribute writer method with validation + # @param [Object] subject Value to be assigned + def subject=(subject) + if subject.to_s.length > 255 + fail ArgumentError, 'invalid value for "subject", the character length must be smaller than or equal to 255.' + end + + @subject = subject + end + + # Custom attribute writer method with validation + # @param [Object] title Value to be assigned + def title=(title) + if title.to_s.length > 255 + fail ArgumentError, 'invalid value for "title", the character length must be smaller than or equal to 255.' + end + + @title = title + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + template_ids == o.template_ids && + client_id == o.client_id && + signers == o.signers && + allow_decline == o.allow_decline && + ccs == o.ccs && + custom_fields == o.custom_fields && + files == o.files && + file_urls == o.file_urls && + message == o.message && + metadata == o.metadata && + signing_options == o.signing_options && + subject == o.subject && + test_mode == o.test_mode && + title == o.title && + populate_auto_fill_fields == o.populate_auto_fill_fields + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [template_ids, client_id, signers, allow_decline, ccs, custom_fields, files, file_urls, message, metadata, signing_options, subject, test_mode, title, populate_auto_fill_fields].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attribute_map = self.class.merged_attributes + + self.class.merged_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[attribute_map[key]])) + end + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + klass = Dropbox::Sign.const_get(type) + klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash(include_nil = true) + hash = {} + self.class.merged_attributes.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + next unless include_nil + is_nullable = self.class.merged_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value, include_nil) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value, include_nil = true) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v, include_nil) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v, include_nil) } + end + elsif value.respond_to? :to_hash + value.to_hash(include_nil) + else + value + end + end + end +end diff --git a/sdks/ruby/lib/dropbox-sign/models/signature_request_edit_request.rb b/sdks/ruby/lib/dropbox-sign/models/signature_request_edit_request.rb new file mode 100644 index 000000000..20d933f92 --- /dev/null +++ b/sdks/ruby/lib/dropbox-sign/models/signature_request_edit_request.rb @@ -0,0 +1,594 @@ +=begin +#Dropbox Sign API + +#Dropbox Sign v3 API + +The version of the OpenAPI document: 3.0.0 +Contact: apisupport@hellosign.com +Generated by: https://openapi-generator.tech +Generator version: 7.8.0 + +=end + +require 'date' +require 'time' + +module Dropbox +end + +module Dropbox::Sign + class SignatureRequestEditRequest + # Use `files[]` to indicate the uploaded file(s) to send for signature. This endpoint requires either **files** or **file_urls[]**, but not both. + # @return [Array] + attr_accessor :files + + # Use `file_urls[]` to have Dropbox Sign download the file(s) to send for signature. This endpoint requires either **files** or **file_urls[]**, but not both. + # @return [Array] + attr_accessor :file_urls + + # Add Signers to your Signature Request. This endpoint requires either **signers** or **grouped_signers**, but not both. + # @return [Array] + attr_accessor :signers + + # Add Grouped Signers to your Signature Request. This endpoint requires either **signers** or **grouped_signers**, but not both. + # @return [Array] + attr_accessor :grouped_signers + + # Allows signers to decline to sign a document if `true`. Defaults to `false`. + # @return [Boolean] + attr_accessor :allow_decline + + # Allows signers to reassign their signature requests to other signers if set to `true`. Defaults to `false`. **NOTE:** Only available for Premium plan and higher. + # @return [Boolean] + attr_accessor :allow_reassign + + # A list describing the attachments + # @return [Array] + attr_accessor :attachments + + # The email addresses that should be CCed. + # @return [Array] + attr_accessor :cc_email_addresses + + # The client id of the API App you want to associate with this request. Used to apply the branding and callback url defined for the app. + # @return [String] + attr_accessor :client_id + + # When used together with merge fields, `custom_fields` allows users to add pre-filled data to their signature requests. Pre-filled data can be used with \"send-once\" signature requests by adding merge fields with `form_fields_per_document` or [Text Tags](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) while passing values back with `custom_fields` together in one API call. For using pre-filled on repeatable signature requests, merge fields are added to templates in the Dropbox Sign UI or by calling [/template/create_embedded_draft](/api/reference/operation/templateCreateEmbeddedDraft) and then passing `custom_fields` on subsequent signature requests referencing that template. + # @return [Array] + attr_accessor :custom_fields + + # @return [SubFieldOptions] + attr_accessor :field_options + + # Group information for fields defined in `form_fields_per_document`. String-indexed JSON array with `group_label` and `requirement` keys. `form_fields_per_document` must contain fields referencing a group defined in `form_field_groups`. + # @return [Array] + attr_accessor :form_field_groups + + # Conditional Logic rules for fields defined in `form_fields_per_document`. + # @return [Array] + attr_accessor :form_field_rules + + # The fields that should appear on the document, expressed as an array of objects. (For more details you can read about it here: [Using Form Fields per Document](/docs/openapi/form-fields-per-document).) **NOTE:** Fields like **text**, **dropdown**, **checkbox**, **radio**, and **hyperlink** have additional required and optional parameters. Check out the list of [additional parameters](/api/reference/constants/#form-fields-per-document) for these field types. * Text Field use `SubFormFieldsPerDocumentText` * Dropdown Field use `SubFormFieldsPerDocumentDropdown` * Hyperlink Field use `SubFormFieldsPerDocumentHyperlink` * Checkbox Field use `SubFormFieldsPerDocumentCheckbox` * Radio Field use `SubFormFieldsPerDocumentRadio` * Signature Field use `SubFormFieldsPerDocumentSignature` * Date Signed Field use `SubFormFieldsPerDocumentDateSigned` * Initials Field use `SubFormFieldsPerDocumentInitials` * Text Merge Field use `SubFormFieldsPerDocumentTextMerge` * Checkbox Merge Field use `SubFormFieldsPerDocumentCheckboxMerge` + # @return [Array] + attr_accessor :form_fields_per_document + + # Enables automatic Text Tag removal when set to true. **NOTE:** Removing text tags this way can cause unwanted clipping. We recommend leaving this setting on `false` and instead hiding your text tags using white text or a similar approach. See the [Text Tags Walkthrough](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) for more information. + # @return [Boolean] + attr_accessor :hide_text_tags + + # Send with a value of `true` if you wish to enable [electronic identification (eID)](https://www.hellosign.com/features/electronic-id), which requires the signer to verify their identity with an eID provider to sign a document.
**NOTE:** eID is only available on the Premium API plan. Cannot be used in `test_mode`. Only works on requests with one signer. + # @return [Boolean] + attr_accessor :is_eid + + # The custom message in the email that will be sent to the signers. + # @return [String] + attr_accessor :message + + # Key-value data that should be attached to the signature request. This metadata is included in all API responses and events involving the signature request. For example, use the metadata field to store a signer's order number for look up when receiving events for the signature request. Each request can include up to 10 metadata keys (or 50 nested metadata keys), with key names up to 40 characters long and values up to 1000 characters long. + # @return [Hash] + attr_accessor :metadata + + # @return [SubSigningOptions] + attr_accessor :signing_options + + # The URL you want signers redirected to after they successfully sign. + # @return [String] + attr_accessor :signing_redirect_url + + # The subject in the email that will be sent to the signers. + # @return [String] + attr_accessor :subject + + # Whether this is a test, the signature request will not be legally binding if set to `true`. Defaults to `false`. + # @return [Boolean] + attr_accessor :test_mode + + # The title you want to assign to the SignatureRequest. + # @return [String] + attr_accessor :title + + # Send with a value of `true` if you wish to enable [Text Tags](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) parsing in your document. Defaults to disabled, or `false`. + # @return [Boolean] + attr_accessor :use_text_tags + + # When the signature request will expire. Unsigned signatures will be moved to the expired status, and no longer signable. See [Signature Request Expiration Date](https://developers.hellosign.com/docs/signature-request/expiration/) for details. + # @return [Integer, nil] + attr_accessor :expires_at + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'files' => :'files', + :'file_urls' => :'file_urls', + :'signers' => :'signers', + :'grouped_signers' => :'grouped_signers', + :'allow_decline' => :'allow_decline', + :'allow_reassign' => :'allow_reassign', + :'attachments' => :'attachments', + :'cc_email_addresses' => :'cc_email_addresses', + :'client_id' => :'client_id', + :'custom_fields' => :'custom_fields', + :'field_options' => :'field_options', + :'form_field_groups' => :'form_field_groups', + :'form_field_rules' => :'form_field_rules', + :'form_fields_per_document' => :'form_fields_per_document', + :'hide_text_tags' => :'hide_text_tags', + :'is_eid' => :'is_eid', + :'message' => :'message', + :'metadata' => :'metadata', + :'signing_options' => :'signing_options', + :'signing_redirect_url' => :'signing_redirect_url', + :'subject' => :'subject', + :'test_mode' => :'test_mode', + :'title' => :'title', + :'use_text_tags' => :'use_text_tags', + :'expires_at' => :'expires_at' + } + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'files' => :'Array', + :'file_urls' => :'Array', + :'signers' => :'Array', + :'grouped_signers' => :'Array', + :'allow_decline' => :'Boolean', + :'allow_reassign' => :'Boolean', + :'attachments' => :'Array', + :'cc_email_addresses' => :'Array', + :'client_id' => :'String', + :'custom_fields' => :'Array', + :'field_options' => :'SubFieldOptions', + :'form_field_groups' => :'Array', + :'form_field_rules' => :'Array', + :'form_fields_per_document' => :'Array', + :'hide_text_tags' => :'Boolean', + :'is_eid' => :'Boolean', + :'message' => :'String', + :'metadata' => :'Hash', + :'signing_options' => :'SubSigningOptions', + :'signing_redirect_url' => :'String', + :'subject' => :'String', + :'test_mode' => :'Boolean', + :'title' => :'String', + :'use_text_tags' => :'Boolean', + :'expires_at' => :'Integer' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + :'expires_at' + ]) + end + + # Returns attribute map of this model + parent + def self.merged_attributes + self.attribute_map + end + + # Attribute type mapping of this model + parent + def self.merged_types + self.openapi_types + end + + # Returns list of attributes with nullable: true of this model + parent + def self.merged_nullable + self.openapi_nullable + end + + # Attempt to instantiate and hydrate a new instance of this class + # @param [Object] data Data to be converted + # @return [SignatureRequestEditRequest] + def self.init(data) + ApiClient.default.convert_to_type( + data, + "SignatureRequestEditRequest" + ) || SignatureRequestEditRequest.new + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `Dropbox::Sign::SignatureRequestEditRequest` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.merged_attributes.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `Dropbox::Sign::SignatureRequestEditRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'files') + if (value = attributes[:'files']).is_a?(Array) + self.files = value + end + end + + if attributes.key?(:'file_urls') + if (value = attributes[:'file_urls']).is_a?(Array) + self.file_urls = value + end + end + + if attributes.key?(:'signers') + if (value = attributes[:'signers']).is_a?(Array) + self.signers = value + end + end + + if attributes.key?(:'grouped_signers') + if (value = attributes[:'grouped_signers']).is_a?(Array) + self.grouped_signers = value + end + end + + if attributes.key?(:'allow_decline') + self.allow_decline = attributes[:'allow_decline'] + else + self.allow_decline = false + end + + if attributes.key?(:'allow_reassign') + self.allow_reassign = attributes[:'allow_reassign'] + else + self.allow_reassign = false + end + + if attributes.key?(:'attachments') + if (value = attributes[:'attachments']).is_a?(Array) + self.attachments = value + end + end + + if attributes.key?(:'cc_email_addresses') + if (value = attributes[:'cc_email_addresses']).is_a?(Array) + self.cc_email_addresses = value + end + end + + if attributes.key?(:'client_id') + self.client_id = attributes[:'client_id'] + end + + if attributes.key?(:'custom_fields') + if (value = attributes[:'custom_fields']).is_a?(Array) + self.custom_fields = value + end + end + + if attributes.key?(:'field_options') + self.field_options = attributes[:'field_options'] + end + + if attributes.key?(:'form_field_groups') + if (value = attributes[:'form_field_groups']).is_a?(Array) + self.form_field_groups = value + end + end + + if attributes.key?(:'form_field_rules') + if (value = attributes[:'form_field_rules']).is_a?(Array) + self.form_field_rules = value + end + end + + if attributes.key?(:'form_fields_per_document') + if (value = attributes[:'form_fields_per_document']).is_a?(Array) + self.form_fields_per_document = value + end + end + + if attributes.key?(:'hide_text_tags') + self.hide_text_tags = attributes[:'hide_text_tags'] + else + self.hide_text_tags = false + end + + if attributes.key?(:'is_eid') + self.is_eid = attributes[:'is_eid'] + else + self.is_eid = false + end + + if attributes.key?(:'message') + self.message = attributes[:'message'] + end + + if attributes.key?(:'metadata') + if (value = attributes[:'metadata']).is_a?(Hash) + self.metadata = value + end + end + + if attributes.key?(:'signing_options') + self.signing_options = attributes[:'signing_options'] + end + + if attributes.key?(:'signing_redirect_url') + self.signing_redirect_url = attributes[:'signing_redirect_url'] + end + + if attributes.key?(:'subject') + self.subject = attributes[:'subject'] + end + + if attributes.key?(:'test_mode') + self.test_mode = attributes[:'test_mode'] + else + self.test_mode = false + end + + if attributes.key?(:'title') + self.title = attributes[:'title'] + end + + if attributes.key?(:'use_text_tags') + self.use_text_tags = attributes[:'use_text_tags'] + else + self.use_text_tags = false + end + + if attributes.key?(:'expires_at') + self.expires_at = attributes[:'expires_at'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + if !@message.nil? && @message.to_s.length > 5000 + invalid_properties.push('invalid value for "message", the character length must be smaller than or equal to 5000.') + end + + if !@subject.nil? && @subject.to_s.length > 255 + invalid_properties.push('invalid value for "subject", the character length must be smaller than or equal to 255.') + end + + if !@title.nil? && @title.to_s.length > 255 + invalid_properties.push('invalid value for "title", the character length must be smaller than or equal to 255.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + return false if !@message.nil? && @message.to_s.length > 5000 + return false if !@subject.nil? && @subject.to_s.length > 255 + return false if !@title.nil? && @title.to_s.length > 255 + true + end + + # Custom attribute writer method with validation + # @param [Object] message Value to be assigned + def message=(message) + if message.to_s.length > 5000 + fail ArgumentError, 'invalid value for "message", the character length must be smaller than or equal to 5000.' + end + + @message = message + end + + # Custom attribute writer method with validation + # @param [Object] metadata Value to be assigned + def metadata=(metadata) + @metadata = metadata + end + + # Custom attribute writer method with validation + # @param [Object] subject Value to be assigned + def subject=(subject) + if subject.to_s.length > 255 + fail ArgumentError, 'invalid value for "subject", the character length must be smaller than or equal to 255.' + end + + @subject = subject + end + + # Custom attribute writer method with validation + # @param [Object] title Value to be assigned + def title=(title) + if title.to_s.length > 255 + fail ArgumentError, 'invalid value for "title", the character length must be smaller than or equal to 255.' + end + + @title = title + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + files == o.files && + file_urls == o.file_urls && + signers == o.signers && + grouped_signers == o.grouped_signers && + allow_decline == o.allow_decline && + allow_reassign == o.allow_reassign && + attachments == o.attachments && + cc_email_addresses == o.cc_email_addresses && + client_id == o.client_id && + custom_fields == o.custom_fields && + field_options == o.field_options && + form_field_groups == o.form_field_groups && + form_field_rules == o.form_field_rules && + form_fields_per_document == o.form_fields_per_document && + hide_text_tags == o.hide_text_tags && + is_eid == o.is_eid && + message == o.message && + metadata == o.metadata && + signing_options == o.signing_options && + signing_redirect_url == o.signing_redirect_url && + subject == o.subject && + test_mode == o.test_mode && + title == o.title && + use_text_tags == o.use_text_tags && + expires_at == o.expires_at + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [files, file_urls, signers, grouped_signers, allow_decline, allow_reassign, attachments, cc_email_addresses, client_id, custom_fields, field_options, form_field_groups, form_field_rules, form_fields_per_document, hide_text_tags, is_eid, message, metadata, signing_options, signing_redirect_url, subject, test_mode, title, use_text_tags, expires_at].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attribute_map = self.class.merged_attributes + + self.class.merged_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[attribute_map[key]])) + end + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + klass = Dropbox::Sign.const_get(type) + klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash(include_nil = true) + hash = {} + self.class.merged_attributes.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + next unless include_nil + is_nullable = self.class.merged_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value, include_nil) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value, include_nil = true) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v, include_nil) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v, include_nil) } + end + elsif value.respond_to? :to_hash + value.to_hash(include_nil) + else + value + end + end + end +end diff --git a/sdks/ruby/lib/dropbox-sign/models/signature_request_edit_with_template_request.rb b/sdks/ruby/lib/dropbox-sign/models/signature_request_edit_with_template_request.rb new file mode 100644 index 000000000..64a29f3ab --- /dev/null +++ b/sdks/ruby/lib/dropbox-sign/models/signature_request_edit_with_template_request.rb @@ -0,0 +1,492 @@ +=begin +#Dropbox Sign API + +#Dropbox Sign v3 API + +The version of the OpenAPI document: 3.0.0 +Contact: apisupport@hellosign.com +Generated by: https://openapi-generator.tech +Generator version: 7.8.0 + +=end + +require 'date' +require 'time' + +module Dropbox +end + +module Dropbox::Sign + # + class SignatureRequestEditWithTemplateRequest + # Use `template_ids` to create a SignatureRequest from one or more templates, in the order in which the template will be used. + # @return [Array] + attr_accessor :template_ids + + # Add Signers to your Templated-based Signature Request. + # @return [Array] + attr_accessor :signers + + # Allows signers to decline to sign a document if `true`. Defaults to `false`. + # @return [Boolean] + attr_accessor :allow_decline + + # Add CC email recipients. Required when a CC role exists for the Template. + # @return [Array] + attr_accessor :ccs + + # Client id of the app to associate with the signature request. Used to apply the branding and callback url defined for the app. + # @return [String] + attr_accessor :client_id + + # An array defining values and options for custom fields. Required when a custom field exists in the Template. + # @return [Array] + attr_accessor :custom_fields + + # Use `files[]` to indicate the uploaded file(s) to send for signature. This endpoint requires either **files** or **file_urls[]**, but not both. + # @return [Array] + attr_accessor :files + + # Use `file_urls[]` to have Dropbox Sign download the file(s) to send for signature. This endpoint requires either **files** or **file_urls[]**, but not both. + # @return [Array] + attr_accessor :file_urls + + # Send with a value of `true` if you wish to enable [electronic identification (eID)](https://www.hellosign.com/features/electronic-id), which requires the signer to verify their identity with an eID provider to sign a document.
**NOTE:** eID is only available on the Premium API plan. Cannot be used in `test_mode`. Only works on requests with one signer. + # @return [Boolean] + attr_accessor :is_eid + + # The custom message in the email that will be sent to the signers. + # @return [String] + attr_accessor :message + + # Key-value data that should be attached to the signature request. This metadata is included in all API responses and events involving the signature request. For example, use the metadata field to store a signer's order number for look up when receiving events for the signature request. Each request can include up to 10 metadata keys (or 50 nested metadata keys), with key names up to 40 characters long and values up to 1000 characters long. + # @return [Hash] + attr_accessor :metadata + + # @return [SubSigningOptions] + attr_accessor :signing_options + + # The URL you want signers redirected to after they successfully sign. + # @return [String] + attr_accessor :signing_redirect_url + + # The subject in the email that will be sent to the signers. + # @return [String] + attr_accessor :subject + + # Whether this is a test, the signature request will not be legally binding if set to `true`. Defaults to `false`. + # @return [Boolean] + attr_accessor :test_mode + + # The title you want to assign to the SignatureRequest. + # @return [String] + attr_accessor :title + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'template_ids' => :'template_ids', + :'signers' => :'signers', + :'allow_decline' => :'allow_decline', + :'ccs' => :'ccs', + :'client_id' => :'client_id', + :'custom_fields' => :'custom_fields', + :'files' => :'files', + :'file_urls' => :'file_urls', + :'is_eid' => :'is_eid', + :'message' => :'message', + :'metadata' => :'metadata', + :'signing_options' => :'signing_options', + :'signing_redirect_url' => :'signing_redirect_url', + :'subject' => :'subject', + :'test_mode' => :'test_mode', + :'title' => :'title' + } + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'template_ids' => :'Array', + :'signers' => :'Array', + :'allow_decline' => :'Boolean', + :'ccs' => :'Array', + :'client_id' => :'String', + :'custom_fields' => :'Array', + :'files' => :'Array', + :'file_urls' => :'Array', + :'is_eid' => :'Boolean', + :'message' => :'String', + :'metadata' => :'Hash', + :'signing_options' => :'SubSigningOptions', + :'signing_redirect_url' => :'String', + :'subject' => :'String', + :'test_mode' => :'Boolean', + :'title' => :'String' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Returns attribute map of this model + parent + def self.merged_attributes + self.attribute_map + end + + # Attribute type mapping of this model + parent + def self.merged_types + self.openapi_types + end + + # Returns list of attributes with nullable: true of this model + parent + def self.merged_nullable + self.openapi_nullable + end + + # Attempt to instantiate and hydrate a new instance of this class + # @param [Object] data Data to be converted + # @return [SignatureRequestEditWithTemplateRequest] + def self.init(data) + ApiClient.default.convert_to_type( + data, + "SignatureRequestEditWithTemplateRequest" + ) || SignatureRequestEditWithTemplateRequest.new + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `Dropbox::Sign::SignatureRequestEditWithTemplateRequest` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.merged_attributes.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `Dropbox::Sign::SignatureRequestEditWithTemplateRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'template_ids') + if (value = attributes[:'template_ids']).is_a?(Array) + self.template_ids = value + end + end + + if attributes.key?(:'signers') + if (value = attributes[:'signers']).is_a?(Array) + self.signers = value + end + end + + if attributes.key?(:'allow_decline') + self.allow_decline = attributes[:'allow_decline'] + else + self.allow_decline = false + end + + if attributes.key?(:'ccs') + if (value = attributes[:'ccs']).is_a?(Array) + self.ccs = value + end + end + + if attributes.key?(:'client_id') + self.client_id = attributes[:'client_id'] + end + + if attributes.key?(:'custom_fields') + if (value = attributes[:'custom_fields']).is_a?(Array) + self.custom_fields = value + end + end + + if attributes.key?(:'files') + if (value = attributes[:'files']).is_a?(Array) + self.files = value + end + end + + if attributes.key?(:'file_urls') + if (value = attributes[:'file_urls']).is_a?(Array) + self.file_urls = value + end + end + + if attributes.key?(:'is_eid') + self.is_eid = attributes[:'is_eid'] + else + self.is_eid = false + end + + if attributes.key?(:'message') + self.message = attributes[:'message'] + end + + if attributes.key?(:'metadata') + if (value = attributes[:'metadata']).is_a?(Hash) + self.metadata = value + end + end + + if attributes.key?(:'signing_options') + self.signing_options = attributes[:'signing_options'] + end + + if attributes.key?(:'signing_redirect_url') + self.signing_redirect_url = attributes[:'signing_redirect_url'] + end + + if attributes.key?(:'subject') + self.subject = attributes[:'subject'] + end + + if attributes.key?(:'test_mode') + self.test_mode = attributes[:'test_mode'] + else + self.test_mode = false + end + + if attributes.key?(:'title') + self.title = attributes[:'title'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + if @template_ids.nil? + invalid_properties.push('invalid value for "template_ids", template_ids cannot be nil.') + end + + if @signers.nil? + invalid_properties.push('invalid value for "signers", signers cannot be nil.') + end + + if !@message.nil? && @message.to_s.length > 5000 + invalid_properties.push('invalid value for "message", the character length must be smaller than or equal to 5000.') + end + + if !@subject.nil? && @subject.to_s.length > 255 + invalid_properties.push('invalid value for "subject", the character length must be smaller than or equal to 255.') + end + + if !@title.nil? && @title.to_s.length > 255 + invalid_properties.push('invalid value for "title", the character length must be smaller than or equal to 255.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + return false if @template_ids.nil? + return false if @signers.nil? + return false if !@message.nil? && @message.to_s.length > 5000 + return false if !@subject.nil? && @subject.to_s.length > 255 + return false if !@title.nil? && @title.to_s.length > 255 + true + end + + # Custom attribute writer method with validation + # @param [Object] message Value to be assigned + def message=(message) + if message.to_s.length > 5000 + fail ArgumentError, 'invalid value for "message", the character length must be smaller than or equal to 5000.' + end + + @message = message + end + + # Custom attribute writer method with validation + # @param [Object] metadata Value to be assigned + def metadata=(metadata) + @metadata = metadata + end + + # Custom attribute writer method with validation + # @param [Object] subject Value to be assigned + def subject=(subject) + if subject.to_s.length > 255 + fail ArgumentError, 'invalid value for "subject", the character length must be smaller than or equal to 255.' + end + + @subject = subject + end + + # Custom attribute writer method with validation + # @param [Object] title Value to be assigned + def title=(title) + if title.to_s.length > 255 + fail ArgumentError, 'invalid value for "title", the character length must be smaller than or equal to 255.' + end + + @title = title + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + template_ids == o.template_ids && + signers == o.signers && + allow_decline == o.allow_decline && + ccs == o.ccs && + client_id == o.client_id && + custom_fields == o.custom_fields && + files == o.files && + file_urls == o.file_urls && + is_eid == o.is_eid && + message == o.message && + metadata == o.metadata && + signing_options == o.signing_options && + signing_redirect_url == o.signing_redirect_url && + subject == o.subject && + test_mode == o.test_mode && + title == o.title + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [template_ids, signers, allow_decline, ccs, client_id, custom_fields, files, file_urls, is_eid, message, metadata, signing_options, signing_redirect_url, subject, test_mode, title].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attribute_map = self.class.merged_attributes + + self.class.merged_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[attribute_map[key]])) + end + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + klass = Dropbox::Sign.const_get(type) + klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash(include_nil = true) + hash = {} + self.class.merged_attributes.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + next unless include_nil + is_nullable = self.class.merged_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value, include_nil) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value, include_nil = true) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v, include_nil) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v, include_nil) } + end + elsif value.respond_to? :to_hash + value.to_hash(include_nil) + else + value + end + end + end +end