From 5c206153b55ff817d16d7921960be41c8a575a3c Mon Sep 17 00:00:00 2001 From: Brian Erkkinen Date: Thu, 27 Aug 2026 15:41:16 -0400 Subject: [PATCH 1/3] Add Embedded Fax API to OpenAPI --- examples/FaxDraftCreateExample.cs | 51 ++ examples/FaxDraftCreateExample.java | 48 ++ examples/FaxDraftCreateExample.php | 36 ++ examples/FaxDraftCreateExample.py | 32 + examples/FaxDraftCreateExample.rb | 30 + examples/FaxDraftCreateExample.sh | 8 + examples/FaxDraftCreateExample.ts | 28 + examples/json/FaxDraftCreateRequest.json | 15 + examples/json/FaxDraftCreateResponse.json | 7 + openapi-fern.yaml | 423 +++++++++++++ openapi-raw.yaml | 187 ++++++ openapi-sdk.yaml | 193 ++++++ openapi.yaml | 193 ++++++ .../FaxDraftCreateExample.cs | 51 ++ .../sign_sandbox/FaxDraftCreateExample.java | 48 ++ sandbox/node/src/FaxDraftCreateExample.ts | 28 + sandbox/php/src/FaxDraftCreateExample.php | 36 ++ sandbox/python/src/FaxDraftCreateExample.py | 32 + sandbox/ruby/src/FaxDraftCreateExample.rb | 30 + sdks/dotnet/README.md | 5 + sdks/dotnet/docs/FaxApi.md | 113 ++++ sdks/dotnet/docs/FaxDraftCreateRequest.md | 9 + sdks/dotnet/docs/FaxDraftCreateResponse.md | 9 + sdks/dotnet/docs/FaxDraftResponse.md | 10 + sdks/dotnet/docs/SubEditorPageOptions.md | 10 + sdks/dotnet/src/Dropbox.Sign/Api/FaxApi.cs | 220 +++++++ .../Model/FaxDraftCreateRequest.cs | 299 +++++++++ .../Model/FaxDraftCreateResponse.cs | 197 ++++++ .../Dropbox.Sign/Model/FaxDraftResponse.cs | 224 +++++++ .../Model/SubEditorPageOptions.cs | 206 ++++++ sdks/java-v1/README.md | 5 + sdks/java-v1/docs/FaxApi.md | 90 +++ sdks/java-v1/docs/FaxDraftCreateRequest.md | 16 + sdks/java-v1/docs/FaxDraftCreateResponse.md | 12 + sdks/java-v1/docs/FaxDraftResponse.md | 13 + sdks/java-v1/docs/SubEditorPageOptions.md | 13 + .../java/com/dropbox/sign/api/FaxApi.java | 76 +++ .../sign/model/FaxDraftCreateRequest.java | 447 +++++++++++++ .../sign/model/FaxDraftCreateResponse.java | 228 +++++++ .../dropbox/sign/model/FaxDraftResponse.java | 264 ++++++++ .../sign/model/SubEditorPageOptions.java | 271 ++++++++ sdks/java-v2/README.md | 5 + sdks/java-v2/docs/FaxApi.md | 90 +++ sdks/java-v2/docs/FaxDraftCreateRequest.md | 16 + sdks/java-v2/docs/FaxDraftCreateResponse.md | 12 + sdks/java-v2/docs/FaxDraftResponse.md | 13 + sdks/java-v2/docs/SubEditorPageOptions.md | 13 + .../java/com/dropbox/sign/api/FaxApi.java | 67 +- .../sign/model/FaxDraftCreateRequest.java | 465 ++++++++++++++ .../sign/model/FaxDraftCreateResponse.java | 241 +++++++ .../dropbox/sign/model/FaxDraftResponse.java | 280 +++++++++ .../sign/model/SubEditorPageOptions.java | 280 +++++++++ sdks/node/README.md | 5 + sdks/node/api/faxApi.ts | 142 +++++ sdks/node/dist/api.js | 291 +++++++++ sdks/node/docs/api/FaxApi.md | 68 ++ sdks/node/docs/model/FaxDraftCreateRequest.md | 16 + .../node/docs/model/FaxDraftCreateResponse.md | 12 + sdks/node/docs/model/FaxDraftResponse.md | 13 + sdks/node/docs/model/SubEditorPageOptions.md | 13 + sdks/node/model/faxDraftCreateRequest.ts | 94 +++ sdks/node/model/faxDraftCreateResponse.ts | 59 ++ sdks/node/model/faxDraftResponse.ts | 72 +++ sdks/node/model/index.ts | 12 + sdks/node/model/subEditorPageOptions.ts | 72 +++ sdks/node/types/api/faxApi.d.ts | 3 +- .../types/model/faxDraftCreateRequest.d.ts | 14 + .../types/model/faxDraftCreateResponse.d.ts | 11 + sdks/node/types/model/faxDraftResponse.d.ts | 10 + sdks/node/types/model/index.d.ts | 6 +- .../types/model/subEditorPageOptions.d.ts | 10 + sdks/php/README.md | 5 + sdks/php/docs/Api/FaxApi.md | 75 +++ sdks/php/docs/Model/FaxDraftCreateRequest.md | 16 + sdks/php/docs/Model/FaxDraftCreateResponse.md | 12 + sdks/php/docs/Model/FaxDraftResponse.md | 13 + sdks/php/docs/Model/SubEditorPageOptions.md | 13 + sdks/php/src/Api/FaxApi.php | 339 ++++++++++ sdks/php/src/Model/FaxDraftCreateRequest.php | 595 ++++++++++++++++++ sdks/php/src/Model/FaxDraftCreateResponse.php | 450 +++++++++++++ sdks/php/src/Model/FaxDraftResponse.php | 491 +++++++++++++++ sdks/php/src/Model/SubEditorPageOptions.php | 480 ++++++++++++++ sdks/python/README.md | 5 + sdks/python/docs/FaxApi.md | 76 +++ sdks/python/docs/FaxDraftCreateRequest.md | 15 + sdks/python/docs/FaxDraftCreateResponse.md | 11 + sdks/python/docs/FaxDraftResponse.md | 12 + sdks/python/docs/SubEditorPageOptions.md | 12 + sdks/python/dropbox_sign/__init__.py | 4 + sdks/python/dropbox_sign/api/fax_api.py | 279 ++++++++ sdks/python/dropbox_sign/models/__init__.py | 4 + .../models/fax_draft_create_request.py | 177 ++++++ .../models/fax_draft_create_response.py | 151 +++++ .../dropbox_sign/models/fax_draft_response.py | 134 ++++ .../models/sub_editor_page_options.py | 155 +++++ sdks/ruby/README.md | 5 + sdks/ruby/docs/FaxApi.md | 83 +++ sdks/ruby/docs/FaxDraftCreateRequest.md | 14 + sdks/ruby/docs/FaxDraftCreateResponse.md | 10 + sdks/ruby/docs/FaxDraftResponse.md | 11 + sdks/ruby/docs/SubEditorPageOptions.md | 11 + sdks/ruby/lib/dropbox-sign.rb | 4 + sdks/ruby/lib/dropbox-sign/api/fax_api.rb | 110 ++++ .../models/fax_draft_create_request.rb | 344 ++++++++++ .../models/fax_draft_create_response.rb | 279 ++++++++ .../dropbox-sign/models/fax_draft_response.rb | 320 ++++++++++ .../models/sub_editor_page_options.rb | 281 +++++++++ translations/en.yaml | 24 + 108 files changed, 11635 insertions(+), 3 deletions(-) create mode 100644 examples/FaxDraftCreateExample.cs create mode 100644 examples/FaxDraftCreateExample.java create mode 100644 examples/FaxDraftCreateExample.php create mode 100644 examples/FaxDraftCreateExample.py create mode 100644 examples/FaxDraftCreateExample.rb create mode 100644 examples/FaxDraftCreateExample.sh create mode 100644 examples/FaxDraftCreateExample.ts create mode 100644 examples/json/FaxDraftCreateRequest.json create mode 100644 examples/json/FaxDraftCreateResponse.json create mode 100644 sandbox/dotnet/src/Dropbox.SignSandbox/FaxDraftCreateExample.cs create mode 100644 sandbox/java/src/main/java/com/dropbox/sign_sandbox/FaxDraftCreateExample.java create mode 100644 sandbox/node/src/FaxDraftCreateExample.ts create mode 100644 sandbox/php/src/FaxDraftCreateExample.php create mode 100644 sandbox/python/src/FaxDraftCreateExample.py create mode 100644 sandbox/ruby/src/FaxDraftCreateExample.rb create mode 100644 sdks/dotnet/docs/FaxDraftCreateRequest.md create mode 100644 sdks/dotnet/docs/FaxDraftCreateResponse.md create mode 100644 sdks/dotnet/docs/FaxDraftResponse.md create mode 100644 sdks/dotnet/docs/SubEditorPageOptions.md create mode 100644 sdks/dotnet/src/Dropbox.Sign/Model/FaxDraftCreateRequest.cs create mode 100644 sdks/dotnet/src/Dropbox.Sign/Model/FaxDraftCreateResponse.cs create mode 100644 sdks/dotnet/src/Dropbox.Sign/Model/FaxDraftResponse.cs create mode 100644 sdks/dotnet/src/Dropbox.Sign/Model/SubEditorPageOptions.cs create mode 100644 sdks/java-v1/docs/FaxDraftCreateRequest.md create mode 100644 sdks/java-v1/docs/FaxDraftCreateResponse.md create mode 100644 sdks/java-v1/docs/FaxDraftResponse.md create mode 100644 sdks/java-v1/docs/SubEditorPageOptions.md create mode 100644 sdks/java-v1/src/main/java/com/dropbox/sign/model/FaxDraftCreateRequest.java create mode 100644 sdks/java-v1/src/main/java/com/dropbox/sign/model/FaxDraftCreateResponse.java create mode 100644 sdks/java-v1/src/main/java/com/dropbox/sign/model/FaxDraftResponse.java create mode 100644 sdks/java-v1/src/main/java/com/dropbox/sign/model/SubEditorPageOptions.java create mode 100644 sdks/java-v2/docs/FaxDraftCreateRequest.md create mode 100644 sdks/java-v2/docs/FaxDraftCreateResponse.md create mode 100644 sdks/java-v2/docs/FaxDraftResponse.md create mode 100644 sdks/java-v2/docs/SubEditorPageOptions.md create mode 100644 sdks/java-v2/src/main/java/com/dropbox/sign/model/FaxDraftCreateRequest.java create mode 100644 sdks/java-v2/src/main/java/com/dropbox/sign/model/FaxDraftCreateResponse.java create mode 100644 sdks/java-v2/src/main/java/com/dropbox/sign/model/FaxDraftResponse.java create mode 100644 sdks/java-v2/src/main/java/com/dropbox/sign/model/SubEditorPageOptions.java create mode 100644 sdks/node/docs/model/FaxDraftCreateRequest.md create mode 100644 sdks/node/docs/model/FaxDraftCreateResponse.md create mode 100644 sdks/node/docs/model/FaxDraftResponse.md create mode 100644 sdks/node/docs/model/SubEditorPageOptions.md create mode 100644 sdks/node/model/faxDraftCreateRequest.ts create mode 100644 sdks/node/model/faxDraftCreateResponse.ts create mode 100644 sdks/node/model/faxDraftResponse.ts create mode 100644 sdks/node/model/subEditorPageOptions.ts create mode 100644 sdks/node/types/model/faxDraftCreateRequest.d.ts create mode 100644 sdks/node/types/model/faxDraftCreateResponse.d.ts create mode 100644 sdks/node/types/model/faxDraftResponse.d.ts create mode 100644 sdks/node/types/model/subEditorPageOptions.d.ts create mode 100644 sdks/php/docs/Model/FaxDraftCreateRequest.md create mode 100644 sdks/php/docs/Model/FaxDraftCreateResponse.md create mode 100644 sdks/php/docs/Model/FaxDraftResponse.md create mode 100644 sdks/php/docs/Model/SubEditorPageOptions.md create mode 100644 sdks/php/src/Model/FaxDraftCreateRequest.php create mode 100644 sdks/php/src/Model/FaxDraftCreateResponse.php create mode 100644 sdks/php/src/Model/FaxDraftResponse.php create mode 100644 sdks/php/src/Model/SubEditorPageOptions.php create mode 100644 sdks/python/docs/FaxDraftCreateRequest.md create mode 100644 sdks/python/docs/FaxDraftCreateResponse.md create mode 100644 sdks/python/docs/FaxDraftResponse.md create mode 100644 sdks/python/docs/SubEditorPageOptions.md create mode 100644 sdks/python/dropbox_sign/models/fax_draft_create_request.py create mode 100644 sdks/python/dropbox_sign/models/fax_draft_create_response.py create mode 100644 sdks/python/dropbox_sign/models/fax_draft_response.py create mode 100644 sdks/python/dropbox_sign/models/sub_editor_page_options.py create mode 100644 sdks/ruby/docs/FaxDraftCreateRequest.md create mode 100644 sdks/ruby/docs/FaxDraftCreateResponse.md create mode 100644 sdks/ruby/docs/FaxDraftResponse.md create mode 100644 sdks/ruby/docs/SubEditorPageOptions.md create mode 100644 sdks/ruby/lib/dropbox-sign/models/fax_draft_create_request.rb create mode 100644 sdks/ruby/lib/dropbox-sign/models/fax_draft_create_response.rb create mode 100644 sdks/ruby/lib/dropbox-sign/models/fax_draft_response.rb create mode 100644 sdks/ruby/lib/dropbox-sign/models/sub_editor_page_options.rb diff --git a/examples/FaxDraftCreateExample.cs b/examples/FaxDraftCreateExample.cs new file mode 100644 index 000000000..d3fc604be --- /dev/null +++ b/examples/FaxDraftCreateExample.cs @@ -0,0 +1,51 @@ +using System; +using System.Collections.Generic; + +using Dropbox.Sign.Api; +using Dropbox.Sign.Client; +using Dropbox.Sign.Model; + +namespace Dropbox.SignSandbox; + +public class FaxDraftCreateExample +{ + public static void Run() + { + var config = new Configuration(); + config.Username = "YOUR_API_KEY"; + + var editorOptions = new SubEditorPageOptions( + forceUploadPage: false, + forceEditorPage: true, + forceReviewPage: true + ); + var faxDraftCreateRequest = new FaxDraftCreateRequest( + clientId: "b6b8e7deaf8f0b95c029dca049356d4a2cf9710a", + fileUrls: new List + { + "https://www.dropbox.com/s/ad9qnhbrjjn64tu/mutual-NDA-example.pdf?dl=1", + }, + recipients: new List + { + "+14155552671", + }, + editorOptions: editorOptions, + testMode: true + ); + + try + { + var response = new FaxApi(config).FaxDraftCreate( + faxDraftCreateRequest: faxDraftCreateRequest + ); + + Console.WriteLine(response); + } + catch (ApiException e) + { + Console.WriteLine("Exception when calling FaxApi#FaxDraftCreate: " + e.Message); + Console.WriteLine("Status Code: " + e.ErrorCode); + Console.WriteLine(e.StackTrace); + } + } +} diff --git a/examples/FaxDraftCreateExample.java b/examples/FaxDraftCreateExample.java new file mode 100644 index 000000000..e40906227 --- /dev/null +++ b/examples/FaxDraftCreateExample.java @@ -0,0 +1,48 @@ +package com.dropbox.sign_sandbox; + +import com.dropbox.sign.ApiException; +import com.dropbox.sign.Configuration; +import com.dropbox.sign.api.FaxApi; +import com.dropbox.sign.auth.HttpBasicAuth; +import com.dropbox.sign.model.FaxDraftCreateRequest; +import com.dropbox.sign.model.SubEditorPageOptions; + +import java.util.List; + +public class FaxDraftCreateExample +{ + public static void main(String[] args) + { + var config = Configuration.getDefaultApiClient(); + ((HttpBasicAuth) config.getAuthentication("api_key")).setUsername("YOUR_API_KEY"); + + var editorOptions = new SubEditorPageOptions(); + editorOptions.forceUploadPage(false); + editorOptions.forceEditorPage(true); + editorOptions.forceReviewPage(true); + + var faxDraftCreateRequest = new FaxDraftCreateRequest(); + faxDraftCreateRequest.clientId("b6b8e7deaf8f0b95c029dca049356d4a2cf9710a"); + faxDraftCreateRequest.fileUrls(List.of( + "https://www.dropbox.com/s/ad9qnhbrjjn64tu/mutual-NDA-example.pdf?dl=1" + )); + faxDraftCreateRequest.recipients(List.of("+14155552671")); + faxDraftCreateRequest.editorOptions(editorOptions); + faxDraftCreateRequest.testMode(true); + + try + { + var response = new FaxApi(config).faxDraftCreate( + faxDraftCreateRequest + ); + + System.out.println(response); + } catch (ApiException e) { + System.err.println("Exception when calling FaxApi#faxDraftCreate"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} diff --git a/examples/FaxDraftCreateExample.php b/examples/FaxDraftCreateExample.php new file mode 100644 index 000000000..ca8b5767d --- /dev/null +++ b/examples/FaxDraftCreateExample.php @@ -0,0 +1,36 @@ +setUsername("YOUR_API_KEY"); + +$editor_options = (new Dropbox\Sign\Model\SubEditorPageOptions()) + ->setForceUploadPage(false) + ->setForceEditorPage(true) + ->setForceReviewPage(true); + +$fax_draft_create_request = (new Dropbox\Sign\Model\FaxDraftCreateRequest()) + ->setClientId("b6b8e7deaf8f0b95c029dca049356d4a2cf9710a") + ->setFileUrls([ + "https://www.dropbox.com/s/ad9qnhbrjjn64tu/mutual-NDA-example.pdf?dl=1", + ]) + ->setRecipients([ + "+14155552671", + ]) + ->setEditorOptions($editor_options) + ->setTestMode(true); + +try { + $response = (new Dropbox\Sign\Api\FaxApi(config: $config))->faxDraftCreate( + fax_draft_create_request: $fax_draft_create_request, + ); + + print_r($response); +} catch (Dropbox\Sign\ApiException $e) { + echo "Exception when calling FaxApi#faxDraftCreate: {$e->getMessage()}"; +} diff --git a/examples/FaxDraftCreateExample.py b/examples/FaxDraftCreateExample.py new file mode 100644 index 000000000..2239813b3 --- /dev/null +++ b/examples/FaxDraftCreateExample.py @@ -0,0 +1,32 @@ +from pprint import pprint + +from dropbox_sign import ApiClient, ApiException, Configuration, api, models + +configuration = Configuration( + username="YOUR_API_KEY", +) + +with ApiClient(configuration) as api_client: + editor_options = models.SubEditorPageOptions( + force_upload_page=False, + force_editor_page=True, + force_review_page=True, + ) + fax_draft_create_request = models.FaxDraftCreateRequest( + client_id="b6b8e7deaf8f0b95c029dca049356d4a2cf9710a", + file_urls=[ + "https://www.dropbox.com/s/ad9qnhbrjjn64tu/mutual-NDA-example.pdf?dl=1", + ], + recipients=["+14155552671"], + editor_options=editor_options, + test_mode=True, + ) + + try: + response = api.FaxApi(api_client).fax_draft_create( + fax_draft_create_request=fax_draft_create_request, + ) + + pprint(response) + except ApiException as e: + print("Exception when calling FaxApi#fax_draft_create: %s\n" % e) diff --git a/examples/FaxDraftCreateExample.rb b/examples/FaxDraftCreateExample.rb new file mode 100644 index 000000000..8fb5bcaae --- /dev/null +++ b/examples/FaxDraftCreateExample.rb @@ -0,0 +1,30 @@ +require "json" +require "dropbox-sign" + +Dropbox::Sign.configure do |config| + config.username = "YOUR_API_KEY" +end + +editor_options = Dropbox::Sign::SubEditorPageOptions.new +editor_options.force_upload_page = false +editor_options.force_editor_page = true +editor_options.force_review_page = true + +fax_draft_create_request = Dropbox::Sign::FaxDraftCreateRequest.new +fax_draft_create_request.client_id = "b6b8e7deaf8f0b95c029dca049356d4a2cf9710a" +fax_draft_create_request.file_urls = [ + "https://www.dropbox.com/s/ad9qnhbrjjn64tu/mutual-NDA-example.pdf?dl=1", +] +fax_draft_create_request.recipients = ["+14155552671"] +fax_draft_create_request.editor_options = editor_options +fax_draft_create_request.test_mode = true + +begin + response = Dropbox::Sign::FaxApi.new.fax_draft_create( + fax_draft_create_request, + ) + + p response +rescue Dropbox::Sign::ApiError => e + puts "Exception when calling FaxApi#fax_draft_create: #{e}" +end diff --git a/examples/FaxDraftCreateExample.sh b/examples/FaxDraftCreateExample.sh new file mode 100644 index 000000000..e51b77b77 --- /dev/null +++ b/examples/FaxDraftCreateExample.sh @@ -0,0 +1,8 @@ +curl -X POST 'https://api.hellosign.com/v3/fax/draft/create' \ + -u 'YOUR_API_KEY:' \ + -F 'client_id=YOUR_CLIENT_ID' \ + -F 'file_urls[0]=https://www.dropbox.com/s/ad9qnhbrjjn64tu/mutual-NDA-example.pdf?dl=1' \ + -F 'recipients[0]=+14155552671' \ + -F 'editor_options[force_editor_page]=1' \ + -F 'editor_options[force_review_page]=1' \ + -F 'test_mode=1' diff --git a/examples/FaxDraftCreateExample.ts b/examples/FaxDraftCreateExample.ts new file mode 100644 index 000000000..2f359af39 --- /dev/null +++ b/examples/FaxDraftCreateExample.ts @@ -0,0 +1,28 @@ +import api from "@dropbox/sign" +import models from "@dropbox/sign" + +const apiCaller = new api.FaxApi(); +apiCaller.username = "YOUR_API_KEY"; + +const faxDraftCreateRequest: models.FaxDraftCreateRequest = { + clientId: "b6b8e7deaf8f0b95c029dca049356d4a2cf9710a", + fileUrls: [ + "https://www.dropbox.com/s/ad9qnhbrjjn64tu/mutual-NDA-example.pdf?dl=1", + ], + recipients: ["+14155552671"], + editorOptions: { + forceUploadPage: false, + forceEditorPage: true, + forceReviewPage: true, + }, + testMode: true, +}; + +apiCaller.faxDraftCreate( + faxDraftCreateRequest, +).then(response => { + console.log(response.body); +}).catch(error => { + console.log("Exception when calling FaxApi#faxDraftCreate:"); + console.log(error.body); +}); diff --git a/examples/json/FaxDraftCreateRequest.json b/examples/json/FaxDraftCreateRequest.json new file mode 100644 index 000000000..dfba9ac46 --- /dev/null +++ b/examples/json/FaxDraftCreateRequest.json @@ -0,0 +1,15 @@ +{ + "client_id": "b6b8e7deaf8f0b95c029dca049356d4a2cf9710a", + "file_urls": [ + "https://www.dropbox.com/s/ad9qnhbrjjn64tu/mutual-NDA-example.pdf?dl=1" + ], + "recipients": [ + "+14155552671" + ], + "editor_options": { + "force_upload_page": false, + "force_editor_page": true, + "force_review_page": true + }, + "test_mode": true +} diff --git a/examples/json/FaxDraftCreateResponse.json b/examples/json/FaxDraftCreateResponse.json new file mode 100644 index 000000000..5532cf100 --- /dev/null +++ b/examples/json/FaxDraftCreateResponse.json @@ -0,0 +1,7 @@ +{ + "fax_draft": { + "fax_id": "c2e9691c85d9d6fa6ae773842e3680b2b8650f1d", + "url": "https://embedded.fax.dropbox.com/prep-and-send/embedded-fax?cached_params_token=30c4d8df776038c2fa5f7094c3718937", + "expires_at": 1787857200 + } +} diff --git a/openapi-fern.yaml b/openapi-fern.yaml index 7ca8f36cc..e791e8dd0 100644 --- a/openapi-fern.yaml +++ b/openapi-fern.yaml @@ -4063,6 +4063,324 @@ paths: seo: title: Delete Fax | API Documentation | Dropbox Fax for Developers description: 'The Dropbox Fax API allows you to build custom integrations. To find out how to delete a fax, click here.' + /fax/draft/create: + post: + tags: + - Fax + summary: Create Embedded Fax Draft + description: Creates an embedded Fax draft and returns a URL that can be opened in an approved iframe for preparation and sending. + operationId: faxDraftCreate + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/FaxDraftCreateRequest' + examples: + example: + $ref: '#/components/examples/FaxDraftCreateRequest' + multipart/form-data: + schema: + $ref: '#/components/schemas/FaxDraftCreateRequest' + 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/FaxDraftCreateResponse' + examples: + example: + $ref: '#/components/examples/FaxDraftCreateResponse' + 4XX: + description: failed_operation + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + 400_example: + $ref: '#/components/examples/Error400Response' + 401_example: + $ref: '#/components/examples/Error401Response' + 402_example: + $ref: '#/components/examples/Error402Response' + 403_example: + $ref: '#/components/examples/Error403Response' + 429_example: + $ref: '#/components/examples/Error429Response' + 404_example: + $ref: '#/components/examples/Error404Response' + 4XX_example: + $ref: '#/components/examples/Error4XXResponse' + security: + - api_key: [] + x-codeSamples: + - lang: PHP + label: PHP + source: | + setUsername("YOUR_API_KEY"); + + $editor_options = (new Dropbox\Sign\Model\SubEditorPageOptions()) + ->setForceUploadPage(false) + ->setForceEditorPage(true) + ->setForceReviewPage(true); + + $fax_draft_create_request = (new Dropbox\Sign\Model\FaxDraftCreateRequest()) + ->setClientId("b6b8e7deaf8f0b95c029dca049356d4a2cf9710a") + ->setFileUrls([ + "https://www.dropbox.com/s/ad9qnhbrjjn64tu/mutual-NDA-example.pdf?dl=1", + ]) + ->setRecipients([ + "+14155552671", + ]) + ->setEditorOptions($editor_options) + ->setTestMode(true); + + try { + $response = (new Dropbox\Sign\Api\FaxApi(config: $config))->faxDraftCreate( + fax_draft_create_request: $fax_draft_create_request, + ); + + print_r($response); + } catch (Dropbox\Sign\ApiException $e) { + echo "Exception when calling FaxApi#faxDraftCreate: {$e->getMessage()}"; + } + - lang: csharp + label: C# + source: | + using System; + using System.Collections.Generic; + + using Dropbox.Sign.Api; + using Dropbox.Sign.Client; + using Dropbox.Sign.Model; + + namespace Dropbox.SignSandbox; + + public class FaxDraftCreateExample + { + public static void Run() + { + var config = new Configuration(); + config.Username = "YOUR_API_KEY"; + + var editorOptions = new SubEditorPageOptions( + forceUploadPage: false, + forceEditorPage: true, + forceReviewPage: true + ); + var faxDraftCreateRequest = new FaxDraftCreateRequest( + clientId: "b6b8e7deaf8f0b95c029dca049356d4a2cf9710a", + fileUrls: new List + { + "https://www.dropbox.com/s/ad9qnhbrjjn64tu/mutual-NDA-example.pdf?dl=1", + }, + recipients: new List + { + "+14155552671", + }, + editorOptions: editorOptions, + testMode: true + ); + + try + { + var response = new FaxApi(config).FaxDraftCreate( + faxDraftCreateRequest: faxDraftCreateRequest + ); + + Console.WriteLine(response); + } + catch (ApiException e) + { + Console.WriteLine("Exception when calling FaxApi#FaxDraftCreate: " + e.Message); + Console.WriteLine("Status Code: " + e.ErrorCode); + Console.WriteLine(e.StackTrace); + } + } + } + - lang: TypeScript + label: TypeScript + source: | + import api from "@dropbox/sign" + import models from "@dropbox/sign" + + const apiCaller = new api.FaxApi(); + apiCaller.username = "YOUR_API_KEY"; + + const faxDraftCreateRequest: models.FaxDraftCreateRequest = { + clientId: "b6b8e7deaf8f0b95c029dca049356d4a2cf9710a", + fileUrls: [ + "https://www.dropbox.com/s/ad9qnhbrjjn64tu/mutual-NDA-example.pdf?dl=1", + ], + recipients: ["+14155552671"], + editorOptions: { + forceUploadPage: false, + forceEditorPage: true, + forceReviewPage: true, + }, + testMode: true, + }; + + apiCaller.faxDraftCreate( + faxDraftCreateRequest, + ).then(response => { + console.log(response.body); + }).catch(error => { + console.log("Exception when calling FaxApi#faxDraftCreate:"); + console.log(error.body); + }); + - lang: Java + label: Java + source: | + package com.dropbox.sign_sandbox; + + import com.dropbox.sign.ApiException; + import com.dropbox.sign.Configuration; + import com.dropbox.sign.api.FaxApi; + import com.dropbox.sign.auth.HttpBasicAuth; + import com.dropbox.sign.model.FaxDraftCreateRequest; + import com.dropbox.sign.model.SubEditorPageOptions; + + import java.util.List; + + public class FaxDraftCreateExample + { + public static void main(String[] args) + { + var config = Configuration.getDefaultApiClient(); + ((HttpBasicAuth) config.getAuthentication("api_key")).setUsername("YOUR_API_KEY"); + + var editorOptions = new SubEditorPageOptions(); + editorOptions.forceUploadPage(false); + editorOptions.forceEditorPage(true); + editorOptions.forceReviewPage(true); + + var faxDraftCreateRequest = new FaxDraftCreateRequest(); + faxDraftCreateRequest.clientId("b6b8e7deaf8f0b95c029dca049356d4a2cf9710a"); + faxDraftCreateRequest.fileUrls(List.of( + "https://www.dropbox.com/s/ad9qnhbrjjn64tu/mutual-NDA-example.pdf?dl=1" + )); + faxDraftCreateRequest.recipients(List.of("+14155552671")); + faxDraftCreateRequest.editorOptions(editorOptions); + faxDraftCreateRequest.testMode(true); + + try + { + var response = new FaxApi(config).faxDraftCreate( + faxDraftCreateRequest + ); + + System.out.println(response); + } catch (ApiException e) { + System.err.println("Exception when calling FaxApi#faxDraftCreate"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } + } + - lang: Ruby + label: Ruby + source: | + require "json" + require "dropbox-sign" + + Dropbox::Sign.configure do |config| + config.username = "YOUR_API_KEY" + end + + editor_options = Dropbox::Sign::SubEditorPageOptions.new + editor_options.force_upload_page = false + editor_options.force_editor_page = true + editor_options.force_review_page = true + + fax_draft_create_request = Dropbox::Sign::FaxDraftCreateRequest.new + fax_draft_create_request.client_id = "b6b8e7deaf8f0b95c029dca049356d4a2cf9710a" + fax_draft_create_request.file_urls = [ + "https://www.dropbox.com/s/ad9qnhbrjjn64tu/mutual-NDA-example.pdf?dl=1", + ] + fax_draft_create_request.recipients = ["+14155552671"] + fax_draft_create_request.editor_options = editor_options + fax_draft_create_request.test_mode = true + + begin + response = Dropbox::Sign::FaxApi.new.fax_draft_create( + fax_draft_create_request, + ) + + p response + rescue Dropbox::Sign::ApiError => e + puts "Exception when calling FaxApi#fax_draft_create: #{e}" + end + - lang: Python + label: Python + source: | + from pprint import pprint + + from dropbox_sign import ApiClient, ApiException, Configuration, api, models + + configuration = Configuration( + username="YOUR_API_KEY", + ) + + with ApiClient(configuration) as api_client: + editor_options = models.SubEditorPageOptions( + force_upload_page=False, + force_editor_page=True, + force_review_page=True, + ) + fax_draft_create_request = models.FaxDraftCreateRequest( + client_id="b6b8e7deaf8f0b95c029dca049356d4a2cf9710a", + file_urls=[ + "https://www.dropbox.com/s/ad9qnhbrjjn64tu/mutual-NDA-example.pdf?dl=1", + ], + recipients=["+14155552671"], + editor_options=editor_options, + test_mode=True, + ) + + try: + response = api.FaxApi(api_client).fax_draft_create( + fax_draft_create_request=fax_draft_create_request, + ) + + pprint(response) + except ApiException as e: + print("Exception when calling FaxApi#fax_draft_create: %s\n" % e) + - lang: cURL + label: cURL + source: | + curl -X POST 'https://api.hellosign.com/v3/fax/draft/create' \ + -u 'YOUR_API_KEY:' \ + -F 'client_id=YOUR_CLIENT_ID' \ + -F 'file_urls[0]=https://www.dropbox.com/s/ad9qnhbrjjn64tu/mutual-NDA-example.pdf?dl=1' \ + -F 'recipients[0]=+14155552671' \ + -F 'editor_options[force_editor_page]=1' \ + -F 'editor_options[force_review_page]=1' \ + -F 'test_mode=1' + x-meta: + seo: + title: Create Embedded Fax Draft | API Documentation | Dropbox Fax for Developers + description: 'Create an embedded Fax draft, then prepare and send it from an approved iframe in your application.' /fax/files/{fax_id}: get: tags: @@ -23274,6 +23592,44 @@ components: type: boolean default: false type: object + FaxDraftCreateRequest: + required: + - client_id + properties: + files: + description: |- + Use `files[]` to upload the file(s) for the embedded Fax draft. + + This endpoint accepts either **files** or **file_urls[]**, but not both. Files can be added later in the embedded flow when neither is provided. + type: array + items: + type: string + format: binary + file_urls: + description: |- + Use `file_urls[]` to have Dropbox Fax download the file(s) for the embedded Fax draft. + + This endpoint accepts either **files** or **file_urls[]**, but not both. Files can be added later in the embedded flow when neither is provided. + type: array + items: + type: string + client_id: + description: Client ID of the API app that owns the embedded Fax draft. + type: string + editor_options: + $ref: '#/components/schemas/SubEditorPageOptions' + recipients: + description: Fax numbers to prefill in the embedded flow. Each fax number must be in a supported international format. A maximum of 20 unique fax numbers can be provided. + type: array + items: + type: string + maxItems: 20 + uniqueItems: true + test_mode: + description: 'When set to `true`, the completed draft will not send a Fax or consume Fax pages. Defaults to `false`.' + type: boolean + default: false + type: object FaxLineAddUserRequest: required: - number @@ -24826,6 +25182,22 @@ components: type: boolean default: false type: object + SubEditorPageOptions: + description: Controls which completed pages are shown again when the embedded Fax draft is opened. + properties: + force_upload_page: + description: 'When set to `true`, always shows the upload page, even when files are already attached. Defaults to `false`.' + type: boolean + default: false + force_editor_page: + description: 'When set to `true`, always shows the editor page, even when the document is already prepared. Defaults to `false`.' + type: boolean + default: false + force_review_page: + description: 'When set to `true`, always shows the review page, even when recipients and Fax details are already provided. Defaults to `false`.' + type: boolean + default: false + type: object SubFieldOptions: description: This allows the requester to specify field options for a signature request. required: @@ -26823,6 +27195,19 @@ components: error: $ref: '#/components/schemas/ErrorResponseError' type: object + FaxDraftCreateResponse: + required: + - fax_draft + properties: + fax_draft: + $ref: '#/components/schemas/FaxDraftResponse' + warnings: + description: A list of warnings. + type: array + items: + $ref: '#/components/schemas/WarningResponse' + type: object + x-internal-class: true FaxGetResponse: required: - fax @@ -27299,6 +27684,24 @@ components: $ref: '#/components/schemas/FaxResponseTransmission' type: object x-internal-class: true + FaxDraftResponse: + description: 'Contains the embedded Fax draft ID, iframe URL, and expiration timestamp.' + required: + - fax_id + - url + - expires_at + properties: + fax_id: + description: ID of the Fax draft. + type: string + url: + description: URL to open in an approved iframe for preparing and sending the Fax. + type: string + expires_at: + description: Unix timestamp indicating when the embedded Fax draft URL expires. + type: integer + type: object + x-internal-class: true FaxLineResponseFaxLine: properties: number: @@ -29669,6 +30072,19 @@ components: cc_roles: - '' merge_fields: [] + FaxDraftCreateRequest: + summary: Default Example + value: + client_id: b6b8e7deaf8f0b95c029dca049356d4a2cf9710a + file_urls: + - https://www.dropbox.com/s/ad9qnhbrjjn64tu/mutual-NDA-example.pdf?dl=1 + recipients: + - +14155552671 + editor_options: + force_upload_page: false + force_editor_page: true + force_review_page: true + test_mode: true FaxLineAddUserRequest: summary: Default Example value: @@ -31113,6 +31529,13 @@ components: error_msg: This value should not be blank error_path: cc_email_addresses[0] error_name: bad_request + FaxDraftCreateResponse: + summary: Embedded Fax Draft Response + value: + fax_draft: + fax_id: c2e9691c85d9d6fa6ae773842e3680b2b8650f1d + url: https://embedded.fax.dropbox.com/prep-and-send/embedded-fax?cached_params_token=30c4d8df776038c2fa5f7094c3718937 + expires_at: 1787857200 FaxGetResponse: summary: Fax Response value: diff --git a/openapi-raw.yaml b/openapi-raw.yaml index 2b401a8c8..eba08d062 100644 --- a/openapi-raw.yaml +++ b/openapi-raw.yaml @@ -1585,6 +1585,106 @@ paths: seo: title: '_t__FaxDelete::SEO::TITLE' description: '_t__FaxDelete::SEO::DESCRIPTION' + /fax/draft/create: + post: + tags: + - Fax + summary: '_t__FaxDraftCreate::SUMMARY' + description: '_t__FaxDraftCreate::DESCRIPTION' + operationId: faxDraftCreate + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/FaxDraftCreateRequest' + examples: + example: + $ref: '#/components/examples/FaxDraftCreateRequest' + multipart/form-data: + schema: + $ref: '#/components/schemas/FaxDraftCreateRequest' + 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/FaxDraftCreateResponse' + examples: + example: + $ref: '#/components/examples/FaxDraftCreateResponse' + 4XX: + description: failed_operation + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + 400_example: + $ref: '#/components/examples/Error400Response' + 401_example: + $ref: '#/components/examples/Error401Response' + 402_example: + $ref: '#/components/examples/Error402Response' + 403_example: + $ref: '#/components/examples/Error403Response' + 429_example: + $ref: '#/components/examples/Error429Response' + 404_example: + $ref: '#/components/examples/Error404Response' + 4XX_example: + $ref: '#/components/examples/Error4XXResponse' + security: + - + api_key: [] + x-codeSamples: + - + lang: PHP + label: PHP + source: + $ref: examples/FaxDraftCreateExample.php + - + lang: 'C#' + label: 'C#' + source: + $ref: examples/FaxDraftCreateExample.cs + - + lang: TypeScript + label: TypeScript + source: + $ref: examples/FaxDraftCreateExample.ts + - + lang: Java + label: Java + source: + $ref: examples/FaxDraftCreateExample.java + - + lang: Ruby + label: Ruby + source: + $ref: examples/FaxDraftCreateExample.rb + - + lang: Python + label: Python + source: + $ref: examples/FaxDraftCreateExample.py + - + lang: cURL + label: cURL + source: + $ref: examples/FaxDraftCreateExample.sh + x-meta: + seo: + title: '_t__FaxDraftCreate::SEO::TITLE' + description: '_t__FaxDraftCreate::SEO::DESCRIPTION' '/fax/files/{fax_id}': get: tags: @@ -8032,6 +8132,38 @@ components: - sdk - doc type: object + FaxDraftCreateRequest: + required: + - client_id + properties: + files: + description: '_t__FaxDraftCreate::FILES' + type: array + items: + type: string + format: binary + file_urls: + description: '_t__FaxDraftCreate::FILE_URLS' + type: array + items: + type: string + client_id: + description: '_t__FaxDraftCreate::CLIENT_ID' + type: string + editor_options: + $ref: '#/components/schemas/SubEditorPageOptions' + recipients: + description: '_t__FaxDraftCreate::RECIPIENTS' + type: array + items: + type: string + maxItems: 20 + uniqueItems: true + test_mode: + description: '_t__FaxDraftCreate::TEST_MODE' + type: boolean + default: false + type: object FaxLineAddUserRequest: required: - number @@ -9348,6 +9480,22 @@ components: type: boolean default: false type: object + SubEditorPageOptions: + description: '_t__Sub::EditorPageOptions::DESCRIPTION' + properties: + force_upload_page: + description: '_t__Sub::EditorPageOptions::FORCE_UPLOAD_PAGE' + type: boolean + default: false + force_editor_page: + description: '_t__Sub::EditorPageOptions::FORCE_EDITOR_PAGE' + type: boolean + default: false + force_review_page: + description: '_t__Sub::EditorPageOptions::FORCE_REVIEW_PAGE' + type: boolean + default: false + type: object SubFieldOptions: description: '_t__Sub::FieldOptions::DESCRIPTION' required: @@ -11132,6 +11280,19 @@ components: error: $ref: '#/components/schemas/ErrorResponseError' type: object + FaxDraftCreateResponse: + required: + - fax_draft + properties: + fax_draft: + $ref: '#/components/schemas/FaxDraftResponse' + warnings: + description: '_t__WarningResponse::LIST_DESCRIPTION' + type: array + items: + $ref: '#/components/schemas/WarningResponse' + type: object + x-internal-class: true FaxGetResponse: required: - fax @@ -11609,6 +11770,24 @@ components: $ref: '#/components/schemas/FaxResponseTransmission' type: object x-internal-class: true + FaxDraftResponse: + description: '_t__FaxDraftResponse::DESCRIPTION' + required: + - fax_id + - url + - expires_at + properties: + fax_id: + description: '_t__FaxDraftResponse::FAX_ID' + type: string + url: + description: '_t__FaxDraftResponse::URL' + type: string + expires_at: + description: '_t__FaxDraftResponse::EXPIRES_AT' + type: integer + type: object + x-internal-class: true FaxLineResponseFaxLine: properties: number: @@ -13849,6 +14028,10 @@ components: summary: 'Default Example' value: $ref: examples/json/EmbeddedEditUrlRequest.json + FaxDraftCreateRequest: + summary: 'Default Example' + value: + $ref: examples/json/FaxDraftCreateRequest.json FaxLineAddUserRequest: summary: 'Default Example' value: @@ -14144,6 +14327,10 @@ components: summary: '_t__Error::4XX' value: $ref: examples/json/Error4XXResponse.json + FaxDraftCreateResponse: + summary: '_t__FaxDraftCreateResponseExample::SUMMARY' + value: + $ref: examples/json/FaxDraftCreateResponse.json FaxGetResponse: summary: '_t__FaxGetResponseExample::SUMMARY' value: diff --git a/openapi-sdk.yaml b/openapi-sdk.yaml index 72b323aeb..13d588586 100644 --- a/openapi-sdk.yaml +++ b/openapi-sdk.yaml @@ -1550,6 +1550,106 @@ paths: seo: title: 'Delete Fax | API Documentation | Dropbox Fax for Developers' description: 'The Dropbox Fax API allows you to build custom integrations. To find out how to delete a fax, click here.' + /fax/draft/create: + post: + tags: + - Fax + summary: 'Create Embedded Fax Draft' + description: 'Creates an embedded Fax draft and returns a URL that can be opened in an approved iframe for preparation and sending.' + operationId: faxDraftCreate + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/FaxDraftCreateRequest' + examples: + example: + $ref: '#/components/examples/FaxDraftCreateRequest' + multipart/form-data: + schema: + $ref: '#/components/schemas/FaxDraftCreateRequest' + 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/FaxDraftCreateResponse' + examples: + example: + $ref: '#/components/examples/FaxDraftCreateResponse' + '4XX': + description: failed_operation + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + 400_example: + $ref: '#/components/examples/Error400Response' + 401_example: + $ref: '#/components/examples/Error401Response' + 402_example: + $ref: '#/components/examples/Error402Response' + 403_example: + $ref: '#/components/examples/Error403Response' + 429_example: + $ref: '#/components/examples/Error429Response' + 404_example: + $ref: '#/components/examples/Error404Response' + 4XX_example: + $ref: '#/components/examples/Error4XXResponse' + security: + - + api_key: [] + x-codeSamples: + - + lang: PHP + label: PHP + source: + $ref: examples/FaxDraftCreateExample.php + - + lang: 'C#' + label: 'C#' + source: + $ref: examples/FaxDraftCreateExample.cs + - + lang: TypeScript + label: TypeScript + source: + $ref: examples/FaxDraftCreateExample.ts + - + lang: Java + label: Java + source: + $ref: examples/FaxDraftCreateExample.java + - + lang: Ruby + label: Ruby + source: + $ref: examples/FaxDraftCreateExample.rb + - + lang: Python + label: Python + source: + $ref: examples/FaxDraftCreateExample.py + - + lang: cURL + label: cURL + source: + $ref: examples/FaxDraftCreateExample.sh + x-meta: + seo: + title: 'Create Embedded Fax Draft | API Documentation | Dropbox Fax for Developers' + description: 'Create an embedded Fax draft, then prepare and send it from an approved iframe in your application.' '/fax/files/{fax_id}': get: tags: @@ -7976,6 +8076,44 @@ components: type: boolean default: false type: object + FaxDraftCreateRequest: + required: + - client_id + properties: + files: + description: |- + Use `files[]` to upload the file(s) for the embedded Fax draft. + + This endpoint accepts either **files** or **file_urls[]**, but not both. Files can be added later in the embedded flow when neither is provided. + type: array + items: + type: string + format: binary + file_urls: + description: |- + Use `file_urls[]` to have Dropbox Fax download the file(s) for the embedded Fax draft. + + This endpoint accepts either **files** or **file_urls[]**, but not both. Files can be added later in the embedded flow when neither is provided. + type: array + items: + type: string + client_id: + description: 'Client ID of the API app that owns the embedded Fax draft.' + type: string + editor_options: + $ref: '#/components/schemas/SubEditorPageOptions' + recipients: + description: 'Fax numbers to prefill in the embedded flow. Each fax number must be in a supported international format. A maximum of 20 unique fax numbers can be provided.' + type: array + items: + type: string + maxItems: 20 + uniqueItems: true + test_mode: + description: 'When set to `true`, the completed draft will not send a Fax or consume Fax pages. Defaults to `false`.' + type: boolean + default: false + type: object FaxLineAddUserRequest: required: - number @@ -9548,6 +9686,22 @@ components: type: boolean default: false type: object + SubEditorPageOptions: + description: 'Controls which completed pages are shown again when the embedded Fax draft is opened.' + properties: + force_upload_page: + description: 'When set to `true`, always shows the upload page, even when files are already attached. Defaults to `false`.' + type: boolean + default: false + force_editor_page: + description: 'When set to `true`, always shows the editor page, even when the document is already prepared. Defaults to `false`.' + type: boolean + default: false + force_review_page: + description: 'When set to `true`, always shows the review page, even when recipients and Fax details are already provided. Defaults to `false`.' + type: boolean + default: false + type: object SubFieldOptions: description: 'This allows the requester to specify field options for a signature request.' required: @@ -11555,6 +11709,19 @@ components: error: $ref: '#/components/schemas/ErrorResponseError' type: object + FaxDraftCreateResponse: + required: + - fax_draft + properties: + fax_draft: + $ref: '#/components/schemas/FaxDraftResponse' + warnings: + description: 'A list of warnings.' + type: array + items: + $ref: '#/components/schemas/WarningResponse' + type: object + x-internal-class: true FaxGetResponse: required: - fax @@ -12032,6 +12199,24 @@ components: $ref: '#/components/schemas/FaxResponseTransmission' type: object x-internal-class: true + FaxDraftResponse: + description: 'Contains the embedded Fax draft ID, iframe URL, and expiration timestamp.' + required: + - fax_id + - url + - expires_at + properties: + fax_id: + description: 'ID of the Fax draft.' + type: string + url: + description: 'URL to open in an approved iframe for preparing and sending the Fax.' + type: string + expires_at: + description: 'Unix timestamp indicating when the embedded Fax draft URL expires.' + type: integer + type: object + x-internal-class: true FaxLineResponseFaxLine: properties: number: @@ -13887,6 +14072,10 @@ components: summary: 'Default Example' value: $ref: examples/json/EmbeddedEditUrlRequest.json + FaxDraftCreateRequest: + summary: 'Default Example' + value: + $ref: examples/json/FaxDraftCreateRequest.json FaxLineAddUserRequest: summary: 'Default Example' value: @@ -14175,6 +14364,10 @@ components: summary: 'Error 4XX failed_operation' value: $ref: examples/json/Error4XXResponse.json + FaxDraftCreateResponse: + summary: 'Embedded Fax Draft Response' + value: + $ref: examples/json/FaxDraftCreateResponse.json FaxGetResponse: summary: 'Fax Response' value: diff --git a/openapi.yaml b/openapi.yaml index b9ac61877..65f0b33c9 100644 --- a/openapi.yaml +++ b/openapi.yaml @@ -1550,6 +1550,106 @@ paths: seo: title: 'Delete Fax | API Documentation | Dropbox Fax for Developers' description: 'The Dropbox Fax API allows you to build custom integrations. To find out how to delete a fax, click here.' + /fax/draft/create: + post: + tags: + - Fax + summary: 'Create Embedded Fax Draft' + description: 'Creates an embedded Fax draft and returns a URL that can be opened in an approved iframe for preparation and sending.' + operationId: faxDraftCreate + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/FaxDraftCreateRequest' + examples: + example: + $ref: '#/components/examples/FaxDraftCreateRequest' + multipart/form-data: + schema: + $ref: '#/components/schemas/FaxDraftCreateRequest' + 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/FaxDraftCreateResponse' + examples: + example: + $ref: '#/components/examples/FaxDraftCreateResponse' + '4XX': + description: failed_operation + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + 400_example: + $ref: '#/components/examples/Error400Response' + 401_example: + $ref: '#/components/examples/Error401Response' + 402_example: + $ref: '#/components/examples/Error402Response' + 403_example: + $ref: '#/components/examples/Error403Response' + 429_example: + $ref: '#/components/examples/Error429Response' + 404_example: + $ref: '#/components/examples/Error404Response' + 4XX_example: + $ref: '#/components/examples/Error4XXResponse' + security: + - + api_key: [] + x-codeSamples: + - + lang: PHP + label: PHP + source: + $ref: examples/FaxDraftCreateExample.php + - + lang: 'C#' + label: 'C#' + source: + $ref: examples/FaxDraftCreateExample.cs + - + lang: TypeScript + label: TypeScript + source: + $ref: examples/FaxDraftCreateExample.ts + - + lang: Java + label: Java + source: + $ref: examples/FaxDraftCreateExample.java + - + lang: Ruby + label: Ruby + source: + $ref: examples/FaxDraftCreateExample.rb + - + lang: Python + label: Python + source: + $ref: examples/FaxDraftCreateExample.py + - + lang: cURL + label: cURL + source: + $ref: examples/FaxDraftCreateExample.sh + x-meta: + seo: + title: 'Create Embedded Fax Draft | API Documentation | Dropbox Fax for Developers' + description: 'Create an embedded Fax draft, then prepare and send it from an approved iframe in your application.' '/fax/files/{fax_id}': get: tags: @@ -7976,6 +8076,44 @@ components: type: boolean default: false type: object + FaxDraftCreateRequest: + required: + - client_id + properties: + files: + description: |- + Use `files[]` to upload the file(s) for the embedded Fax draft. + + This endpoint accepts either **files** or **file_urls[]**, but not both. Files can be added later in the embedded flow when neither is provided. + type: array + items: + type: string + format: binary + file_urls: + description: |- + Use `file_urls[]` to have Dropbox Fax download the file(s) for the embedded Fax draft. + + This endpoint accepts either **files** or **file_urls[]**, but not both. Files can be added later in the embedded flow when neither is provided. + type: array + items: + type: string + client_id: + description: 'Client ID of the API app that owns the embedded Fax draft.' + type: string + editor_options: + $ref: '#/components/schemas/SubEditorPageOptions' + recipients: + description: 'Fax numbers to prefill in the embedded flow. Each fax number must be in a supported international format. A maximum of 20 unique fax numbers can be provided.' + type: array + items: + type: string + maxItems: 20 + uniqueItems: true + test_mode: + description: 'When set to `true`, the completed draft will not send a Fax or consume Fax pages. Defaults to `false`.' + type: boolean + default: false + type: object FaxLineAddUserRequest: required: - number @@ -9528,6 +9666,22 @@ components: type: boolean default: false type: object + SubEditorPageOptions: + description: 'Controls which completed pages are shown again when the embedded Fax draft is opened.' + properties: + force_upload_page: + description: 'When set to `true`, always shows the upload page, even when files are already attached. Defaults to `false`.' + type: boolean + default: false + force_editor_page: + description: 'When set to `true`, always shows the editor page, even when the document is already prepared. Defaults to `false`.' + type: boolean + default: false + force_review_page: + description: 'When set to `true`, always shows the review page, even when recipients and Fax details are already provided. Defaults to `false`.' + type: boolean + default: false + type: object SubFieldOptions: description: 'This allows the requester to specify field options for a signature request.' required: @@ -11535,6 +11689,19 @@ components: error: $ref: '#/components/schemas/ErrorResponseError' type: object + FaxDraftCreateResponse: + required: + - fax_draft + properties: + fax_draft: + $ref: '#/components/schemas/FaxDraftResponse' + warnings: + description: 'A list of warnings.' + type: array + items: + $ref: '#/components/schemas/WarningResponse' + type: object + x-internal-class: true FaxGetResponse: required: - fax @@ -12012,6 +12179,24 @@ components: $ref: '#/components/schemas/FaxResponseTransmission' type: object x-internal-class: true + FaxDraftResponse: + description: 'Contains the embedded Fax draft ID, iframe URL, and expiration timestamp.' + required: + - fax_id + - url + - expires_at + properties: + fax_id: + description: 'ID of the Fax draft.' + type: string + url: + description: 'URL to open in an approved iframe for preparing and sending the Fax.' + type: string + expires_at: + description: 'Unix timestamp indicating when the embedded Fax draft URL expires.' + type: integer + type: object + x-internal-class: true FaxLineResponseFaxLine: properties: number: @@ -14383,6 +14568,10 @@ components: summary: 'Default Example' value: $ref: examples/json/EmbeddedEditUrlRequest.json + FaxDraftCreateRequest: + summary: 'Default Example' + value: + $ref: examples/json/FaxDraftCreateRequest.json FaxLineAddUserRequest: summary: 'Default Example' value: @@ -14671,6 +14860,10 @@ components: summary: 'Error 4XX failed_operation' value: $ref: examples/json/Error4XXResponse.json + FaxDraftCreateResponse: + summary: 'Embedded Fax Draft Response' + value: + $ref: examples/json/FaxDraftCreateResponse.json FaxGetResponse: summary: 'Fax Response' value: diff --git a/sandbox/dotnet/src/Dropbox.SignSandbox/FaxDraftCreateExample.cs b/sandbox/dotnet/src/Dropbox.SignSandbox/FaxDraftCreateExample.cs new file mode 100644 index 000000000..d3fc604be --- /dev/null +++ b/sandbox/dotnet/src/Dropbox.SignSandbox/FaxDraftCreateExample.cs @@ -0,0 +1,51 @@ +using System; +using System.Collections.Generic; + +using Dropbox.Sign.Api; +using Dropbox.Sign.Client; +using Dropbox.Sign.Model; + +namespace Dropbox.SignSandbox; + +public class FaxDraftCreateExample +{ + public static void Run() + { + var config = new Configuration(); + config.Username = "YOUR_API_KEY"; + + var editorOptions = new SubEditorPageOptions( + forceUploadPage: false, + forceEditorPage: true, + forceReviewPage: true + ); + var faxDraftCreateRequest = new FaxDraftCreateRequest( + clientId: "b6b8e7deaf8f0b95c029dca049356d4a2cf9710a", + fileUrls: new List + { + "https://www.dropbox.com/s/ad9qnhbrjjn64tu/mutual-NDA-example.pdf?dl=1", + }, + recipients: new List + { + "+14155552671", + }, + editorOptions: editorOptions, + testMode: true + ); + + try + { + var response = new FaxApi(config).FaxDraftCreate( + faxDraftCreateRequest: faxDraftCreateRequest + ); + + Console.WriteLine(response); + } + catch (ApiException e) + { + Console.WriteLine("Exception when calling FaxApi#FaxDraftCreate: " + e.Message); + Console.WriteLine("Status Code: " + e.ErrorCode); + Console.WriteLine(e.StackTrace); + } + } +} diff --git a/sandbox/java/src/main/java/com/dropbox/sign_sandbox/FaxDraftCreateExample.java b/sandbox/java/src/main/java/com/dropbox/sign_sandbox/FaxDraftCreateExample.java new file mode 100644 index 000000000..e40906227 --- /dev/null +++ b/sandbox/java/src/main/java/com/dropbox/sign_sandbox/FaxDraftCreateExample.java @@ -0,0 +1,48 @@ +package com.dropbox.sign_sandbox; + +import com.dropbox.sign.ApiException; +import com.dropbox.sign.Configuration; +import com.dropbox.sign.api.FaxApi; +import com.dropbox.sign.auth.HttpBasicAuth; +import com.dropbox.sign.model.FaxDraftCreateRequest; +import com.dropbox.sign.model.SubEditorPageOptions; + +import java.util.List; + +public class FaxDraftCreateExample +{ + public static void main(String[] args) + { + var config = Configuration.getDefaultApiClient(); + ((HttpBasicAuth) config.getAuthentication("api_key")).setUsername("YOUR_API_KEY"); + + var editorOptions = new SubEditorPageOptions(); + editorOptions.forceUploadPage(false); + editorOptions.forceEditorPage(true); + editorOptions.forceReviewPage(true); + + var faxDraftCreateRequest = new FaxDraftCreateRequest(); + faxDraftCreateRequest.clientId("b6b8e7deaf8f0b95c029dca049356d4a2cf9710a"); + faxDraftCreateRequest.fileUrls(List.of( + "https://www.dropbox.com/s/ad9qnhbrjjn64tu/mutual-NDA-example.pdf?dl=1" + )); + faxDraftCreateRequest.recipients(List.of("+14155552671")); + faxDraftCreateRequest.editorOptions(editorOptions); + faxDraftCreateRequest.testMode(true); + + try + { + var response = new FaxApi(config).faxDraftCreate( + faxDraftCreateRequest + ); + + System.out.println(response); + } catch (ApiException e) { + System.err.println("Exception when calling FaxApi#faxDraftCreate"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} diff --git a/sandbox/node/src/FaxDraftCreateExample.ts b/sandbox/node/src/FaxDraftCreateExample.ts new file mode 100644 index 000000000..2f359af39 --- /dev/null +++ b/sandbox/node/src/FaxDraftCreateExample.ts @@ -0,0 +1,28 @@ +import api from "@dropbox/sign" +import models from "@dropbox/sign" + +const apiCaller = new api.FaxApi(); +apiCaller.username = "YOUR_API_KEY"; + +const faxDraftCreateRequest: models.FaxDraftCreateRequest = { + clientId: "b6b8e7deaf8f0b95c029dca049356d4a2cf9710a", + fileUrls: [ + "https://www.dropbox.com/s/ad9qnhbrjjn64tu/mutual-NDA-example.pdf?dl=1", + ], + recipients: ["+14155552671"], + editorOptions: { + forceUploadPage: false, + forceEditorPage: true, + forceReviewPage: true, + }, + testMode: true, +}; + +apiCaller.faxDraftCreate( + faxDraftCreateRequest, +).then(response => { + console.log(response.body); +}).catch(error => { + console.log("Exception when calling FaxApi#faxDraftCreate:"); + console.log(error.body); +}); diff --git a/sandbox/php/src/FaxDraftCreateExample.php b/sandbox/php/src/FaxDraftCreateExample.php new file mode 100644 index 000000000..ca8b5767d --- /dev/null +++ b/sandbox/php/src/FaxDraftCreateExample.php @@ -0,0 +1,36 @@ +setUsername("YOUR_API_KEY"); + +$editor_options = (new Dropbox\Sign\Model\SubEditorPageOptions()) + ->setForceUploadPage(false) + ->setForceEditorPage(true) + ->setForceReviewPage(true); + +$fax_draft_create_request = (new Dropbox\Sign\Model\FaxDraftCreateRequest()) + ->setClientId("b6b8e7deaf8f0b95c029dca049356d4a2cf9710a") + ->setFileUrls([ + "https://www.dropbox.com/s/ad9qnhbrjjn64tu/mutual-NDA-example.pdf?dl=1", + ]) + ->setRecipients([ + "+14155552671", + ]) + ->setEditorOptions($editor_options) + ->setTestMode(true); + +try { + $response = (new Dropbox\Sign\Api\FaxApi(config: $config))->faxDraftCreate( + fax_draft_create_request: $fax_draft_create_request, + ); + + print_r($response); +} catch (Dropbox\Sign\ApiException $e) { + echo "Exception when calling FaxApi#faxDraftCreate: {$e->getMessage()}"; +} diff --git a/sandbox/python/src/FaxDraftCreateExample.py b/sandbox/python/src/FaxDraftCreateExample.py new file mode 100644 index 000000000..2239813b3 --- /dev/null +++ b/sandbox/python/src/FaxDraftCreateExample.py @@ -0,0 +1,32 @@ +from pprint import pprint + +from dropbox_sign import ApiClient, ApiException, Configuration, api, models + +configuration = Configuration( + username="YOUR_API_KEY", +) + +with ApiClient(configuration) as api_client: + editor_options = models.SubEditorPageOptions( + force_upload_page=False, + force_editor_page=True, + force_review_page=True, + ) + fax_draft_create_request = models.FaxDraftCreateRequest( + client_id="b6b8e7deaf8f0b95c029dca049356d4a2cf9710a", + file_urls=[ + "https://www.dropbox.com/s/ad9qnhbrjjn64tu/mutual-NDA-example.pdf?dl=1", + ], + recipients=["+14155552671"], + editor_options=editor_options, + test_mode=True, + ) + + try: + response = api.FaxApi(api_client).fax_draft_create( + fax_draft_create_request=fax_draft_create_request, + ) + + pprint(response) + except ApiException as e: + print("Exception when calling FaxApi#fax_draft_create: %s\n" % e) diff --git a/sandbox/ruby/src/FaxDraftCreateExample.rb b/sandbox/ruby/src/FaxDraftCreateExample.rb new file mode 100644 index 000000000..8fb5bcaae --- /dev/null +++ b/sandbox/ruby/src/FaxDraftCreateExample.rb @@ -0,0 +1,30 @@ +require "json" +require "dropbox-sign" + +Dropbox::Sign.configure do |config| + config.username = "YOUR_API_KEY" +end + +editor_options = Dropbox::Sign::SubEditorPageOptions.new +editor_options.force_upload_page = false +editor_options.force_editor_page = true +editor_options.force_review_page = true + +fax_draft_create_request = Dropbox::Sign::FaxDraftCreateRequest.new +fax_draft_create_request.client_id = "b6b8e7deaf8f0b95c029dca049356d4a2cf9710a" +fax_draft_create_request.file_urls = [ + "https://www.dropbox.com/s/ad9qnhbrjjn64tu/mutual-NDA-example.pdf?dl=1", +] +fax_draft_create_request.recipients = ["+14155552671"] +fax_draft_create_request.editor_options = editor_options +fax_draft_create_request.test_mode = true + +begin + response = Dropbox::Sign::FaxApi.new.fax_draft_create( + fax_draft_create_request, + ) + + p response +rescue Dropbox::Sign::ApiError => e + puts "Exception when calling FaxApi#fax_draft_create: #{e}" +end diff --git a/sdks/dotnet/README.md b/sdks/dotnet/README.md index 414467bc4..096169b4a 100644 --- a/sdks/dotnet/README.md +++ b/sdks/dotnet/README.md @@ -145,6 +145,7 @@ Class | Method | HTTP request | Description *EmbeddedApi* | [**EmbeddedEditUrl**](docs/EmbeddedApi.md#embeddedediturl) | **POST** /embedded/edit_url/{template_id} | Get Embedded Template Edit URL *EmbeddedApi* | [**EmbeddedSignUrl**](docs/EmbeddedApi.md#embeddedsignurl) | **GET** /embedded/sign_url/{signature_id} | Get Embedded Sign URL *FaxApi* | [**FaxDelete**](docs/FaxApi.md#faxdelete) | **DELETE** /fax/{fax_id} | Delete Fax +*FaxApi* | [**FaxDraftCreate**](docs/FaxApi.md#faxdraftcreate) | **POST** /fax/draft/create | Create Embedded Fax Draft *FaxApi* | [**FaxFiles**](docs/FaxApi.md#faxfiles) | **GET** /fax/files/{fax_id} | Download Fax Files *FaxApi* | [**FaxGet**](docs/FaxApi.md#faxget) | **GET** /fax/{fax_id} | Get Fax *FaxApi* | [**FaxList**](docs/FaxApi.md#faxlist) | **GET** /fax/list | Lists Faxes @@ -244,6 +245,9 @@ Class | Method | HTTP request | Description - [Model.EventCallbackRequest](docs/EventCallbackRequest.md) - [Model.EventCallbackRequestEvent](docs/EventCallbackRequestEvent.md) - [Model.EventCallbackRequestEventMetadata](docs/EventCallbackRequestEventMetadata.md) + - [Model.FaxDraftCreateRequest](docs/FaxDraftCreateRequest.md) + - [Model.FaxDraftCreateResponse](docs/FaxDraftCreateResponse.md) + - [Model.FaxDraftResponse](docs/FaxDraftResponse.md) - [Model.FaxGetResponse](docs/FaxGetResponse.md) - [Model.FaxLineAddUserRequest](docs/FaxLineAddUserRequest.md) - [Model.FaxLineAreaCodeGetCountryEnum](docs/FaxLineAreaCodeGetCountryEnum.md) @@ -307,6 +311,7 @@ Class | Method | HTTP request | Description - [Model.SubCC](docs/SubCC.md) - [Model.SubCustomField](docs/SubCustomField.md) - [Model.SubEditorOptions](docs/SubEditorOptions.md) + - [Model.SubEditorPageOptions](docs/SubEditorPageOptions.md) - [Model.SubFieldOptions](docs/SubFieldOptions.md) - [Model.SubFormFieldGroup](docs/SubFormFieldGroup.md) - [Model.SubFormFieldRule](docs/SubFormFieldRule.md) diff --git a/sdks/dotnet/docs/FaxApi.md b/sdks/dotnet/docs/FaxApi.md index 41349a481..440c311f4 100644 --- a/sdks/dotnet/docs/FaxApi.md +++ b/sdks/dotnet/docs/FaxApi.md @@ -5,6 +5,7 @@ All URIs are relative to *https://api.hellosign.com/v3* | Method | HTTP request | Description | |--------|--------------|-------------| | [**FaxDelete**](FaxApi.md#faxdelete) | **DELETE** /fax/{fax_id} | Delete Fax | +| [**FaxDraftCreate**](FaxApi.md#faxdraftcreate) | **POST** /fax/draft/create | Create Embedded Fax Draft | | [**FaxFiles**](FaxApi.md#faxfiles) | **GET** /fax/files/{fax_id} | Download Fax Files | | [**FaxGet**](FaxApi.md#faxget) | **GET** /fax/{fax_id} | Get Fax | | [**FaxList**](FaxApi.md#faxlist) | **GET** /fax/list | Lists Faxes | @@ -100,6 +101,118 @@ void (empty response body) [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **FaxDraftCreate** +> FaxDraftCreateResponse FaxDraftCreate (FaxDraftCreateRequest faxDraftCreateRequest) + +Create Embedded Fax Draft + +Creates an embedded Fax draft and returns a URL that can be opened in an approved iframe for preparation and sending. + +### Example +```csharp +using System; +using System.Collections.Generic; + +using Dropbox.Sign.Api; +using Dropbox.Sign.Client; +using Dropbox.Sign.Model; + +namespace Dropbox.SignSandbox; + +public class FaxDraftCreateExample +{ + public static void Run() + { + var config = new Configuration(); + config.Username = "YOUR_API_KEY"; + + var editorOptions = new SubEditorPageOptions( + forceUploadPage: false, + forceEditorPage: true, + forceReviewPage: true + ); + var faxDraftCreateRequest = new FaxDraftCreateRequest( + clientId: "b6b8e7deaf8f0b95c029dca049356d4a2cf9710a", + fileUrls: new List + { + "https://www.dropbox.com/s/ad9qnhbrjjn64tu/mutual-NDA-example.pdf?dl=1", + }, + recipients: new List + { + "+14155552671", + }, + editorOptions: editorOptions, + testMode: true + ); + + try + { + var response = new FaxApi(config).FaxDraftCreate( + faxDraftCreateRequest: faxDraftCreateRequest + ); + + Console.WriteLine(response); + } + catch (ApiException e) + { + Console.WriteLine("Exception when calling FaxApi#FaxDraftCreate: " + e.Message); + Console.WriteLine("Status Code: " + e.ErrorCode); + Console.WriteLine(e.StackTrace); + } + } +} + +``` + +#### Using the FaxDraftCreateWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // Create Embedded Fax Draft + ApiResponse response = apiInstance.FaxDraftCreateWithHttpInfo(faxDraftCreateRequest); + 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 FaxApi.FaxDraftCreateWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **faxDraftCreateRequest** | [**FaxDraftCreateRequest**](FaxDraftCreateRequest.md) | | | + +### Return type + +[**FaxDraftCreateResponse**](FaxDraftCreateResponse.md) + +### Authorization + +[api_key](../README.md#api_key) + +### 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) + # **FaxFiles** > System.IO.Stream FaxFiles (string faxId) diff --git a/sdks/dotnet/docs/FaxDraftCreateRequest.md b/sdks/dotnet/docs/FaxDraftCreateRequest.md new file mode 100644 index 000000000..20021dccc --- /dev/null +++ b/sdks/dotnet/docs/FaxDraftCreateRequest.md @@ -0,0 +1,9 @@ +# Dropbox.Sign.Model.FaxDraftCreateRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ClientId** | **string** | Client ID of the API app that owns the embedded Fax draft. | **Files** | **List<System.IO.Stream>** | Use `files[]` to upload the file(s) for the embedded Fax draft.

This endpoint accepts either **files** or **file_urls[]**, but not both. Files can be added later in the embedded flow when neither is provided. | [optional] **FileUrls** | **List<string>** | Use `file_urls[]` to have Dropbox Fax download the file(s) for the embedded Fax draft.

This endpoint accepts either **files** or **file_urls[]**, but not both. Files can be added later in the embedded flow when neither is provided. | [optional] **EditorOptions** | [**SubEditorPageOptions**](SubEditorPageOptions.md) | | [optional] **Recipients** | **List<string>** | Fax numbers to prefill in the embedded flow. Each fax number must be in a supported international format. A maximum of 20 unique fax numbers can be provided. | [optional] **TestMode** | **bool** | When set to `true`, the completed draft will not send a Fax or consume Fax pages. Defaults to `false`. | [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/FaxDraftCreateResponse.md b/sdks/dotnet/docs/FaxDraftCreateResponse.md new file mode 100644 index 000000000..2fb318b14 --- /dev/null +++ b/sdks/dotnet/docs/FaxDraftCreateResponse.md @@ -0,0 +1,9 @@ +# Dropbox.Sign.Model.FaxDraftCreateResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**FaxDraft** | [**FaxDraftResponse**](FaxDraftResponse.md) | | **Warnings** | [**List<WarningResponse>**](WarningResponse.md) | A list of warnings. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/sdks/dotnet/docs/FaxDraftResponse.md b/sdks/dotnet/docs/FaxDraftResponse.md new file mode 100644 index 000000000..b4304af45 --- /dev/null +++ b/sdks/dotnet/docs/FaxDraftResponse.md @@ -0,0 +1,10 @@ +# Dropbox.Sign.Model.FaxDraftResponse +Contains the embedded Fax draft ID, iframe URL, and expiration timestamp. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**FaxId** | **string** | ID of the Fax draft. | **Url** | **string** | URL to open in an approved iframe for preparing and sending the Fax. | **ExpiresAt** | **int** | Unix timestamp indicating when the embedded Fax draft URL expires. | + +[[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/SubEditorPageOptions.md b/sdks/dotnet/docs/SubEditorPageOptions.md new file mode 100644 index 000000000..73028acbb --- /dev/null +++ b/sdks/dotnet/docs/SubEditorPageOptions.md @@ -0,0 +1,10 @@ +# Dropbox.Sign.Model.SubEditorPageOptions +Controls which completed pages are shown again when the embedded Fax draft is opened. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ForceUploadPage** | **bool** | When set to `true`, always shows the upload page, even when files are already attached. Defaults to `false`. | [optional] [default to false]**ForceEditorPage** | **bool** | When set to `true`, always shows the editor page, even when the document is already prepared. Defaults to `false`. | [optional] [default to false]**ForceReviewPage** | **bool** | When set to `true`, always shows the review page, even when recipients and Fax details are already provided. Defaults to `false`. | [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/src/Dropbox.Sign/Api/FaxApi.cs b/sdks/dotnet/src/Dropbox.Sign/Api/FaxApi.cs index 096d3bf66..894768095 100644 --- a/sdks/dotnet/src/Dropbox.Sign/Api/FaxApi.cs +++ b/sdks/dotnet/src/Dropbox.Sign/Api/FaxApi.cs @@ -51,6 +51,29 @@ public interface IFaxApiSync : IApiAccessor /// ApiResponse of Object(void) ApiResponse FaxDeleteWithHttpInfo(string faxId, int operationIndex = 0); /// + /// Create Embedded Fax Draft + /// + /// + /// Creates an embedded Fax draft and returns a URL that can be opened in an approved iframe for preparation and sending. + /// + /// Thrown when fails to make API call + /// + /// Index associated with the operation. + /// FaxDraftCreateResponse + FaxDraftCreateResponse FaxDraftCreate(FaxDraftCreateRequest faxDraftCreateRequest, int operationIndex = 0); + + /// + /// Create Embedded Fax Draft + /// + /// + /// Creates an embedded Fax draft and returns a URL that can be opened in an approved iframe for preparation and sending. + /// + /// Thrown when fails to make API call + /// + /// Index associated with the operation. + /// ApiResponse of FaxDraftCreateResponse + ApiResponse FaxDraftCreateWithHttpInfo(FaxDraftCreateRequest faxDraftCreateRequest, int operationIndex = 0); + /// /// Download Fax Files /// /// @@ -179,6 +202,31 @@ public interface IFaxApiAsync : IApiAccessor /// Task of ApiResponse System.Threading.Tasks.Task> FaxDeleteWithHttpInfoAsync(string faxId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); /// + /// Create Embedded Fax Draft + /// + /// + /// Creates an embedded Fax draft and returns a URL that can be opened in an approved iframe for preparation and sending. + /// + /// Thrown when fails to make API call + /// + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of FaxDraftCreateResponse + System.Threading.Tasks.Task FaxDraftCreateAsync(FaxDraftCreateRequest faxDraftCreateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + + /// + /// Create Embedded Fax Draft + /// + /// + /// Creates an embedded Fax draft and returns a URL that can be opened in an approved iframe for preparation and sending. + /// + /// Thrown when fails to make API call + /// + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (FaxDraftCreateResponse) + System.Threading.Tasks.Task> FaxDraftCreateWithHttpInfoAsync(FaxDraftCreateRequest faxDraftCreateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + /// /// Download Fax Files /// /// @@ -554,6 +602,178 @@ public Dropbox.Sign.Client.ApiResponse FaxDeleteWithHttpInfo(string faxI return localVarResponse; } + /// + /// Create Embedded Fax Draft Creates an embedded Fax draft and returns a URL that can be opened in an approved iframe for preparation and sending. + /// + /// Thrown when fails to make API call + /// + /// Index associated with the operation. + /// FaxDraftCreateResponse + public FaxDraftCreateResponse FaxDraftCreate(FaxDraftCreateRequest faxDraftCreateRequest, int operationIndex = 0) + { + Dropbox.Sign.Client.ApiResponse localVarResponse = FaxDraftCreateWithHttpInfo(faxDraftCreateRequest); + return localVarResponse.Data; + } + + /// + /// Create Embedded Fax Draft Creates an embedded Fax draft and returns a URL that can be opened in an approved iframe for preparation and sending. + /// + /// Thrown when fails to make API call + /// + /// Index associated with the operation. + /// ApiResponse of FaxDraftCreateResponse + public Dropbox.Sign.Client.ApiResponse FaxDraftCreateWithHttpInfo(FaxDraftCreateRequest faxDraftCreateRequest, int operationIndex = 0) + { + // verify the required parameter 'faxDraftCreateRequest' is set + if (faxDraftCreateRequest == null) + { + throw new Dropbox.Sign.Client.ApiException(400, "Missing required parameter 'faxDraftCreateRequest' when calling FaxApi->FaxDraftCreate"); + } + + Dropbox.Sign.Client.RequestOptions localVarRequestOptions = new Dropbox.Sign.Client.RequestOptions(); + + var localVarContentType = ""; + var openApiTypes = faxDraftCreateRequest.GetOpenApiTypes(); + if (ClientUtils.HasFileType(openApiTypes)) + { + ClientUtils.SetFormData(localVarRequestOptions, openApiTypes); + localVarContentType = "multipart/form-data"; + } + else + { + localVarContentType = "application/json"; + localVarRequestOptions.Data = faxDraftCreateRequest; + } + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } + + var localVarAccept = Dropbox.Sign.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } + + + localVarRequestOptions.Operation = "FaxApi.FaxDraftCreate"; + 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)); + } + + // make the HTTP request + var localVarResponse = this.Client.Post("/fax/draft/create", localVarRequestOptions, this.Configuration); + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("FaxDraftCreate", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + + /// + /// Create Embedded Fax Draft Creates an embedded Fax draft and returns a URL that can be opened in an approved iframe for preparation and sending. + /// + /// Thrown when fails to make API call + /// + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of FaxDraftCreateResponse + public async System.Threading.Tasks.Task FaxDraftCreateAsync(FaxDraftCreateRequest faxDraftCreateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + { + Dropbox.Sign.Client.ApiResponse localVarResponse = await FaxDraftCreateWithHttpInfoAsync(faxDraftCreateRequest, operationIndex, cancellationToken).ConfigureAwait(false); + return localVarResponse.Data; + } + + /// + /// Create Embedded Fax Draft Creates an embedded Fax draft and returns a URL that can be opened in an approved iframe for preparation and sending. + /// + /// Thrown when fails to make API call + /// + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (FaxDraftCreateResponse) + public async System.Threading.Tasks.Task> FaxDraftCreateWithHttpInfoAsync(FaxDraftCreateRequest faxDraftCreateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + { + // verify the required parameter 'faxDraftCreateRequest' is set + if (faxDraftCreateRequest == null) + { + throw new Dropbox.Sign.Client.ApiException(400, "Missing required parameter 'faxDraftCreateRequest' when calling FaxApi->FaxDraftCreate"); + } + + + Dropbox.Sign.Client.RequestOptions localVarRequestOptions = new Dropbox.Sign.Client.RequestOptions(); + + var localVarContentType = ""; + var openApiTypes = faxDraftCreateRequest.GetOpenApiTypes(); + if (ClientUtils.HasFileType(openApiTypes)) + { + ClientUtils.SetFormData(localVarRequestOptions, openApiTypes); + localVarContentType = "multipart/form-data"; + } + else + { + localVarContentType = "application/json"; + localVarRequestOptions.Data = faxDraftCreateRequest; + } + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } + + var localVarAccept = Dropbox.Sign.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } + + + localVarRequestOptions.Operation = "FaxApi.FaxDraftCreate"; + 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)); + } + + // make the HTTP request + var localVarResponse = await this.AsynchronousClient.PostAsync("/fax/draft/create", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("FaxDraftCreate", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + /// /// Download Fax Files Downloads files associated with a Fax /// diff --git a/sdks/dotnet/src/Dropbox.Sign/Model/FaxDraftCreateRequest.cs b/sdks/dotnet/src/Dropbox.Sign/Model/FaxDraftCreateRequest.cs new file mode 100644 index 000000000..9d336784c --- /dev/null +++ b/sdks/dotnet/src/Dropbox.Sign/Model/FaxDraftCreateRequest.cs @@ -0,0 +1,299 @@ +/* + * 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 +{ + /// + /// FaxDraftCreateRequest + /// + [DataContract(Name = "FaxDraftCreateRequest")] + [JsonObject(ItemNullValueHandling = NullValueHandling.Ignore)] + public partial class FaxDraftCreateRequest : IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + [JsonConstructorAttribute] + protected FaxDraftCreateRequest() { } + /// + /// Initializes a new instance of the class. + /// + /// Use `files[]` to upload the file(s) for the embedded Fax draft. This endpoint accepts either **files** or **file_urls[]**, but not both. Files can be added later in the embedded flow when neither is provided.. + /// Use `file_urls[]` to have Dropbox Fax download the file(s) for the embedded Fax draft. This endpoint accepts either **files** or **file_urls[]**, but not both. Files can be added later in the embedded flow when neither is provided.. + /// Client ID of the API app that owns the embedded Fax draft. (required). + /// editorOptions. + /// Fax numbers to prefill in the embedded flow. Each fax number must be in a supported international format. A maximum of 20 unique fax numbers can be provided.. + /// When set to `true`, the completed draft will not send a Fax or consume Fax pages. Defaults to `false`. (default to false). + public FaxDraftCreateRequest(List files = default(List), List fileUrls = default(List), string clientId = default(string), SubEditorPageOptions editorOptions = default(SubEditorPageOptions), List recipients = default(List), bool testMode = false) + { + + // to ensure "clientId" is required (not null) + if (clientId == null) + { + throw new ArgumentNullException("clientId is a required property for FaxDraftCreateRequest and cannot be null"); + } + this.ClientId = clientId; + this.Files = files; + this.FileUrls = fileUrls; + this.EditorOptions = editorOptions; + this.Recipients = recipients; + this.TestMode = testMode; + } + + /// + /// Attempt to instantiate and hydrate a new instance of this class + /// + /// String of JSON data representing target object + public static FaxDraftCreateRequest Init(string jsonData) + { + var obj = JsonConvert.DeserializeObject(jsonData); + + if (obj == null) + { + throw new Exception("Unable to deserialize JSON to instance of FaxDraftCreateRequest"); + } + + return obj; + } + + /// + /// Client ID of the API app that owns the embedded Fax draft. + /// + /// Client ID of the API app that owns the embedded Fax draft. + [DataMember(Name = "client_id", IsRequired = true, EmitDefaultValue = true)] + public string ClientId { get; set; } + + /// + /// Use `files[]` to upload the file(s) for the embedded Fax draft. This endpoint accepts either **files** or **file_urls[]**, but not both. Files can be added later in the embedded flow when neither is provided. + /// + /// Use `files[]` to upload the file(s) for the embedded Fax draft. This endpoint accepts either **files** or **file_urls[]**, but not both. Files can be added later in the embedded flow when neither is provided. + [DataMember(Name = "files", EmitDefaultValue = true)] + public List Files { get; set; } + + /// + /// Use `file_urls[]` to have Dropbox Fax download the file(s) for the embedded Fax draft. This endpoint accepts either **files** or **file_urls[]**, but not both. Files can be added later in the embedded flow when neither is provided. + /// + /// Use `file_urls[]` to have Dropbox Fax download the file(s) for the embedded Fax draft. This endpoint accepts either **files** or **file_urls[]**, but not both. Files can be added later in the embedded flow when neither is provided. + [DataMember(Name = "file_urls", EmitDefaultValue = true)] + public List FileUrls { get; set; } + + /// + /// Gets or Sets EditorOptions + /// + [DataMember(Name = "editor_options", EmitDefaultValue = true)] + public SubEditorPageOptions EditorOptions { get; set; } + + /// + /// Fax numbers to prefill in the embedded flow. Each fax number must be in a supported international format. A maximum of 20 unique fax numbers can be provided. + /// + /// Fax numbers to prefill in the embedded flow. Each fax number must be in a supported international format. A maximum of 20 unique fax numbers can be provided. + [DataMember(Name = "recipients", EmitDefaultValue = true)] + public List Recipients { get; set; } + + /// + /// When set to `true`, the completed draft will not send a Fax or consume Fax pages. Defaults to `false`. + /// + /// When set to `true`, the completed draft will not send a Fax or consume Fax pages. Defaults to `false`. + [DataMember(Name = "test_mode", EmitDefaultValue = true)] + public bool TestMode { 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 FaxDraftCreateRequest {\n"); + sb.Append(" ClientId: ").Append(ClientId).Append("\n"); + sb.Append(" Files: ").Append(Files).Append("\n"); + sb.Append(" FileUrls: ").Append(FileUrls).Append("\n"); + sb.Append(" EditorOptions: ").Append(EditorOptions).Append("\n"); + sb.Append(" Recipients: ").Append(Recipients).Append("\n"); + sb.Append(" TestMode: ").Append(TestMode).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 FaxDraftCreateRequest); + } + + /// + /// Returns true if FaxDraftCreateRequest instances are equal + /// + /// Instance of FaxDraftCreateRequest to be compared + /// Boolean + public bool Equals(FaxDraftCreateRequest 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.EditorOptions == input.EditorOptions || + (this.EditorOptions != null && + this.EditorOptions.Equals(input.EditorOptions)) + ) && + ( + this.Recipients == input.Recipients || + this.Recipients != null && + input.Recipients != null && + this.Recipients.SequenceEqual(input.Recipients) + ) && + ( + this.TestMode == input.TestMode || + this.TestMode.Equals(input.TestMode) + ); + } + + /// + /// 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.EditorOptions != null) + { + hashCode = (hashCode * 59) + this.EditorOptions.GetHashCode(); + } + if (this.Recipients != null) + { + hashCode = (hashCode * 59) + this.Recipients.GetHashCode(); + } + hashCode = (hashCode * 59) + this.TestMode.GetHashCode(); + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + yield break; + } + public List GetOpenApiTypes() + { + var types = new List(); + types.Add(new OpenApiType() + { + Name = "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 = "editor_options", + Property = "EditorOptions", + Type = "SubEditorPageOptions", + Value = EditorOptions, + }); + types.Add(new OpenApiType() + { + Name = "recipients", + Property = "Recipients", + Type = "List", + Value = Recipients, + }); + types.Add(new OpenApiType() + { + Name = "test_mode", + Property = "TestMode", + Type = "bool", + Value = TestMode, + }); + + return types; + } + } + +} diff --git a/sdks/dotnet/src/Dropbox.Sign/Model/FaxDraftCreateResponse.cs b/sdks/dotnet/src/Dropbox.Sign/Model/FaxDraftCreateResponse.cs new file mode 100644 index 000000000..223f12794 --- /dev/null +++ b/sdks/dotnet/src/Dropbox.Sign/Model/FaxDraftCreateResponse.cs @@ -0,0 +1,197 @@ +/* + * Dropbox Sign API + * + * Dropbox Sign v3 API + * + * The version of the OpenAPI document: 3.0.0 + * Contact: apisupport@hellosign.com + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using System.ComponentModel.DataAnnotations; +using OpenAPIDateConverter = Dropbox.Sign.Client.OpenAPIDateConverter; + +namespace Dropbox.Sign.Model +{ + /// + /// FaxDraftCreateResponse + /// + [DataContract(Name = "FaxDraftCreateResponse")] + [JsonObject(ItemNullValueHandling = NullValueHandling.Ignore)] + public partial class FaxDraftCreateResponse : IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + [JsonConstructorAttribute] + protected FaxDraftCreateResponse() { } + /// + /// Initializes a new instance of the class. + /// + /// faxDraft (required). + /// A list of warnings.. + public FaxDraftCreateResponse(FaxDraftResponse faxDraft = default(FaxDraftResponse), List warnings = default(List)) + { + + // to ensure "faxDraft" is required (not null) + if (faxDraft == null) + { + throw new ArgumentNullException("faxDraft is a required property for FaxDraftCreateResponse and cannot be null"); + } + this.FaxDraft = faxDraft; + this.Warnings = warnings; + } + + /// + /// Attempt to instantiate and hydrate a new instance of this class + /// + /// String of JSON data representing target object + public static FaxDraftCreateResponse Init(string jsonData) + { + var obj = JsonConvert.DeserializeObject(jsonData); + + if (obj == null) + { + throw new Exception("Unable to deserialize JSON to instance of FaxDraftCreateResponse"); + } + + return obj; + } + + /// + /// Gets or Sets FaxDraft + /// + [DataMember(Name = "fax_draft", IsRequired = true, EmitDefaultValue = true)] + public FaxDraftResponse FaxDraft { get; set; } + + /// + /// A list of warnings. + /// + /// A list of warnings. + [DataMember(Name = "warnings", EmitDefaultValue = true)] + public List Warnings { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class FaxDraftCreateResponse {\n"); + sb.Append(" FaxDraft: ").Append(FaxDraft).Append("\n"); + sb.Append(" Warnings: ").Append(Warnings).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return this.Equals(input as FaxDraftCreateResponse); + } + + /// + /// Returns true if FaxDraftCreateResponse instances are equal + /// + /// Instance of FaxDraftCreateResponse to be compared + /// Boolean + public bool Equals(FaxDraftCreateResponse input) + { + if (input == null) + { + return false; + } + return + ( + this.FaxDraft == input.FaxDraft || + (this.FaxDraft != null && + this.FaxDraft.Equals(input.FaxDraft)) + ) && + ( + this.Warnings == input.Warnings || + this.Warnings != null && + input.Warnings != null && + this.Warnings.SequenceEqual(input.Warnings) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.FaxDraft != null) + { + hashCode = (hashCode * 59) + this.FaxDraft.GetHashCode(); + } + if (this.Warnings != null) + { + hashCode = (hashCode * 59) + this.Warnings.GetHashCode(); + } + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + yield break; + } + public List GetOpenApiTypes() + { + var types = new List(); + types.Add(new OpenApiType() + { + Name = "fax_draft", + Property = "FaxDraft", + Type = "FaxDraftResponse", + Value = FaxDraft, + }); + types.Add(new OpenApiType() + { + Name = "warnings", + Property = "Warnings", + Type = "List", + Value = Warnings, + }); + + return types; + } + } + +} diff --git a/sdks/dotnet/src/Dropbox.Sign/Model/FaxDraftResponse.cs b/sdks/dotnet/src/Dropbox.Sign/Model/FaxDraftResponse.cs new file mode 100644 index 000000000..671c8fd4d --- /dev/null +++ b/sdks/dotnet/src/Dropbox.Sign/Model/FaxDraftResponse.cs @@ -0,0 +1,224 @@ +/* + * 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 +{ + /// + /// Contains the embedded Fax draft ID, iframe URL, and expiration timestamp. + /// + [DataContract(Name = "FaxDraftResponse")] + [JsonObject(ItemNullValueHandling = NullValueHandling.Ignore)] + public partial class FaxDraftResponse : IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + [JsonConstructorAttribute] + protected FaxDraftResponse() { } + /// + /// Initializes a new instance of the class. + /// + /// ID of the Fax draft. (required). + /// URL to open in an approved iframe for preparing and sending the Fax. (required). + /// Unix timestamp indicating when the embedded Fax draft URL expires. (required). + public FaxDraftResponse(string faxId = default(string), string url = default(string), int expiresAt = default(int)) + { + + // to ensure "faxId" is required (not null) + if (faxId == null) + { + throw new ArgumentNullException("faxId is a required property for FaxDraftResponse and cannot be null"); + } + this.FaxId = faxId; + // to ensure "url" is required (not null) + if (url == null) + { + throw new ArgumentNullException("url is a required property for FaxDraftResponse and cannot be null"); + } + this.Url = url; + this.ExpiresAt = expiresAt; + } + + /// + /// Attempt to instantiate and hydrate a new instance of this class + /// + /// String of JSON data representing target object + public static FaxDraftResponse Init(string jsonData) + { + var obj = JsonConvert.DeserializeObject(jsonData); + + if (obj == null) + { + throw new Exception("Unable to deserialize JSON to instance of FaxDraftResponse"); + } + + return obj; + } + + /// + /// ID of the Fax draft. + /// + /// ID of the Fax draft. + [DataMember(Name = "fax_id", IsRequired = true, EmitDefaultValue = true)] + public string FaxId { get; set; } + + /// + /// URL to open in an approved iframe for preparing and sending the Fax. + /// + /// URL to open in an approved iframe for preparing and sending the Fax. + [DataMember(Name = "url", IsRequired = true, EmitDefaultValue = true)] + public string Url { get; set; } + + /// + /// Unix timestamp indicating when the embedded Fax draft URL expires. + /// + /// Unix timestamp indicating when the embedded Fax draft URL expires. + [DataMember(Name = "expires_at", IsRequired = true, 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 FaxDraftResponse {\n"); + sb.Append(" FaxId: ").Append(FaxId).Append("\n"); + sb.Append(" Url: ").Append(Url).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 FaxDraftResponse); + } + + /// + /// Returns true if FaxDraftResponse instances are equal + /// + /// Instance of FaxDraftResponse to be compared + /// Boolean + public bool Equals(FaxDraftResponse input) + { + if (input == null) + { + return false; + } + return + ( + this.FaxId == input.FaxId || + (this.FaxId != null && + this.FaxId.Equals(input.FaxId)) + ) && + ( + this.Url == input.Url || + (this.Url != null && + this.Url.Equals(input.Url)) + ) && + ( + this.ExpiresAt == input.ExpiresAt || + 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.FaxId != null) + { + hashCode = (hashCode * 59) + this.FaxId.GetHashCode(); + } + if (this.Url != null) + { + hashCode = (hashCode * 59) + this.Url.GetHashCode(); + } + hashCode = (hashCode * 59) + this.ExpiresAt.GetHashCode(); + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + yield break; + } + public List GetOpenApiTypes() + { + var types = new List(); + types.Add(new OpenApiType() + { + Name = "fax_id", + Property = "FaxId", + Type = "string", + Value = FaxId, + }); + types.Add(new OpenApiType() + { + Name = "url", + Property = "Url", + Type = "string", + Value = Url, + }); + types.Add(new OpenApiType() + { + Name = "expires_at", + Property = "ExpiresAt", + Type = "int", + Value = ExpiresAt, + }); + + return types; + } + } + +} diff --git a/sdks/dotnet/src/Dropbox.Sign/Model/SubEditorPageOptions.cs b/sdks/dotnet/src/Dropbox.Sign/Model/SubEditorPageOptions.cs new file mode 100644 index 000000000..bfad09bfb --- /dev/null +++ b/sdks/dotnet/src/Dropbox.Sign/Model/SubEditorPageOptions.cs @@ -0,0 +1,206 @@ +/* + * 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 +{ + /// + /// Controls which completed pages are shown again when the embedded Fax draft is opened. + /// + [DataContract(Name = "SubEditorPageOptions")] + [JsonObject(ItemNullValueHandling = NullValueHandling.Ignore)] + public partial class SubEditorPageOptions : IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + [JsonConstructorAttribute] + protected SubEditorPageOptions() { } + /// + /// Initializes a new instance of the class. + /// + /// When set to `true`, always shows the upload page, even when files are already attached. Defaults to `false`. (default to false). + /// When set to `true`, always shows the editor page, even when the document is already prepared. Defaults to `false`. (default to false). + /// When set to `true`, always shows the review page, even when recipients and Fax details are already provided. Defaults to `false`. (default to false). + public SubEditorPageOptions(bool forceUploadPage = false, bool forceEditorPage = false, bool forceReviewPage = false) + { + + this.ForceUploadPage = forceUploadPage; + this.ForceEditorPage = forceEditorPage; + this.ForceReviewPage = forceReviewPage; + } + + /// + /// Attempt to instantiate and hydrate a new instance of this class + /// + /// String of JSON data representing target object + public static SubEditorPageOptions Init(string jsonData) + { + var obj = JsonConvert.DeserializeObject(jsonData); + + if (obj == null) + { + throw new Exception("Unable to deserialize JSON to instance of SubEditorPageOptions"); + } + + return obj; + } + + /// + /// When set to `true`, always shows the upload page, even when files are already attached. Defaults to `false`. + /// + /// When set to `true`, always shows the upload page, even when files are already attached. Defaults to `false`. + [DataMember(Name = "force_upload_page", EmitDefaultValue = true)] + public bool ForceUploadPage { get; set; } + + /// + /// When set to `true`, always shows the editor page, even when the document is already prepared. Defaults to `false`. + /// + /// When set to `true`, always shows the editor page, even when the document is already prepared. Defaults to `false`. + [DataMember(Name = "force_editor_page", EmitDefaultValue = true)] + public bool ForceEditorPage { get; set; } + + /// + /// When set to `true`, always shows the review page, even when recipients and Fax details are already provided. Defaults to `false`. + /// + /// When set to `true`, always shows the review page, even when recipients and Fax details are already provided. Defaults to `false`. + [DataMember(Name = "force_review_page", EmitDefaultValue = true)] + public bool ForceReviewPage { 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 SubEditorPageOptions {\n"); + sb.Append(" ForceUploadPage: ").Append(ForceUploadPage).Append("\n"); + sb.Append(" ForceEditorPage: ").Append(ForceEditorPage).Append("\n"); + sb.Append(" ForceReviewPage: ").Append(ForceReviewPage).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 SubEditorPageOptions); + } + + /// + /// Returns true if SubEditorPageOptions instances are equal + /// + /// Instance of SubEditorPageOptions to be compared + /// Boolean + public bool Equals(SubEditorPageOptions input) + { + if (input == null) + { + return false; + } + return + ( + this.ForceUploadPage == input.ForceUploadPage || + this.ForceUploadPage.Equals(input.ForceUploadPage) + ) && + ( + this.ForceEditorPage == input.ForceEditorPage || + this.ForceEditorPage.Equals(input.ForceEditorPage) + ) && + ( + this.ForceReviewPage == input.ForceReviewPage || + this.ForceReviewPage.Equals(input.ForceReviewPage) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + hashCode = (hashCode * 59) + this.ForceUploadPage.GetHashCode(); + hashCode = (hashCode * 59) + this.ForceEditorPage.GetHashCode(); + hashCode = (hashCode * 59) + this.ForceReviewPage.GetHashCode(); + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + yield break; + } + public List GetOpenApiTypes() + { + var types = new List(); + types.Add(new OpenApiType() + { + Name = "force_upload_page", + Property = "ForceUploadPage", + Type = "bool", + Value = ForceUploadPage, + }); + types.Add(new OpenApiType() + { + Name = "force_editor_page", + Property = "ForceEditorPage", + Type = "bool", + Value = ForceEditorPage, + }); + types.Add(new OpenApiType() + { + Name = "force_review_page", + Property = "ForceReviewPage", + Type = "bool", + Value = ForceReviewPage, + }); + + return types; + } + } + +} diff --git a/sdks/java-v1/README.md b/sdks/java-v1/README.md index 7ea39626e..224ff8b48 100644 --- a/sdks/java-v1/README.md +++ b/sdks/java-v1/README.md @@ -188,6 +188,7 @@ Class | Method | HTTP request | Description *EmbeddedApi* | [**embeddedEditUrl**](docs/EmbeddedApi.md#embeddedEditUrl) | **POST** /embedded/edit_url/{template_id} | Get Embedded Template Edit URL *EmbeddedApi* | [**embeddedSignUrl**](docs/EmbeddedApi.md#embeddedSignUrl) | **GET** /embedded/sign_url/{signature_id} | Get Embedded Sign URL *FaxApi* | [**faxDelete**](docs/FaxApi.md#faxDelete) | **DELETE** /fax/{fax_id} | Delete Fax +*FaxApi* | [**faxDraftCreate**](docs/FaxApi.md#faxDraftCreate) | **POST** /fax/draft/create | Create Embedded Fax Draft *FaxApi* | [**faxFiles**](docs/FaxApi.md#faxFiles) | **GET** /fax/files/{fax_id} | Download Fax Files *FaxApi* | [**faxGet**](docs/FaxApi.md#faxGet) | **GET** /fax/{fax_id} | Get Fax *FaxApi* | [**faxList**](docs/FaxApi.md#faxList) | **GET** /fax/list | Lists Faxes @@ -286,6 +287,9 @@ Class | Method | HTTP request | Description - [EventCallbackRequest](docs/EventCallbackRequest.md) - [EventCallbackRequestEvent](docs/EventCallbackRequestEvent.md) - [EventCallbackRequestEventMetadata](docs/EventCallbackRequestEventMetadata.md) + - [FaxDraftCreateRequest](docs/FaxDraftCreateRequest.md) + - [FaxDraftCreateResponse](docs/FaxDraftCreateResponse.md) + - [FaxDraftResponse](docs/FaxDraftResponse.md) - [FaxGetResponse](docs/FaxGetResponse.md) - [FaxLineAddUserRequest](docs/FaxLineAddUserRequest.md) - [FaxLineAreaCodeGetCountryEnum](docs/FaxLineAreaCodeGetCountryEnum.md) @@ -349,6 +353,7 @@ Class | Method | HTTP request | Description - [SubCC](docs/SubCC.md) - [SubCustomField](docs/SubCustomField.md) - [SubEditorOptions](docs/SubEditorOptions.md) + - [SubEditorPageOptions](docs/SubEditorPageOptions.md) - [SubFieldOptions](docs/SubFieldOptions.md) - [SubFormFieldGroup](docs/SubFormFieldGroup.md) - [SubFormFieldRule](docs/SubFormFieldRule.md) diff --git a/sdks/java-v1/docs/FaxApi.md b/sdks/java-v1/docs/FaxApi.md index 7ee47ff0e..69431ab4d 100644 --- a/sdks/java-v1/docs/FaxApi.md +++ b/sdks/java-v1/docs/FaxApi.md @@ -5,6 +5,7 @@ All URIs are relative to *https://api.hellosign.com/v3* | Method | HTTP request | Description | |------------- | ------------- | -------------| [**faxDelete**](FaxApi.md#faxDelete) | **DELETE** /fax/{fax_id} | Delete Fax +[**faxDraftCreate**](FaxApi.md#faxDraftCreate) | **POST** /fax/draft/create | Create Embedded Fax Draft [**faxFiles**](FaxApi.md#faxFiles) | **GET** /fax/files/{fax_id} | Download Fax Files [**faxGet**](FaxApi.md#faxGet) | **GET** /fax/{fax_id} | Get Fax [**faxList**](FaxApi.md#faxList) | **GET** /fax/list | Lists Faxes @@ -91,6 +92,95 @@ null (empty response body) | **4XX** | failed_operation | - | +## faxDraftCreate + +> FaxDraftCreateResponse faxDraftCreate(faxDraftCreateRequest) + +Create Embedded Fax Draft + +Creates an embedded Fax draft and returns a URL that can be opened in an approved iframe for preparation and sending. + +### Example + +```java +package com.dropbox.sign_sandbox; + +import com.dropbox.sign.ApiException; +import com.dropbox.sign.Configuration; +import com.dropbox.sign.api.FaxApi; +import com.dropbox.sign.auth.HttpBasicAuth; +import com.dropbox.sign.model.FaxDraftCreateRequest; +import com.dropbox.sign.model.SubEditorPageOptions; + +import java.util.List; + +public class FaxDraftCreateExample +{ + public static void main(String[] args) + { + var config = Configuration.getDefaultApiClient(); + ((HttpBasicAuth) config.getAuthentication("api_key")).setUsername("YOUR_API_KEY"); + + var editorOptions = new SubEditorPageOptions(); + editorOptions.forceUploadPage(false); + editorOptions.forceEditorPage(true); + editorOptions.forceReviewPage(true); + + var faxDraftCreateRequest = new FaxDraftCreateRequest(); + faxDraftCreateRequest.clientId("b6b8e7deaf8f0b95c029dca049356d4a2cf9710a"); + faxDraftCreateRequest.fileUrls(List.of( + "https://www.dropbox.com/s/ad9qnhbrjjn64tu/mutual-NDA-example.pdf?dl=1" + )); + faxDraftCreateRequest.recipients(List.of("+14155552671")); + faxDraftCreateRequest.editorOptions(editorOptions); + faxDraftCreateRequest.testMode(true); + + try + { + var response = new FaxApi(config).faxDraftCreate( + faxDraftCreateRequest + ); + + System.out.println(response); + } catch (ApiException e) { + System.err.println("Exception when calling FaxApi#faxDraftCreate"); + 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 | +|------------- | ------------- | ------------- | -------------| + **faxDraftCreateRequest** | [**FaxDraftCreateRequest**](FaxDraftCreateRequest.md)| | + +### Return type + +[**FaxDraftCreateResponse**](FaxDraftCreateResponse.md) + +### Authorization + +[api_key](../README.md#api_key) + +### 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 | - | + + ## faxFiles > File faxFiles(faxId) diff --git a/sdks/java-v1/docs/FaxDraftCreateRequest.md b/sdks/java-v1/docs/FaxDraftCreateRequest.md new file mode 100644 index 000000000..e03d715f3 --- /dev/null +++ b/sdks/java-v1/docs/FaxDraftCreateRequest.md @@ -0,0 +1,16 @@ + + +# FaxDraftCreateRequest + + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +| `clientId`*_required_ | ```String``` | Client ID of the API app that owns the embedded Fax draft. | | +| `files` | ```List``` | Use `files[]` to upload the file(s) for the embedded Fax draft.

This endpoint accepts either **files** or **file_urls[]**, but not both. Files can be added later in the embedded flow when neither is provided. | | +| `fileUrls` | ```List``` | Use `file_urls[]` to have Dropbox Fax download the file(s) for the embedded Fax draft.

This endpoint accepts either **files** or **file_urls[]**, but not both. Files can be added later in the embedded flow when neither is provided. | | +| `editorOptions` | [```SubEditorPageOptions```](SubEditorPageOptions.md) | | | +| `recipients` | ```Set``` | Fax numbers to prefill in the embedded flow. Each fax number must be in a supported international format. A maximum of 20 unique fax numbers can be provided. | | +| `testMode` | ```Boolean``` | When set to `true`, the completed draft will not send a Fax or consume Fax pages. Defaults to `false`. | | diff --git a/sdks/java-v1/docs/FaxDraftCreateResponse.md b/sdks/java-v1/docs/FaxDraftCreateResponse.md new file mode 100644 index 000000000..e17134a76 --- /dev/null +++ b/sdks/java-v1/docs/FaxDraftCreateResponse.md @@ -0,0 +1,12 @@ + + +# FaxDraftCreateResponse + + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +| `faxDraft`*_required_ | [```FaxDraftResponse```](FaxDraftResponse.md) | | | +| `warnings` | [```List```](WarningResponse.md) | A list of warnings. | | diff --git a/sdks/java-v1/docs/FaxDraftResponse.md b/sdks/java-v1/docs/FaxDraftResponse.md new file mode 100644 index 000000000..015faf54f --- /dev/null +++ b/sdks/java-v1/docs/FaxDraftResponse.md @@ -0,0 +1,13 @@ + + +# FaxDraftResponse + +Contains the embedded Fax draft ID, iframe URL, and expiration timestamp. + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +| `faxId`*_required_ | ```String``` | ID of the Fax draft. | | +| `url`*_required_ | ```String``` | URL to open in an approved iframe for preparing and sending the Fax. | | +| `expiresAt`*_required_ | ```Integer``` | Unix timestamp indicating when the embedded Fax draft URL expires. | | diff --git a/sdks/java-v1/docs/SubEditorPageOptions.md b/sdks/java-v1/docs/SubEditorPageOptions.md new file mode 100644 index 000000000..935d8b0db --- /dev/null +++ b/sdks/java-v1/docs/SubEditorPageOptions.md @@ -0,0 +1,13 @@ + + +# SubEditorPageOptions + +Controls which completed pages are shown again when the embedded Fax draft is opened. + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +| `forceUploadPage` | ```Boolean``` | When set to `true`, always shows the upload page, even when files are already attached. Defaults to `false`. | | +| `forceEditorPage` | ```Boolean``` | When set to `true`, always shows the editor page, even when the document is already prepared. Defaults to `false`. | | +| `forceReviewPage` | ```Boolean``` | When set to `true`, always shows the review page, even when recipients and Fax details are already provided. Defaults to `false`. | | diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/api/FaxApi.java b/sdks/java-v1/src/main/java/com/dropbox/sign/api/FaxApi.java index 259f1117d..8d0dc2fb9 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/api/FaxApi.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/api/FaxApi.java @@ -5,6 +5,8 @@ import com.dropbox.sign.ApiResponse; import com.dropbox.sign.Configuration; import com.dropbox.sign.Pair; +import com.dropbox.sign.model.FaxDraftCreateRequest; +import com.dropbox.sign.model.FaxDraftCreateResponse; import com.dropbox.sign.model.FaxGetResponse; import com.dropbox.sign.model.FaxListResponse; import com.dropbox.sign.model.FaxSendRequest; @@ -114,6 +116,80 @@ public ApiResponse faxDeleteWithHttpInfo(String faxId) throws ApiException false); } + /** + * Create Embedded Fax Draft Creates an embedded Fax draft and returns a URL that can be opened + * in an approved iframe for preparation and sending. + * + * @param faxDraftCreateRequest (required) + * @return FaxDraftCreateResponse + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + * + *
Response Details
Status Code Description Response Headers
200 successful operation * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
4XX failed_operation -
+ */ + public FaxDraftCreateResponse faxDraftCreate(FaxDraftCreateRequest faxDraftCreateRequest) + throws ApiException { + return faxDraftCreateWithHttpInfo(faxDraftCreateRequest).getData(); + } + + /** + * Create Embedded Fax Draft Creates an embedded Fax draft and returns a URL that can be opened + * in an approved iframe for preparation and sending. + * + * @param faxDraftCreateRequest (required) + * @return ApiResponse<FaxDraftCreateResponse> + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + * + *
Response Details
Status Code Description Response Headers
200 successful operation * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
4XX failed_operation -
+ */ + public ApiResponse faxDraftCreateWithHttpInfo( + FaxDraftCreateRequest faxDraftCreateRequest) throws ApiException { + + // Check required parameters + if (faxDraftCreateRequest == null) { + throw new ApiException( + 400, + "Missing the required parameter 'faxDraftCreateRequest' when calling" + + " faxDraftCreate"); + } + + String localVarAccept = apiClient.selectHeaderAccept("application/json"); + Map localVarFormParams = new LinkedHashMap<>(); + localVarFormParams = faxDraftCreateRequest.createFormData(); + boolean isFileTypeFound = !localVarFormParams.isEmpty(); + String localVarContentType = + isFileTypeFound + ? "multipart/form-data" + : apiClient.selectHeaderContentType( + "application/json", "multipart/form-data"); + String[] localVarAuthNames = new String[] {"api_key"}; + GenericType localVarReturnType = + new GenericType() {}; + return apiClient.invokeAPI( + "FaxApi.faxDraftCreate", + "/fax/draft/create", + "POST", + new ArrayList<>(), + isFileTypeFound ? null : faxDraftCreateRequest, + new LinkedHashMap<>(), + new LinkedHashMap<>(), + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType, + false); + } + /** * Download Fax Files Downloads files associated with a Fax * diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/model/FaxDraftCreateRequest.java b/sdks/java-v1/src/main/java/com/dropbox/sign/model/FaxDraftCreateRequest.java new file mode 100644 index 000000000..2cab759de --- /dev/null +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/model/FaxDraftCreateRequest.java @@ -0,0 +1,447 @@ +/* + * 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 com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.io.File; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.LinkedHashSet; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; + +/** FaxDraftCreateRequest */ +@JsonPropertyOrder({ + FaxDraftCreateRequest.JSON_PROPERTY_CLIENT_ID, + FaxDraftCreateRequest.JSON_PROPERTY_FILES, + FaxDraftCreateRequest.JSON_PROPERTY_FILE_URLS, + FaxDraftCreateRequest.JSON_PROPERTY_EDITOR_OPTIONS, + FaxDraftCreateRequest.JSON_PROPERTY_RECIPIENTS, + FaxDraftCreateRequest.JSON_PROPERTY_TEST_MODE +}) +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +@JsonIgnoreProperties(ignoreUnknown = true) +public class FaxDraftCreateRequest { + public static final String JSON_PROPERTY_CLIENT_ID = "client_id"; + @javax.annotation.Nonnull private String clientId; + + public static final String JSON_PROPERTY_FILES = "files"; + @javax.annotation.Nullable private List files = null; + + public static final String JSON_PROPERTY_FILE_URLS = "file_urls"; + @javax.annotation.Nullable private List fileUrls = null; + + public static final String JSON_PROPERTY_EDITOR_OPTIONS = "editor_options"; + @javax.annotation.Nullable private SubEditorPageOptions editorOptions; + + public static final String JSON_PROPERTY_RECIPIENTS = "recipients"; + @javax.annotation.Nullable private Set recipients = null; + + public static final String JSON_PROPERTY_TEST_MODE = "test_mode"; + @javax.annotation.Nullable private Boolean testMode = false; + + public FaxDraftCreateRequest() {} + + /** + * Attempt to instantiate and hydrate a new instance of this class + * + * @param jsonData String of JSON data representing target object + */ + public static FaxDraftCreateRequest init(String jsonData) throws Exception { + return new ObjectMapper().readValue(jsonData, FaxDraftCreateRequest.class); + } + + public static FaxDraftCreateRequest init(HashMap data) throws Exception { + return new ObjectMapper() + .readValue( + new ObjectMapper().writeValueAsString(data), FaxDraftCreateRequest.class); + } + + public FaxDraftCreateRequest clientId(@javax.annotation.Nonnull String clientId) { + this.clientId = clientId; + return this; + } + + /** + * Client ID of the API app that owns the embedded Fax draft. + * + * @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(@javax.annotation.Nonnull String clientId) { + this.clientId = clientId; + } + + public FaxDraftCreateRequest files(@javax.annotation.Nullable List files) { + this.files = files; + return this; + } + + public FaxDraftCreateRequest addFilesItem(File filesItem) { + if (this.files == null) { + this.files = new ArrayList<>(); + } + this.files.add(filesItem); + return this; + } + + /** + * Use `files[]` to upload the file(s) for the embedded Fax draft. This endpoint + * accepts either **files** or **file_urls[]**, but not both. Files can be added later in the + * embedded flow when neither is provided. + * + * @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(@javax.annotation.Nullable List files) { + this.files = files; + } + + public FaxDraftCreateRequest fileUrls(@javax.annotation.Nullable List fileUrls) { + this.fileUrls = fileUrls; + return this; + } + + public FaxDraftCreateRequest addFileUrlsItem(String fileUrlsItem) { + if (this.fileUrls == null) { + this.fileUrls = new ArrayList<>(); + } + this.fileUrls.add(fileUrlsItem); + return this; + } + + /** + * Use `file_urls[]` to have Dropbox Fax download the file(s) for the embedded Fax + * draft. This endpoint accepts either **files** or **file_urls[]**, but not both. Files can be + * added later in the embedded flow when neither is provided. + * + * @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(@javax.annotation.Nullable List fileUrls) { + this.fileUrls = fileUrls; + } + + public FaxDraftCreateRequest editorOptions( + @javax.annotation.Nullable SubEditorPageOptions editorOptions) { + this.editorOptions = editorOptions; + return this; + } + + /** + * Get editorOptions + * + * @return editorOptions + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_EDITOR_OPTIONS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public SubEditorPageOptions getEditorOptions() { + return editorOptions; + } + + @JsonProperty(JSON_PROPERTY_EDITOR_OPTIONS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEditorOptions(@javax.annotation.Nullable SubEditorPageOptions editorOptions) { + this.editorOptions = editorOptions; + } + + public FaxDraftCreateRequest recipients(@javax.annotation.Nullable Set recipients) { + this.recipients = recipients; + return this; + } + + public FaxDraftCreateRequest addRecipientsItem(String recipientsItem) { + if (this.recipients == null) { + this.recipients = new LinkedHashSet<>(); + } + this.recipients.add(recipientsItem); + return this; + } + + /** + * Fax numbers to prefill in the embedded flow. Each fax number must be in a supported + * international format. A maximum of 20 unique fax numbers can be provided. + * + * @return recipients + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_RECIPIENTS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Set getRecipients() { + return recipients; + } + + @JsonDeserialize(as = LinkedHashSet.class) + @JsonProperty(JSON_PROPERTY_RECIPIENTS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setRecipients(@javax.annotation.Nullable Set recipients) { + this.recipients = recipients; + } + + public FaxDraftCreateRequest testMode(@javax.annotation.Nullable Boolean testMode) { + this.testMode = testMode; + return this; + } + + /** + * When set to `true`, the completed draft will not send a Fax or consume Fax pages. + * 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(@javax.annotation.Nullable Boolean testMode) { + this.testMode = testMode; + } + + /** Return true if this FaxDraftCreateRequest object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + FaxDraftCreateRequest faxDraftCreateRequest = (FaxDraftCreateRequest) o; + return Objects.equals(this.clientId, faxDraftCreateRequest.clientId) + && Objects.equals(this.files, faxDraftCreateRequest.files) + && Objects.equals(this.fileUrls, faxDraftCreateRequest.fileUrls) + && Objects.equals(this.editorOptions, faxDraftCreateRequest.editorOptions) + && Objects.equals(this.recipients, faxDraftCreateRequest.recipients) + && Objects.equals(this.testMode, faxDraftCreateRequest.testMode); + } + + @Override + public int hashCode() { + return Objects.hash(clientId, files, fileUrls, editorOptions, recipients, testMode); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class FaxDraftCreateRequest {\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(" editorOptions: ").append(toIndentedString(editorOptions)).append("\n"); + sb.append(" recipients: ").append(toIndentedString(recipients)).append("\n"); + sb.append(" testMode: ").append(toIndentedString(testMode)).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 (editorOptions != null) { + if (isFileTypeOrListOfFiles(editorOptions)) { + fileTypeFound = true; + } + + if (editorOptions.getClass().equals(java.io.File.class) + || editorOptions.getClass().equals(Integer.class) + || editorOptions.getClass().equals(String.class) + || editorOptions.getClass().isEnum()) { + map.put("editor_options", editorOptions); + } else if (isListOfFile(editorOptions)) { + for (int i = 0; i < getListSize(editorOptions); i++) { + map.put("editor_options[" + i + "]", getFromList(editorOptions, i)); + } + } else { + map.put( + "editor_options", + JSON.getDefault().getMapper().writeValueAsString(editorOptions)); + } + } + if (recipients != null) { + if (isFileTypeOrListOfFiles(recipients)) { + fileTypeFound = true; + } + + if (recipients.getClass().equals(java.io.File.class) + || recipients.getClass().equals(Integer.class) + || recipients.getClass().equals(String.class) + || recipients.getClass().isEnum()) { + map.put("recipients", recipients); + } else if (isListOfFile(recipients)) { + for (int i = 0; i < getListSize(recipients); i++) { + map.put("recipients[" + i + "]", getFromList(recipients, i)); + } + } else { + map.put( + "recipients", + JSON.getDefault().getMapper().writeValueAsString(recipients)); + } + } + 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)); + } + } + } 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/FaxDraftCreateResponse.java b/sdks/java-v1/src/main/java/com/dropbox/sign/model/FaxDraftCreateResponse.java new file mode 100644 index 000000000..3cd5d6885 --- /dev/null +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/model/FaxDraftCreateResponse.java @@ -0,0 +1,228 @@ +/* + * Dropbox Sign API + * Dropbox Sign v3 API + * + * The version of the OpenAPI document: 3.0.0 + * Contact: apisupport@hellosign.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.dropbox.sign.model; + +import com.dropbox.sign.ApiException; +import com.dropbox.sign.JSON; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.databind.ObjectMapper; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; + +/** FaxDraftCreateResponse */ +@JsonPropertyOrder({ + FaxDraftCreateResponse.JSON_PROPERTY_FAX_DRAFT, + FaxDraftCreateResponse.JSON_PROPERTY_WARNINGS +}) +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +@JsonIgnoreProperties(ignoreUnknown = true) +public class FaxDraftCreateResponse { + public static final String JSON_PROPERTY_FAX_DRAFT = "fax_draft"; + @javax.annotation.Nonnull private FaxDraftResponse faxDraft; + + public static final String JSON_PROPERTY_WARNINGS = "warnings"; + @javax.annotation.Nullable private List warnings = null; + + public FaxDraftCreateResponse() {} + + /** + * Attempt to instantiate and hydrate a new instance of this class + * + * @param jsonData String of JSON data representing target object + */ + public static FaxDraftCreateResponse init(String jsonData) throws Exception { + return new ObjectMapper().readValue(jsonData, FaxDraftCreateResponse.class); + } + + public static FaxDraftCreateResponse init(HashMap data) throws Exception { + return new ObjectMapper() + .readValue( + new ObjectMapper().writeValueAsString(data), FaxDraftCreateResponse.class); + } + + public FaxDraftCreateResponse faxDraft(@javax.annotation.Nonnull FaxDraftResponse faxDraft) { + this.faxDraft = faxDraft; + return this; + } + + /** + * Get faxDraft + * + * @return faxDraft + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_FAX_DRAFT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public FaxDraftResponse getFaxDraft() { + return faxDraft; + } + + @JsonProperty(JSON_PROPERTY_FAX_DRAFT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setFaxDraft(@javax.annotation.Nonnull FaxDraftResponse faxDraft) { + this.faxDraft = faxDraft; + } + + public FaxDraftCreateResponse warnings( + @javax.annotation.Nullable List warnings) { + this.warnings = warnings; + return this; + } + + public FaxDraftCreateResponse addWarningsItem(WarningResponse warningsItem) { + if (this.warnings == null) { + this.warnings = new ArrayList<>(); + } + this.warnings.add(warningsItem); + return this; + } + + /** + * A list of warnings. + * + * @return warnings + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_WARNINGS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getWarnings() { + return warnings; + } + + @JsonProperty(JSON_PROPERTY_WARNINGS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setWarnings(@javax.annotation.Nullable List warnings) { + this.warnings = warnings; + } + + /** Return true if this FaxDraftCreateResponse object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + FaxDraftCreateResponse faxDraftCreateResponse = (FaxDraftCreateResponse) o; + return Objects.equals(this.faxDraft, faxDraftCreateResponse.faxDraft) + && Objects.equals(this.warnings, faxDraftCreateResponse.warnings); + } + + @Override + public int hashCode() { + return Objects.hash(faxDraft, warnings); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class FaxDraftCreateResponse {\n"); + sb.append(" faxDraft: ").append(toIndentedString(faxDraft)).append("\n"); + sb.append(" warnings: ").append(toIndentedString(warnings)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public Map createFormData() throws ApiException { + Map map = new HashMap<>(); + boolean fileTypeFound = false; + try { + if (faxDraft != null) { + if (isFileTypeOrListOfFiles(faxDraft)) { + fileTypeFound = true; + } + + if (faxDraft.getClass().equals(java.io.File.class) + || faxDraft.getClass().equals(Integer.class) + || faxDraft.getClass().equals(String.class) + || faxDraft.getClass().isEnum()) { + map.put("fax_draft", faxDraft); + } else if (isListOfFile(faxDraft)) { + for (int i = 0; i < getListSize(faxDraft); i++) { + map.put("fax_draft[" + i + "]", getFromList(faxDraft, i)); + } + } else { + map.put( + "fax_draft", + JSON.getDefault().getMapper().writeValueAsString(faxDraft)); + } + } + if (warnings != null) { + if (isFileTypeOrListOfFiles(warnings)) { + fileTypeFound = true; + } + + if (warnings.getClass().equals(java.io.File.class) + || warnings.getClass().equals(Integer.class) + || warnings.getClass().equals(String.class) + || warnings.getClass().isEnum()) { + map.put("warnings", warnings); + } else if (isListOfFile(warnings)) { + for (int i = 0; i < getListSize(warnings); i++) { + map.put("warnings[" + i + "]", getFromList(warnings, i)); + } + } else { + map.put("warnings", JSON.getDefault().getMapper().writeValueAsString(warnings)); + } + } + } catch (Exception e) { + throw new ApiException(e); + } + + return fileTypeFound ? map : new HashMap<>(); + } + + private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { + return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); + } + + private boolean isListOfFile(Object obj) throws Exception { + return obj instanceof java.util.List + && !isListEmpty(obj) + && getFromList(obj, 0) instanceof java.io.File; + } + + private boolean isListEmpty(Object obj) throws Exception { + return (boolean) + Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); + } + + private Object getFromList(Object obj, int index) throws Exception { + return Class.forName(java.util.List.class.getName()) + .getMethod("get", int.class) + .invoke(obj, index); + } + + private int getListSize(Object obj) throws Exception { + return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/model/FaxDraftResponse.java b/sdks/java-v1/src/main/java/com/dropbox/sign/model/FaxDraftResponse.java new file mode 100644 index 000000000..314bca218 --- /dev/null +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/model/FaxDraftResponse.java @@ -0,0 +1,264 @@ +/* + * Dropbox Sign API + * Dropbox Sign v3 API + * + * The version of the OpenAPI document: 3.0.0 + * Contact: apisupport@hellosign.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.dropbox.sign.model; + +import com.dropbox.sign.ApiException; +import com.dropbox.sign.JSON; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.databind.ObjectMapper; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Contains the embedded Fax draft ID, iframe URL, and expiration timestamp. */ +@JsonPropertyOrder({ + FaxDraftResponse.JSON_PROPERTY_FAX_ID, + FaxDraftResponse.JSON_PROPERTY_URL, + FaxDraftResponse.JSON_PROPERTY_EXPIRES_AT +}) +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +@JsonIgnoreProperties(ignoreUnknown = true) +public class FaxDraftResponse { + public static final String JSON_PROPERTY_FAX_ID = "fax_id"; + @javax.annotation.Nonnull private String faxId; + + public static final String JSON_PROPERTY_URL = "url"; + @javax.annotation.Nonnull private String url; + + public static final String JSON_PROPERTY_EXPIRES_AT = "expires_at"; + @javax.annotation.Nonnull private Integer expiresAt; + + public FaxDraftResponse() {} + + /** + * Attempt to instantiate and hydrate a new instance of this class + * + * @param jsonData String of JSON data representing target object + */ + public static FaxDraftResponse init(String jsonData) throws Exception { + return new ObjectMapper().readValue(jsonData, FaxDraftResponse.class); + } + + public static FaxDraftResponse init(HashMap data) throws Exception { + return new ObjectMapper() + .readValue(new ObjectMapper().writeValueAsString(data), FaxDraftResponse.class); + } + + public FaxDraftResponse faxId(@javax.annotation.Nonnull String faxId) { + this.faxId = faxId; + return this; + } + + /** + * ID of the Fax draft. + * + * @return faxId + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_FAX_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getFaxId() { + return faxId; + } + + @JsonProperty(JSON_PROPERTY_FAX_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setFaxId(@javax.annotation.Nonnull String faxId) { + this.faxId = faxId; + } + + public FaxDraftResponse url(@javax.annotation.Nonnull String url) { + this.url = url; + return this; + } + + /** + * URL to open in an approved iframe for preparing and sending the Fax. + * + * @return url + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_URL) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getUrl() { + return url; + } + + @JsonProperty(JSON_PROPERTY_URL) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setUrl(@javax.annotation.Nonnull String url) { + this.url = url; + } + + public FaxDraftResponse expiresAt(@javax.annotation.Nonnull Integer expiresAt) { + this.expiresAt = expiresAt; + return this; + } + + /** + * Unix timestamp indicating when the embedded Fax draft URL expires. + * + * @return expiresAt + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_EXPIRES_AT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Integer getExpiresAt() { + return expiresAt; + } + + @JsonProperty(JSON_PROPERTY_EXPIRES_AT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setExpiresAt(@javax.annotation.Nonnull Integer expiresAt) { + this.expiresAt = expiresAt; + } + + /** Return true if this FaxDraftResponse object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + FaxDraftResponse faxDraftResponse = (FaxDraftResponse) o; + return Objects.equals(this.faxId, faxDraftResponse.faxId) + && Objects.equals(this.url, faxDraftResponse.url) + && Objects.equals(this.expiresAt, faxDraftResponse.expiresAt); + } + + @Override + public int hashCode() { + return Objects.hash(faxId, url, expiresAt); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class FaxDraftResponse {\n"); + sb.append(" faxId: ").append(toIndentedString(faxId)).append("\n"); + sb.append(" url: ").append(toIndentedString(url)).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 (faxId != null) { + if (isFileTypeOrListOfFiles(faxId)) { + fileTypeFound = true; + } + + if (faxId.getClass().equals(java.io.File.class) + || faxId.getClass().equals(Integer.class) + || faxId.getClass().equals(String.class) + || faxId.getClass().isEnum()) { + map.put("fax_id", faxId); + } else if (isListOfFile(faxId)) { + for (int i = 0; i < getListSize(faxId); i++) { + map.put("fax_id[" + i + "]", getFromList(faxId, i)); + } + } else { + map.put("fax_id", JSON.getDefault().getMapper().writeValueAsString(faxId)); + } + } + if (url != null) { + if (isFileTypeOrListOfFiles(url)) { + fileTypeFound = true; + } + + if (url.getClass().equals(java.io.File.class) + || url.getClass().equals(Integer.class) + || url.getClass().equals(String.class) + || url.getClass().isEnum()) { + map.put("url", url); + } else if (isListOfFile(url)) { + for (int i = 0; i < getListSize(url); i++) { + map.put("url[" + i + "]", getFromList(url, i)); + } + } else { + map.put("url", JSON.getDefault().getMapper().writeValueAsString(url)); + } + } + 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/SubEditorPageOptions.java b/sdks/java-v1/src/main/java/com/dropbox/sign/model/SubEditorPageOptions.java new file mode 100644 index 000000000..d43170c4f --- /dev/null +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/model/SubEditorPageOptions.java @@ -0,0 +1,271 @@ +/* + * Dropbox Sign API + * Dropbox Sign v3 API + * + * The version of the OpenAPI document: 3.0.0 + * Contact: apisupport@hellosign.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.dropbox.sign.model; + +import com.dropbox.sign.ApiException; +import com.dropbox.sign.JSON; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.databind.ObjectMapper; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Controls which completed pages are shown again when the embedded Fax draft is opened. */ +@JsonPropertyOrder({ + SubEditorPageOptions.JSON_PROPERTY_FORCE_UPLOAD_PAGE, + SubEditorPageOptions.JSON_PROPERTY_FORCE_EDITOR_PAGE, + SubEditorPageOptions.JSON_PROPERTY_FORCE_REVIEW_PAGE +}) +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +@JsonIgnoreProperties(ignoreUnknown = true) +public class SubEditorPageOptions { + public static final String JSON_PROPERTY_FORCE_UPLOAD_PAGE = "force_upload_page"; + @javax.annotation.Nullable private Boolean forceUploadPage = false; + + public static final String JSON_PROPERTY_FORCE_EDITOR_PAGE = "force_editor_page"; + @javax.annotation.Nullable private Boolean forceEditorPage = false; + + public static final String JSON_PROPERTY_FORCE_REVIEW_PAGE = "force_review_page"; + @javax.annotation.Nullable private Boolean forceReviewPage = false; + + public SubEditorPageOptions() {} + + /** + * Attempt to instantiate and hydrate a new instance of this class + * + * @param jsonData String of JSON data representing target object + */ + public static SubEditorPageOptions init(String jsonData) throws Exception { + return new ObjectMapper().readValue(jsonData, SubEditorPageOptions.class); + } + + public static SubEditorPageOptions init(HashMap data) throws Exception { + return new ObjectMapper() + .readValue(new ObjectMapper().writeValueAsString(data), SubEditorPageOptions.class); + } + + public SubEditorPageOptions forceUploadPage( + @javax.annotation.Nullable Boolean forceUploadPage) { + this.forceUploadPage = forceUploadPage; + return this; + } + + /** + * When set to `true`, always shows the upload page, even when files are already + * attached. Defaults to `false`. + * + * @return forceUploadPage + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_FORCE_UPLOAD_PAGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getForceUploadPage() { + return forceUploadPage; + } + + @JsonProperty(JSON_PROPERTY_FORCE_UPLOAD_PAGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setForceUploadPage(@javax.annotation.Nullable Boolean forceUploadPage) { + this.forceUploadPage = forceUploadPage; + } + + public SubEditorPageOptions forceEditorPage( + @javax.annotation.Nullable Boolean forceEditorPage) { + this.forceEditorPage = forceEditorPage; + return this; + } + + /** + * When set to `true`, always shows the editor page, even when the document is already + * prepared. Defaults to `false`. + * + * @return forceEditorPage + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_FORCE_EDITOR_PAGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getForceEditorPage() { + return forceEditorPage; + } + + @JsonProperty(JSON_PROPERTY_FORCE_EDITOR_PAGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setForceEditorPage(@javax.annotation.Nullable Boolean forceEditorPage) { + this.forceEditorPage = forceEditorPage; + } + + public SubEditorPageOptions forceReviewPage( + @javax.annotation.Nullable Boolean forceReviewPage) { + this.forceReviewPage = forceReviewPage; + return this; + } + + /** + * When set to `true`, always shows the review page, even when recipients and Fax + * details are already provided. Defaults to `false`. + * + * @return forceReviewPage + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_FORCE_REVIEW_PAGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getForceReviewPage() { + return forceReviewPage; + } + + @JsonProperty(JSON_PROPERTY_FORCE_REVIEW_PAGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setForceReviewPage(@javax.annotation.Nullable Boolean forceReviewPage) { + this.forceReviewPage = forceReviewPage; + } + + /** Return true if this SubEditorPageOptions object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SubEditorPageOptions subEditorPageOptions = (SubEditorPageOptions) o; + return Objects.equals(this.forceUploadPage, subEditorPageOptions.forceUploadPage) + && Objects.equals(this.forceEditorPage, subEditorPageOptions.forceEditorPage) + && Objects.equals(this.forceReviewPage, subEditorPageOptions.forceReviewPage); + } + + @Override + public int hashCode() { + return Objects.hash(forceUploadPage, forceEditorPage, forceReviewPage); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SubEditorPageOptions {\n"); + sb.append(" forceUploadPage: ").append(toIndentedString(forceUploadPage)).append("\n"); + sb.append(" forceEditorPage: ").append(toIndentedString(forceEditorPage)).append("\n"); + sb.append(" forceReviewPage: ").append(toIndentedString(forceReviewPage)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public Map createFormData() throws ApiException { + Map map = new HashMap<>(); + boolean fileTypeFound = false; + try { + if (forceUploadPage != null) { + if (isFileTypeOrListOfFiles(forceUploadPage)) { + fileTypeFound = true; + } + + if (forceUploadPage.getClass().equals(java.io.File.class) + || forceUploadPage.getClass().equals(Integer.class) + || forceUploadPage.getClass().equals(String.class) + || forceUploadPage.getClass().isEnum()) { + map.put("force_upload_page", forceUploadPage); + } else if (isListOfFile(forceUploadPage)) { + for (int i = 0; i < getListSize(forceUploadPage); i++) { + map.put("force_upload_page[" + i + "]", getFromList(forceUploadPage, i)); + } + } else { + map.put( + "force_upload_page", + JSON.getDefault().getMapper().writeValueAsString(forceUploadPage)); + } + } + if (forceEditorPage != null) { + if (isFileTypeOrListOfFiles(forceEditorPage)) { + fileTypeFound = true; + } + + if (forceEditorPage.getClass().equals(java.io.File.class) + || forceEditorPage.getClass().equals(Integer.class) + || forceEditorPage.getClass().equals(String.class) + || forceEditorPage.getClass().isEnum()) { + map.put("force_editor_page", forceEditorPage); + } else if (isListOfFile(forceEditorPage)) { + for (int i = 0; i < getListSize(forceEditorPage); i++) { + map.put("force_editor_page[" + i + "]", getFromList(forceEditorPage, i)); + } + } else { + map.put( + "force_editor_page", + JSON.getDefault().getMapper().writeValueAsString(forceEditorPage)); + } + } + if (forceReviewPage != null) { + if (isFileTypeOrListOfFiles(forceReviewPage)) { + fileTypeFound = true; + } + + if (forceReviewPage.getClass().equals(java.io.File.class) + || forceReviewPage.getClass().equals(Integer.class) + || forceReviewPage.getClass().equals(String.class) + || forceReviewPage.getClass().isEnum()) { + map.put("force_review_page", forceReviewPage); + } else if (isListOfFile(forceReviewPage)) { + for (int i = 0; i < getListSize(forceReviewPage); i++) { + map.put("force_review_page[" + i + "]", getFromList(forceReviewPage, i)); + } + } else { + map.put( + "force_review_page", + JSON.getDefault().getMapper().writeValueAsString(forceReviewPage)); + } + } + } 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 91850482a..4f0f88675 100644 --- a/sdks/java-v2/README.md +++ b/sdks/java-v2/README.md @@ -164,6 +164,7 @@ Class | Method | HTTP request | Description *EmbeddedApi* | [**embeddedEditUrl**](docs/EmbeddedApi.md#embeddedEditUrl) | **POST** /embedded/edit_url/{template_id} | Get Embedded Template Edit URL *EmbeddedApi* | [**embeddedSignUrl**](docs/EmbeddedApi.md#embeddedSignUrl) | **GET** /embedded/sign_url/{signature_id} | Get Embedded Sign URL *FaxApi* | [**faxDelete**](docs/FaxApi.md#faxDelete) | **DELETE** /fax/{fax_id} | Delete Fax +*FaxApi* | [**faxDraftCreate**](docs/FaxApi.md#faxDraftCreate) | **POST** /fax/draft/create | Create Embedded Fax Draft *FaxApi* | [**faxFiles**](docs/FaxApi.md#faxFiles) | **GET** /fax/files/{fax_id} | Download Fax Files *FaxApi* | [**faxGet**](docs/FaxApi.md#faxGet) | **GET** /fax/{fax_id} | Get Fax *FaxApi* | [**faxList**](docs/FaxApi.md#faxList) | **GET** /fax/list | Lists Faxes @@ -262,6 +263,9 @@ Class | Method | HTTP request | Description - [EventCallbackRequest](docs/EventCallbackRequest.md) - [EventCallbackRequestEvent](docs/EventCallbackRequestEvent.md) - [EventCallbackRequestEventMetadata](docs/EventCallbackRequestEventMetadata.md) + - [FaxDraftCreateRequest](docs/FaxDraftCreateRequest.md) + - [FaxDraftCreateResponse](docs/FaxDraftCreateResponse.md) + - [FaxDraftResponse](docs/FaxDraftResponse.md) - [FaxGetResponse](docs/FaxGetResponse.md) - [FaxLineAddUserRequest](docs/FaxLineAddUserRequest.md) - [FaxLineAreaCodeGetCountryEnum](docs/FaxLineAreaCodeGetCountryEnum.md) @@ -325,6 +329,7 @@ Class | Method | HTTP request | Description - [SubCC](docs/SubCC.md) - [SubCustomField](docs/SubCustomField.md) - [SubEditorOptions](docs/SubEditorOptions.md) + - [SubEditorPageOptions](docs/SubEditorPageOptions.md) - [SubFieldOptions](docs/SubFieldOptions.md) - [SubFormFieldGroup](docs/SubFormFieldGroup.md) - [SubFormFieldRule](docs/SubFormFieldRule.md) diff --git a/sdks/java-v2/docs/FaxApi.md b/sdks/java-v2/docs/FaxApi.md index 7ee47ff0e..69431ab4d 100644 --- a/sdks/java-v2/docs/FaxApi.md +++ b/sdks/java-v2/docs/FaxApi.md @@ -5,6 +5,7 @@ All URIs are relative to *https://api.hellosign.com/v3* | Method | HTTP request | Description | |------------- | ------------- | -------------| [**faxDelete**](FaxApi.md#faxDelete) | **DELETE** /fax/{fax_id} | Delete Fax +[**faxDraftCreate**](FaxApi.md#faxDraftCreate) | **POST** /fax/draft/create | Create Embedded Fax Draft [**faxFiles**](FaxApi.md#faxFiles) | **GET** /fax/files/{fax_id} | Download Fax Files [**faxGet**](FaxApi.md#faxGet) | **GET** /fax/{fax_id} | Get Fax [**faxList**](FaxApi.md#faxList) | **GET** /fax/list | Lists Faxes @@ -91,6 +92,95 @@ null (empty response body) | **4XX** | failed_operation | - | +## faxDraftCreate + +> FaxDraftCreateResponse faxDraftCreate(faxDraftCreateRequest) + +Create Embedded Fax Draft + +Creates an embedded Fax draft and returns a URL that can be opened in an approved iframe for preparation and sending. + +### Example + +```java +package com.dropbox.sign_sandbox; + +import com.dropbox.sign.ApiException; +import com.dropbox.sign.Configuration; +import com.dropbox.sign.api.FaxApi; +import com.dropbox.sign.auth.HttpBasicAuth; +import com.dropbox.sign.model.FaxDraftCreateRequest; +import com.dropbox.sign.model.SubEditorPageOptions; + +import java.util.List; + +public class FaxDraftCreateExample +{ + public static void main(String[] args) + { + var config = Configuration.getDefaultApiClient(); + ((HttpBasicAuth) config.getAuthentication("api_key")).setUsername("YOUR_API_KEY"); + + var editorOptions = new SubEditorPageOptions(); + editorOptions.forceUploadPage(false); + editorOptions.forceEditorPage(true); + editorOptions.forceReviewPage(true); + + var faxDraftCreateRequest = new FaxDraftCreateRequest(); + faxDraftCreateRequest.clientId("b6b8e7deaf8f0b95c029dca049356d4a2cf9710a"); + faxDraftCreateRequest.fileUrls(List.of( + "https://www.dropbox.com/s/ad9qnhbrjjn64tu/mutual-NDA-example.pdf?dl=1" + )); + faxDraftCreateRequest.recipients(List.of("+14155552671")); + faxDraftCreateRequest.editorOptions(editorOptions); + faxDraftCreateRequest.testMode(true); + + try + { + var response = new FaxApi(config).faxDraftCreate( + faxDraftCreateRequest + ); + + System.out.println(response); + } catch (ApiException e) { + System.err.println("Exception when calling FaxApi#faxDraftCreate"); + 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 | +|------------- | ------------- | ------------- | -------------| + **faxDraftCreateRequest** | [**FaxDraftCreateRequest**](FaxDraftCreateRequest.md)| | + +### Return type + +[**FaxDraftCreateResponse**](FaxDraftCreateResponse.md) + +### Authorization + +[api_key](../README.md#api_key) + +### 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 | - | + + ## faxFiles > File faxFiles(faxId) diff --git a/sdks/java-v2/docs/FaxDraftCreateRequest.md b/sdks/java-v2/docs/FaxDraftCreateRequest.md new file mode 100644 index 000000000..e03d715f3 --- /dev/null +++ b/sdks/java-v2/docs/FaxDraftCreateRequest.md @@ -0,0 +1,16 @@ + + +# FaxDraftCreateRequest + + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +| `clientId`*_required_ | ```String``` | Client ID of the API app that owns the embedded Fax draft. | | +| `files` | ```List``` | Use `files[]` to upload the file(s) for the embedded Fax draft.

This endpoint accepts either **files** or **file_urls[]**, but not both. Files can be added later in the embedded flow when neither is provided. | | +| `fileUrls` | ```List``` | Use `file_urls[]` to have Dropbox Fax download the file(s) for the embedded Fax draft.

This endpoint accepts either **files** or **file_urls[]**, but not both. Files can be added later in the embedded flow when neither is provided. | | +| `editorOptions` | [```SubEditorPageOptions```](SubEditorPageOptions.md) | | | +| `recipients` | ```Set``` | Fax numbers to prefill in the embedded flow. Each fax number must be in a supported international format. A maximum of 20 unique fax numbers can be provided. | | +| `testMode` | ```Boolean``` | When set to `true`, the completed draft will not send a Fax or consume Fax pages. Defaults to `false`. | | diff --git a/sdks/java-v2/docs/FaxDraftCreateResponse.md b/sdks/java-v2/docs/FaxDraftCreateResponse.md new file mode 100644 index 000000000..e17134a76 --- /dev/null +++ b/sdks/java-v2/docs/FaxDraftCreateResponse.md @@ -0,0 +1,12 @@ + + +# FaxDraftCreateResponse + + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +| `faxDraft`*_required_ | [```FaxDraftResponse```](FaxDraftResponse.md) | | | +| `warnings` | [```List```](WarningResponse.md) | A list of warnings. | | diff --git a/sdks/java-v2/docs/FaxDraftResponse.md b/sdks/java-v2/docs/FaxDraftResponse.md new file mode 100644 index 000000000..015faf54f --- /dev/null +++ b/sdks/java-v2/docs/FaxDraftResponse.md @@ -0,0 +1,13 @@ + + +# FaxDraftResponse + +Contains the embedded Fax draft ID, iframe URL, and expiration timestamp. + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +| `faxId`*_required_ | ```String``` | ID of the Fax draft. | | +| `url`*_required_ | ```String``` | URL to open in an approved iframe for preparing and sending the Fax. | | +| `expiresAt`*_required_ | ```Integer``` | Unix timestamp indicating when the embedded Fax draft URL expires. | | diff --git a/sdks/java-v2/docs/SubEditorPageOptions.md b/sdks/java-v2/docs/SubEditorPageOptions.md new file mode 100644 index 000000000..935d8b0db --- /dev/null +++ b/sdks/java-v2/docs/SubEditorPageOptions.md @@ -0,0 +1,13 @@ + + +# SubEditorPageOptions + +Controls which completed pages are shown again when the embedded Fax draft is opened. + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +| `forceUploadPage` | ```Boolean``` | When set to `true`, always shows the upload page, even when files are already attached. Defaults to `false`. | | +| `forceEditorPage` | ```Boolean``` | When set to `true`, always shows the editor page, even when the document is already prepared. Defaults to `false`. | | +| `forceReviewPage` | ```Boolean``` | When set to `true`, always shows the review page, even when recipients and Fax details are already provided. Defaults to `false`. | | diff --git a/sdks/java-v2/src/main/java/com/dropbox/sign/api/FaxApi.java b/sdks/java-v2/src/main/java/com/dropbox/sign/api/FaxApi.java index e438d0d03..94cb2e63a 100644 --- a/sdks/java-v2/src/main/java/com/dropbox/sign/api/FaxApi.java +++ b/sdks/java-v2/src/main/java/com/dropbox/sign/api/FaxApi.java @@ -9,6 +9,8 @@ import jakarta.ws.rs.core.GenericType; import com.dropbox.sign.model.ErrorResponse; +import com.dropbox.sign.model.FaxDraftCreateRequest; +import com.dropbox.sign.model.FaxDraftCreateResponse; import com.dropbox.sign.model.FaxGetResponse; import com.dropbox.sign.model.FaxListResponse; import com.dropbox.sign.model.FaxSendRequest; @@ -115,6 +117,69 @@ public ApiResponse faxDeleteWithHttpInfo(String faxId) throws ApiException false ); } + /** + * Create Embedded Fax Draft + * Creates an embedded Fax draft and returns a URL that can be opened in an approved iframe for preparation and sending. + * @param faxDraftCreateRequest (required) + * @return FaxDraftCreateResponse + * @throws ApiException if fails to make API call + * @http.response.details + + + + + +
Response Details
Status Code Description Response Headers
200 successful operation * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
4XX failed_operation -
+ */ + public FaxDraftCreateResponse faxDraftCreate(FaxDraftCreateRequest faxDraftCreateRequest) throws ApiException { + return faxDraftCreateWithHttpInfo(faxDraftCreateRequest).getData(); + } + + + /** + * Create Embedded Fax Draft + * Creates an embedded Fax draft and returns a URL that can be opened in an approved iframe for preparation and sending. + * @param faxDraftCreateRequest (required) + * @return ApiResponse<FaxDraftCreateResponse> + * @throws ApiException if fails to make API call + * @http.response.details + + + + + +
Response Details
Status Code Description Response Headers
200 successful operation * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
4XX failed_operation -
+ */ + public ApiResponse faxDraftCreateWithHttpInfo(FaxDraftCreateRequest faxDraftCreateRequest) throws ApiException { + + // Check required parameters + if (faxDraftCreateRequest == null) { + throw new ApiException(400, "Missing the required parameter 'faxDraftCreateRequest' when calling faxDraftCreate"); + } + + String localVarAccept = apiClient.selectHeaderAccept("application/json"); + Map localVarFormParams = new LinkedHashMap<>(); + localVarFormParams = faxDraftCreateRequest.createFormData(); + boolean isFileTypeFound = !localVarFormParams.isEmpty(); + String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType("application/json", "multipart/form-data"); + String[] localVarAuthNames = new String[] {"api_key"}; + GenericType localVarReturnType = new GenericType() {}; + return apiClient.invokeAPI( + "FaxApi.faxDraftCreate", + "/fax/draft/create", + "POST", + new ArrayList<>(), + isFileTypeFound ? null : faxDraftCreateRequest, + new LinkedHashMap<>(), + new LinkedHashMap<>(), + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType, + false + ); + } /** * Download Fax Files * Downloads files associated with a Fax @@ -423,4 +488,4 @@ public ApiResponse faxSendWithHttpInfo(FaxSendRequest faxSendReq false ); } -} \ No newline at end of file +} diff --git a/sdks/java-v2/src/main/java/com/dropbox/sign/model/FaxDraftCreateRequest.java b/sdks/java-v2/src/main/java/com/dropbox/sign/model/FaxDraftCreateRequest.java new file mode 100644 index 000000000..280063e80 --- /dev/null +++ b/sdks/java-v2/src/main/java/com/dropbox/sign/model/FaxDraftCreateRequest.java @@ -0,0 +1,465 @@ +/* + * 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.SubEditorPageOptions; +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 com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.io.File; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.LinkedHashSet; +import java.util.List; +import java.util.Set; +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; +/** + * FaxDraftCreateRequest + */ +@JsonPropertyOrder({ + FaxDraftCreateRequest.JSON_PROPERTY_CLIENT_ID, + FaxDraftCreateRequest.JSON_PROPERTY_FILES, + FaxDraftCreateRequest.JSON_PROPERTY_FILE_URLS, + FaxDraftCreateRequest.JSON_PROPERTY_EDITOR_OPTIONS, + FaxDraftCreateRequest.JSON_PROPERTY_RECIPIENTS, + FaxDraftCreateRequest.JSON_PROPERTY_TEST_MODE +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.12.0") +@JsonIgnoreProperties(ignoreUnknown=true) +public class FaxDraftCreateRequest { + public static final String JSON_PROPERTY_CLIENT_ID = "client_id"; + @jakarta.annotation.Nonnull + private String clientId; + + public static final String JSON_PROPERTY_FILES = "files"; + @jakarta.annotation.Nullable + private List files = null; + + public static final String JSON_PROPERTY_FILE_URLS = "file_urls"; + @jakarta.annotation.Nullable + private List fileUrls = null; + + public static final String JSON_PROPERTY_EDITOR_OPTIONS = "editor_options"; + @jakarta.annotation.Nullable + private SubEditorPageOptions editorOptions; + + public static final String JSON_PROPERTY_RECIPIENTS = "recipients"; + @jakarta.annotation.Nullable + private Set recipients = null; + + public static final String JSON_PROPERTY_TEST_MODE = "test_mode"; + @jakarta.annotation.Nullable + private Boolean testMode = false; + + public FaxDraftCreateRequest() { + } + + /** + * Attempt to instantiate and hydrate a new instance of this class + * @param jsonData String of JSON data representing target object + */ + static public FaxDraftCreateRequest init(String jsonData) throws Exception { + return new ObjectMapper().readValue(jsonData, FaxDraftCreateRequest.class); + } + + static public FaxDraftCreateRequest init(HashMap data) throws Exception { + return new ObjectMapper().readValue( + new ObjectMapper().writeValueAsString(data), + FaxDraftCreateRequest.class + ); + } + + public FaxDraftCreateRequest clientId(@jakarta.annotation.Nonnull String clientId) { + this.clientId = clientId; + return this; + } + + /** + * Client ID of the API app that owns the embedded Fax draft. + * @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(@jakarta.annotation.Nonnull String clientId) { + this.clientId = clientId; + } + + + public FaxDraftCreateRequest files(@jakarta.annotation.Nullable List files) { + this.files = files; + return this; + } + + public FaxDraftCreateRequest addFilesItem(File filesItem) { + if (this.files == null) { + this.files = new ArrayList<>(); + } + this.files.add(filesItem); + return this; + } + + /** + * Use `files[]` to upload the file(s) for the embedded Fax draft. This endpoint accepts either **files** or **file_urls[]**, but not both. Files can be added later in the embedded flow when neither is provided. + * @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(@jakarta.annotation.Nullable List files) { + this.files = files; + } + + + public FaxDraftCreateRequest fileUrls(@jakarta.annotation.Nullable List fileUrls) { + this.fileUrls = fileUrls; + return this; + } + + public FaxDraftCreateRequest addFileUrlsItem(String fileUrlsItem) { + if (this.fileUrls == null) { + this.fileUrls = new ArrayList<>(); + } + this.fileUrls.add(fileUrlsItem); + return this; + } + + /** + * Use `file_urls[]` to have Dropbox Fax download the file(s) for the embedded Fax draft. This endpoint accepts either **files** or **file_urls[]**, but not both. Files can be added later in the embedded flow when neither is provided. + * @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(@jakarta.annotation.Nullable List fileUrls) { + this.fileUrls = fileUrls; + } + + + public FaxDraftCreateRequest editorOptions(@jakarta.annotation.Nullable SubEditorPageOptions editorOptions) { + this.editorOptions = editorOptions; + return this; + } + + /** + * Get editorOptions + * @return editorOptions + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_EDITOR_OPTIONS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public SubEditorPageOptions getEditorOptions() { + return editorOptions; + } + + + @JsonProperty(JSON_PROPERTY_EDITOR_OPTIONS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEditorOptions(@jakarta.annotation.Nullable SubEditorPageOptions editorOptions) { + this.editorOptions = editorOptions; + } + + + public FaxDraftCreateRequest recipients(@jakarta.annotation.Nullable Set recipients) { + this.recipients = recipients; + return this; + } + + public FaxDraftCreateRequest addRecipientsItem(String recipientsItem) { + if (this.recipients == null) { + this.recipients = new LinkedHashSet<>(); + } + this.recipients.add(recipientsItem); + return this; + } + + /** + * Fax numbers to prefill in the embedded flow. Each fax number must be in a supported international format. A maximum of 20 unique fax numbers can be provided. + * @return recipients + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_RECIPIENTS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Set getRecipients() { + return recipients; + } + + + @JsonDeserialize(as = LinkedHashSet.class) + @JsonProperty(JSON_PROPERTY_RECIPIENTS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setRecipients(@jakarta.annotation.Nullable Set recipients) { + this.recipients = recipients; + } + + + public FaxDraftCreateRequest testMode(@jakarta.annotation.Nullable Boolean testMode) { + this.testMode = testMode; + return this; + } + + /** + * When set to `true`, the completed draft will not send a Fax or consume Fax pages. 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(@jakarta.annotation.Nullable Boolean testMode) { + this.testMode = testMode; + } + + + /** + * Return true if this FaxDraftCreateRequest object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + FaxDraftCreateRequest faxDraftCreateRequest = (FaxDraftCreateRequest) o; + return Objects.equals(this.clientId, faxDraftCreateRequest.clientId) && + Objects.equals(this.files, faxDraftCreateRequest.files) && + Objects.equals(this.fileUrls, faxDraftCreateRequest.fileUrls) && + Objects.equals(this.editorOptions, faxDraftCreateRequest.editorOptions) && + Objects.equals(this.recipients, faxDraftCreateRequest.recipients) && + Objects.equals(this.testMode, faxDraftCreateRequest.testMode); + } + + @Override + public int hashCode() { + return Objects.hash(clientId, files, fileUrls, editorOptions, recipients, testMode); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class FaxDraftCreateRequest {\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(" editorOptions: ").append(toIndentedString(editorOptions)).append("\n"); + sb.append(" recipients: ").append(toIndentedString(recipients)).append("\n"); + sb.append(" testMode: ").append(toIndentedString(testMode)).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 (editorOptions != null) { + if (isFileTypeOrListOfFiles(editorOptions)) { + fileTypeFound = true; + } + + if (editorOptions.getClass().equals(java.io.File.class) || + editorOptions.getClass().equals(Integer.class) || + editorOptions.getClass().equals(String.class) || + editorOptions.getClass().isEnum()) { + map.put("editor_options", editorOptions); + } else if (isListOfFile(editorOptions)) { + for(int i = 0; i< getListSize(editorOptions); i++) { + map.put("editor_options[" + i + "]", getFromList(editorOptions, i)); + } + } + else { + map.put("editor_options", JSON.getDefault().getMapper().writeValueAsString(editorOptions)); + } + } + if (recipients != null) { + if (isFileTypeOrListOfFiles(recipients)) { + fileTypeFound = true; + } + + if (recipients.getClass().equals(java.io.File.class) || + recipients.getClass().equals(Integer.class) || + recipients.getClass().equals(String.class) || + recipients.getClass().isEnum()) { + map.put("recipients", recipients); + } else if (isListOfFile(recipients)) { + for(int i = 0; i< getListSize(recipients); i++) { + map.put("recipients[" + i + "]", getFromList(recipients, i)); + } + } + else { + map.put("recipients", JSON.getDefault().getMapper().writeValueAsString(recipients)); + } + } + 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)); + } + } + } 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/FaxDraftCreateResponse.java b/sdks/java-v2/src/main/java/com/dropbox/sign/model/FaxDraftCreateResponse.java new file mode 100644 index 000000000..b17a9f032 --- /dev/null +++ b/sdks/java-v2/src/main/java/com/dropbox/sign/model/FaxDraftCreateResponse.java @@ -0,0 +1,241 @@ +/* + * 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.FaxDraftResponse; +import com.dropbox.sign.model.WarningResponse; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.dropbox.sign.JSON; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.databind.ObjectMapper; + + +import com.dropbox.sign.ApiException; +/** + * FaxDraftCreateResponse + */ +@JsonPropertyOrder({ + FaxDraftCreateResponse.JSON_PROPERTY_FAX_DRAFT, + FaxDraftCreateResponse.JSON_PROPERTY_WARNINGS +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.12.0") +@JsonIgnoreProperties(ignoreUnknown=true) +public class FaxDraftCreateResponse { + public static final String JSON_PROPERTY_FAX_DRAFT = "fax_draft"; + @jakarta.annotation.Nonnull + private FaxDraftResponse faxDraft; + + public static final String JSON_PROPERTY_WARNINGS = "warnings"; + @jakarta.annotation.Nullable + private List warnings = null; + + public FaxDraftCreateResponse() { + } + + /** + * Attempt to instantiate and hydrate a new instance of this class + * @param jsonData String of JSON data representing target object + */ + static public FaxDraftCreateResponse init(String jsonData) throws Exception { + return new ObjectMapper().readValue(jsonData, FaxDraftCreateResponse.class); + } + + static public FaxDraftCreateResponse init(HashMap data) throws Exception { + return new ObjectMapper().readValue( + new ObjectMapper().writeValueAsString(data), + FaxDraftCreateResponse.class + ); + } + + public FaxDraftCreateResponse faxDraft(@jakarta.annotation.Nonnull FaxDraftResponse faxDraft) { + this.faxDraft = faxDraft; + return this; + } + + /** + * Get faxDraft + * @return faxDraft + */ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_FAX_DRAFT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public FaxDraftResponse getFaxDraft() { + return faxDraft; + } + + + @JsonProperty(JSON_PROPERTY_FAX_DRAFT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setFaxDraft(@jakarta.annotation.Nonnull FaxDraftResponse faxDraft) { + this.faxDraft = faxDraft; + } + + + public FaxDraftCreateResponse warnings(@jakarta.annotation.Nullable List warnings) { + this.warnings = warnings; + return this; + } + + public FaxDraftCreateResponse addWarningsItem(WarningResponse warningsItem) { + if (this.warnings == null) { + this.warnings = new ArrayList<>(); + } + this.warnings.add(warningsItem); + return this; + } + + /** + * A list of warnings. + * @return warnings + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_WARNINGS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getWarnings() { + return warnings; + } + + + @JsonProperty(JSON_PROPERTY_WARNINGS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setWarnings(@jakarta.annotation.Nullable List warnings) { + this.warnings = warnings; + } + + + /** + * Return true if this FaxDraftCreateResponse object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + FaxDraftCreateResponse faxDraftCreateResponse = (FaxDraftCreateResponse) o; + return Objects.equals(this.faxDraft, faxDraftCreateResponse.faxDraft) && + Objects.equals(this.warnings, faxDraftCreateResponse.warnings); + } + + @Override + public int hashCode() { + return Objects.hash(faxDraft, warnings); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class FaxDraftCreateResponse {\n"); + sb.append(" faxDraft: ").append(toIndentedString(faxDraft)).append("\n"); + sb.append(" warnings: ").append(toIndentedString(warnings)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public Map createFormData() throws ApiException { + Map map = new HashMap<>(); + boolean fileTypeFound = false; + try { + if (faxDraft != null) { + if (isFileTypeOrListOfFiles(faxDraft)) { + fileTypeFound = true; + } + + if (faxDraft.getClass().equals(java.io.File.class) || + faxDraft.getClass().equals(Integer.class) || + faxDraft.getClass().equals(String.class) || + faxDraft.getClass().isEnum()) { + map.put("fax_draft", faxDraft); + } else if (isListOfFile(faxDraft)) { + for(int i = 0; i< getListSize(faxDraft); i++) { + map.put("fax_draft[" + i + "]", getFromList(faxDraft, i)); + } + } + else { + map.put("fax_draft", JSON.getDefault().getMapper().writeValueAsString(faxDraft)); + } + } + if (warnings != null) { + if (isFileTypeOrListOfFiles(warnings)) { + fileTypeFound = true; + } + + if (warnings.getClass().equals(java.io.File.class) || + warnings.getClass().equals(Integer.class) || + warnings.getClass().equals(String.class) || + warnings.getClass().isEnum()) { + map.put("warnings", warnings); + } else if (isListOfFile(warnings)) { + for(int i = 0; i< getListSize(warnings); i++) { + map.put("warnings[" + i + "]", getFromList(warnings, i)); + } + } + else { + map.put("warnings", JSON.getDefault().getMapper().writeValueAsString(warnings)); + } + } + } catch (Exception e) { + throw new ApiException(e); + } + + return fileTypeFound ? map : new HashMap<>(); + } + + private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { + return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); + } + + private boolean isListOfFile(Object obj) throws Exception { + return obj instanceof java.util.List && !isListEmpty(obj) && getFromList(obj, 0) instanceof java.io.File; + } + + private boolean isListEmpty(Object obj) throws Exception { + return (boolean) Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); + } + + private Object getFromList(Object obj, int index) throws Exception { + return Class.forName(java.util.List.class.getName()).getMethod("get", int.class).invoke(obj, index); + } + + private int getListSize(Object obj) throws Exception { + return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} diff --git a/sdks/java-v2/src/main/java/com/dropbox/sign/model/FaxDraftResponse.java b/sdks/java-v2/src/main/java/com/dropbox/sign/model/FaxDraftResponse.java new file mode 100644 index 000000000..eec3fe7d1 --- /dev/null +++ b/sdks/java-v2/src/main/java/com/dropbox/sign/model/FaxDraftResponse.java @@ -0,0 +1,280 @@ +/* + * Dropbox Sign API + * Dropbox Sign v3 API + * + * The version of the OpenAPI document: 3.0.0 + * Contact: apisupport@hellosign.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.dropbox.sign.model; + +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.dropbox.sign.JSON; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.databind.ObjectMapper; + + +import com.dropbox.sign.ApiException; +/** + * Contains the embedded Fax draft ID, iframe URL, and expiration timestamp. + */ +@JsonPropertyOrder({ + FaxDraftResponse.JSON_PROPERTY_FAX_ID, + FaxDraftResponse.JSON_PROPERTY_URL, + FaxDraftResponse.JSON_PROPERTY_EXPIRES_AT +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.12.0") +@JsonIgnoreProperties(ignoreUnknown=true) +public class FaxDraftResponse { + public static final String JSON_PROPERTY_FAX_ID = "fax_id"; + @jakarta.annotation.Nonnull + private String faxId; + + public static final String JSON_PROPERTY_URL = "url"; + @jakarta.annotation.Nonnull + private String url; + + public static final String JSON_PROPERTY_EXPIRES_AT = "expires_at"; + @jakarta.annotation.Nonnull + private Integer expiresAt; + + public FaxDraftResponse() { + } + + /** + * Attempt to instantiate and hydrate a new instance of this class + * @param jsonData String of JSON data representing target object + */ + static public FaxDraftResponse init(String jsonData) throws Exception { + return new ObjectMapper().readValue(jsonData, FaxDraftResponse.class); + } + + static public FaxDraftResponse init(HashMap data) throws Exception { + return new ObjectMapper().readValue( + new ObjectMapper().writeValueAsString(data), + FaxDraftResponse.class + ); + } + + public FaxDraftResponse faxId(@jakarta.annotation.Nonnull String faxId) { + this.faxId = faxId; + return this; + } + + /** + * ID of the Fax draft. + * @return faxId + */ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_FAX_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getFaxId() { + return faxId; + } + + + @JsonProperty(JSON_PROPERTY_FAX_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setFaxId(@jakarta.annotation.Nonnull String faxId) { + this.faxId = faxId; + } + + + public FaxDraftResponse url(@jakarta.annotation.Nonnull String url) { + this.url = url; + return this; + } + + /** + * URL to open in an approved iframe for preparing and sending the Fax. + * @return url + */ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_URL) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getUrl() { + return url; + } + + + @JsonProperty(JSON_PROPERTY_URL) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setUrl(@jakarta.annotation.Nonnull String url) { + this.url = url; + } + + + public FaxDraftResponse expiresAt(@jakarta.annotation.Nonnull Integer expiresAt) { + this.expiresAt = expiresAt; + return this; + } + + /** + * Unix timestamp indicating when the embedded Fax draft URL expires. + * @return expiresAt + */ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_EXPIRES_AT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public Integer getExpiresAt() { + return expiresAt; + } + + + @JsonProperty(JSON_PROPERTY_EXPIRES_AT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setExpiresAt(@jakarta.annotation.Nonnull Integer expiresAt) { + this.expiresAt = expiresAt; + } + + + /** + * Return true if this FaxDraftResponse object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + FaxDraftResponse faxDraftResponse = (FaxDraftResponse) o; + return Objects.equals(this.faxId, faxDraftResponse.faxId) && + Objects.equals(this.url, faxDraftResponse.url) && + Objects.equals(this.expiresAt, faxDraftResponse.expiresAt); + } + + @Override + public int hashCode() { + return Objects.hash(faxId, url, expiresAt); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class FaxDraftResponse {\n"); + sb.append(" faxId: ").append(toIndentedString(faxId)).append("\n"); + sb.append(" url: ").append(toIndentedString(url)).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 (faxId != null) { + if (isFileTypeOrListOfFiles(faxId)) { + fileTypeFound = true; + } + + if (faxId.getClass().equals(java.io.File.class) || + faxId.getClass().equals(Integer.class) || + faxId.getClass().equals(String.class) || + faxId.getClass().isEnum()) { + map.put("fax_id", faxId); + } else if (isListOfFile(faxId)) { + for(int i = 0; i< getListSize(faxId); i++) { + map.put("fax_id[" + i + "]", getFromList(faxId, i)); + } + } + else { + map.put("fax_id", JSON.getDefault().getMapper().writeValueAsString(faxId)); + } + } + if (url != null) { + if (isFileTypeOrListOfFiles(url)) { + fileTypeFound = true; + } + + if (url.getClass().equals(java.io.File.class) || + url.getClass().equals(Integer.class) || + url.getClass().equals(String.class) || + url.getClass().isEnum()) { + map.put("url", url); + } else if (isListOfFile(url)) { + for(int i = 0; i< getListSize(url); i++) { + map.put("url[" + i + "]", getFromList(url, i)); + } + } + else { + map.put("url", JSON.getDefault().getMapper().writeValueAsString(url)); + } + } + 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/SubEditorPageOptions.java b/sdks/java-v2/src/main/java/com/dropbox/sign/model/SubEditorPageOptions.java new file mode 100644 index 000000000..cd03c20df --- /dev/null +++ b/sdks/java-v2/src/main/java/com/dropbox/sign/model/SubEditorPageOptions.java @@ -0,0 +1,280 @@ +/* + * Dropbox Sign API + * Dropbox Sign v3 API + * + * The version of the OpenAPI document: 3.0.0 + * Contact: apisupport@hellosign.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.dropbox.sign.model; + +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.dropbox.sign.JSON; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.databind.ObjectMapper; + + +import com.dropbox.sign.ApiException; +/** + * Controls which completed pages are shown again when the embedded Fax draft is opened. + */ +@JsonPropertyOrder({ + SubEditorPageOptions.JSON_PROPERTY_FORCE_UPLOAD_PAGE, + SubEditorPageOptions.JSON_PROPERTY_FORCE_EDITOR_PAGE, + SubEditorPageOptions.JSON_PROPERTY_FORCE_REVIEW_PAGE +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.12.0") +@JsonIgnoreProperties(ignoreUnknown=true) +public class SubEditorPageOptions { + public static final String JSON_PROPERTY_FORCE_UPLOAD_PAGE = "force_upload_page"; + @jakarta.annotation.Nullable + private Boolean forceUploadPage = false; + + public static final String JSON_PROPERTY_FORCE_EDITOR_PAGE = "force_editor_page"; + @jakarta.annotation.Nullable + private Boolean forceEditorPage = false; + + public static final String JSON_PROPERTY_FORCE_REVIEW_PAGE = "force_review_page"; + @jakarta.annotation.Nullable + private Boolean forceReviewPage = false; + + public SubEditorPageOptions() { + } + + /** + * Attempt to instantiate and hydrate a new instance of this class + * @param jsonData String of JSON data representing target object + */ + static public SubEditorPageOptions init(String jsonData) throws Exception { + return new ObjectMapper().readValue(jsonData, SubEditorPageOptions.class); + } + + static public SubEditorPageOptions init(HashMap data) throws Exception { + return new ObjectMapper().readValue( + new ObjectMapper().writeValueAsString(data), + SubEditorPageOptions.class + ); + } + + public SubEditorPageOptions forceUploadPage(@jakarta.annotation.Nullable Boolean forceUploadPage) { + this.forceUploadPage = forceUploadPage; + return this; + } + + /** + * When set to `true`, always shows the upload page, even when files are already attached. Defaults to `false`. + * @return forceUploadPage + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_FORCE_UPLOAD_PAGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Boolean getForceUploadPage() { + return forceUploadPage; + } + + + @JsonProperty(JSON_PROPERTY_FORCE_UPLOAD_PAGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setForceUploadPage(@jakarta.annotation.Nullable Boolean forceUploadPage) { + this.forceUploadPage = forceUploadPage; + } + + + public SubEditorPageOptions forceEditorPage(@jakarta.annotation.Nullable Boolean forceEditorPage) { + this.forceEditorPage = forceEditorPage; + return this; + } + + /** + * When set to `true`, always shows the editor page, even when the document is already prepared. Defaults to `false`. + * @return forceEditorPage + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_FORCE_EDITOR_PAGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Boolean getForceEditorPage() { + return forceEditorPage; + } + + + @JsonProperty(JSON_PROPERTY_FORCE_EDITOR_PAGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setForceEditorPage(@jakarta.annotation.Nullable Boolean forceEditorPage) { + this.forceEditorPage = forceEditorPage; + } + + + public SubEditorPageOptions forceReviewPage(@jakarta.annotation.Nullable Boolean forceReviewPage) { + this.forceReviewPage = forceReviewPage; + return this; + } + + /** + * When set to `true`, always shows the review page, even when recipients and Fax details are already provided. Defaults to `false`. + * @return forceReviewPage + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_FORCE_REVIEW_PAGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Boolean getForceReviewPage() { + return forceReviewPage; + } + + + @JsonProperty(JSON_PROPERTY_FORCE_REVIEW_PAGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setForceReviewPage(@jakarta.annotation.Nullable Boolean forceReviewPage) { + this.forceReviewPage = forceReviewPage; + } + + + /** + * Return true if this SubEditorPageOptions object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SubEditorPageOptions subEditorPageOptions = (SubEditorPageOptions) o; + return Objects.equals(this.forceUploadPage, subEditorPageOptions.forceUploadPage) && + Objects.equals(this.forceEditorPage, subEditorPageOptions.forceEditorPage) && + Objects.equals(this.forceReviewPage, subEditorPageOptions.forceReviewPage); + } + + @Override + public int hashCode() { + return Objects.hash(forceUploadPage, forceEditorPage, forceReviewPage); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SubEditorPageOptions {\n"); + sb.append(" forceUploadPage: ").append(toIndentedString(forceUploadPage)).append("\n"); + sb.append(" forceEditorPage: ").append(toIndentedString(forceEditorPage)).append("\n"); + sb.append(" forceReviewPage: ").append(toIndentedString(forceReviewPage)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public Map createFormData() throws ApiException { + Map map = new HashMap<>(); + boolean fileTypeFound = false; + try { + if (forceUploadPage != null) { + if (isFileTypeOrListOfFiles(forceUploadPage)) { + fileTypeFound = true; + } + + if (forceUploadPage.getClass().equals(java.io.File.class) || + forceUploadPage.getClass().equals(Integer.class) || + forceUploadPage.getClass().equals(String.class) || + forceUploadPage.getClass().isEnum()) { + map.put("force_upload_page", forceUploadPage); + } else if (isListOfFile(forceUploadPage)) { + for(int i = 0; i< getListSize(forceUploadPage); i++) { + map.put("force_upload_page[" + i + "]", getFromList(forceUploadPage, i)); + } + } + else { + map.put("force_upload_page", JSON.getDefault().getMapper().writeValueAsString(forceUploadPage)); + } + } + if (forceEditorPage != null) { + if (isFileTypeOrListOfFiles(forceEditorPage)) { + fileTypeFound = true; + } + + if (forceEditorPage.getClass().equals(java.io.File.class) || + forceEditorPage.getClass().equals(Integer.class) || + forceEditorPage.getClass().equals(String.class) || + forceEditorPage.getClass().isEnum()) { + map.put("force_editor_page", forceEditorPage); + } else if (isListOfFile(forceEditorPage)) { + for(int i = 0; i< getListSize(forceEditorPage); i++) { + map.put("force_editor_page[" + i + "]", getFromList(forceEditorPage, i)); + } + } + else { + map.put("force_editor_page", JSON.getDefault().getMapper().writeValueAsString(forceEditorPage)); + } + } + if (forceReviewPage != null) { + if (isFileTypeOrListOfFiles(forceReviewPage)) { + fileTypeFound = true; + } + + if (forceReviewPage.getClass().equals(java.io.File.class) || + forceReviewPage.getClass().equals(Integer.class) || + forceReviewPage.getClass().equals(String.class) || + forceReviewPage.getClass().isEnum()) { + map.put("force_review_page", forceReviewPage); + } else if (isListOfFile(forceReviewPage)) { + for(int i = 0; i< getListSize(forceReviewPage); i++) { + map.put("force_review_page[" + i + "]", getFromList(forceReviewPage, i)); + } + } + else { + map.put("force_review_page", JSON.getDefault().getMapper().writeValueAsString(forceReviewPage)); + } + } + } 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 bb45ec624..75bd6eacf 100644 --- a/sdks/node/README.md +++ b/sdks/node/README.md @@ -93,6 +93,7 @@ All URIs are relative to *https://api.hellosign.com/v3* | *EmbeddedApi* | [**embeddedEditUrl**](./docs/api/EmbeddedApi.md#embeddedediturl) | **POST** /embedded/edit_url/{template_id} | Get Embedded Template Edit URL | | *EmbeddedApi* | [**embeddedSignUrl**](./docs/api/EmbeddedApi.md#embeddedsignurl) | **GET** /embedded/sign_url/{signature_id} | Get Embedded Sign URL | | *FaxApi* | [**faxDelete**](./docs/api/FaxApi.md#faxdelete) | **DELETE** /fax/{fax_id} | Delete Fax | +| *FaxApi* | [**faxDraftCreate**](./docs/api/FaxApi.md#faxdraftcreate) | **POST** /fax/draft/create | Create Embedded Fax Draft | | *FaxApi* | [**faxFiles**](./docs/api/FaxApi.md#faxfiles) | **GET** /fax/files/{fax_id} | Download Fax Files | | *FaxApi* | [**faxGet**](./docs/api/FaxApi.md#faxget) | **GET** /fax/{fax_id} | Get Fax | | *FaxApi* | [**faxList**](./docs/api/FaxApi.md#faxlist) | **GET** /fax/list | Lists Faxes | @@ -190,6 +191,9 @@ All URIs are relative to *https://api.hellosign.com/v3* - [EventCallbackRequest](./docs/model/EventCallbackRequest.md) - [EventCallbackRequestEvent](./docs/model/EventCallbackRequestEvent.md) - [EventCallbackRequestEventMetadata](./docs/model/EventCallbackRequestEventMetadata.md) +- [FaxDraftCreateRequest](./docs/model/FaxDraftCreateRequest.md) +- [FaxDraftCreateResponse](./docs/model/FaxDraftCreateResponse.md) +- [FaxDraftResponse](./docs/model/FaxDraftResponse.md) - [FaxGetResponse](./docs/model/FaxGetResponse.md) - [FaxLineAddUserRequest](./docs/model/FaxLineAddUserRequest.md) - [FaxLineAreaCodeGetCountryEnum](./docs/model/FaxLineAreaCodeGetCountryEnum.md) @@ -253,6 +257,7 @@ All URIs are relative to *https://api.hellosign.com/v3* - [SubCC](./docs/model/SubCC.md) - [SubCustomField](./docs/model/SubCustomField.md) - [SubEditorOptions](./docs/model/SubEditorOptions.md) +- [SubEditorPageOptions](./docs/model/SubEditorPageOptions.md) - [SubFieldOptions](./docs/model/SubFieldOptions.md) - [SubFormFieldGroup](./docs/model/SubFormFieldGroup.md) - [SubFormFieldRule](./docs/model/SubFormFieldRule.md) diff --git a/sdks/node/api/faxApi.ts b/sdks/node/api/faxApi.ts index 26e224280..cbcefc0d2 100644 --- a/sdks/node/api/faxApi.ts +++ b/sdks/node/api/faxApi.ts @@ -26,6 +26,8 @@ import axios, { AxiosError, AxiosRequestConfig, AxiosResponse } from "axios"; import { Authentication, + FaxDraftCreateRequest, + FaxDraftCreateResponse, FaxGetResponse, FaxListResponse, FaxSendRequest, @@ -219,6 +221,146 @@ export class FaxApi { }); }); } + /** + * Creates an embedded Fax draft and returns a URL that can be opened in an approved iframe for preparation and sending. + * @summary Create Embedded Fax Draft + * @param faxDraftCreateRequest + * @param options + */ + public async faxDraftCreate( + faxDraftCreateRequest: FaxDraftCreateRequest, + options: optionsI = { headers: {} } + ): Promise> { + faxDraftCreateRequest = deserializeIfNeeded( + faxDraftCreateRequest, + "FaxDraftCreateRequest" + ); + const localVarPath = this.basePath + "/fax/draft/create"; + 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 'faxDraftCreateRequest' is not null or undefined + if (faxDraftCreateRequest === null || faxDraftCreateRequest === undefined) { + throw new Error( + "Required parameter faxDraftCreateRequest was null or undefined when calling faxDraftCreate." + ); + } + + (Object).assign(localVarHeaderParams, options.headers); + + let localVarUseFormData = false; + + const result = generateFormData( + faxDraftCreateRequest, + FaxDraftCreateRequest.attributeTypeMap + ); + localVarUseFormData = result.localVarUseFormData; + + let data = {}; + if (localVarUseFormData) { + const formData = toFormData(result.data); + data = formData; + localVarHeaderParams = { + ...localVarHeaderParams, + ...formData.getHeaders(), + }; + } else { + data = ObjectSerializer.serialize( + faxDraftCreateRequest, + "FaxDraftCreateRequest" + ); + } + + let localVarRequestOptions: AxiosRequestConfig = { + method: "POST", + params: localVarQueryParameters, + headers: localVarHeaderParams, + url: localVarPath, + paramsSerializer: this._useQuerystring + ? queryParamsSerializer + : undefined, + maxContentLength: Infinity, + maxBodyLength: Infinity, + responseType: "json", + data, + }; + + let authenticationPromise = Promise.resolve(); + if (this.authentications.api_key.username) { + authenticationPromise = authenticationPromise.then(() => + this.authentications.api_key.applyToRequest(localVarRequestOptions) + ); + } + 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, + "FaxDraftCreateResponse" + ); + }, + (error: AxiosError) => { + if (error.response == null) { + reject(error); + return; + } + + if ( + handleErrorCodeResponse( + reject, + error.response, + 200, + "FaxDraftCreateResponse" + ) + ) { + return; + } + + if ( + handleErrorRangeResponse( + reject, + error.response, + "4XX", + "ErrorResponse" + ) + ) { + return; + } + + reject(error); + } + ); + } + ); + }); + } /** * Downloads files associated with a Fax * @summary Download Fax Files diff --git a/sdks/node/dist/api.js b/sdks/node/dist/api.js index a1419df7a..abc7781fd 100644 --- a/sdks/node/dist/api.js +++ b/sdks/node/dist/api.js @@ -13186,6 +13186,9 @@ __export(api_exports, { EventCallbackRequestEvent: () => EventCallbackRequestEvent, EventCallbackRequestEventMetadata: () => EventCallbackRequestEventMetadata, FaxApi: () => FaxApi, + FaxDraftCreateRequest: () => FaxDraftCreateRequest, + FaxDraftCreateResponse: () => FaxDraftCreateResponse, + FaxDraftResponse: () => FaxDraftResponse, FaxGetResponse: () => FaxGetResponse, FaxLineAddUserRequest: () => FaxLineAddUserRequest, FaxLineApi: () => FaxLineApi, @@ -13258,6 +13261,7 @@ __export(api_exports, { SubCC: () => SubCC, SubCustomField: () => SubCustomField, SubEditorOptions: () => SubEditorOptions, + SubEditorPageOptions: () => SubEditorPageOptions, SubFieldOptions: () => SubFieldOptions, SubFormFieldGroup: () => SubFormFieldGroup, SubFormFieldRule: () => SubFormFieldRule, @@ -18207,6 +18211,121 @@ var EventCallbackRequestEventMetadata = class _EventCallbackRequestEventMetadata } }; +// model/faxDraftCreateRequest.ts +var FaxDraftCreateRequest = class _FaxDraftCreateRequest { + constructor() { + /** + * When set to `true`, the completed draft will not send a Fax or consume Fax pages. Defaults to `false`. + */ + this["testMode"] = false; + } + static { + this.discriminator = void 0; + } + static { + this.attributeTypeMap = [ + { + name: "clientId", + baseName: "client_id", + type: "string" + }, + { + name: "files", + baseName: "files", + type: "Array" + }, + { + name: "fileUrls", + baseName: "file_urls", + type: "Array" + }, + { + name: "editorOptions", + baseName: "editor_options", + type: "SubEditorPageOptions" + }, + { + name: "recipients", + baseName: "recipients", + type: "Set" + }, + { + name: "testMode", + baseName: "test_mode", + type: "boolean" + } + ]; + } + static getAttributeTypeMap() { + return _FaxDraftCreateRequest.attributeTypeMap; + } + /** Attempt to instantiate and hydrate a new instance of this class */ + static init(data) { + return ObjectSerializer.deserialize(data, "FaxDraftCreateRequest"); + } +}; + +// model/faxDraftCreateResponse.ts +var FaxDraftCreateResponse = class _FaxDraftCreateResponse { + static { + this.discriminator = void 0; + } + static { + this.attributeTypeMap = [ + { + name: "faxDraft", + baseName: "fax_draft", + type: "FaxDraftResponse" + }, + { + name: "warnings", + baseName: "warnings", + type: "Array" + } + ]; + } + static getAttributeTypeMap() { + return _FaxDraftCreateResponse.attributeTypeMap; + } + /** Attempt to instantiate and hydrate a new instance of this class */ + static init(data) { + return ObjectSerializer.deserialize(data, "FaxDraftCreateResponse"); + } +}; + +// model/faxDraftResponse.ts +var FaxDraftResponse = class _FaxDraftResponse { + static { + this.discriminator = void 0; + } + static { + this.attributeTypeMap = [ + { + name: "faxId", + baseName: "fax_id", + type: "string" + }, + { + name: "url", + baseName: "url", + type: "string" + }, + { + name: "expiresAt", + baseName: "expires_at", + type: "number" + } + ]; + } + static getAttributeTypeMap() { + return _FaxDraftResponse.attributeTypeMap; + } + /** Attempt to instantiate and hydrate a new instance of this class */ + static init(data) { + return ObjectSerializer.deserialize(data, "FaxDraftResponse"); + } +}; + // model/faxGetResponse.ts var FaxGetResponse = class _FaxGetResponse { static { @@ -21954,6 +22073,53 @@ var SubEditorOptions = class _SubEditorOptions { } }; +// model/subEditorPageOptions.ts +var SubEditorPageOptions = class _SubEditorPageOptions { + constructor() { + /** + * When set to `true`, always shows the upload page, even when files are already attached. Defaults to `false`. + */ + this["forceUploadPage"] = false; + /** + * When set to `true`, always shows the editor page, even when the document is already prepared. Defaults to `false`. + */ + this["forceEditorPage"] = false; + /** + * When set to `true`, always shows the review page, even when recipients and Fax details are already provided. Defaults to `false`. + */ + this["forceReviewPage"] = false; + } + static { + this.discriminator = void 0; + } + static { + this.attributeTypeMap = [ + { + name: "forceUploadPage", + baseName: "force_upload_page", + type: "boolean" + }, + { + name: "forceEditorPage", + baseName: "force_editor_page", + type: "boolean" + }, + { + name: "forceReviewPage", + baseName: "force_review_page", + type: "boolean" + } + ]; + } + static getAttributeTypeMap() { + return _SubEditorPageOptions.attributeTypeMap; + } + /** Attempt to instantiate and hydrate a new instance of this class */ + static init(data) { + return ObjectSerializer.deserialize(data, "SubEditorPageOptions"); + } +}; + // model/subFieldOptions.ts var SubFieldOptions = class _SubFieldOptions { static { @@ -26931,6 +27097,9 @@ var typeMap = { EventCallbackRequest, EventCallbackRequestEvent, EventCallbackRequestEventMetadata, + FaxDraftCreateRequest, + FaxDraftCreateResponse, + FaxDraftResponse, FaxGetResponse, FaxLineAddUserRequest, FaxLineAreaCodeGetResponse, @@ -26989,6 +27158,7 @@ var typeMap = { SubCC, SubCustomField, SubEditorOptions, + SubEditorPageOptions, SubFieldOptions, SubFormFieldGroup, SubFormFieldRule, @@ -29015,6 +29185,123 @@ var FaxApi = class { }); }); } + /** + * Creates an embedded Fax draft and returns a URL that can be opened in an approved iframe for preparation and sending. + * @summary Create Embedded Fax Draft + * @param faxDraftCreateRequest + * @param options + */ + async faxDraftCreate(faxDraftCreateRequest, options = { headers: {} }) { + faxDraftCreateRequest = deserializeIfNeeded4( + faxDraftCreateRequest, + "FaxDraftCreateRequest" + ); + const localVarPath = this.basePath + "/fax/draft/create"; + 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 (faxDraftCreateRequest === null || faxDraftCreateRequest === void 0) { + throw new Error( + "Required parameter faxDraftCreateRequest was null or undefined when calling faxDraftCreate." + ); + } + Object.assign(localVarHeaderParams, options.headers); + let localVarUseFormData = false; + const result = generateFormData( + faxDraftCreateRequest, + FaxDraftCreateRequest.attributeTypeMap + ); + localVarUseFormData = result.localVarUseFormData; + let data = {}; + if (localVarUseFormData) { + const formData2 = toFormData3(result.data); + data = formData2; + localVarHeaderParams = { + ...localVarHeaderParams, + ...formData2.getHeaders() + }; + } else { + data = ObjectSerializer.serialize( + faxDraftCreateRequest, + "FaxDraftCreateRequest" + ); + } + 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) => { + handleSuccessfulResponse5( + resolve, + reject, + response, + "FaxDraftCreateResponse" + ); + }, + (error) => { + if (error.response == null) { + reject(error); + return; + } + if (handleErrorCodeResponse5( + reject, + error.response, + 200, + "FaxDraftCreateResponse" + )) { + return; + } + if (handleErrorRangeResponse5( + reject, + error.response, + "4XX", + "ErrorResponse" + )) { + return; + } + reject(error); + } + ); + } + ); + }); + } /** * Downloads files associated with a Fax * @summary Download Fax Files @@ -36450,6 +36737,9 @@ var APIS = [ EventCallbackRequestEvent, EventCallbackRequestEventMetadata, FaxApi, + FaxDraftCreateRequest, + FaxDraftCreateResponse, + FaxDraftResponse, FaxGetResponse, FaxLineAddUserRequest, FaxLineApi, @@ -36522,6 +36812,7 @@ var APIS = [ SubCC, SubCustomField, SubEditorOptions, + SubEditorPageOptions, SubFieldOptions, SubFormFieldGroup, SubFormFieldRule, diff --git a/sdks/node/docs/api/FaxApi.md b/sdks/node/docs/api/FaxApi.md index efc84eea6..e49af9b5c 100644 --- a/sdks/node/docs/api/FaxApi.md +++ b/sdks/node/docs/api/FaxApi.md @@ -5,6 +5,7 @@ All URIs are relative to https://api.hellosign.com/v3. | Method | HTTP request | Description | | ------------- | ------------- | ------------- | | [**faxDelete()**](FaxApi.md#faxDelete) | **DELETE** /fax/{fax_id} | Delete Fax | +| [**faxDraftCreate()**](FaxApi.md#faxDraftCreate) | **POST** /fax/draft/create | Create Embedded Fax Draft | | [**faxFiles()**](FaxApi.md#faxFiles) | **GET** /fax/files/{fax_id} | Download Fax Files | | [**faxGet()**](FaxApi.md#faxGet) | **GET** /fax/{fax_id} | Get Fax | | [**faxList()**](FaxApi.md#faxList) | **GET** /fax/list | Lists Faxes | @@ -63,6 +64,73 @@ void (empty response body) [[Back to Model list]](../../README.md#models) [[Back to README]](../../README.md) +## `faxDraftCreate()` + +```typescript +faxDraftCreate(faxDraftCreateRequest: FaxDraftCreateRequest): FaxDraftCreateResponse +``` + +Create Embedded Fax Draft + +Creates an embedded Fax draft and returns a URL that can be opened in an approved iframe for preparation and sending. + +### TypeScript Example + +```typescript +import api from "@dropbox/sign" +import models from "@dropbox/sign" + +const apiCaller = new api.FaxApi(); +apiCaller.username = "YOUR_API_KEY"; + +const faxDraftCreateRequest: models.FaxDraftCreateRequest = { + clientId: "b6b8e7deaf8f0b95c029dca049356d4a2cf9710a", + fileUrls: [ + "https://www.dropbox.com/s/ad9qnhbrjjn64tu/mutual-NDA-example.pdf?dl=1", + ], + recipients: ["+14155552671"], + editorOptions: { + forceUploadPage: false, + forceEditorPage: true, + forceReviewPage: true, + }, + testMode: true, +}; + +apiCaller.faxDraftCreate( + faxDraftCreateRequest, +).then(response => { + console.log(response.body); +}).catch(error => { + console.log("Exception when calling FaxApi#faxDraftCreate:"); + console.log(error.body); +}); + +``` + +### Parameters + +|Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **faxDraftCreateRequest** | [**FaxDraftCreateRequest**](../model/FaxDraftCreateRequest.md)| | | + +### Return type + +[**FaxDraftCreateResponse**](../model/FaxDraftCreateResponse.md) + +### Authorization + +[api_key](../../README.md#api_key) + +### 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) + ## `faxFiles()` ```typescript diff --git a/sdks/node/docs/model/FaxDraftCreateRequest.md b/sdks/node/docs/model/FaxDraftCreateRequest.md new file mode 100644 index 000000000..bbfc7c24b --- /dev/null +++ b/sdks/node/docs/model/FaxDraftCreateRequest.md @@ -0,0 +1,16 @@ +# # FaxDraftCreateRequest + + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +| `clientId`*_required_ | ```string``` | Client ID of the API app that owns the embedded Fax draft. | | +| `files` | ```Array``` | Use `files[]` to upload the file(s) for the embedded Fax draft.

This endpoint accepts either **files** or **file_urls[]**, but not both. Files can be added later in the embedded flow when neither is provided. | | +| `fileUrls` | ```Array``` | Use `file_urls[]` to have Dropbox Fax download the file(s) for the embedded Fax draft.

This endpoint accepts either **files** or **file_urls[]**, but not both. Files can be added later in the embedded flow when neither is provided. | | +| `editorOptions` | [```SubEditorPageOptions```](SubEditorPageOptions.md) | | | +| `recipients` | ```Set``` | Fax numbers to prefill in the embedded flow. Each fax number must be in a supported international format. A maximum of 20 unique fax numbers can be provided. | | +| `testMode` | ```boolean``` | When set to `true`, the completed draft will not send a Fax or consume Fax pages. Defaults to `false`. | [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/FaxDraftCreateResponse.md b/sdks/node/docs/model/FaxDraftCreateResponse.md new file mode 100644 index 000000000..5b27adcf5 --- /dev/null +++ b/sdks/node/docs/model/FaxDraftCreateResponse.md @@ -0,0 +1,12 @@ +# # FaxDraftCreateResponse + + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +| `faxDraft`*_required_ | [```FaxDraftResponse```](FaxDraftResponse.md) | | | +| `warnings` | [```Array```](WarningResponse.md) | A list of warnings. | | + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/sdks/node/docs/model/FaxDraftResponse.md b/sdks/node/docs/model/FaxDraftResponse.md new file mode 100644 index 000000000..5d4b2de94 --- /dev/null +++ b/sdks/node/docs/model/FaxDraftResponse.md @@ -0,0 +1,13 @@ +# # FaxDraftResponse + +Contains the embedded Fax draft ID, iframe URL, and expiration timestamp. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +| `faxId`*_required_ | ```string``` | ID of the Fax draft. | | +| `url`*_required_ | ```string``` | URL to open in an approved iframe for preparing and sending the Fax. | | +| `expiresAt`*_required_ | ```number``` | Unix timestamp indicating when the embedded Fax draft URL expires. | | + +[[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/SubEditorPageOptions.md b/sdks/node/docs/model/SubEditorPageOptions.md new file mode 100644 index 000000000..a4f3a9cdb --- /dev/null +++ b/sdks/node/docs/model/SubEditorPageOptions.md @@ -0,0 +1,13 @@ +# # SubEditorPageOptions + +Controls which completed pages are shown again when the embedded Fax draft is opened. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +| `forceUploadPage` | ```boolean``` | When set to `true`, always shows the upload page, even when files are already attached. Defaults to `false`. | [default to false] | +| `forceEditorPage` | ```boolean``` | When set to `true`, always shows the editor page, even when the document is already prepared. Defaults to `false`. | [default to false] | +| `forceReviewPage` | ```boolean``` | When set to `true`, always shows the review page, even when recipients and Fax details are already provided. Defaults to `false`. | [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/model/faxDraftCreateRequest.ts b/sdks/node/model/faxDraftCreateRequest.ts new file mode 100644 index 000000000..cb81bfa47 --- /dev/null +++ b/sdks/node/model/faxDraftCreateRequest.ts @@ -0,0 +1,94 @@ +/** + * 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 { SubEditorPageOptions } from "./subEditorPageOptions"; + +export class FaxDraftCreateRequest { + /** + * Client ID of the API app that owns the embedded Fax draft. + */ + "clientId": string; + /** + * Use `files[]` to upload the file(s) for the embedded Fax draft. This endpoint accepts either **files** or **file_urls[]**, but not both. Files can be added later in the embedded flow when neither is provided. + */ + "files"?: Array; + /** + * Use `file_urls[]` to have Dropbox Fax download the file(s) for the embedded Fax draft. This endpoint accepts either **files** or **file_urls[]**, but not both. Files can be added later in the embedded flow when neither is provided. + */ + "fileUrls"?: Array; + "editorOptions"?: SubEditorPageOptions; + /** + * Fax numbers to prefill in the embedded flow. Each fax number must be in a supported international format. A maximum of 20 unique fax numbers can be provided. + */ + "recipients"?: Set; + /** + * When set to `true`, the completed draft will not send a Fax or consume Fax pages. Defaults to `false`. + */ + "testMode"?: boolean = false; + + 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: "editorOptions", + baseName: "editor_options", + type: "SubEditorPageOptions", + }, + { + name: "recipients", + baseName: "recipients", + type: "Set", + }, + { + name: "testMode", + baseName: "test_mode", + type: "boolean", + }, + ]; + + static getAttributeTypeMap(): AttributeTypeMap { + return FaxDraftCreateRequest.attributeTypeMap; + } + + /** Attempt to instantiate and hydrate a new instance of this class */ + static init(data: any): FaxDraftCreateRequest { + return ObjectSerializer.deserialize(data, "FaxDraftCreateRequest"); + } +} diff --git a/sdks/node/model/faxDraftCreateResponse.ts b/sdks/node/model/faxDraftCreateResponse.ts new file mode 100644 index 000000000..93a2b9131 --- /dev/null +++ b/sdks/node/model/faxDraftCreateResponse.ts @@ -0,0 +1,59 @@ +/** + * The MIT License (MIT) + * + * Copyright (C) 2023 dropbox.com + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +import { AttributeTypeMap, ObjectSerializer } from "./"; +import { FaxDraftResponse } from "./faxDraftResponse"; +import { WarningResponse } from "./warningResponse"; + +export class FaxDraftCreateResponse { + "faxDraft": FaxDraftResponse; + /** + * A list of warnings. + */ + "warnings"?: Array; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: AttributeTypeMap = [ + { + name: "faxDraft", + baseName: "fax_draft", + type: "FaxDraftResponse", + }, + { + name: "warnings", + baseName: "warnings", + type: "Array", + }, + ]; + + static getAttributeTypeMap(): AttributeTypeMap { + return FaxDraftCreateResponse.attributeTypeMap; + } + + /** Attempt to instantiate and hydrate a new instance of this class */ + static init(data: any): FaxDraftCreateResponse { + return ObjectSerializer.deserialize(data, "FaxDraftCreateResponse"); + } +} diff --git a/sdks/node/model/faxDraftResponse.ts b/sdks/node/model/faxDraftResponse.ts new file mode 100644 index 000000000..bba821eaf --- /dev/null +++ b/sdks/node/model/faxDraftResponse.ts @@ -0,0 +1,72 @@ +/** + * The MIT License (MIT) + * + * Copyright (C) 2023 dropbox.com + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +import { AttributeTypeMap, ObjectSerializer } from "./"; + +/** + * Contains the embedded Fax draft ID, iframe URL, and expiration timestamp. + */ +export class FaxDraftResponse { + /** + * ID of the Fax draft. + */ + "faxId": string; + /** + * URL to open in an approved iframe for preparing and sending the Fax. + */ + "url": string; + /** + * Unix timestamp indicating when the embedded Fax draft URL expires. + */ + "expiresAt": number; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: AttributeTypeMap = [ + { + name: "faxId", + baseName: "fax_id", + type: "string", + }, + { + name: "url", + baseName: "url", + type: "string", + }, + { + name: "expiresAt", + baseName: "expires_at", + type: "number", + }, + ]; + + static getAttributeTypeMap(): AttributeTypeMap { + return FaxDraftResponse.attributeTypeMap; + } + + /** Attempt to instantiate and hydrate a new instance of this class */ + static init(data: any): FaxDraftResponse { + return ObjectSerializer.deserialize(data, "FaxDraftResponse"); + } +} diff --git a/sdks/node/model/index.ts b/sdks/node/model/index.ts index 47632382b..c44cdfcf7 100644 --- a/sdks/node/model/index.ts +++ b/sdks/node/model/index.ts @@ -34,6 +34,9 @@ import { EventCallbackHelper } from "./eventCallbackHelper"; import { EventCallbackRequest } from "./eventCallbackRequest"; import { EventCallbackRequestEvent } from "./eventCallbackRequestEvent"; import { EventCallbackRequestEventMetadata } from "./eventCallbackRequestEventMetadata"; +import { FaxDraftCreateRequest } from "./faxDraftCreateRequest"; +import { FaxDraftCreateResponse } from "./faxDraftCreateResponse"; +import { FaxDraftResponse } from "./faxDraftResponse"; import { FaxGetResponse } from "./faxGetResponse"; import { FaxLineAddUserRequest } from "./faxLineAddUserRequest"; import { FaxLineAreaCodeGetCountryEnum } from "./faxLineAreaCodeGetCountryEnum"; @@ -110,6 +113,7 @@ import { SubBulkSignerListCustomField } from "./subBulkSignerListCustomField"; import { SubCC } from "./subCC"; import { SubCustomField } from "./subCustomField"; import { SubEditorOptions } from "./subEditorOptions"; +import { SubEditorPageOptions } from "./subEditorPageOptions"; import { SubFieldOptions } from "./subFieldOptions"; import { SubFormFieldGroup } from "./subFormFieldGroup"; import { SubFormFieldRule } from "./subFormFieldRule"; @@ -291,6 +295,9 @@ export let typeMap: { [index: string]: any } = { EventCallbackRequest: EventCallbackRequest, EventCallbackRequestEvent: EventCallbackRequestEvent, EventCallbackRequestEventMetadata: EventCallbackRequestEventMetadata, + FaxDraftCreateRequest: FaxDraftCreateRequest, + FaxDraftCreateResponse: FaxDraftCreateResponse, + FaxDraftResponse: FaxDraftResponse, FaxGetResponse: FaxGetResponse, FaxLineAddUserRequest: FaxLineAddUserRequest, FaxLineAreaCodeGetResponse: FaxLineAreaCodeGetResponse, @@ -366,6 +373,7 @@ export let typeMap: { [index: string]: any } = { SubCC: SubCC, SubCustomField: SubCustomField, SubEditorOptions: SubEditorOptions, + SubEditorPageOptions: SubEditorPageOptions, SubFieldOptions: SubFieldOptions, SubFormFieldGroup: SubFormFieldGroup, SubFormFieldRule: SubFormFieldRule, @@ -522,6 +530,9 @@ export { EventCallbackRequest, EventCallbackRequestEvent, EventCallbackRequestEventMetadata, + FaxDraftCreateRequest, + FaxDraftCreateResponse, + FaxDraftResponse, FaxGetResponse, FaxLineAddUserRequest, FaxLineAreaCodeGetCountryEnum, @@ -592,6 +603,7 @@ export { SubCC, SubCustomField, SubEditorOptions, + SubEditorPageOptions, SubFieldOptions, SubFormFieldGroup, SubFormFieldRule, diff --git a/sdks/node/model/subEditorPageOptions.ts b/sdks/node/model/subEditorPageOptions.ts new file mode 100644 index 000000000..a7f0f5875 --- /dev/null +++ b/sdks/node/model/subEditorPageOptions.ts @@ -0,0 +1,72 @@ +/** + * The MIT License (MIT) + * + * Copyright (C) 2023 dropbox.com + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +import { AttributeTypeMap, ObjectSerializer } from "./"; + +/** + * Controls which completed pages are shown again when the embedded Fax draft is opened. + */ +export class SubEditorPageOptions { + /** + * When set to `true`, always shows the upload page, even when files are already attached. Defaults to `false`. + */ + "forceUploadPage"?: boolean = false; + /** + * When set to `true`, always shows the editor page, even when the document is already prepared. Defaults to `false`. + */ + "forceEditorPage"?: boolean = false; + /** + * When set to `true`, always shows the review page, even when recipients and Fax details are already provided. Defaults to `false`. + */ + "forceReviewPage"?: boolean = false; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: AttributeTypeMap = [ + { + name: "forceUploadPage", + baseName: "force_upload_page", + type: "boolean", + }, + { + name: "forceEditorPage", + baseName: "force_editor_page", + type: "boolean", + }, + { + name: "forceReviewPage", + baseName: "force_review_page", + type: "boolean", + }, + ]; + + static getAttributeTypeMap(): AttributeTypeMap { + return SubEditorPageOptions.attributeTypeMap; + } + + /** Attempt to instantiate and hydrate a new instance of this class */ + static init(data: any): SubEditorPageOptions { + return ObjectSerializer.deserialize(data, "SubEditorPageOptions"); + } +} diff --git a/sdks/node/types/api/faxApi.d.ts b/sdks/node/types/api/faxApi.d.ts index f18e42259..653db98f9 100644 --- a/sdks/node/types/api/faxApi.d.ts +++ b/sdks/node/types/api/faxApi.d.ts @@ -1,4 +1,4 @@ -import { Authentication, FaxGetResponse, FaxListResponse, FaxSendRequest, HttpBasicAuth, HttpBearerAuth, Interceptor } from "../model"; +import { Authentication, FaxDraftCreateRequest, FaxDraftCreateResponse, FaxGetResponse, FaxListResponse, FaxSendRequest, HttpBasicAuth, HttpBearerAuth, Interceptor } from "../model"; import { optionsI, returnTypeI, returnTypeT } from "./"; export declare enum FaxApiApiKeys { } @@ -25,6 +25,7 @@ export declare class FaxApi { set accessToken(accessToken: string | (() => string)); addInterceptor(interceptor: Interceptor): void; faxDelete(faxId: string, options?: optionsI): Promise; + faxDraftCreate(faxDraftCreateRequest: FaxDraftCreateRequest, options?: optionsI): Promise>; faxFiles(faxId: string, options?: optionsI): Promise>; faxGet(faxId: string, options?: optionsI): Promise>; faxList(page?: number, pageSize?: number, options?: optionsI): Promise>; diff --git a/sdks/node/types/model/faxDraftCreateRequest.d.ts b/sdks/node/types/model/faxDraftCreateRequest.d.ts new file mode 100644 index 000000000..207e0f515 --- /dev/null +++ b/sdks/node/types/model/faxDraftCreateRequest.d.ts @@ -0,0 +1,14 @@ +import { AttributeTypeMap, RequestFile } from "./"; +import { SubEditorPageOptions } from "./subEditorPageOptions"; +export declare class FaxDraftCreateRequest { + "clientId": string; + "files"?: Array; + "fileUrls"?: Array; + "editorOptions"?: SubEditorPageOptions; + "recipients"?: Set; + "testMode"?: boolean; + static discriminator: string | undefined; + static attributeTypeMap: AttributeTypeMap; + static getAttributeTypeMap(): AttributeTypeMap; + static init(data: any): FaxDraftCreateRequest; +} diff --git a/sdks/node/types/model/faxDraftCreateResponse.d.ts b/sdks/node/types/model/faxDraftCreateResponse.d.ts new file mode 100644 index 000000000..1ff545b11 --- /dev/null +++ b/sdks/node/types/model/faxDraftCreateResponse.d.ts @@ -0,0 +1,11 @@ +import { AttributeTypeMap } from "./"; +import { FaxDraftResponse } from "./faxDraftResponse"; +import { WarningResponse } from "./warningResponse"; +export declare class FaxDraftCreateResponse { + "faxDraft": FaxDraftResponse; + "warnings"?: Array; + static discriminator: string | undefined; + static attributeTypeMap: AttributeTypeMap; + static getAttributeTypeMap(): AttributeTypeMap; + static init(data: any): FaxDraftCreateResponse; +} diff --git a/sdks/node/types/model/faxDraftResponse.d.ts b/sdks/node/types/model/faxDraftResponse.d.ts new file mode 100644 index 000000000..fa95c8a36 --- /dev/null +++ b/sdks/node/types/model/faxDraftResponse.d.ts @@ -0,0 +1,10 @@ +import { AttributeTypeMap } from "./"; +export declare class FaxDraftResponse { + "faxId": string; + "url": string; + "expiresAt": number; + static discriminator: string | undefined; + static attributeTypeMap: AttributeTypeMap; + static getAttributeTypeMap(): AttributeTypeMap; + static init(data: any): FaxDraftResponse; +} diff --git a/sdks/node/types/model/index.d.ts b/sdks/node/types/model/index.d.ts index d36185eb5..084b816c0 100644 --- a/sdks/node/types/model/index.d.ts +++ b/sdks/node/types/model/index.d.ts @@ -34,6 +34,9 @@ import { EventCallbackHelper } from "./eventCallbackHelper"; import { EventCallbackRequest } from "./eventCallbackRequest"; import { EventCallbackRequestEvent } from "./eventCallbackRequestEvent"; import { EventCallbackRequestEventMetadata } from "./eventCallbackRequestEventMetadata"; +import { FaxDraftCreateRequest } from "./faxDraftCreateRequest"; +import { FaxDraftCreateResponse } from "./faxDraftCreateResponse"; +import { FaxDraftResponse } from "./faxDraftResponse"; import { FaxGetResponse } from "./faxGetResponse"; import { FaxLineAddUserRequest } from "./faxLineAddUserRequest"; import { FaxLineAreaCodeGetCountryEnum } from "./faxLineAreaCodeGetCountryEnum"; @@ -98,6 +101,7 @@ import { SubBulkSignerListCustomField } from "./subBulkSignerListCustomField"; import { SubCC } from "./subCC"; import { SubCustomField } from "./subCustomField"; import { SubEditorOptions } from "./subEditorOptions"; +import { SubEditorPageOptions } from "./subEditorPageOptions"; import { SubFieldOptions } from "./subFieldOptions"; import { SubFormFieldGroup } from "./subFormFieldGroup"; import { SubFormFieldRule } from "./subFormFieldRule"; @@ -198,4 +202,4 @@ export declare let enumsMap: { export declare let typeMap: { [index: string]: any; }; -export { AccountCreateRequest, AccountCreateResponse, AccountGetResponse, AccountResponse, AccountResponseQuotas, AccountResponseSettings, AccountResponseUsage, AccountUpdateRequest, AccountVerifyRequest, AccountVerifyResponse, AccountVerifyResponseAccount, ApiAppCreateRequest, ApiAppGetResponse, ApiAppListResponse, ApiAppResponse, ApiAppResponseOAuth, ApiAppResponseOptions, ApiAppResponseOwnerAccount, ApiAppResponseWhiteLabelingOptions, ApiAppUpdateRequest, ApiKeyAuth, AttributeTypeMap, Authentication, BulkSendJobGetResponse, BulkSendJobGetResponseSignatureRequests, BulkSendJobListResponse, BulkSendJobResponse, BulkSendJobSendResponse, EmbeddedEditUrlRequest, EmbeddedEditUrlResponse, EmbeddedEditUrlResponseEmbedded, EmbeddedSignUrlResponse, EmbeddedSignUrlResponseEmbedded, ErrorResponse, ErrorResponseError, EventCallbackHelper, EventCallbackRequest, EventCallbackRequestEvent, EventCallbackRequestEventMetadata, FaxGetResponse, FaxLineAddUserRequest, FaxLineAreaCodeGetCountryEnum, FaxLineAreaCodeGetProvinceEnum, FaxLineAreaCodeGetResponse, FaxLineAreaCodeGetStateEnum, FaxLineCreateRequest, FaxLineDeleteRequest, FaxLineListResponse, FaxLineRemoveUserRequest, FaxLineResponse, FaxLineResponseFaxLine, FaxListResponse, FaxResponse, FaxResponseTransmission, FaxSendRequest, FileResponse, FileResponseDataUri, HttpBasicAuth, HttpBearerAuth, Interceptor, ListInfoResponse, OAuth, OAuthTokenGenerateRequest, OAuthTokenRefreshRequest, OAuthTokenResponse, ObjectSerializer, ReportCreateRequest, ReportCreateResponse, ReportResponse, RequestDetailedFile, RequestFile, SignatureRequestBulkCreateEmbeddedWithTemplateRequest, SignatureRequestBulkSendWithTemplateRequest, SignatureRequestCreateEmbeddedRequest, SignatureRequestCreateEmbeddedWithTemplateRequest, SignatureRequestEditEmbeddedRequest, SignatureRequestEditEmbeddedWithTemplateRequest, SignatureRequestEditRequest, SignatureRequestEditWithTemplateRequest, SignatureRequestGetResponse, SignatureRequestListResponse, SignatureRequestRemindRequest, SignatureRequestResponse, SignatureRequestResponseAttachment, SignatureRequestResponseCustomFieldBase, SignatureRequestResponseCustomFieldCheckbox, SignatureRequestResponseCustomFieldText, SignatureRequestResponseCustomFieldTypeEnum, SignatureRequestResponseDataBase, SignatureRequestResponseDataTypeEnum, SignatureRequestResponseDataValueCheckbox, SignatureRequestResponseDataValueCheckboxMerge, SignatureRequestResponseDataValueDateSigned, SignatureRequestResponseDataValueDropdown, SignatureRequestResponseDataValueInitials, SignatureRequestResponseDataValueRadio, SignatureRequestResponseDataValueSignature, SignatureRequestResponseDataValueText, SignatureRequestResponseDataValueTextMerge, SignatureRequestResponseSignatures, SignatureRequestSendRequest, SignatureRequestSendWithTemplateRequest, SignatureRequestUpdateRequest, SubAttachment, SubBulkSignerList, SubBulkSignerListCustomField, SubCC, SubCustomField, SubEditorOptions, SubFieldOptions, SubFormFieldGroup, SubFormFieldRule, SubFormFieldRuleAction, SubFormFieldRuleTrigger, SubFormFieldsPerDocumentBase, SubFormFieldsPerDocumentCheckbox, SubFormFieldsPerDocumentCheckboxMerge, SubFormFieldsPerDocumentDateSigned, SubFormFieldsPerDocumentDropdown, SubFormFieldsPerDocumentFontEnum, SubFormFieldsPerDocumentHyperlink, SubFormFieldsPerDocumentInitials, SubFormFieldsPerDocumentRadio, SubFormFieldsPerDocumentSignature, SubFormFieldsPerDocumentText, SubFormFieldsPerDocumentTextMerge, SubFormFieldsPerDocumentTypeEnum, SubMergeField, SubOAuth, SubOptions, SubSignatureRequestGroupedSigners, SubSignatureRequestSigner, SubSignatureRequestTemplateSigner, SubSigningOptions, SubTeamResponse, SubTemplateRole, SubUnclaimedDraftSigner, SubUnclaimedDraftTemplateSigner, SubWhiteLabelingOptions, TeamAddMemberRequest, TeamCreateRequest, TeamGetInfoResponse, TeamGetResponse, TeamInfoResponse, TeamInviteResponse, TeamInvitesResponse, TeamMemberResponse, TeamMembersResponse, TeamParentResponse, TeamRemoveMemberRequest, TeamResponse, TeamSubTeamsResponse, TeamUpdateRequest, TemplateAddUserRequest, TemplateCreateEmbeddedDraftRequest, TemplateCreateEmbeddedDraftResponse, TemplateCreateEmbeddedDraftResponseTemplate, TemplateCreateRequest, TemplateCreateResponse, TemplateCreateResponseTemplate, TemplateGetResponse, TemplateListResponse, TemplateRemoveUserRequest, TemplateResponse, TemplateResponseAccount, TemplateResponseAccountQuota, TemplateResponseCCRole, TemplateResponseDocument, TemplateResponseDocumentCustomFieldBase, TemplateResponseDocumentCustomFieldCheckbox, TemplateResponseDocumentCustomFieldText, TemplateResponseDocumentFieldGroup, TemplateResponseDocumentFieldGroupRule, TemplateResponseDocumentFormFieldBase, TemplateResponseDocumentFormFieldCheckbox, TemplateResponseDocumentFormFieldDateSigned, TemplateResponseDocumentFormFieldDropdown, TemplateResponseDocumentFormFieldHyperlink, TemplateResponseDocumentFormFieldInitials, TemplateResponseDocumentFormFieldRadio, TemplateResponseDocumentFormFieldSignature, TemplateResponseDocumentFormFieldText, TemplateResponseDocumentStaticFieldBase, TemplateResponseDocumentStaticFieldCheckbox, TemplateResponseDocumentStaticFieldDateSigned, TemplateResponseDocumentStaticFieldDropdown, TemplateResponseDocumentStaticFieldHyperlink, TemplateResponseDocumentStaticFieldInitials, TemplateResponseDocumentStaticFieldRadio, TemplateResponseDocumentStaticFieldSignature, TemplateResponseDocumentStaticFieldText, TemplateResponseFieldAvgTextLength, TemplateResponseSignerRole, TemplateUpdateFilesRequest, TemplateUpdateFilesResponse, TemplateUpdateFilesResponseTemplate, UnclaimedDraftCreateEmbeddedRequest, UnclaimedDraftCreateEmbeddedWithTemplateRequest, UnclaimedDraftCreateRequest, UnclaimedDraftCreateResponse, UnclaimedDraftEditAndResendRequest, UnclaimedDraftResponse, VoidAuth, WarningResponse, }; +export { AccountCreateRequest, AccountCreateResponse, AccountGetResponse, AccountResponse, AccountResponseQuotas, AccountResponseSettings, AccountResponseUsage, AccountUpdateRequest, AccountVerifyRequest, AccountVerifyResponse, AccountVerifyResponseAccount, ApiAppCreateRequest, ApiAppGetResponse, ApiAppListResponse, ApiAppResponse, ApiAppResponseOAuth, ApiAppResponseOptions, ApiAppResponseOwnerAccount, ApiAppResponseWhiteLabelingOptions, ApiAppUpdateRequest, ApiKeyAuth, AttributeTypeMap, Authentication, BulkSendJobGetResponse, BulkSendJobGetResponseSignatureRequests, BulkSendJobListResponse, BulkSendJobResponse, BulkSendJobSendResponse, EmbeddedEditUrlRequest, EmbeddedEditUrlResponse, EmbeddedEditUrlResponseEmbedded, EmbeddedSignUrlResponse, EmbeddedSignUrlResponseEmbedded, ErrorResponse, ErrorResponseError, EventCallbackHelper, EventCallbackRequest, EventCallbackRequestEvent, EventCallbackRequestEventMetadata, FaxDraftCreateRequest, FaxDraftCreateResponse, FaxDraftResponse, 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, SubEditorPageOptions, SubFieldOptions, SubFormFieldGroup, SubFormFieldRule, SubFormFieldRuleAction, SubFormFieldRuleTrigger, SubFormFieldsPerDocumentBase, SubFormFieldsPerDocumentCheckbox, SubFormFieldsPerDocumentCheckboxMerge, SubFormFieldsPerDocumentDateSigned, SubFormFieldsPerDocumentDropdown, SubFormFieldsPerDocumentFontEnum, SubFormFieldsPerDocumentHyperlink, SubFormFieldsPerDocumentInitials, SubFormFieldsPerDocumentRadio, SubFormFieldsPerDocumentSignature, SubFormFieldsPerDocumentText, SubFormFieldsPerDocumentTextMerge, SubFormFieldsPerDocumentTypeEnum, SubMergeField, SubOAuth, SubOptions, SubSignatureRequestGroupedSigners, SubSignatureRequestSigner, SubSignatureRequestTemplateSigner, SubSigningOptions, SubTeamResponse, SubTemplateRole, SubUnclaimedDraftSigner, SubUnclaimedDraftTemplateSigner, SubWhiteLabelingOptions, TeamAddMemberRequest, TeamCreateRequest, TeamGetInfoResponse, TeamGetResponse, TeamInfoResponse, TeamInviteResponse, TeamInvitesResponse, TeamMemberResponse, TeamMembersResponse, TeamParentResponse, TeamRemoveMemberRequest, TeamResponse, TeamSubTeamsResponse, TeamUpdateRequest, TemplateAddUserRequest, TemplateCreateEmbeddedDraftRequest, TemplateCreateEmbeddedDraftResponse, TemplateCreateEmbeddedDraftResponseTemplate, TemplateCreateRequest, TemplateCreateResponse, TemplateCreateResponseTemplate, TemplateGetResponse, TemplateListResponse, TemplateRemoveUserRequest, TemplateResponse, TemplateResponseAccount, TemplateResponseAccountQuota, TemplateResponseCCRole, TemplateResponseDocument, TemplateResponseDocumentCustomFieldBase, TemplateResponseDocumentCustomFieldCheckbox, TemplateResponseDocumentCustomFieldText, TemplateResponseDocumentFieldGroup, TemplateResponseDocumentFieldGroupRule, TemplateResponseDocumentFormFieldBase, TemplateResponseDocumentFormFieldCheckbox, TemplateResponseDocumentFormFieldDateSigned, TemplateResponseDocumentFormFieldDropdown, TemplateResponseDocumentFormFieldHyperlink, TemplateResponseDocumentFormFieldInitials, TemplateResponseDocumentFormFieldRadio, TemplateResponseDocumentFormFieldSignature, TemplateResponseDocumentFormFieldText, TemplateResponseDocumentStaticFieldBase, TemplateResponseDocumentStaticFieldCheckbox, TemplateResponseDocumentStaticFieldDateSigned, TemplateResponseDocumentStaticFieldDropdown, TemplateResponseDocumentStaticFieldHyperlink, TemplateResponseDocumentStaticFieldInitials, TemplateResponseDocumentStaticFieldRadio, TemplateResponseDocumentStaticFieldSignature, TemplateResponseDocumentStaticFieldText, TemplateResponseFieldAvgTextLength, TemplateResponseSignerRole, TemplateUpdateFilesRequest, TemplateUpdateFilesResponse, TemplateUpdateFilesResponseTemplate, UnclaimedDraftCreateEmbeddedRequest, UnclaimedDraftCreateEmbeddedWithTemplateRequest, UnclaimedDraftCreateRequest, UnclaimedDraftCreateResponse, UnclaimedDraftEditAndResendRequest, UnclaimedDraftResponse, VoidAuth, WarningResponse, }; diff --git a/sdks/node/types/model/subEditorPageOptions.d.ts b/sdks/node/types/model/subEditorPageOptions.d.ts new file mode 100644 index 000000000..440982fac --- /dev/null +++ b/sdks/node/types/model/subEditorPageOptions.d.ts @@ -0,0 +1,10 @@ +import { AttributeTypeMap } from "./"; +export declare class SubEditorPageOptions { + "forceUploadPage"?: boolean; + "forceEditorPage"?: boolean; + "forceReviewPage"?: boolean; + static discriminator: string | undefined; + static attributeTypeMap: AttributeTypeMap; + static getAttributeTypeMap(): AttributeTypeMap; + static init(data: any): SubEditorPageOptions; +} diff --git a/sdks/php/README.md b/sdks/php/README.md index d510976a0..474d905a4 100644 --- a/sdks/php/README.md +++ b/sdks/php/README.md @@ -161,6 +161,7 @@ All URIs are relative to *https://api.hellosign.com/v3* | *EmbeddedApi* | [**embeddedEditUrl**](docs/Api/EmbeddedApi.md#embeddedediturl) | **POST** /embedded/edit_url/{template_id} | Get Embedded Template Edit URL | | *EmbeddedApi* | [**embeddedSignUrl**](docs/Api/EmbeddedApi.md#embeddedsignurl) | **GET** /embedded/sign_url/{signature_id} | Get Embedded Sign URL | | *FaxApi* | [**faxDelete**](docs/Api/FaxApi.md#faxdelete) | **DELETE** /fax/{fax_id} | Delete Fax | +| *FaxApi* | [**faxDraftCreate**](docs/Api/FaxApi.md#faxdraftcreate) | **POST** /fax/draft/create | Create Embedded Fax Draft | | *FaxApi* | [**faxFiles**](docs/Api/FaxApi.md#faxfiles) | **GET** /fax/files/{fax_id} | Download Fax Files | | *FaxApi* | [**faxGet**](docs/Api/FaxApi.md#faxget) | **GET** /fax/{fax_id} | Get Fax | | *FaxApi* | [**faxList**](docs/Api/FaxApi.md#faxlist) | **GET** /fax/list | Lists Faxes | @@ -259,6 +260,9 @@ All URIs are relative to *https://api.hellosign.com/v3* - [EventCallbackRequest](docs/Model/EventCallbackRequest.md) - [EventCallbackRequestEvent](docs/Model/EventCallbackRequestEvent.md) - [EventCallbackRequestEventMetadata](docs/Model/EventCallbackRequestEventMetadata.md) +- [FaxDraftCreateRequest](docs/Model/FaxDraftCreateRequest.md) +- [FaxDraftCreateResponse](docs/Model/FaxDraftCreateResponse.md) +- [FaxDraftResponse](docs/Model/FaxDraftResponse.md) - [FaxGetResponse](docs/Model/FaxGetResponse.md) - [FaxLineAddUserRequest](docs/Model/FaxLineAddUserRequest.md) - [FaxLineAreaCodeGetCountryEnum](docs/Model/FaxLineAreaCodeGetCountryEnum.md) @@ -322,6 +326,7 @@ All URIs are relative to *https://api.hellosign.com/v3* - [SubCC](docs/Model/SubCC.md) - [SubCustomField](docs/Model/SubCustomField.md) - [SubEditorOptions](docs/Model/SubEditorOptions.md) +- [SubEditorPageOptions](docs/Model/SubEditorPageOptions.md) - [SubFieldOptions](docs/Model/SubFieldOptions.md) - [SubFormFieldGroup](docs/Model/SubFormFieldGroup.md) - [SubFormFieldRule](docs/Model/SubFormFieldRule.md) diff --git a/sdks/php/docs/Api/FaxApi.md b/sdks/php/docs/Api/FaxApi.md index aeb7a3949..cafbaac3c 100644 --- a/sdks/php/docs/Api/FaxApi.md +++ b/sdks/php/docs/Api/FaxApi.md @@ -5,6 +5,7 @@ All URIs are relative to https://api.hellosign.com/v3. | Method | HTTP request | Description | | ------------- | ------------- | ------------- | | [**faxDelete()**](FaxApi.md#faxDelete) | **DELETE** /fax/{fax_id} | Delete Fax | +| [**faxDraftCreate()**](FaxApi.md#faxDraftCreate) | **POST** /fax/draft/create | Create Embedded Fax Draft | | [**faxFiles()**](FaxApi.md#faxFiles) | **GET** /fax/files/{fax_id} | Download Fax Files | | [**faxGet()**](FaxApi.md#faxGet) | **GET** /fax/{fax_id} | Get Fax | | [**faxList()**](FaxApi.md#faxList) | **GET** /fax/list | Lists Faxes | @@ -68,6 +69,80 @@ void (empty response body) [[Back to Model list]](../../README.md#models) [[Back to README]](../../README.md) +## `faxDraftCreate()` + +```php +faxDraftCreate($fax_draft_create_request): \Dropbox\Sign\Model\FaxDraftCreateResponse +``` +Create Embedded Fax Draft + +Creates an embedded Fax draft and returns a URL that can be opened in an approved iframe for preparation and sending. + +### Example + +```php +setUsername("YOUR_API_KEY"); + +$editor_options = (new Dropbox\Sign\Model\SubEditorPageOptions()) + ->setForceUploadPage(false) + ->setForceEditorPage(true) + ->setForceReviewPage(true); + +$fax_draft_create_request = (new Dropbox\Sign\Model\FaxDraftCreateRequest()) + ->setClientId("b6b8e7deaf8f0b95c029dca049356d4a2cf9710a") + ->setFileUrls([ + "https://www.dropbox.com/s/ad9qnhbrjjn64tu/mutual-NDA-example.pdf?dl=1", + ]) + ->setRecipients([ + "+14155552671", + ]) + ->setEditorOptions($editor_options) + ->setTestMode(true); + +try { + $response = (new Dropbox\Sign\Api\FaxApi(config: $config))->faxDraftCreate( + fax_draft_create_request: $fax_draft_create_request, + ); + + print_r($response); +} catch (Dropbox\Sign\ApiException $e) { + echo "Exception when calling FaxApi#faxDraftCreate: {$e->getMessage()}"; +} + +``` + +### Parameters + +|Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **fax_draft_create_request** | [**\Dropbox\Sign\Model\FaxDraftCreateRequest**](../Model/FaxDraftCreateRequest.md)| | | + +### Return type + +[**\Dropbox\Sign\Model\FaxDraftCreateResponse**](../Model/FaxDraftCreateResponse.md) + +### Authorization + +[api_key](../../README.md#api_key) + +### 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) + ## `faxFiles()` ```php diff --git a/sdks/php/docs/Model/FaxDraftCreateRequest.md b/sdks/php/docs/Model/FaxDraftCreateRequest.md new file mode 100644 index 000000000..749fe84b7 --- /dev/null +++ b/sdks/php/docs/Model/FaxDraftCreateRequest.md @@ -0,0 +1,16 @@ +# # FaxDraftCreateRequest + + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +| `client_id`*_required_ | ```string``` | Client ID of the API app that owns the embedded Fax draft. | | +| `files` | ```\SplFileObject[]``` | Use `files[]` to upload the file(s) for the embedded Fax draft.

This endpoint accepts either **files** or **file_urls[]**, but not both. Files can be added later in the embedded flow when neither is provided. | | +| `file_urls` | ```string[]``` | Use `file_urls[]` to have Dropbox Fax download the file(s) for the embedded Fax draft.

This endpoint accepts either **files** or **file_urls[]**, but not both. Files can be added later in the embedded flow when neither is provided. | | +| `editor_options` | [```\Dropbox\Sign\Model\SubEditorPageOptions```](SubEditorPageOptions.md) | | | +| `recipients` | ```string[]``` | Fax numbers to prefill in the embedded flow. Each fax number must be in a supported international format. A maximum of 20 unique fax numbers can be provided. | | +| `test_mode` | ```bool``` | When set to `true`, the completed draft will not send a Fax or consume Fax pages. Defaults to `false`. | [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/FaxDraftCreateResponse.md b/sdks/php/docs/Model/FaxDraftCreateResponse.md new file mode 100644 index 000000000..4b824669b --- /dev/null +++ b/sdks/php/docs/Model/FaxDraftCreateResponse.md @@ -0,0 +1,12 @@ +# # FaxDraftCreateResponse + + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +| `fax_draft`*_required_ | [```\Dropbox\Sign\Model\FaxDraftResponse```](FaxDraftResponse.md) | | | +| `warnings` | [```\Dropbox\Sign\Model\WarningResponse[]```](WarningResponse.md) | A list of warnings. | | + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/sdks/php/docs/Model/FaxDraftResponse.md b/sdks/php/docs/Model/FaxDraftResponse.md new file mode 100644 index 000000000..228c88d95 --- /dev/null +++ b/sdks/php/docs/Model/FaxDraftResponse.md @@ -0,0 +1,13 @@ +# # FaxDraftResponse + +Contains the embedded Fax draft ID, iframe URL, and expiration timestamp. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +| `fax_id`*_required_ | ```string``` | ID of the Fax draft. | | +| `url`*_required_ | ```string``` | URL to open in an approved iframe for preparing and sending the Fax. | | +| `expires_at`*_required_ | ```int``` | Unix timestamp indicating when the embedded Fax draft URL expires. | | + +[[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/SubEditorPageOptions.md b/sdks/php/docs/Model/SubEditorPageOptions.md new file mode 100644 index 000000000..263953c9a --- /dev/null +++ b/sdks/php/docs/Model/SubEditorPageOptions.md @@ -0,0 +1,13 @@ +# # SubEditorPageOptions + +Controls which completed pages are shown again when the embedded Fax draft is opened. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +| `force_upload_page` | ```bool``` | When set to `true`, always shows the upload page, even when files are already attached. Defaults to `false`. | [default to false] | +| `force_editor_page` | ```bool``` | When set to `true`, always shows the editor page, even when the document is already prepared. Defaults to `false`. | [default to false] | +| `force_review_page` | ```bool``` | When set to `true`, always shows the review page, even when recipients and Fax details are already provided. Defaults to `false`. | [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/src/Api/FaxApi.php b/sdks/php/src/Api/FaxApi.php index ec43e8a7f..82ae6d598 100644 --- a/sdks/php/src/Api/FaxApi.php +++ b/sdks/php/src/Api/FaxApi.php @@ -71,6 +71,10 @@ class FaxApi 'faxDelete' => [ 'application/json', ], + 'faxDraftCreate' => [ + 'application/json', + 'multipart/form-data', + ], 'faxFiles' => [ 'application/json', ], @@ -369,6 +373,341 @@ public function faxDeleteRequest(string $fax_id, string $contentType = self::con ); } + /** + * Operation faxDraftCreate + * + * Create Embedded Fax Draft + * + * @param Model\FaxDraftCreateRequest $fax_draft_create_request fax_draft_create_request (required) + * + * @return Model\FaxDraftCreateResponse + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + */ + public function faxDraftCreate(Model\FaxDraftCreateRequest $fax_draft_create_request) + { + list($response) = $this->faxDraftCreateWithHttpInfo($fax_draft_create_request); + return $response; + } + + /** + * Operation faxDraftCreateWithHttpInfo + * + * Create Embedded Fax Draft + * + * @param Model\FaxDraftCreateRequest $fax_draft_create_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['faxDraftCreate'] to see the possible values for this operation + * + * @return array of Model\FaxDraftCreateResponse, 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 ::faxDraftCreate. This method will eventually become unavailable + */ + public function faxDraftCreateWithHttpInfo(Model\FaxDraftCreateRequest $fax_draft_create_request, string $contentType = self::contentTypes['faxDraftCreate'][0]) + { + $request = $this->faxDraftCreateRequest($fax_draft_create_request, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + $this->response = $response; + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int)$e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string)$e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int)$e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + $result = $this->handleRangeCodeResponse( + $response, + '4XX', + '\Dropbox\Sign\Model\ErrorResponse' + ); + if ($result) { + return $result; + } + + switch ($statusCode) { + case 200: + if ('\Dropbox\Sign\Model\FaxDraftCreateResponse' === '\SplFileObject') { + $content = $response->getBody(); // stream goes to serializer + } else { + $content = (string)$response->getBody(); + if ('\Dropbox\Sign\Model\FaxDraftCreateResponse' !== '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\FaxDraftCreateResponse', []), + $response->getStatusCode(), + $response->getHeaders(), + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string)$request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string)$response->getBody() + ); + } + + $returnType = '\Dropbox\Sign\Model\FaxDraftCreateResponse'; + 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\FaxDraftCreateResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation faxDraftCreateAsync + * + * Create Embedded Fax Draft + * + * @param Model\FaxDraftCreateRequest $fax_draft_create_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['faxDraftCreate'] to see the possible values for this operation + * + * @return \GuzzleHttp\Promise\PromiseInterface + * @throws InvalidArgumentException + * @deprecated Prefer to use ::faxDraftCreate. This method will eventually become unavailable + */ + public function faxDraftCreateAsync(Model\FaxDraftCreateRequest $fax_draft_create_request, string $contentType = self::contentTypes['faxDraftCreate'][0]) + { + return $this->faxDraftCreateAsyncWithHttpInfo($fax_draft_create_request, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation faxDraftCreateAsyncWithHttpInfo + * + * Create Embedded Fax Draft + * + * @param Model\FaxDraftCreateRequest $fax_draft_create_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['faxDraftCreate'] to see the possible values for this operation + * + * @return \GuzzleHttp\Promise\PromiseInterface + * @throws InvalidArgumentException + * @deprecated Prefer to use ::faxDraftCreate. This method will eventually become unavailable + */ + public function faxDraftCreateAsyncWithHttpInfo(Model\FaxDraftCreateRequest $fax_draft_create_request, string $contentType = self::contentTypes['faxDraftCreate'][0]) + { + $returnType = '\Dropbox\Sign\Model\FaxDraftCreateResponse'; + $request = $this->faxDraftCreateRequest($fax_draft_create_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 'faxDraftCreate' + * + * @param Model\FaxDraftCreateRequest $fax_draft_create_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['faxDraftCreate'] to see the possible values for this operation + * + * @return Request + * @throws InvalidArgumentException + * @deprecated Prefer to use ::faxDraftCreate. This method will eventually become unavailable + */ + public function faxDraftCreateRequest(Model\FaxDraftCreateRequest $fax_draft_create_request, string $contentType = self::contentTypes['faxDraftCreate'][0]) + { + // verify the required parameter 'fax_draft_create_request' is set + if ($fax_draft_create_request === null || (is_array($fax_draft_create_request) && count($fax_draft_create_request) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $fax_draft_create_request when calling faxDraftCreate' + ); + } + + $resourcePath = '/fax/draft/create'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + $formParams = ObjectSerializer::getFormParams( + $fax_draft_create_request + ); + + $multipart = !empty($formParams); + + $headers = $this->headerSelector->selectHeaders( + $multipart ? ['multipart/form-data'] : ['application/json'], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) === 0) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + // if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($fax_draft_create_request)); + } else { + $httpBody = $fax_draft_create_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, $fax_draft_create_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() . ':'); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'POST', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + /** * Operation faxFiles * diff --git a/sdks/php/src/Model/FaxDraftCreateRequest.php b/sdks/php/src/Model/FaxDraftCreateRequest.php new file mode 100644 index 000000000..53b925d26 --- /dev/null +++ b/sdks/php/src/Model/FaxDraftCreateRequest.php @@ -0,0 +1,595 @@ + + */ +class FaxDraftCreateRequest implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'FaxDraftCreateRequest'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'client_id' => 'string', + 'files' => '\SplFileObject[]', + 'file_urls' => 'string[]', + 'editor_options' => '\Dropbox\Sign\Model\SubEditorPageOptions', + 'recipients' => 'string[]', + 'test_mode' => 'bool', + ]; + + /** + * 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, + 'editor_options' => null, + 'recipients' => null, + 'test_mode' => null, + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var bool[] + */ + protected static array $openAPINullables = [ + 'client_id' => false, + 'files' => false, + 'file_urls' => false, + 'editor_options' => false, + 'recipients' => false, + 'test_mode' => 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 = [ + 'client_id' => 'client_id', + 'files' => 'files', + 'file_urls' => 'file_urls', + 'editor_options' => 'editor_options', + 'recipients' => 'recipients', + 'test_mode' => 'test_mode', + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'client_id' => 'setClientId', + 'files' => 'setFiles', + 'file_urls' => 'setFileUrls', + 'editor_options' => 'setEditorOptions', + 'recipients' => 'setRecipients', + 'test_mode' => 'setTestMode', + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'client_id' => 'getClientId', + 'files' => 'getFiles', + 'file_urls' => 'getFileUrls', + 'editor_options' => 'getEditorOptions', + 'recipients' => 'getRecipients', + 'test_mode' => 'getTestMode', + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('client_id', $data ?? [], null); + $this->setIfExists('files', $data ?? [], null); + $this->setIfExists('file_urls', $data ?? [], null); + $this->setIfExists('editor_options', $data ?? [], null); + $this->setIfExists('recipients', $data ?? [], null); + $this->setIfExists('test_mode', $data ?? [], false); + } + + /** + * @deprecated use ::init() + */ + public static function fromArray(array $data): FaxDraftCreateRequest + { + return self::init($data); + } + + /** + * Attempt to instantiate and hydrate a new instance of this class + */ + public static function init(array $data): FaxDraftCreateRequest + { + /** @var FaxDraftCreateRequest */ + return ObjectSerializer::deserialize( + $data, + FaxDraftCreateRequest::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['recipients']) && (count($this->container['recipients']) > 20)) { + $invalidProperties[] = "invalid value for 'recipients', number of items must be less than or equal to 20."; + } + + 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 API app that owns the embedded Fax draft + * + * @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 upload the file(s) for the embedded Fax draft. This endpoint accepts either **files** or **file_urls[]**, but not both. Files can be added later in the embedded flow when neither is provided. + * + * @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 Fax download the file(s) for the embedded Fax draft. This endpoint accepts either **files** or **file_urls[]**, but not both. Files can be added later in the embedded flow when neither is provided. + * + * @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 editor_options + * + * @return SubEditorPageOptions|null + */ + public function getEditorOptions() + { + return $this->container['editor_options']; + } + + /** + * Sets editor_options + * + * @param SubEditorPageOptions|null $editor_options editor_options + * + * @return self + */ + public function setEditorOptions(?SubEditorPageOptions $editor_options) + { + if (is_null($editor_options)) { + throw new InvalidArgumentException('non-nullable editor_options cannot be null'); + } + $this->container['editor_options'] = $editor_options; + + return $this; + } + + /** + * Gets recipients + * + * @return string[]|null + */ + public function getRecipients() + { + return $this->container['recipients']; + } + + /** + * Sets recipients + * + * @param string[]|null $recipients Fax numbers to prefill in the embedded flow. Each fax number must be in a supported international format. A maximum of 20 unique fax numbers can be provided. + * + * @return self + */ + public function setRecipients(?array $recipients) + { + if (is_null($recipients)) { + throw new InvalidArgumentException('non-nullable recipients cannot be null'); + } + + if (count($recipients) > 20) { + throw new InvalidArgumentException('invalid value for $recipients when calling FaxDraftCreateRequest., number of items must be less than or equal to 20.'); + } + $this->container['recipients'] = $recipients; + + return $this; + } + + /** + * Gets test_mode + * + * @return bool|null + */ + public function getTestMode() + { + return $this->container['test_mode']; + } + + /** + * Sets test_mode + * + * @param bool|null $test_mode When set to `true`, the completed draft will not send a Fax or consume Fax pages. 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; + } + + /** + * 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/FaxDraftCreateResponse.php b/sdks/php/src/Model/FaxDraftCreateResponse.php new file mode 100644 index 000000000..761da17cd --- /dev/null +++ b/sdks/php/src/Model/FaxDraftCreateResponse.php @@ -0,0 +1,450 @@ + + */ +class FaxDraftCreateResponse implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'FaxDraftCreateResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'fax_draft' => '\Dropbox\Sign\Model\FaxDraftResponse', + 'warnings' => '\Dropbox\Sign\Model\WarningResponse[]', + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'fax_draft' => null, + 'warnings' => null, + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var bool[] + */ + protected static array $openAPINullables = [ + 'fax_draft' => false, + 'warnings' => false, + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var bool[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return bool[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param bool[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'fax_draft' => 'fax_draft', + 'warnings' => 'warnings', + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'fax_draft' => 'setFaxDraft', + 'warnings' => 'setWarnings', + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'fax_draft' => 'getFaxDraft', + 'warnings' => 'getWarnings', + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('fax_draft', $data ?? [], null); + $this->setIfExists('warnings', $data ?? [], null); + } + + /** + * @deprecated use ::init() + */ + public static function fromArray(array $data): FaxDraftCreateResponse + { + return self::init($data); + } + + /** + * Attempt to instantiate and hydrate a new instance of this class + */ + public static function init(array $data): FaxDraftCreateResponse + { + /** @var FaxDraftCreateResponse */ + return ObjectSerializer::deserialize( + $data, + FaxDraftCreateResponse::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['fax_draft'] === null) { + $invalidProperties[] = "'fax_draft' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + /** + * Gets fax_draft + * + * @return FaxDraftResponse + */ + public function getFaxDraft() + { + return $this->container['fax_draft']; + } + + /** + * Sets fax_draft + * + * @param FaxDraftResponse $fax_draft fax_draft + * + * @return self + */ + public function setFaxDraft(FaxDraftResponse $fax_draft) + { + if (is_null($fax_draft)) { + throw new InvalidArgumentException('non-nullable fax_draft cannot be null'); + } + $this->container['fax_draft'] = $fax_draft; + + return $this; + } + + /** + * Gets warnings + * + * @return WarningResponse[]|null + */ + public function getWarnings() + { + return $this->container['warnings']; + } + + /** + * Sets warnings + * + * @param WarningResponse[]|null $warnings a list of warnings + * + * @return self + */ + public function setWarnings(?array $warnings) + { + if (is_null($warnings)) { + throw new InvalidArgumentException('non-nullable warnings cannot be null'); + } + $this->container['warnings'] = $warnings; + + return $this; + } + + /** + * Returns true if offset exists. False otherwise. + * + * @param int $offset Offset + */ + #[ReturnTypeWillChange] + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param int $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + */ + #[ReturnTypeWillChange] + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param int $offset Offset + */ + #[ReturnTypeWillChange] + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @see https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource + */ + #[ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_UNESCAPED_SLASHES + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} diff --git a/sdks/php/src/Model/FaxDraftResponse.php b/sdks/php/src/Model/FaxDraftResponse.php new file mode 100644 index 000000000..b46848995 --- /dev/null +++ b/sdks/php/src/Model/FaxDraftResponse.php @@ -0,0 +1,491 @@ + + */ +class FaxDraftResponse implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'FaxDraftResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'fax_id' => 'string', + 'url' => 'string', + 'expires_at' => 'int', + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'fax_id' => null, + 'url' => null, + 'expires_at' => null, + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var bool[] + */ + protected static array $openAPINullables = [ + 'fax_id' => false, + 'url' => false, + 'expires_at' => 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 = [ + 'fax_id' => 'fax_id', + 'url' => 'url', + 'expires_at' => 'expires_at', + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'fax_id' => 'setFaxId', + 'url' => 'setUrl', + 'expires_at' => 'setExpiresAt', + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'fax_id' => 'getFaxId', + 'url' => 'getUrl', + '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[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('fax_id', $data ?? [], null); + $this->setIfExists('url', $data ?? [], null); + $this->setIfExists('expires_at', $data ?? [], null); + } + + /** + * @deprecated use ::init() + */ + public static function fromArray(array $data): FaxDraftResponse + { + return self::init($data); + } + + /** + * Attempt to instantiate and hydrate a new instance of this class + */ + public static function init(array $data): FaxDraftResponse + { + /** @var FaxDraftResponse */ + return ObjectSerializer::deserialize( + $data, + FaxDraftResponse::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['fax_id'] === null) { + $invalidProperties[] = "'fax_id' can't be null"; + } + if ($this->container['url'] === null) { + $invalidProperties[] = "'url' can't be null"; + } + if ($this->container['expires_at'] === null) { + $invalidProperties[] = "'expires_at' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + /** + * Gets fax_id + * + * @return string + */ + public function getFaxId() + { + return $this->container['fax_id']; + } + + /** + * Sets fax_id + * + * @param string $fax_id ID of the Fax draft + * + * @return self + */ + public function setFaxId(string $fax_id) + { + if (is_null($fax_id)) { + throw new InvalidArgumentException('non-nullable fax_id cannot be null'); + } + $this->container['fax_id'] = $fax_id; + + return $this; + } + + /** + * Gets url + * + * @return string + */ + public function getUrl() + { + return $this->container['url']; + } + + /** + * Sets url + * + * @param string $url URL to open in an approved iframe for preparing and sending the Fax + * + * @return self + */ + public function setUrl(string $url) + { + if (is_null($url)) { + throw new InvalidArgumentException('non-nullable url cannot be null'); + } + $this->container['url'] = $url; + + return $this; + } + + /** + * Gets expires_at + * + * @return int + */ + public function getExpiresAt() + { + return $this->container['expires_at']; + } + + /** + * Sets expires_at + * + * @param int $expires_at unix timestamp indicating when the embedded Fax draft URL expires + * + * @return self + */ + public function setExpiresAt(int $expires_at) + { + if (is_null($expires_at)) { + throw new InvalidArgumentException('non-nullable expires_at cannot be null'); + } + $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/SubEditorPageOptions.php b/sdks/php/src/Model/SubEditorPageOptions.php new file mode 100644 index 000000000..d6d3e26f6 --- /dev/null +++ b/sdks/php/src/Model/SubEditorPageOptions.php @@ -0,0 +1,480 @@ + + */ +class SubEditorPageOptions implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'SubEditorPageOptions'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'force_upload_page' => 'bool', + 'force_editor_page' => 'bool', + 'force_review_page' => 'bool', + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'force_upload_page' => null, + 'force_editor_page' => null, + 'force_review_page' => null, + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var bool[] + */ + protected static array $openAPINullables = [ + 'force_upload_page' => false, + 'force_editor_page' => false, + 'force_review_page' => 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 = [ + 'force_upload_page' => 'force_upload_page', + 'force_editor_page' => 'force_editor_page', + 'force_review_page' => 'force_review_page', + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'force_upload_page' => 'setForceUploadPage', + 'force_editor_page' => 'setForceEditorPage', + 'force_review_page' => 'setForceReviewPage', + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'force_upload_page' => 'getForceUploadPage', + 'force_editor_page' => 'getForceEditorPage', + 'force_review_page' => 'getForceReviewPage', + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('force_upload_page', $data ?? [], false); + $this->setIfExists('force_editor_page', $data ?? [], false); + $this->setIfExists('force_review_page', $data ?? [], false); + } + + /** + * @deprecated use ::init() + */ + public static function fromArray(array $data): SubEditorPageOptions + { + return self::init($data); + } + + /** + * Attempt to instantiate and hydrate a new instance of this class + */ + public static function init(array $data): SubEditorPageOptions + { + /** @var SubEditorPageOptions */ + return ObjectSerializer::deserialize( + $data, + SubEditorPageOptions::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() + { + return []; + } + + /** + * 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 force_upload_page + * + * @return bool|null + */ + public function getForceUploadPage() + { + return $this->container['force_upload_page']; + } + + /** + * Sets force_upload_page + * + * @param bool|null $force_upload_page When set to `true`, always shows the upload page, even when files are already attached. Defaults to `false`. + * + * @return self + */ + public function setForceUploadPage(?bool $force_upload_page) + { + if (is_null($force_upload_page)) { + throw new InvalidArgumentException('non-nullable force_upload_page cannot be null'); + } + $this->container['force_upload_page'] = $force_upload_page; + + return $this; + } + + /** + * Gets force_editor_page + * + * @return bool|null + */ + public function getForceEditorPage() + { + return $this->container['force_editor_page']; + } + + /** + * Sets force_editor_page + * + * @param bool|null $force_editor_page When set to `true`, always shows the editor page, even when the document is already prepared. Defaults to `false`. + * + * @return self + */ + public function setForceEditorPage(?bool $force_editor_page) + { + if (is_null($force_editor_page)) { + throw new InvalidArgumentException('non-nullable force_editor_page cannot be null'); + } + $this->container['force_editor_page'] = $force_editor_page; + + return $this; + } + + /** + * Gets force_review_page + * + * @return bool|null + */ + public function getForceReviewPage() + { + return $this->container['force_review_page']; + } + + /** + * Sets force_review_page + * + * @param bool|null $force_review_page When set to `true`, always shows the review page, even when recipients and Fax details are already provided. Defaults to `false`. + * + * @return self + */ + public function setForceReviewPage(?bool $force_review_page) + { + if (is_null($force_review_page)) { + throw new InvalidArgumentException('non-nullable force_review_page cannot be null'); + } + $this->container['force_review_page'] = $force_review_page; + + 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 1837792ca..f7bd672df 100644 --- a/sdks/python/README.md +++ b/sdks/python/README.md @@ -117,6 +117,7 @@ Class | Method | HTTP request | Description |```EmbeddedApi``` | [```embedded_edit_url```](docs/EmbeddedApi.md#embedded_edit_url) | ```POST /embedded/edit_url/{template_id}``` | Get Embedded Template Edit URL| ```EmbeddedApi``` | [```embedded_sign_url```](docs/EmbeddedApi.md#embedded_sign_url) | ```GET /embedded/sign_url/{signature_id}``` | Get Embedded Sign URL| |```FaxApi``` | [```fax_delete```](docs/FaxApi.md#fax_delete) | ```DELETE /fax/{fax_id}``` | Delete Fax| +```FaxApi``` | [```fax_draft_create```](docs/FaxApi.md#fax_draft_create) | ```POST /fax/draft/create``` | Create Embedded Fax Draft| ```FaxApi``` | [```fax_files```](docs/FaxApi.md#fax_files) | ```GET /fax/files/{fax_id}``` | Download Fax Files| ```FaxApi``` | [```fax_get```](docs/FaxApi.md#fax_get) | ```GET /fax/{fax_id}``` | Get Fax| ```FaxApi``` | [```fax_list```](docs/FaxApi.md#fax_list) | ```GET /fax/list``` | Lists Faxes| @@ -215,6 +216,9 @@ Class | Method | HTTP request | Description - [EventCallbackRequest](docs/EventCallbackRequest.md) - [EventCallbackRequestEvent](docs/EventCallbackRequestEvent.md) - [EventCallbackRequestEventMetadata](docs/EventCallbackRequestEventMetadata.md) + - [FaxDraftCreateRequest](docs/FaxDraftCreateRequest.md) + - [FaxDraftCreateResponse](docs/FaxDraftCreateResponse.md) + - [FaxDraftResponse](docs/FaxDraftResponse.md) - [FaxGetResponse](docs/FaxGetResponse.md) - [FaxLineAddUserRequest](docs/FaxLineAddUserRequest.md) - [FaxLineAreaCodeGetCountryEnum](docs/FaxLineAreaCodeGetCountryEnum.md) @@ -278,6 +282,7 @@ Class | Method | HTTP request | Description - [SubCC](docs/SubCC.md) - [SubCustomField](docs/SubCustomField.md) - [SubEditorOptions](docs/SubEditorOptions.md) + - [SubEditorPageOptions](docs/SubEditorPageOptions.md) - [SubFieldOptions](docs/SubFieldOptions.md) - [SubFormFieldGroup](docs/SubFormFieldGroup.md) - [SubFormFieldRule](docs/SubFormFieldRule.md) diff --git a/sdks/python/docs/FaxApi.md b/sdks/python/docs/FaxApi.md index 431d0ca9f..2233a9886 100644 --- a/sdks/python/docs/FaxApi.md +++ b/sdks/python/docs/FaxApi.md @@ -5,6 +5,7 @@ All URIs are relative to *https://api.hellosign.com/v3* Method | HTTP request | Description ------------- | ------------- | ------------- |[```fax_delete```](FaxApi.md#fax_delete) | ```DELETE /fax/{fax_id}``` | Delete Fax| +|[```fax_draft_create```](FaxApi.md#fax_draft_create) | ```POST /fax/draft/create``` | Create Embedded Fax Draft| |[```fax_files```](FaxApi.md#fax_files) | ```GET /fax/files/{fax_id}``` | Download Fax Files| |[```fax_get```](FaxApi.md#fax_get) | ```GET /fax/{fax_id}``` | Get Fax| |[```fax_list```](FaxApi.md#fax_list) | ```GET /fax/list``` | Lists Faxes| @@ -71,6 +72,81 @@ void (empty response body) [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +# ```fax_draft_create``` +> ```FaxDraftCreateResponse fax_draft_create(fax_draft_create_request)``` + +Create Embedded Fax Draft + +Creates an embedded Fax draft and returns a URL that can be opened in an approved iframe for preparation and sending. + +### Example + +* Basic Authentication (api_key): + +```python +from pprint import pprint + +from dropbox_sign import ApiClient, ApiException, Configuration, api, models + +configuration = Configuration( + username="YOUR_API_KEY", +) + +with ApiClient(configuration) as api_client: + editor_options = models.SubEditorPageOptions( + force_upload_page=False, + force_editor_page=True, + force_review_page=True, + ) + fax_draft_create_request = models.FaxDraftCreateRequest( + client_id="b6b8e7deaf8f0b95c029dca049356d4a2cf9710a", + file_urls=[ + "https://www.dropbox.com/s/ad9qnhbrjjn64tu/mutual-NDA-example.pdf?dl=1", + ], + recipients=["+14155552671"], + editor_options=editor_options, + test_mode=True, + ) + + try: + response = api.FaxApi(api_client).fax_draft_create( + fax_draft_create_request=fax_draft_create_request, + ) + + pprint(response) + except ApiException as e: + print("Exception when calling FaxApi#fax_draft_create: %s\n" % e) + +``` +``` + +### Parameters +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| `fax_draft_create_request` | [**FaxDraftCreateRequest**](FaxDraftCreateRequest.md) | | | + +### Return type + +[**FaxDraftCreateResponse**](FaxDraftCreateResponse.md) + +### Authorization + +[api_key](../README.md#api_key) + +### 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) + # ```fax_files``` > ```io.IOBase fax_files(fax_id)``` diff --git a/sdks/python/docs/FaxDraftCreateRequest.md b/sdks/python/docs/FaxDraftCreateRequest.md new file mode 100644 index 000000000..f50603c27 --- /dev/null +++ b/sdks/python/docs/FaxDraftCreateRequest.md @@ -0,0 +1,15 @@ +# FaxDraftCreateRequest + + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +| `client_id`*_required_ | ```str``` | Client ID of the API app that owns the embedded Fax draft. | | +| `files` | ```List[io.IOBase]``` | Use `files[]` to upload the file(s) for the embedded Fax draft.

This endpoint accepts either **files** or **file_urls[]**, but not both. Files can be added later in the embedded flow when neither is provided. | | +| `file_urls` | ```List[str]``` | Use `file_urls[]` to have Dropbox Fax download the file(s) for the embedded Fax draft.

This endpoint accepts either **files** or **file_urls[]**, but not both. Files can be added later in the embedded flow when neither is provided. | | +| `editor_options` | [```SubEditorPageOptions```](SubEditorPageOptions.md) | | | +| `recipients` | ```List[str]``` | Fax numbers to prefill in the embedded flow. Each fax number must be in a supported international format. A maximum of 20 unique fax numbers can be provided. | | +| `test_mode` | ```bool``` | When set to `true`, the completed draft will not send a Fax or consume Fax pages. Defaults to `false`. | [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/FaxDraftCreateResponse.md b/sdks/python/docs/FaxDraftCreateResponse.md new file mode 100644 index 000000000..89ce8486e --- /dev/null +++ b/sdks/python/docs/FaxDraftCreateResponse.md @@ -0,0 +1,11 @@ +# FaxDraftCreateResponse + + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +| `fax_draft`*_required_ | [```FaxDraftResponse```](FaxDraftResponse.md) | | | +| `warnings` | [```List[WarningResponse]```](WarningResponse.md) | A list of warnings. | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/sdks/python/docs/FaxDraftResponse.md b/sdks/python/docs/FaxDraftResponse.md new file mode 100644 index 000000000..9ac237a55 --- /dev/null +++ b/sdks/python/docs/FaxDraftResponse.md @@ -0,0 +1,12 @@ +# FaxDraftResponse + +Contains the embedded Fax draft ID, iframe URL, and expiration timestamp. + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +| `fax_id`*_required_ | ```str``` | ID of the Fax draft. | | +| `url`*_required_ | ```str``` | URL to open in an approved iframe for preparing and sending the Fax. | | +| `expires_at`*_required_ | ```int``` | Unix timestamp indicating when the embedded Fax draft URL expires. | | + +[[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/SubEditorPageOptions.md b/sdks/python/docs/SubEditorPageOptions.md new file mode 100644 index 000000000..c606a4632 --- /dev/null +++ b/sdks/python/docs/SubEditorPageOptions.md @@ -0,0 +1,12 @@ +# SubEditorPageOptions + +Controls which completed pages are shown again when the embedded Fax draft is opened. + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +| `force_upload_page` | ```bool``` | When set to `true`, always shows the upload page, even when files are already attached. Defaults to `false`. | [default to False] | +| `force_editor_page` | ```bool``` | When set to `true`, always shows the editor page, even when the document is already prepared. Defaults to `false`. | [default to False] | +| `force_review_page` | ```bool``` | When set to `true`, always shows the review page, even when recipients and Fax details are already provided. Defaults to `false`. | [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/dropbox_sign/__init__.py b/sdks/python/dropbox_sign/__init__.py index a45398df8..9e983360f 100644 --- a/sdks/python/dropbox_sign/__init__.py +++ b/sdks/python/dropbox_sign/__init__.py @@ -81,6 +81,9 @@ from dropbox_sign.models.event_callback_request_event_metadata import ( EventCallbackRequestEventMetadata, ) +from dropbox_sign.models.fax_draft_create_request import FaxDraftCreateRequest +from dropbox_sign.models.fax_draft_create_response import FaxDraftCreateResponse +from dropbox_sign.models.fax_draft_response import FaxDraftResponse from dropbox_sign.models.fax_get_response import FaxGetResponse from dropbox_sign.models.fax_line_add_user_request import FaxLineAddUserRequest from dropbox_sign.models.fax_line_area_code_get_country_enum import ( @@ -216,6 +219,7 @@ from dropbox_sign.models.sub_cc import SubCC from dropbox_sign.models.sub_custom_field import SubCustomField from dropbox_sign.models.sub_editor_options import SubEditorOptions +from dropbox_sign.models.sub_editor_page_options import SubEditorPageOptions 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 diff --git a/sdks/python/dropbox_sign/api/fax_api.py b/sdks/python/dropbox_sign/api/fax_api.py index abf615a7f..cd8545fb6 100644 --- a/sdks/python/dropbox_sign/api/fax_api.py +++ b/sdks/python/dropbox_sign/api/fax_api.py @@ -20,6 +20,8 @@ from pydantic import Field, StrictBytes, StrictStr from typing import Optional, Tuple, Union from typing_extensions import Annotated +from dropbox_sign.models.fax_draft_create_request import FaxDraftCreateRequest +from dropbox_sign.models.fax_draft_create_response import FaxDraftCreateResponse from dropbox_sign.models.fax_get_response import FaxGetResponse from dropbox_sign.models.fax_list_response import FaxListResponse from dropbox_sign.models.fax_send_request import FaxSendRequest @@ -287,6 +289,283 @@ def _fax_delete_serialize( _request_auth=_request_auth, ) + @validate_call + def fax_draft_create( + self, + fax_draft_create_request: FaxDraftCreateRequest, + _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, + ) -> FaxDraftCreateResponse: + """Create Embedded Fax Draft + + Creates an embedded Fax draft and returns a URL that can be opened in an approved iframe for preparation and sending. + + :param fax_draft_create_request: (required) + :type fax_draft_create_request: FaxDraftCreateRequest + :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._fax_draft_create_serialize( + fax_draft_create_request=fax_draft_create_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "FaxDraftCreateResponse", + "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 fax_draft_create_with_http_info( + self, + fax_draft_create_request: FaxDraftCreateRequest, + _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[FaxDraftCreateResponse]: + """Create Embedded Fax Draft + + Creates an embedded Fax draft and returns a URL that can be opened in an approved iframe for preparation and sending. + + :param fax_draft_create_request: (required) + :type fax_draft_create_request: FaxDraftCreateRequest + :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._fax_draft_create_serialize( + fax_draft_create_request=fax_draft_create_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "FaxDraftCreateResponse", + "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 fax_draft_create_without_preload_content( + self, + fax_draft_create_request: FaxDraftCreateRequest, + _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: + """Create Embedded Fax Draft + + Creates an embedded Fax draft and returns a URL that can be opened in an approved iframe for preparation and sending. + + :param fax_draft_create_request: (required) + :type fax_draft_create_request: FaxDraftCreateRequest + :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._fax_draft_create_serialize( + fax_draft_create_request=fax_draft_create_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "FaxDraftCreateResponse", + "4XX": "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + return response_data.response + + def _fax_draft_create_serialize( + self, + fax_draft_create_request, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = {} + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + has_files = False + body_param = fax_draft_create_request + excluded_json_fields = set([]) + for param_name, param_type in body_param.openapi_types().items(): + param_value = getattr(body_param, param_name) + if param_value is None: + continue + + if "io.IOBase" in param_type: + has_files = True + _content_type = "multipart/form-data" + excluded_json_fields.add(param_name) + + if isinstance(param_value, list): + for index, item in enumerate(param_value): + _files[f"{param_name}[{index}]"] = item + else: + _files[param_name] = param_value + + if has_files is True: + _form_params = body_param.to_json_form_params(excluded_json_fields) + + # process the path parameters + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if fax_draft_create_request is not None and has_files is False: + _body_params = fax_draft_create_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"] + + return self.api_client.param_serialize( + method="POST", + resource_path="/fax/draft/create", + 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 fax_files( self, diff --git a/sdks/python/dropbox_sign/models/__init__.py b/sdks/python/dropbox_sign/models/__init__.py index 2fd334213..fcaf947a2 100644 --- a/sdks/python/dropbox_sign/models/__init__.py +++ b/sdks/python/dropbox_sign/models/__init__.py @@ -64,6 +64,9 @@ from dropbox_sign.models.event_callback_request_event_metadata import ( EventCallbackRequestEventMetadata, ) +from dropbox_sign.models.fax_draft_create_request import FaxDraftCreateRequest +from dropbox_sign.models.fax_draft_create_response import FaxDraftCreateResponse +from dropbox_sign.models.fax_draft_response import FaxDraftResponse from dropbox_sign.models.fax_get_response import FaxGetResponse from dropbox_sign.models.fax_line_add_user_request import FaxLineAddUserRequest from dropbox_sign.models.fax_line_area_code_get_country_enum import ( @@ -199,6 +202,7 @@ from dropbox_sign.models.sub_cc import SubCC from dropbox_sign.models.sub_custom_field import SubCustomField from dropbox_sign.models.sub_editor_options import SubEditorOptions +from dropbox_sign.models.sub_editor_page_options import SubEditorPageOptions 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 diff --git a/sdks/python/dropbox_sign/models/fax_draft_create_request.py b/sdks/python/dropbox_sign/models/fax_draft_create_request.py new file mode 100644 index 000000000..641e5196c --- /dev/null +++ b/sdks/python/dropbox_sign/models/fax_draft_create_request.py @@ -0,0 +1,177 @@ +# 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, Tuple, Union +from typing_extensions import Annotated +from dropbox_sign.models.sub_editor_page_options import SubEditorPageOptions +from typing import Optional, Set +from typing_extensions import Self +from typing import Tuple, Union +import io +from pydantic import StrictBool + + +class FaxDraftCreateRequest(BaseModel): + """ + FaxDraftCreateRequest + """ # noqa: E501 + + client_id: StrictStr = Field( + description="Client ID of the API app that owns the embedded Fax draft." + ) + files: Optional[ + List[Union[StrictBytes, StrictStr, io.IOBase, Tuple[StrictStr, StrictBytes, io.IOBase]]] + ] = Field( + default=None, + description="Use `files[]` to upload the file(s) for the embedded Fax draft. This endpoint accepts either **files** or **file_urls[]**, but not both. Files can be added later in the embedded flow when neither is provided.", + ) + file_urls: Optional[List[StrictStr]] = Field( + default=None, + description="Use `file_urls[]` to have Dropbox Fax download the file(s) for the embedded Fax draft. This endpoint accepts either **files** or **file_urls[]**, but not both. Files can be added later in the embedded flow when neither is provided.", + ) + editor_options: Optional[SubEditorPageOptions] = None + recipients: Optional[Annotated[List[StrictStr], Field(max_length=20)]] = Field( + default=None, + description="Fax numbers to prefill in the embedded flow. Each fax number must be in a supported international format. A maximum of 20 unique fax numbers can be provided.", + ) + test_mode: Optional[StrictBool] = Field( + default=False, + description="When set to `true`, the completed draft will not send a Fax or consume Fax pages. Defaults to `false`.", + ) + __properties: ClassVar[List[str]] = [ + "client_id", + "files", + "file_urls", + "editor_options", + "recipients", + "test_mode", + ] + + 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 FaxDraftCreateRequest 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 editor_options + if self.editor_options: + _dict["editor_options"] = self.editor_options.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of FaxDraftCreateRequest 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"), + "editor_options": ( + SubEditorPageOptions.from_dict(obj["editor_options"]) + if obj.get("editor_options") is not None + else None + ), + "recipients": obj.get("recipients"), + "test_mode": ( + obj.get("test_mode") if obj.get("test_mode") 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 { + "client_id": "(str,)", + "files": "(List[io.IOBase],)", + "file_urls": "(List[str],)", + "editor_options": "(SubEditorPageOptions,)", + "recipients": "(List[str],)", + "test_mode": "(bool,)", + } + + @classmethod + def openapi_type_is_array(cls, property_name: str) -> bool: + return property_name in [ + "files", + "file_urls", + "recipients", + ] diff --git a/sdks/python/dropbox_sign/models/fax_draft_create_response.py b/sdks/python/dropbox_sign/models/fax_draft_create_response.py new file mode 100644 index 000000000..6f0849b03 --- /dev/null +++ b/sdks/python/dropbox_sign/models/fax_draft_create_response.py @@ -0,0 +1,151 @@ +# coding: utf-8 + +""" +Dropbox Sign API + +Dropbox Sign v3 API + +The version of the OpenAPI document: 3.0.0 +Contact: apisupport@hellosign.com +Generated by OpenAPI Generator (https://openapi-generator.tech) + +Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field +from typing import Any, ClassVar, Dict, List, Optional +from dropbox_sign.models.fax_draft_response import FaxDraftResponse +from dropbox_sign.models.warning_response import WarningResponse +from typing import Optional, Set +from typing_extensions import Self +from typing import Tuple, Union +import io +from pydantic import StrictBool + + +class FaxDraftCreateResponse(BaseModel): + """ + FaxDraftCreateResponse + """ # noqa: E501 + + fax_draft: FaxDraftResponse + warnings: Optional[List[WarningResponse]] = Field( + default=None, description="A list of warnings." + ) + __properties: ClassVar[List[str]] = ["fax_draft", "warnings"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + arbitrary_types_allowed=True, + ) + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + def to_json_form_params( + self, excluded_fields: Set[str] = None + ) -> List[Tuple[str, str]]: + data: List[Tuple[str, str]] = [] + + for key, value in self.to_dict(excluded_fields).items(): + if isinstance(value, (int, str, bool)): + data.append((key, value)) + else: + data.append((key, json.dumps(value, ensure_ascii=False))) + + return data + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of FaxDraftCreateResponse 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 fax_draft + if self.fax_draft: + _dict["fax_draft"] = self.fax_draft.to_dict() + # override the default output from pydantic by calling `to_dict()` of each item in warnings (list) + _items = [] + if self.warnings: + for _item_warnings in self.warnings: + if _item_warnings: + _items.append(_item_warnings.to_dict()) + _dict["warnings"] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of FaxDraftCreateResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate( + { + "fax_draft": ( + FaxDraftResponse.from_dict(obj["fax_draft"]) + if obj.get("fax_draft") is not None + else None + ), + "warnings": ( + [WarningResponse.from_dict(_item) for _item in obj["warnings"]] + if obj.get("warnings") is not None + else None + ), + } + ) + return _obj + + @classmethod + def init(cls, data: Any) -> Self: + """ + Attempt to instantiate and hydrate a new instance of this class + """ + if isinstance(data, str): + data = json.loads(data) + + return cls.from_dict(data) + + @classmethod + def openapi_types(cls) -> Dict[str, str]: + return { + "fax_draft": "(FaxDraftResponse,)", + "warnings": "(List[WarningResponse],)", + } + + @classmethod + def openapi_type_is_array(cls, property_name: str) -> bool: + return property_name in [ + "warnings", + ] diff --git a/sdks/python/dropbox_sign/models/fax_draft_response.py b/sdks/python/dropbox_sign/models/fax_draft_response.py new file mode 100644 index 000000000..fc9ab3535 --- /dev/null +++ b/sdks/python/dropbox_sign/models/fax_draft_response.py @@ -0,0 +1,134 @@ +# coding: utf-8 + +""" +Dropbox Sign API + +Dropbox Sign v3 API + +The version of the OpenAPI document: 3.0.0 +Contact: apisupport@hellosign.com +Generated by OpenAPI Generator (https://openapi-generator.tech) + +Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List +from typing import Optional, Set +from typing_extensions import Self +from typing import Tuple, Union +import io +from pydantic import StrictBool + + +class FaxDraftResponse(BaseModel): + """ + Contains the embedded Fax draft ID, iframe URL, and expiration timestamp. + """ # noqa: E501 + + fax_id: StrictStr = Field(description="ID of the Fax draft.") + url: StrictStr = Field( + description="URL to open in an approved iframe for preparing and sending the Fax." + ) + expires_at: StrictInt = Field( + description="Unix timestamp indicating when the embedded Fax draft URL expires." + ) + __properties: ClassVar[List[str]] = ["fax_id", "url", "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 FaxDraftResponse from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self, excluded_fields: Set[str] = None) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of FaxDraftResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate( + { + "fax_id": obj.get("fax_id"), + "url": obj.get("url"), + "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 { + "fax_id": "(str,)", + "url": "(str,)", + "expires_at": "(int,)", + } + + @classmethod + def openapi_type_is_array(cls, property_name: str) -> bool: + return property_name in [] diff --git a/sdks/python/dropbox_sign/models/sub_editor_page_options.py b/sdks/python/dropbox_sign/models/sub_editor_page_options.py new file mode 100644 index 000000000..c60f3d6e4 --- /dev/null +++ b/sdks/python/dropbox_sign/models/sub_editor_page_options.py @@ -0,0 +1,155 @@ +# coding: utf-8 + +""" +Dropbox Sign API + +Dropbox Sign v3 API + +The version of the OpenAPI document: 3.0.0 +Contact: apisupport@hellosign.com +Generated by OpenAPI Generator (https://openapi-generator.tech) + +Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictBool +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self +from typing import Tuple, Union +import io +from pydantic import StrictBool + + +class SubEditorPageOptions(BaseModel): + """ + Controls which completed pages are shown again when the embedded Fax draft is opened. + """ # noqa: E501 + + force_upload_page: Optional[StrictBool] = Field( + default=False, + description="When set to `true`, always shows the upload page, even when files are already attached. Defaults to `false`.", + ) + force_editor_page: Optional[StrictBool] = Field( + default=False, + description="When set to `true`, always shows the editor page, even when the document is already prepared. Defaults to `false`.", + ) + force_review_page: Optional[StrictBool] = Field( + default=False, + description="When set to `true`, always shows the review page, even when recipients and Fax details are already provided. Defaults to `false`.", + ) + __properties: ClassVar[List[str]] = [ + "force_upload_page", + "force_editor_page", + "force_review_page", + ] + + 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 SubEditorPageOptions from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self, excluded_fields: Set[str] = None) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of SubEditorPageOptions from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate( + { + "force_upload_page": ( + obj.get("force_upload_page") + if obj.get("force_upload_page") is not None + else False + ), + "force_editor_page": ( + obj.get("force_editor_page") + if obj.get("force_editor_page") is not None + else False + ), + "force_review_page": ( + obj.get("force_review_page") + if obj.get("force_review_page") 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 { + "force_upload_page": "(bool,)", + "force_editor_page": "(bool,)", + "force_review_page": "(bool,)", + } + + @classmethod + def openapi_type_is_array(cls, property_name: str) -> bool: + return property_name in [] diff --git a/sdks/ruby/README.md b/sdks/ruby/README.md index 4d11460d2..9a309574f 100644 --- a/sdks/ruby/README.md +++ b/sdks/ruby/README.md @@ -121,6 +121,7 @@ All URIs are relative to *https://api.hellosign.com/v3* |*Dropbox::Sign::EmbeddedApi* | [**embedded_edit_url**](docs/EmbeddedApi.md#embedded_edit_url) | **POST** /embedded/edit_url/{template_id} | Get Embedded Template Edit URL | |*Dropbox::Sign::EmbeddedApi* | [**embedded_sign_url**](docs/EmbeddedApi.md#embedded_sign_url) | **GET** /embedded/sign_url/{signature_id} | Get Embedded Sign URL | |*Dropbox::Sign::FaxApi* | [**fax_delete**](docs/FaxApi.md#fax_delete) | **DELETE** /fax/{fax_id} | Delete Fax | +|*Dropbox::Sign::FaxApi* | [**fax_draft_create**](docs/FaxApi.md#fax_draft_create) | **POST** /fax/draft/create | Create Embedded Fax Draft | |*Dropbox::Sign::FaxApi* | [**fax_files**](docs/FaxApi.md#fax_files) | **GET** /fax/files/{fax_id} | Download Fax Files | |*Dropbox::Sign::FaxApi* | [**fax_get**](docs/FaxApi.md#fax_get) | **GET** /fax/{fax_id} | Get Fax | |*Dropbox::Sign::FaxApi* | [**fax_list**](docs/FaxApi.md#fax_list) | **GET** /fax/list | Lists Faxes | @@ -219,6 +220,9 @@ All URIs are relative to *https://api.hellosign.com/v3* - [Dropbox::Sign::EventCallbackRequest](docs/EventCallbackRequest.md) - [Dropbox::Sign::EventCallbackRequestEvent](docs/EventCallbackRequestEvent.md) - [Dropbox::Sign::EventCallbackRequestEventMetadata](docs/EventCallbackRequestEventMetadata.md) + - [Dropbox::Sign::FaxDraftCreateRequest](docs/FaxDraftCreateRequest.md) + - [Dropbox::Sign::FaxDraftCreateResponse](docs/FaxDraftCreateResponse.md) + - [Dropbox::Sign::FaxDraftResponse](docs/FaxDraftResponse.md) - [Dropbox::Sign::FaxGetResponse](docs/FaxGetResponse.md) - [Dropbox::Sign::FaxLineAddUserRequest](docs/FaxLineAddUserRequest.md) - [Dropbox::Sign::FaxLineAreaCodeGetCountryEnum](docs/FaxLineAreaCodeGetCountryEnum.md) @@ -282,6 +286,7 @@ All URIs are relative to *https://api.hellosign.com/v3* - [Dropbox::Sign::SubCC](docs/SubCC.md) - [Dropbox::Sign::SubCustomField](docs/SubCustomField.md) - [Dropbox::Sign::SubEditorOptions](docs/SubEditorOptions.md) + - [Dropbox::Sign::SubEditorPageOptions](docs/SubEditorPageOptions.md) - [Dropbox::Sign::SubFieldOptions](docs/SubFieldOptions.md) - [Dropbox::Sign::SubFormFieldGroup](docs/SubFormFieldGroup.md) - [Dropbox::Sign::SubFormFieldRule](docs/SubFormFieldRule.md) diff --git a/sdks/ruby/docs/FaxApi.md b/sdks/ruby/docs/FaxApi.md index 310c9a34b..a5151fd0f 100644 --- a/sdks/ruby/docs/FaxApi.md +++ b/sdks/ruby/docs/FaxApi.md @@ -5,6 +5,7 @@ All URIs are relative to *https://api.hellosign.com/v3* | Method | HTTP request | Description | | ------ | ------------ | ----------- | | [`fax_delete`](FaxApi.md#fax_delete) | **DELETE** `/fax/{fax_id}` | Delete Fax | +| [`fax_draft_create`](FaxApi.md#fax_draft_create) | **POST** `/fax/draft/create` | Create Embedded Fax Draft | | [`fax_files`](FaxApi.md#fax_files) | **GET** `/fax/files/{fax_id}` | Download Fax Files | | [`fax_get`](FaxApi.md#fax_get) | **GET** `/fax/{fax_id}` | Get Fax | | [`fax_list`](FaxApi.md#fax_list) | **GET** `/fax/list` | Lists Faxes | @@ -77,6 +78,88 @@ nil (empty response body) - **Accept**: application/json +## `fax_draft_create` + +> ` fax_draft_create(fax_draft_create_request)` + +Create Embedded Fax Draft + +Creates an embedded Fax draft and returns a URL that can be opened in an approved iframe for preparation and sending. + +### Examples + +```ruby +require "json" +require "dropbox-sign" + +Dropbox::Sign.configure do |config| + config.username = "YOUR_API_KEY" +end + +editor_options = Dropbox::Sign::SubEditorPageOptions.new +editor_options.force_upload_page = false +editor_options.force_editor_page = true +editor_options.force_review_page = true + +fax_draft_create_request = Dropbox::Sign::FaxDraftCreateRequest.new +fax_draft_create_request.client_id = "b6b8e7deaf8f0b95c029dca049356d4a2cf9710a" +fax_draft_create_request.file_urls = [ + "https://www.dropbox.com/s/ad9qnhbrjjn64tu/mutual-NDA-example.pdf?dl=1", +] +fax_draft_create_request.recipients = ["+14155552671"] +fax_draft_create_request.editor_options = editor_options +fax_draft_create_request.test_mode = true + +begin + response = Dropbox::Sign::FaxApi.new.fax_draft_create( + fax_draft_create_request, + ) + + p response +rescue Dropbox::Sign::ApiError => e + puts "Exception when calling FaxApi#fax_draft_create: #{e}" +end + +``` + +#### Using the `fax_draft_create_with_http_info` variant + +This returns an Array which contains the response data, status code and headers. + +> `, Integer, Hash)> fax_draft_create_with_http_info(fax_draft_create_request)` + +```ruby +begin + # Create Embedded Fax Draft + data, status_code, headers = api_instance.fax_draft_create_with_http_info(fax_draft_create_request) + p status_code # => 2xx + p headers # => { ... } + p data # => +rescue Dropbox::Sign::ApiError => e + puts "Error when calling FaxApi->fax_draft_create_with_http_info: #{e}" +end +``` + +### Parameters + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| `fax_draft_create_request` | [**FaxDraftCreateRequest**](FaxDraftCreateRequest.md) | | | + +### Return type + +[**FaxDraftCreateResponse**](FaxDraftCreateResponse.md) + +### Authorization + +[api_key](../README.md#api_key) + +### HTTP request headers + +- **Content-Type**: application/json, multipart/form-data +- **Accept**: application/json + + ## `fax_files` > `File fax_files(fax_id)` diff --git a/sdks/ruby/docs/FaxDraftCreateRequest.md b/sdks/ruby/docs/FaxDraftCreateRequest.md new file mode 100644 index 000000000..23e23a3d1 --- /dev/null +++ b/sdks/ruby/docs/FaxDraftCreateRequest.md @@ -0,0 +1,14 @@ +# Dropbox::Sign::FaxDraftCreateRequest + + + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| `client_id`*_required_ | ```String``` | Client ID of the API app that owns the embedded Fax draft. | | +| `files` | ```Array``` | Use `files[]` to upload the file(s) for the embedded Fax draft.

This endpoint accepts either **files** or **file_urls[]**, but not both. Files can be added later in the embedded flow when neither is provided. | | +| `file_urls` | ```Array``` | Use `file_urls[]` to have Dropbox Fax download the file(s) for the embedded Fax draft.

This endpoint accepts either **files** or **file_urls[]**, but not both. Files can be added later in the embedded flow when neither is provided. | | +| `editor_options` | [```SubEditorPageOptions```](SubEditorPageOptions.md) | | | +| `recipients` | ```Array``` | Fax numbers to prefill in the embedded flow. Each fax number must be in a supported international format. A maximum of 20 unique fax numbers can be provided. | | +| `test_mode` | ```Boolean``` | When set to `true`, the completed draft will not send a Fax or consume Fax pages. Defaults to `false`. | [default to false] | diff --git a/sdks/ruby/docs/FaxDraftCreateResponse.md b/sdks/ruby/docs/FaxDraftCreateResponse.md new file mode 100644 index 000000000..8b1c843cd --- /dev/null +++ b/sdks/ruby/docs/FaxDraftCreateResponse.md @@ -0,0 +1,10 @@ +# Dropbox::Sign::FaxDraftCreateResponse + + + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| `fax_draft`*_required_ | [```FaxDraftResponse```](FaxDraftResponse.md) | | | +| `warnings` | [```Array```](WarningResponse.md) | A list of warnings. | | diff --git a/sdks/ruby/docs/FaxDraftResponse.md b/sdks/ruby/docs/FaxDraftResponse.md new file mode 100644 index 000000000..ffe442e33 --- /dev/null +++ b/sdks/ruby/docs/FaxDraftResponse.md @@ -0,0 +1,11 @@ +# Dropbox::Sign::FaxDraftResponse + +Contains the embedded Fax draft ID, iframe URL, and expiration timestamp. + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| `fax_id`*_required_ | ```String``` | ID of the Fax draft. | | +| `url`*_required_ | ```String``` | URL to open in an approved iframe for preparing and sending the Fax. | | +| `expires_at`*_required_ | ```Integer``` | Unix timestamp indicating when the embedded Fax draft URL expires. | | diff --git a/sdks/ruby/docs/SubEditorPageOptions.md b/sdks/ruby/docs/SubEditorPageOptions.md new file mode 100644 index 000000000..eca47f7d8 --- /dev/null +++ b/sdks/ruby/docs/SubEditorPageOptions.md @@ -0,0 +1,11 @@ +# Dropbox::Sign::SubEditorPageOptions + +Controls which completed pages are shown again when the embedded Fax draft is opened. + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| `force_upload_page` | ```Boolean``` | When set to `true`, always shows the upload page, even when files are already attached. Defaults to `false`. | [default to false] | +| `force_editor_page` | ```Boolean``` | When set to `true`, always shows the editor page, even when the document is already prepared. Defaults to `false`. | [default to false] | +| `force_review_page` | ```Boolean``` | When set to `true`, always shows the review page, even when recipients and Fax details are already provided. Defaults to `false`. | [default to false] | diff --git a/sdks/ruby/lib/dropbox-sign.rb b/sdks/ruby/lib/dropbox-sign.rb index e85d1d545..04abc47d6 100644 --- a/sdks/ruby/lib/dropbox-sign.rb +++ b/sdks/ruby/lib/dropbox-sign.rb @@ -52,6 +52,9 @@ require 'dropbox-sign/models/event_callback_request' require 'dropbox-sign/models/event_callback_request_event' require 'dropbox-sign/models/event_callback_request_event_metadata' +require 'dropbox-sign/models/fax_draft_create_request' +require 'dropbox-sign/models/fax_draft_create_response' +require 'dropbox-sign/models/fax_draft_response' require 'dropbox-sign/models/fax_get_response' require 'dropbox-sign/models/fax_line_add_user_request' require 'dropbox-sign/models/fax_line_area_code_get_country_enum' @@ -104,6 +107,7 @@ require 'dropbox-sign/models/sub_cc' require 'dropbox-sign/models/sub_custom_field' require 'dropbox-sign/models/sub_editor_options' +require 'dropbox-sign/models/sub_editor_page_options' require 'dropbox-sign/models/sub_field_options' require 'dropbox-sign/models/sub_form_field_group' require 'dropbox-sign/models/sub_form_field_rule' diff --git a/sdks/ruby/lib/dropbox-sign/api/fax_api.rb b/sdks/ruby/lib/dropbox-sign/api/fax_api.rb index f4cfda3a6..131be1843 100644 --- a/sdks/ruby/lib/dropbox-sign/api/fax_api.rb +++ b/sdks/ruby/lib/dropbox-sign/api/fax_api.rb @@ -90,6 +90,116 @@ def fax_delete_with_http_info(fax_id, opts = {}) return data, status_code, headers end + # Create Embedded Fax Draft + # Creates an embedded Fax draft and returns a URL that can be opened in an approved iframe for preparation and sending. + # @param fax_draft_create_request [FaxDraftCreateRequest] + # @param [Hash] opts the optional parameters + # @return [FaxDraftCreateResponse] + def fax_draft_create(fax_draft_create_request, opts = {}) + data, _status_code, _headers = fax_draft_create_with_http_info(fax_draft_create_request, opts) + data + end + + # Create Embedded Fax Draft + # Creates an embedded Fax draft and returns a URL that can be opened in an approved iframe for preparation and sending. + # @param fax_draft_create_request [FaxDraftCreateRequest] + # @param [Hash] opts the optional parameters + # @return [Array<(FaxDraftCreateResponse, Integer, Hash)>] FaxDraftCreateResponse data, response status code and response headers + def fax_draft_create_with_http_info(fax_draft_create_request, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: FaxApi.fax_draft_create ...' + end + # verify the required parameter 'fax_draft_create_request' is set + if @api_client.config.client_side_validation && fax_draft_create_request.nil? + fail ArgumentError, "Missing the required parameter 'fax_draft_create_request' when calling FaxApi.fax_draft_create" + end + # resource path + local_var_path = '/fax/draft/create' + + # 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( + fax_draft_create_request, + Dropbox::Sign::FaxDraftCreateRequest.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] || 'FaxDraftCreateResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || ['api_key'] + + new_options = opts.merge( + :operation => :"FaxApi.fax_draft_create", + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + begin + data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) + rescue Dropbox::Sign::ApiError => e + if e.code === 200 + body = @api_client.convert_to_type( + JSON.parse("[#{e.response_body}]", :symbolize_names => true)[0], + "Dropbox::Sign::FaxDraftCreateResponse" + ) + + fail ApiError.new(:code => e.code, + :response_headers => e.response_headers, + :response_body => body), + e.message + end + + range_code = "4XX".split('').first + range_code_left = "#{range_code}00".to_i + range_code_right = "#{range_code}99".to_i + if e.code && e.code >= range_code_left && e.code <= range_code_right + body = @api_client.convert_to_type( + JSON.parse("[#{e.response_body}]", :symbolize_names => true)[0], + "Dropbox::Sign::ErrorResponse" + ) + + fail ApiError.new(:code => e.code, + :response_headers => e.response_headers, + :response_body => body), + e.message + end + + raise e + end + + if @api_client.config.debugging + @api_client.config.logger.debug "API called: FaxApi#fax_draft_create\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + # Download Fax Files # Downloads files associated with a Fax # @param fax_id [String] Fax ID diff --git a/sdks/ruby/lib/dropbox-sign/models/fax_draft_create_request.rb b/sdks/ruby/lib/dropbox-sign/models/fax_draft_create_request.rb new file mode 100644 index 000000000..4a1f8783d --- /dev/null +++ b/sdks/ruby/lib/dropbox-sign/models/fax_draft_create_request.rb @@ -0,0 +1,344 @@ +=begin +#Dropbox Sign API + +#Dropbox Sign v3 API + +The version of the OpenAPI document: 3.0.0 +Contact: apisupport@hellosign.com +Generated by: https://openapi-generator.tech +Generator version: 7.12.0 + +=end + +require 'date' +require 'time' + +module Dropbox +end + +module Dropbox::Sign + class FaxDraftCreateRequest + # Client ID of the API app that owns the embedded Fax draft. + # @return [String] + attr_accessor :client_id + + # Use `files[]` to upload the file(s) for the embedded Fax draft. This endpoint accepts either **files** or **file_urls[]**, but not both. Files can be added later in the embedded flow when neither is provided. + # @return [Array] + attr_accessor :files + + # Use `file_urls[]` to have Dropbox Fax download the file(s) for the embedded Fax draft. This endpoint accepts either **files** or **file_urls[]**, but not both. Files can be added later in the embedded flow when neither is provided. + # @return [Array] + attr_accessor :file_urls + + # @return [SubEditorPageOptions] + attr_accessor :editor_options + + # Fax numbers to prefill in the embedded flow. Each fax number must be in a supported international format. A maximum of 20 unique fax numbers can be provided. + # @return [Array] + attr_accessor :recipients + + # When set to `true`, the completed draft will not send a Fax or consume Fax pages. Defaults to `false`. + # @return [Boolean] + attr_accessor :test_mode + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'client_id' => :'client_id', + :'files' => :'files', + :'file_urls' => :'file_urls', + :'editor_options' => :'editor_options', + :'recipients' => :'recipients', + :'test_mode' => :'test_mode' + } + end + + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + acceptable_attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'client_id' => :'String', + :'files' => :'Array', + :'file_urls' => :'Array', + :'editor_options' => :'SubEditorPageOptions', + :'recipients' => :'Array', + :'test_mode' => :'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 [FaxDraftCreateRequest] + def self.init(data) + ApiClient.default.convert_to_type( + data, + "FaxDraftCreateRequest" + ) || FaxDraftCreateRequest.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::FaxDraftCreateRequest` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.merged_attributes.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `Dropbox::Sign::FaxDraftCreateRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'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?(:'editor_options') + self.editor_options = attributes[:'editor_options'] + end + + if attributes.key?(:'recipients') + if (value = attributes[:'recipients']).is_a?(Array) + self.recipients = value + end + end + + if attributes.key?(:'test_mode') + self.test_mode = attributes[:'test_mode'] + else + self.test_mode = 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 @client_id.nil? + invalid_properties.push('invalid value for "client_id", client_id cannot be nil.') + end + + if !@recipients.nil? && @recipients.length > 20 + invalid_properties.push('invalid value for "recipients", number of items must be less than or equal to 20.') + 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 !@recipients.nil? && @recipients.length > 20 + true + end + + # Custom attribute writer method with validation + # @param [Object] client_id Value to be assigned + def client_id=(client_id) + if client_id.nil? + fail ArgumentError, 'client_id cannot be nil' + end + + @client_id = client_id + end + + # Custom attribute writer method with validation + # @param [Object] recipients Value to be assigned + def recipients=(recipients) + if recipients.length > 20 + fail ArgumentError, 'invalid value for "recipients", number of items must be less than or equal to 20.' + end + + @recipients = recipients + 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 && + editor_options == o.editor_options && + recipients == o.recipients && + test_mode == o.test_mode + 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, editor_options, recipients, test_mode].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attribute_map = self.class.merged_attributes + + self.class.merged_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[attribute_map[key]])) + end + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + klass = Dropbox::Sign.const_get(type) + klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash(include_nil = true) + hash = {} + self.class.merged_attributes.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + next unless include_nil + is_nullable = self.class.merged_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value, include_nil) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value, include_nil = true) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v, include_nil) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v, include_nil) } + end + elsif value.respond_to? :to_hash + value.to_hash(include_nil) + else + value + end + end + end +end diff --git a/sdks/ruby/lib/dropbox-sign/models/fax_draft_create_response.rb b/sdks/ruby/lib/dropbox-sign/models/fax_draft_create_response.rb new file mode 100644 index 000000000..9a7abca70 --- /dev/null +++ b/sdks/ruby/lib/dropbox-sign/models/fax_draft_create_response.rb @@ -0,0 +1,279 @@ +=begin +#Dropbox Sign API + +#Dropbox Sign v3 API + +The version of the OpenAPI document: 3.0.0 +Contact: apisupport@hellosign.com +Generated by: https://openapi-generator.tech +Generator version: 7.12.0 + +=end + +require 'date' +require 'time' + +module Dropbox +end + +module Dropbox::Sign + class FaxDraftCreateResponse + # @return [FaxDraftResponse] + attr_accessor :fax_draft + + # A list of warnings. + # @return [Array] + attr_accessor :warnings + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'fax_draft' => :'fax_draft', + :'warnings' => :'warnings' + } + end + + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + acceptable_attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'fax_draft' => :'FaxDraftResponse', + :'warnings' => :'Array' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Returns attribute map of this model + parent + def self.merged_attributes + self.attribute_map + end + + # Attribute type mapping of this model + parent + def self.merged_types + self.openapi_types + end + + # Returns list of attributes with nullable: true of this model + parent + def self.merged_nullable + self.openapi_nullable + end + + # Attempt to instantiate and hydrate a new instance of this class + # @param [Object] data Data to be converted + # @return [FaxDraftCreateResponse] + def self.init(data) + ApiClient.default.convert_to_type( + data, + "FaxDraftCreateResponse" + ) || FaxDraftCreateResponse.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::FaxDraftCreateResponse` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.merged_attributes.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `Dropbox::Sign::FaxDraftCreateResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'fax_draft') + self.fax_draft = attributes[:'fax_draft'] + end + + if attributes.key?(:'warnings') + if (value = attributes[:'warnings']).is_a?(Array) + self.warnings = value + end + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + if @fax_draft.nil? + invalid_properties.push('invalid value for "fax_draft", fax_draft cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + return false if @fax_draft.nil? + true + end + + # Custom attribute writer method with validation + # @param [Object] fax_draft Value to be assigned + def fax_draft=(fax_draft) + if fax_draft.nil? + fail ArgumentError, 'fax_draft cannot be nil' + end + + @fax_draft = fax_draft + 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 && + fax_draft == o.fax_draft && + warnings == o.warnings + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [fax_draft, warnings].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attribute_map = self.class.merged_attributes + + self.class.merged_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[attribute_map[key]])) + end + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + klass = Dropbox::Sign.const_get(type) + klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash(include_nil = true) + hash = {} + self.class.merged_attributes.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + next unless include_nil + is_nullable = self.class.merged_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value, include_nil) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value, include_nil = true) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v, include_nil) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v, include_nil) } + end + elsif value.respond_to? :to_hash + value.to_hash(include_nil) + else + value + end + end + end +end diff --git a/sdks/ruby/lib/dropbox-sign/models/fax_draft_response.rb b/sdks/ruby/lib/dropbox-sign/models/fax_draft_response.rb new file mode 100644 index 000000000..0833caead --- /dev/null +++ b/sdks/ruby/lib/dropbox-sign/models/fax_draft_response.rb @@ -0,0 +1,320 @@ +=begin +#Dropbox Sign API + +#Dropbox Sign v3 API + +The version of the OpenAPI document: 3.0.0 +Contact: apisupport@hellosign.com +Generated by: https://openapi-generator.tech +Generator version: 7.12.0 + +=end + +require 'date' +require 'time' + +module Dropbox +end + +module Dropbox::Sign + # Contains the embedded Fax draft ID, iframe URL, and expiration timestamp. + class FaxDraftResponse + # ID of the Fax draft. + # @return [String] + attr_accessor :fax_id + + # URL to open in an approved iframe for preparing and sending the Fax. + # @return [String] + attr_accessor :url + + # Unix timestamp indicating when the embedded Fax draft URL expires. + # @return [Integer] + attr_accessor :expires_at + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'fax_id' => :'fax_id', + :'url' => :'url', + :'expires_at' => :'expires_at' + } + end + + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + acceptable_attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'fax_id' => :'String', + :'url' => :'String', + :'expires_at' => :'Integer' + } + 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 [FaxDraftResponse] + def self.init(data) + ApiClient.default.convert_to_type( + data, + "FaxDraftResponse" + ) || FaxDraftResponse.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::FaxDraftResponse` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.merged_attributes.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `Dropbox::Sign::FaxDraftResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'fax_id') + self.fax_id = attributes[:'fax_id'] + end + + if attributes.key?(:'url') + self.url = attributes[:'url'] + 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 @fax_id.nil? + invalid_properties.push('invalid value for "fax_id", fax_id cannot be nil.') + end + + if @url.nil? + invalid_properties.push('invalid value for "url", url cannot be nil.') + end + + if @expires_at.nil? + invalid_properties.push('invalid value for "expires_at", expires_at cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + return false if @fax_id.nil? + return false if @url.nil? + return false if @expires_at.nil? + true + end + + # Custom attribute writer method with validation + # @param [Object] fax_id Value to be assigned + def fax_id=(fax_id) + if fax_id.nil? + fail ArgumentError, 'fax_id cannot be nil' + end + + @fax_id = fax_id + end + + # Custom attribute writer method with validation + # @param [Object] url Value to be assigned + def url=(url) + if url.nil? + fail ArgumentError, 'url cannot be nil' + end + + @url = url + end + + # Custom attribute writer method with validation + # @param [Object] expires_at Value to be assigned + def expires_at=(expires_at) + if expires_at.nil? + fail ArgumentError, 'expires_at cannot be nil' + end + + @expires_at = expires_at + 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 && + fax_id == o.fax_id && + url == o.url && + 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 + [fax_id, url, 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/sub_editor_page_options.rb b/sdks/ruby/lib/dropbox-sign/models/sub_editor_page_options.rb new file mode 100644 index 000000000..4c4ee643c --- /dev/null +++ b/sdks/ruby/lib/dropbox-sign/models/sub_editor_page_options.rb @@ -0,0 +1,281 @@ +=begin +#Dropbox Sign API + +#Dropbox Sign v3 API + +The version of the OpenAPI document: 3.0.0 +Contact: apisupport@hellosign.com +Generated by: https://openapi-generator.tech +Generator version: 7.12.0 + +=end + +require 'date' +require 'time' + +module Dropbox +end + +module Dropbox::Sign + # Controls which completed pages are shown again when the embedded Fax draft is opened. + class SubEditorPageOptions + # When set to `true`, always shows the upload page, even when files are already attached. Defaults to `false`. + # @return [Boolean] + attr_accessor :force_upload_page + + # When set to `true`, always shows the editor page, even when the document is already prepared. Defaults to `false`. + # @return [Boolean] + attr_accessor :force_editor_page + + # When set to `true`, always shows the review page, even when recipients and Fax details are already provided. Defaults to `false`. + # @return [Boolean] + attr_accessor :force_review_page + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'force_upload_page' => :'force_upload_page', + :'force_editor_page' => :'force_editor_page', + :'force_review_page' => :'force_review_page' + } + end + + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + acceptable_attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'force_upload_page' => :'Boolean', + :'force_editor_page' => :'Boolean', + :'force_review_page' => :'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 [SubEditorPageOptions] + def self.init(data) + ApiClient.default.convert_to_type( + data, + "SubEditorPageOptions" + ) || SubEditorPageOptions.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::SubEditorPageOptions` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.merged_attributes.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `Dropbox::Sign::SubEditorPageOptions`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'force_upload_page') + self.force_upload_page = attributes[:'force_upload_page'] + else + self.force_upload_page = false + end + + if attributes.key?(:'force_editor_page') + self.force_editor_page = attributes[:'force_editor_page'] + else + self.force_editor_page = false + end + + if attributes.key?(:'force_review_page') + self.force_review_page = attributes[:'force_review_page'] + else + self.force_review_page = 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 + 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? + true + 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 && + force_upload_page == o.force_upload_page && + force_editor_page == o.force_editor_page && + force_review_page == o.force_review_page + 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 + [force_upload_page, force_editor_page, force_review_page].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/translations/en.yaml b/translations/en.yaml index c35b7c60b..43eebe5b9 100644 --- a/translations/en.yaml +++ b/translations/en.yaml @@ -163,6 +163,28 @@ "FaxSend::COVER_PAGE_FROM": Fax cover page sender information "FaxSend::COVER_PAGE_MESSAGE": Fax Cover Page Message "FaxSend::TITLE": Fax Title +"FaxDraftCreate::SUMMARY": Create Embedded Fax Draft +"FaxDraftCreate::DESCRIPTION": Creates an embedded Fax draft and returns a URL that can be opened in an approved iframe for preparation and sending. +"FaxDraftCreate::FILES": |- + Use `files[]` to upload the file(s) for the embedded Fax draft. + + This endpoint accepts either **files** or **file_urls[]**, but not both. Files can be added later in the embedded flow when neither is provided. +"FaxDraftCreate::FILE_URLS": |- + Use `file_urls[]` to have Dropbox Fax download the file(s) for the embedded Fax draft. + + This endpoint accepts either **files** or **file_urls[]**, but not both. Files can be added later in the embedded flow when neither is provided. +"FaxDraftCreate::CLIENT_ID": Client ID of the API app that owns the embedded Fax draft. +"FaxDraftCreate::RECIPIENTS": Fax numbers to prefill in the embedded flow. Each fax number must be in a supported international format. A maximum of 20 unique fax numbers can be provided. +"FaxDraftCreate::TEST_MODE": When set to `true`, the completed draft will not send a Fax or consume Fax pages. Defaults to `false`. +"Sub::EditorPageOptions::DESCRIPTION": Controls which completed pages are shown again when the embedded Fax draft is opened. +"Sub::EditorPageOptions::FORCE_UPLOAD_PAGE": When set to `true`, always shows the upload page, even when files are already attached. Defaults to `false`. +"Sub::EditorPageOptions::FORCE_EDITOR_PAGE": When set to `true`, always shows the editor page, even when the document is already prepared. Defaults to `false`. +"Sub::EditorPageOptions::FORCE_REVIEW_PAGE": When set to `true`, always shows the review page, even when recipients and Fax details are already provided. Defaults to `false`. +"FaxDraftCreateResponseExample::SUMMARY": Embedded Fax Draft Response +"FaxDraftResponse::DESCRIPTION": Contains the embedded Fax draft ID, iframe URL, and expiration timestamp. +"FaxDraftResponse::FAX_ID": ID of the Fax draft. +"FaxDraftResponse::URL": URL to open in an approved iframe for preparing and sending the Fax. +"FaxDraftResponse::EXPIRES_AT": Unix timestamp indicating when the embedded Fax draft URL expires. "FaxGetResponseExample::SUMMARY": Fax Response "FaxResponse::FAX_ID": Fax ID "FaxResponse::TITLE": Fax Title @@ -1877,6 +1899,8 @@ "FaxList::SEO::DESCRIPTION": "The Dropbox Fax API allows you to build custom integrations. To find out how to list your faxes, click here." "FaxSend::SEO::TITLE": "Send Fax | API Documentation | Dropbox Fax for Developers" "FaxSend::SEO::DESCRIPTION": "The Dropbox Fax API allows you to build custom integrations. To find out how to send a fax, click here." +"FaxDraftCreate::SEO::TITLE": "Create Embedded Fax Draft | API Documentation | Dropbox Fax for Developers" +"FaxDraftCreate::SEO::DESCRIPTION": "Create an embedded Fax draft, then prepare and send it from an approved iframe in your application." "FaxLineAddUser::SEO::TITLE": "Fax Line Add User | API Documentation | Dropbox Fax for Developers" "FaxLineAddUser::SEO::DESCRIPTION": "The Dropbox Fax API allows you to build custom integrations. To find out how to add a user to an existing fax line, click here." "FaxLineAreaCodeGet::SEO::TITLE": "Fax Line Get Area Codes | API Documentation | Dropbox Fax for Developers" From 6b1f56a6e5c19f660710473a04a202d9f14723b3 Mon Sep 17 00:00:00 2001 From: Brian Erkkinen Date: Thu, 27 Aug 2026 16:22:06 -0400 Subject: [PATCH 2/3] Regenerate SDKs for embedded fax API --- sdks/dotnet/docs/FaxDraftCreateRequest.md | 1 + sdks/dotnet/docs/FaxDraftCreateResponse.md | 3 ++- sdks/dotnet/docs/FaxDraftResponse.md | 3 ++- sdks/dotnet/docs/SubEditorPageOptions.md | 1 + sdks/java-v1/docs/FaxDraftCreateRequest.md | 3 +++ sdks/java-v1/docs/FaxDraftCreateResponse.md | 3 +++ sdks/java-v1/docs/FaxDraftResponse.md | 3 +++ sdks/java-v1/docs/SubEditorPageOptions.md | 3 +++ sdks/java-v2/docs/FaxDraftCreateRequest.md | 3 +++ sdks/java-v2/docs/FaxDraftCreateResponse.md | 3 +++ sdks/java-v2/docs/FaxDraftResponse.md | 3 +++ sdks/java-v2/docs/SubEditorPageOptions.md | 3 +++ sdks/java-v2/src/main/java/com/dropbox/sign/api/FaxApi.java | 4 ++-- .../java/com/dropbox/sign/model/FaxDraftCreateRequest.java | 3 ++- .../java/com/dropbox/sign/model/FaxDraftCreateResponse.java | 3 ++- .../main/java/com/dropbox/sign/model/FaxDraftResponse.java | 3 ++- .../java/com/dropbox/sign/model/SubEditorPageOptions.java | 3 ++- sdks/python/docs/FaxDraftCreateRequest.md | 2 ++ sdks/python/docs/FaxDraftCreateResponse.md | 2 ++ sdks/python/docs/FaxDraftResponse.md | 2 ++ sdks/python/docs/SubEditorPageOptions.md | 2 ++ sdks/ruby/docs/FaxDraftCreateRequest.md | 1 + sdks/ruby/docs/FaxDraftCreateResponse.md | 1 + sdks/ruby/docs/FaxDraftResponse.md | 1 + sdks/ruby/docs/SubEditorPageOptions.md | 1 + sdks/ruby/lib/dropbox-sign/api/fax_api.rb | 4 ++-- 26 files changed, 54 insertions(+), 10 deletions(-) diff --git a/sdks/dotnet/docs/FaxDraftCreateRequest.md b/sdks/dotnet/docs/FaxDraftCreateRequest.md index 20021dccc..636b6dceb 100644 --- a/sdks/dotnet/docs/FaxDraftCreateRequest.md +++ b/sdks/dotnet/docs/FaxDraftCreateRequest.md @@ -7,3 +7,4 @@ Name | Type | Description | Notes **ClientId** | **string** | Client ID of the API app that owns the embedded Fax draft. | **Files** | **List<System.IO.Stream>** | Use `files[]` to upload the file(s) for the embedded Fax draft.

This endpoint accepts either **files** or **file_urls[]**, but not both. Files can be added later in the embedded flow when neither is provided. | [optional] **FileUrls** | **List<string>** | Use `file_urls[]` to have Dropbox Fax download the file(s) for the embedded Fax draft.

This endpoint accepts either **files** or **file_urls[]**, but not both. Files can be added later in the embedded flow when neither is provided. | [optional] **EditorOptions** | [**SubEditorPageOptions**](SubEditorPageOptions.md) | | [optional] **Recipients** | **List<string>** | Fax numbers to prefill in the embedded flow. Each fax number must be in a supported international format. A maximum of 20 unique fax numbers can be provided. | [optional] **TestMode** | **bool** | When set to `true`, the completed draft will not send a Fax or consume Fax pages. Defaults to `false`. | [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/FaxDraftCreateResponse.md b/sdks/dotnet/docs/FaxDraftCreateResponse.md index 2fb318b14..630a0715c 100644 --- a/sdks/dotnet/docs/FaxDraftCreateResponse.md +++ b/sdks/dotnet/docs/FaxDraftCreateResponse.md @@ -4,6 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**FaxDraft** | [**FaxDraftResponse**](FaxDraftResponse.md) | | **Warnings** | [**List<WarningResponse>**](WarningResponse.md) | A list of warnings. | [optional] +**FaxDraft** | [**FaxDraftResponse**](FaxDraftResponse.md) | | **Warnings** | [**List<WarningResponse>**](WarningResponse.md) | A list of warnings. | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/sdks/dotnet/docs/FaxDraftResponse.md b/sdks/dotnet/docs/FaxDraftResponse.md index b4304af45..02a10b5c0 100644 --- a/sdks/dotnet/docs/FaxDraftResponse.md +++ b/sdks/dotnet/docs/FaxDraftResponse.md @@ -5,6 +5,7 @@ Contains the embedded Fax draft ID, iframe URL, and expiration timestamp. Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**FaxId** | **string** | ID of the Fax draft. | **Url** | **string** | URL to open in an approved iframe for preparing and sending the Fax. | **ExpiresAt** | **int** | Unix timestamp indicating when the embedded Fax draft URL expires. | +**FaxId** | **string** | ID of the Fax draft. | **Url** | **string** | URL to open in an approved iframe for preparing and sending the Fax. | **ExpiresAt** | **int** | Unix timestamp indicating when the embedded Fax draft URL expires. | [[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/SubEditorPageOptions.md b/sdks/dotnet/docs/SubEditorPageOptions.md index 73028acbb..888e4167c 100644 --- a/sdks/dotnet/docs/SubEditorPageOptions.md +++ b/sdks/dotnet/docs/SubEditorPageOptions.md @@ -8,3 +8,4 @@ Name | Type | Description | Notes **ForceUploadPage** | **bool** | When set to `true`, always shows the upload page, even when files are already attached. Defaults to `false`. | [optional] [default to false]**ForceEditorPage** | **bool** | When set to `true`, always shows the editor page, even when the document is already prepared. Defaults to `false`. | [optional] [default to false]**ForceReviewPage** | **bool** | When set to `true`, always shows the review page, even when recipients and Fax details are already provided. Defaults to `false`. | [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/java-v1/docs/FaxDraftCreateRequest.md b/sdks/java-v1/docs/FaxDraftCreateRequest.md index e03d715f3..1d58bb9a2 100644 --- a/sdks/java-v1/docs/FaxDraftCreateRequest.md +++ b/sdks/java-v1/docs/FaxDraftCreateRequest.md @@ -14,3 +14,6 @@ | `editorOptions` | [```SubEditorPageOptions```](SubEditorPageOptions.md) | | | | `recipients` | ```Set``` | Fax numbers to prefill in the embedded flow. Each fax number must be in a supported international format. A maximum of 20 unique fax numbers can be provided. | | | `testMode` | ```Boolean``` | When set to `true`, the completed draft will not send a Fax or consume Fax pages. Defaults to `false`. | | + + + diff --git a/sdks/java-v1/docs/FaxDraftCreateResponse.md b/sdks/java-v1/docs/FaxDraftCreateResponse.md index e17134a76..1a5c55458 100644 --- a/sdks/java-v1/docs/FaxDraftCreateResponse.md +++ b/sdks/java-v1/docs/FaxDraftCreateResponse.md @@ -10,3 +10,6 @@ |------------ | ------------- | ------------- | -------------| | `faxDraft`*_required_ | [```FaxDraftResponse```](FaxDraftResponse.md) | | | | `warnings` | [```List```](WarningResponse.md) | A list of warnings. | | + + + diff --git a/sdks/java-v1/docs/FaxDraftResponse.md b/sdks/java-v1/docs/FaxDraftResponse.md index 015faf54f..0e56b7bad 100644 --- a/sdks/java-v1/docs/FaxDraftResponse.md +++ b/sdks/java-v1/docs/FaxDraftResponse.md @@ -11,3 +11,6 @@ Contains the embedded Fax draft ID, iframe URL, and expiration timestamp. | `faxId`*_required_ | ```String``` | ID of the Fax draft. | | | `url`*_required_ | ```String``` | URL to open in an approved iframe for preparing and sending the Fax. | | | `expiresAt`*_required_ | ```Integer``` | Unix timestamp indicating when the embedded Fax draft URL expires. | | + + + diff --git a/sdks/java-v1/docs/SubEditorPageOptions.md b/sdks/java-v1/docs/SubEditorPageOptions.md index 935d8b0db..18161f25c 100644 --- a/sdks/java-v1/docs/SubEditorPageOptions.md +++ b/sdks/java-v1/docs/SubEditorPageOptions.md @@ -11,3 +11,6 @@ Controls which completed pages are shown again when the embedded Fax draft is op | `forceUploadPage` | ```Boolean``` | When set to `true`, always shows the upload page, even when files are already attached. Defaults to `false`. | | | `forceEditorPage` | ```Boolean``` | When set to `true`, always shows the editor page, even when the document is already prepared. Defaults to `false`. | | | `forceReviewPage` | ```Boolean``` | When set to `true`, always shows the review page, even when recipients and Fax details are already provided. Defaults to `false`. | | + + + diff --git a/sdks/java-v2/docs/FaxDraftCreateRequest.md b/sdks/java-v2/docs/FaxDraftCreateRequest.md index e03d715f3..1d58bb9a2 100644 --- a/sdks/java-v2/docs/FaxDraftCreateRequest.md +++ b/sdks/java-v2/docs/FaxDraftCreateRequest.md @@ -14,3 +14,6 @@ | `editorOptions` | [```SubEditorPageOptions```](SubEditorPageOptions.md) | | | | `recipients` | ```Set``` | Fax numbers to prefill in the embedded flow. Each fax number must be in a supported international format. A maximum of 20 unique fax numbers can be provided. | | | `testMode` | ```Boolean``` | When set to `true`, the completed draft will not send a Fax or consume Fax pages. Defaults to `false`. | | + + + diff --git a/sdks/java-v2/docs/FaxDraftCreateResponse.md b/sdks/java-v2/docs/FaxDraftCreateResponse.md index e17134a76..1a5c55458 100644 --- a/sdks/java-v2/docs/FaxDraftCreateResponse.md +++ b/sdks/java-v2/docs/FaxDraftCreateResponse.md @@ -10,3 +10,6 @@ |------------ | ------------- | ------------- | -------------| | `faxDraft`*_required_ | [```FaxDraftResponse```](FaxDraftResponse.md) | | | | `warnings` | [```List```](WarningResponse.md) | A list of warnings. | | + + + diff --git a/sdks/java-v2/docs/FaxDraftResponse.md b/sdks/java-v2/docs/FaxDraftResponse.md index 015faf54f..0e56b7bad 100644 --- a/sdks/java-v2/docs/FaxDraftResponse.md +++ b/sdks/java-v2/docs/FaxDraftResponse.md @@ -11,3 +11,6 @@ Contains the embedded Fax draft ID, iframe URL, and expiration timestamp. | `faxId`*_required_ | ```String``` | ID of the Fax draft. | | | `url`*_required_ | ```String``` | URL to open in an approved iframe for preparing and sending the Fax. | | | `expiresAt`*_required_ | ```Integer``` | Unix timestamp indicating when the embedded Fax draft URL expires. | | + + + diff --git a/sdks/java-v2/docs/SubEditorPageOptions.md b/sdks/java-v2/docs/SubEditorPageOptions.md index 935d8b0db..18161f25c 100644 --- a/sdks/java-v2/docs/SubEditorPageOptions.md +++ b/sdks/java-v2/docs/SubEditorPageOptions.md @@ -11,3 +11,6 @@ Controls which completed pages are shown again when the embedded Fax draft is op | `forceUploadPage` | ```Boolean``` | When set to `true`, always shows the upload page, even when files are already attached. Defaults to `false`. | | | `forceEditorPage` | ```Boolean``` | When set to `true`, always shows the editor page, even when the document is already prepared. Defaults to `false`. | | | `forceReviewPage` | ```Boolean``` | When set to `true`, always shows the review page, even when recipients and Fax details are already provided. Defaults to `false`. | | + + + diff --git a/sdks/java-v2/src/main/java/com/dropbox/sign/api/FaxApi.java b/sdks/java-v2/src/main/java/com/dropbox/sign/api/FaxApi.java index 94cb2e63a..83093f7d1 100644 --- a/sdks/java-v2/src/main/java/com/dropbox/sign/api/FaxApi.java +++ b/sdks/java-v2/src/main/java/com/dropbox/sign/api/FaxApi.java @@ -151,7 +151,7 @@ public FaxDraftCreateResponse faxDraftCreate(FaxDraftCreateRequest faxDraftCreat */ public ApiResponse faxDraftCreateWithHttpInfo(FaxDraftCreateRequest faxDraftCreateRequest) throws ApiException { - + // Check required parameters if (faxDraftCreateRequest == null) { throw new ApiException(400, "Missing the required parameter 'faxDraftCreateRequest' when calling faxDraftCreate"); @@ -488,4 +488,4 @@ public ApiResponse faxSendWithHttpInfo(FaxSendRequest faxSendReq false ); } -} +} \ No newline at end of file diff --git a/sdks/java-v2/src/main/java/com/dropbox/sign/model/FaxDraftCreateRequest.java b/sdks/java-v2/src/main/java/com/dropbox/sign/model/FaxDraftCreateRequest.java index 280063e80..4a0bf78d1 100644 --- a/sdks/java-v2/src/main/java/com/dropbox/sign/model/FaxDraftCreateRequest.java +++ b/sdks/java-v2/src/main/java/com/dropbox/sign/model/FaxDraftCreateRequest.java @@ -74,7 +74,7 @@ public class FaxDraftCreateRequest { @jakarta.annotation.Nullable private Boolean testMode = false; - public FaxDraftCreateRequest() { + public FaxDraftCreateRequest() { } /** @@ -463,3 +463,4 @@ private String toIndentedString(Object o) { } } + diff --git a/sdks/java-v2/src/main/java/com/dropbox/sign/model/FaxDraftCreateResponse.java b/sdks/java-v2/src/main/java/com/dropbox/sign/model/FaxDraftCreateResponse.java index b17a9f032..9c14981c0 100644 --- a/sdks/java-v2/src/main/java/com/dropbox/sign/model/FaxDraftCreateResponse.java +++ b/sdks/java-v2/src/main/java/com/dropbox/sign/model/FaxDraftCreateResponse.java @@ -51,7 +51,7 @@ public class FaxDraftCreateResponse { @jakarta.annotation.Nullable private List warnings = null; - public FaxDraftCreateResponse() { + public FaxDraftCreateResponse() { } /** @@ -239,3 +239,4 @@ private String toIndentedString(Object o) { } } + diff --git a/sdks/java-v2/src/main/java/com/dropbox/sign/model/FaxDraftResponse.java b/sdks/java-v2/src/main/java/com/dropbox/sign/model/FaxDraftResponse.java index eec3fe7d1..0ece9cdff 100644 --- a/sdks/java-v2/src/main/java/com/dropbox/sign/model/FaxDraftResponse.java +++ b/sdks/java-v2/src/main/java/com/dropbox/sign/model/FaxDraftResponse.java @@ -52,7 +52,7 @@ public class FaxDraftResponse { @jakarta.annotation.Nonnull private Integer expiresAt; - public FaxDraftResponse() { + public FaxDraftResponse() { } /** @@ -278,3 +278,4 @@ private String toIndentedString(Object o) { } } + diff --git a/sdks/java-v2/src/main/java/com/dropbox/sign/model/SubEditorPageOptions.java b/sdks/java-v2/src/main/java/com/dropbox/sign/model/SubEditorPageOptions.java index cd03c20df..81d20bfb7 100644 --- a/sdks/java-v2/src/main/java/com/dropbox/sign/model/SubEditorPageOptions.java +++ b/sdks/java-v2/src/main/java/com/dropbox/sign/model/SubEditorPageOptions.java @@ -52,7 +52,7 @@ public class SubEditorPageOptions { @jakarta.annotation.Nullable private Boolean forceReviewPage = false; - public SubEditorPageOptions() { + public SubEditorPageOptions() { } /** @@ -278,3 +278,4 @@ private String toIndentedString(Object o) { } } + diff --git a/sdks/python/docs/FaxDraftCreateRequest.md b/sdks/python/docs/FaxDraftCreateRequest.md index f50603c27..99a41ed58 100644 --- a/sdks/python/docs/FaxDraftCreateRequest.md +++ b/sdks/python/docs/FaxDraftCreateRequest.md @@ -13,3 +13,5 @@ Name | Type | Description | Notes | `test_mode` | ```bool``` | When set to `true`, the completed draft will not send a Fax or consume Fax pages. Defaults to `false`. | [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/FaxDraftCreateResponse.md b/sdks/python/docs/FaxDraftCreateResponse.md index 89ce8486e..b2c94f7a7 100644 --- a/sdks/python/docs/FaxDraftCreateResponse.md +++ b/sdks/python/docs/FaxDraftCreateResponse.md @@ -9,3 +9,5 @@ Name | Type | Description | Notes | `warnings` | [```List[WarningResponse]```](WarningResponse.md) | A list of warnings. | | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/sdks/python/docs/FaxDraftResponse.md b/sdks/python/docs/FaxDraftResponse.md index 9ac237a55..2329ff885 100644 --- a/sdks/python/docs/FaxDraftResponse.md +++ b/sdks/python/docs/FaxDraftResponse.md @@ -10,3 +10,5 @@ Name | Type | Description | Notes | `expires_at`*_required_ | ```int``` | Unix timestamp indicating when the embedded Fax draft URL expires. | | [[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/SubEditorPageOptions.md b/sdks/python/docs/SubEditorPageOptions.md index c606a4632..164980152 100644 --- a/sdks/python/docs/SubEditorPageOptions.md +++ b/sdks/python/docs/SubEditorPageOptions.md @@ -10,3 +10,5 @@ Name | Type | Description | Notes | `force_review_page` | ```bool``` | When set to `true`, always shows the review page, even when recipients and Fax details are already provided. Defaults to `false`. | [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/ruby/docs/FaxDraftCreateRequest.md b/sdks/ruby/docs/FaxDraftCreateRequest.md index 23e23a3d1..7f4202090 100644 --- a/sdks/ruby/docs/FaxDraftCreateRequest.md +++ b/sdks/ruby/docs/FaxDraftCreateRequest.md @@ -12,3 +12,4 @@ | `editor_options` | [```SubEditorPageOptions```](SubEditorPageOptions.md) | | | | `recipients` | ```Array``` | Fax numbers to prefill in the embedded flow. Each fax number must be in a supported international format. A maximum of 20 unique fax numbers can be provided. | | | `test_mode` | ```Boolean``` | When set to `true`, the completed draft will not send a Fax or consume Fax pages. Defaults to `false`. | [default to false] | + diff --git a/sdks/ruby/docs/FaxDraftCreateResponse.md b/sdks/ruby/docs/FaxDraftCreateResponse.md index 8b1c843cd..4099e89f2 100644 --- a/sdks/ruby/docs/FaxDraftCreateResponse.md +++ b/sdks/ruby/docs/FaxDraftCreateResponse.md @@ -8,3 +8,4 @@ | ---- | ---- | ----------- | ----- | | `fax_draft`*_required_ | [```FaxDraftResponse```](FaxDraftResponse.md) | | | | `warnings` | [```Array```](WarningResponse.md) | A list of warnings. | | + diff --git a/sdks/ruby/docs/FaxDraftResponse.md b/sdks/ruby/docs/FaxDraftResponse.md index ffe442e33..72a3c664c 100644 --- a/sdks/ruby/docs/FaxDraftResponse.md +++ b/sdks/ruby/docs/FaxDraftResponse.md @@ -9,3 +9,4 @@ Contains the embedded Fax draft ID, iframe URL, and expiration timestamp. | `fax_id`*_required_ | ```String``` | ID of the Fax draft. | | | `url`*_required_ | ```String``` | URL to open in an approved iframe for preparing and sending the Fax. | | | `expires_at`*_required_ | ```Integer``` | Unix timestamp indicating when the embedded Fax draft URL expires. | | + diff --git a/sdks/ruby/docs/SubEditorPageOptions.md b/sdks/ruby/docs/SubEditorPageOptions.md index eca47f7d8..02a22df81 100644 --- a/sdks/ruby/docs/SubEditorPageOptions.md +++ b/sdks/ruby/docs/SubEditorPageOptions.md @@ -9,3 +9,4 @@ Controls which completed pages are shown again when the embedded Fax draft is op | `force_upload_page` | ```Boolean``` | When set to `true`, always shows the upload page, even when files are already attached. Defaults to `false`. | [default to false] | | `force_editor_page` | ```Boolean``` | When set to `true`, always shows the editor page, even when the document is already prepared. Defaults to `false`. | [default to false] | | `force_review_page` | ```Boolean``` | When set to `true`, always shows the review page, even when recipients and Fax details are already provided. Defaults to `false`. | [default to false] | + diff --git a/sdks/ruby/lib/dropbox-sign/api/fax_api.rb b/sdks/ruby/lib/dropbox-sign/api/fax_api.rb index 131be1843..49d2e7a6b 100644 --- a/sdks/ruby/lib/dropbox-sign/api/fax_api.rb +++ b/sdks/ruby/lib/dropbox-sign/api/fax_api.rb @@ -92,7 +92,7 @@ def fax_delete_with_http_info(fax_id, opts = {}) # Create Embedded Fax Draft # Creates an embedded Fax draft and returns a URL that can be opened in an approved iframe for preparation and sending. - # @param fax_draft_create_request [FaxDraftCreateRequest] + # @param fax_draft_create_request [FaxDraftCreateRequest] # @param [Hash] opts the optional parameters # @return [FaxDraftCreateResponse] def fax_draft_create(fax_draft_create_request, opts = {}) @@ -102,7 +102,7 @@ def fax_draft_create(fax_draft_create_request, opts = {}) # Create Embedded Fax Draft # Creates an embedded Fax draft and returns a URL that can be opened in an approved iframe for preparation and sending. - # @param fax_draft_create_request [FaxDraftCreateRequest] + # @param fax_draft_create_request [FaxDraftCreateRequest] # @param [Hash] opts the optional parameters # @return [Array<(FaxDraftCreateResponse, Integer, Hash)>] FaxDraftCreateResponse data, response status code and response headers def fax_draft_create_with_http_info(fax_draft_create_request, opts = {}) From 9b94c885ce4e873ef6c259af5aeca73b22346669 Mon Sep 17 00:00:00 2001 From: Brian Erkkinen Date: Thu, 27 Aug 2026 16:58:48 -0400 Subject: [PATCH 3/3] Support normal fax drafts without a client ID --- .../json/FaxDraftCreateEmbeddedRequest.json | 15 +++ .../json/FaxDraftCreateEmbeddedResponse.json | 7 ++ examples/json/FaxDraftCreateRequest.json | 9 -- examples/json/FaxDraftCreateResponse.json | 2 +- openapi-fern.yaml | 50 +++++--- openapi-raw.yaml | 14 ++- openapi-sdk.yaml | 47 ++++--- openapi.yaml | 47 ++++--- sdks/dotnet/README.md | 2 +- sdks/dotnet/docs/FaxApi.md | 8 +- sdks/dotnet/docs/FaxDraftCreateRequest.md | 2 +- sdks/dotnet/docs/FaxDraftResponse.md | 4 +- sdks/dotnet/docs/SubEditorPageOptions.md | 2 +- sdks/dotnet/src/Dropbox.Sign/Api/FaxApi.cs | 24 ++-- .../Model/FaxDraftCreateRequest.cs | 75 ++++++----- .../Dropbox.Sign/Model/FaxDraftResponse.cs | 14 +-- .../Model/SubEditorPageOptions.cs | 2 +- sdks/java-v1/README.md | 2 +- sdks/java-v1/docs/FaxApi.md | 8 +- sdks/java-v1/docs/FaxDraftCreateRequest.md | 8 +- sdks/java-v1/docs/FaxDraftResponse.md | 6 +- sdks/java-v1/docs/SubEditorPageOptions.md | 2 +- .../java/com/dropbox/sign/api/FaxApi.java | 12 +- .../sign/model/FaxDraftCreateRequest.java | 119 +++++++++--------- .../dropbox/sign/model/FaxDraftResponse.java | 7 +- .../sign/model/SubEditorPageOptions.java | 5 +- sdks/java-v2/README.md | 2 +- sdks/java-v2/docs/FaxApi.md | 8 +- sdks/java-v2/docs/FaxDraftCreateRequest.md | 8 +- sdks/java-v2/docs/FaxDraftResponse.md | 6 +- sdks/java-v2/docs/SubEditorPageOptions.md | 2 +- .../java/com/dropbox/sign/api/FaxApi.java | 8 +- .../sign/model/FaxDraftCreateRequest.java | 112 ++++++++--------- .../dropbox/sign/model/FaxDraftResponse.java | 6 +- .../sign/model/SubEditorPageOptions.java | 2 +- sdks/node/README.md | 2 +- sdks/node/api/faxApi.ts | 4 +- sdks/node/dist/api.js | 14 +-- sdks/node/docs/api/FaxApi.md | 6 +- sdks/node/docs/model/FaxDraftCreateRequest.md | 8 +- sdks/node/docs/model/FaxDraftResponse.md | 6 +- sdks/node/docs/model/SubEditorPageOptions.md | 2 +- sdks/node/model/faxDraftCreateRequest.ts | 24 ++-- sdks/node/model/faxDraftResponse.ts | 6 +- sdks/node/model/subEditorPageOptions.ts | 2 +- .../types/model/faxDraftCreateRequest.d.ts | 2 +- sdks/php/README.md | 2 +- sdks/php/docs/Api/FaxApi.md | 6 +- sdks/php/docs/Model/FaxDraftCreateRequest.md | 8 +- sdks/php/docs/Model/FaxDraftResponse.md | 6 +- sdks/php/docs/Model/SubEditorPageOptions.md | 2 +- sdks/php/src/Api/FaxApi.php | 8 +- sdks/php/src/Model/FaxDraftCreateRequest.php | 77 ++++++------ sdks/php/src/Model/FaxDraftResponse.php | 6 +- sdks/php/src/Model/SubEditorPageOptions.php | 2 +- sdks/python/README.md | 2 +- sdks/python/docs/FaxApi.md | 8 +- sdks/python/docs/FaxDraftCreateRequest.md | 8 +- sdks/python/docs/FaxDraftResponse.md | 6 +- sdks/python/docs/SubEditorPageOptions.md | 2 +- sdks/python/dropbox_sign/api/fax_api.py | 12 +- .../models/fax_draft_create_request.py | 19 +-- .../dropbox_sign/models/fax_draft_response.py | 6 +- .../models/sub_editor_page_options.py | 2 +- sdks/ruby/README.md | 2 +- sdks/ruby/docs/FaxApi.md | 8 +- sdks/ruby/docs/FaxDraftCreateRequest.md | 8 +- sdks/ruby/docs/FaxDraftResponse.md | 6 +- sdks/ruby/docs/SubEditorPageOptions.md | 2 +- sdks/ruby/lib/dropbox-sign/api/fax_api.rb | 8 +- .../models/fax_draft_create_request.rb | 45 +++---- .../dropbox-sign/models/fax_draft_response.rb | 6 +- .../models/sub_editor_page_options.rb | 2 +- translations/en.yaml | 35 +++--- 74 files changed, 546 insertions(+), 481 deletions(-) create mode 100644 examples/json/FaxDraftCreateEmbeddedRequest.json create mode 100644 examples/json/FaxDraftCreateEmbeddedResponse.json diff --git a/examples/json/FaxDraftCreateEmbeddedRequest.json b/examples/json/FaxDraftCreateEmbeddedRequest.json new file mode 100644 index 000000000..dfba9ac46 --- /dev/null +++ b/examples/json/FaxDraftCreateEmbeddedRequest.json @@ -0,0 +1,15 @@ +{ + "client_id": "b6b8e7deaf8f0b95c029dca049356d4a2cf9710a", + "file_urls": [ + "https://www.dropbox.com/s/ad9qnhbrjjn64tu/mutual-NDA-example.pdf?dl=1" + ], + "recipients": [ + "+14155552671" + ], + "editor_options": { + "force_upload_page": false, + "force_editor_page": true, + "force_review_page": true + }, + "test_mode": true +} diff --git a/examples/json/FaxDraftCreateEmbeddedResponse.json b/examples/json/FaxDraftCreateEmbeddedResponse.json new file mode 100644 index 000000000..5532cf100 --- /dev/null +++ b/examples/json/FaxDraftCreateEmbeddedResponse.json @@ -0,0 +1,7 @@ +{ + "fax_draft": { + "fax_id": "c2e9691c85d9d6fa6ae773842e3680b2b8650f1d", + "url": "https://embedded.fax.dropbox.com/prep-and-send/embedded-fax?cached_params_token=30c4d8df776038c2fa5f7094c3718937", + "expires_at": 1787857200 + } +} diff --git a/examples/json/FaxDraftCreateRequest.json b/examples/json/FaxDraftCreateRequest.json index dfba9ac46..45cf4c966 100644 --- a/examples/json/FaxDraftCreateRequest.json +++ b/examples/json/FaxDraftCreateRequest.json @@ -1,15 +1,6 @@ { - "client_id": "b6b8e7deaf8f0b95c029dca049356d4a2cf9710a", "file_urls": [ "https://www.dropbox.com/s/ad9qnhbrjjn64tu/mutual-NDA-example.pdf?dl=1" ], - "recipients": [ - "+14155552671" - ], - "editor_options": { - "force_upload_page": false, - "force_editor_page": true, - "force_review_page": true - }, "test_mode": true } diff --git a/examples/json/FaxDraftCreateResponse.json b/examples/json/FaxDraftCreateResponse.json index 5532cf100..dcc7ab571 100644 --- a/examples/json/FaxDraftCreateResponse.json +++ b/examples/json/FaxDraftCreateResponse.json @@ -1,7 +1,7 @@ { "fax_draft": { "fax_id": "c2e9691c85d9d6fa6ae773842e3680b2b8650f1d", - "url": "https://embedded.fax.dropbox.com/prep-and-send/embedded-fax?cached_params_token=30c4d8df776038c2fa5f7094c3718937", + "url": "https://app.fax.dropbox.com/prep-and-send/30c4d8df776038c2fa5f7094c3718937b8650f1d", "expires_at": 1787857200 } } diff --git a/openapi-fern.yaml b/openapi-fern.yaml index e791e8dd0..55458eba4 100644 --- a/openapi-fern.yaml +++ b/openapi-fern.yaml @@ -4067,8 +4067,11 @@ paths: post: tags: - Fax - summary: Create Embedded Fax Draft - description: Creates an embedded Fax draft and returns a URL that can be opened in an approved iframe for preparation and sending. + summary: Create Fax Draft + description: |- + Creates a Fax draft and returns a URL for preparing and sending the Fax. + + When `client_id` is provided, the draft is embedded and the returned URL must be opened in an approved iframe. When `client_id` is omitted, the draft is a normal Fax draft that opens in Dropbox Fax. operationId: faxDraftCreate requestBody: required: true @@ -4079,6 +4082,8 @@ paths: examples: example: $ref: '#/components/examples/FaxDraftCreateRequest' + embedded_fax_example: + $ref: '#/components/examples/FaxDraftCreateEmbeddedRequest' multipart/form-data: schema: $ref: '#/components/schemas/FaxDraftCreateRequest' @@ -4099,6 +4104,8 @@ paths: examples: example: $ref: '#/components/examples/FaxDraftCreateResponse' + embedded_fax_example: + $ref: '#/components/examples/FaxDraftCreateEmbeddedResponse' 4XX: description: failed_operation content: @@ -4379,8 +4386,8 @@ paths: -F 'test_mode=1' x-meta: seo: - title: Create Embedded Fax Draft | API Documentation | Dropbox Fax for Developers - description: 'Create an embedded Fax draft, then prepare and send it from an approved iframe in your application.' + title: Create Fax Draft | API Documentation | Dropbox Fax for Developers + description: 'Create a normal or embedded Fax draft, then prepare and send it from Dropbox Fax or an approved iframe.' /fax/files/{fax_id}: get: tags: @@ -23593,33 +23600,31 @@ components: default: false type: object FaxDraftCreateRequest: - required: - - client_id properties: files: description: |- - Use `files[]` to upload the file(s) for the embedded Fax draft. + Use `files[]` to upload the file(s) for the Fax draft. - This endpoint accepts either **files** or **file_urls[]**, but not both. Files can be added later in the embedded flow when neither is provided. + This endpoint accepts either **files** or **file_urls[]**, but not both. Files can be added later when neither is provided. type: array items: type: string format: binary file_urls: description: |- - Use `file_urls[]` to have Dropbox Fax download the file(s) for the embedded Fax draft. + Use `file_urls[]` to have Dropbox Fax download the file(s) for the Fax draft. - This endpoint accepts either **files** or **file_urls[]**, but not both. Files can be added later in the embedded flow when neither is provided. + This endpoint accepts either **files** or **file_urls[]**, but not both. Files can be added later when neither is provided. type: array items: type: string client_id: - description: Client ID of the API app that owns the embedded Fax draft. + description: 'Optional client ID of the API app that owns the embedded Fax draft. When omitted, a normal non-embedded Fax draft is created.' type: string editor_options: $ref: '#/components/schemas/SubEditorPageOptions' recipients: - description: Fax numbers to prefill in the embedded flow. Each fax number must be in a supported international format. A maximum of 20 unique fax numbers can be provided. + description: For embedded Fax drafts only. Fax numbers to prefill in the embedded flow. Each fax number must be in a supported international format. A maximum of 20 unique fax numbers can be provided. type: array items: type: string @@ -25183,7 +25188,7 @@ components: default: false type: object SubEditorPageOptions: - description: Controls which completed pages are shown again when the embedded Fax draft is opened. + description: For embedded Fax drafts only. Controls which completed pages are shown again when the draft is opened. properties: force_upload_page: description: 'When set to `true`, always shows the upload page, even when files are already attached. Defaults to `false`.' @@ -27685,7 +27690,7 @@ components: type: object x-internal-class: true FaxDraftResponse: - description: 'Contains the embedded Fax draft ID, iframe URL, and expiration timestamp.' + description: 'Contains the Fax draft ID, prep-and-send URL, and expiration timestamp.' required: - fax_id - url @@ -27695,10 +27700,10 @@ components: description: ID of the Fax draft. type: string url: - description: URL to open in an approved iframe for preparing and sending the Fax. + description: URL for preparing and sending the Fax. Embedded draft URLs must be opened in an approved iframe; normal draft URLs open in Dropbox Fax. type: string expires_at: - description: Unix timestamp indicating when the embedded Fax draft URL expires. + description: Unix timestamp indicating when the Fax draft URL expires. type: integer type: object x-internal-class: true @@ -30074,6 +30079,12 @@ components: merge_fields: [] FaxDraftCreateRequest: summary: Default Example + value: + file_urls: + - https://www.dropbox.com/s/ad9qnhbrjjn64tu/mutual-NDA-example.pdf?dl=1 + test_mode: true + FaxDraftCreateEmbeddedRequest: + summary: Embedded Fax Draft Request value: client_id: b6b8e7deaf8f0b95c029dca049356d4a2cf9710a file_urls: @@ -31530,6 +31541,13 @@ components: error_path: cc_email_addresses[0] error_name: bad_request FaxDraftCreateResponse: + summary: Fax Draft Response + value: + fax_draft: + fax_id: c2e9691c85d9d6fa6ae773842e3680b2b8650f1d + url: https://app.fax.dropbox.com/prep-and-send/30c4d8df776038c2fa5f7094c3718937b8650f1d + expires_at: 1787857200 + FaxDraftCreateEmbeddedResponse: summary: Embedded Fax Draft Response value: fax_draft: diff --git a/openapi-raw.yaml b/openapi-raw.yaml index eba08d062..200d324c2 100644 --- a/openapi-raw.yaml +++ b/openapi-raw.yaml @@ -1601,6 +1601,8 @@ paths: examples: example: $ref: '#/components/examples/FaxDraftCreateRequest' + embedded_fax_example: + $ref: '#/components/examples/FaxDraftCreateEmbeddedRequest' multipart/form-data: schema: $ref: '#/components/schemas/FaxDraftCreateRequest' @@ -1621,6 +1623,8 @@ paths: examples: example: $ref: '#/components/examples/FaxDraftCreateResponse' + embedded_fax_example: + $ref: '#/components/examples/FaxDraftCreateEmbeddedResponse' 4XX: description: failed_operation content: @@ -8133,8 +8137,6 @@ components: - doc type: object FaxDraftCreateRequest: - required: - - client_id properties: files: description: '_t__FaxDraftCreate::FILES' @@ -14032,6 +14034,10 @@ components: summary: 'Default Example' value: $ref: examples/json/FaxDraftCreateRequest.json + FaxDraftCreateEmbeddedRequest: + summary: '_t__FaxDraftCreateEmbeddedRequestExample::SUMMARY' + value: + $ref: examples/json/FaxDraftCreateEmbeddedRequest.json FaxLineAddUserRequest: summary: 'Default Example' value: @@ -14331,6 +14337,10 @@ components: summary: '_t__FaxDraftCreateResponseExample::SUMMARY' value: $ref: examples/json/FaxDraftCreateResponse.json + FaxDraftCreateEmbeddedResponse: + summary: '_t__FaxDraftCreateEmbeddedResponseExample::SUMMARY' + value: + $ref: examples/json/FaxDraftCreateEmbeddedResponse.json FaxGetResponse: summary: '_t__FaxGetResponseExample::SUMMARY' value: diff --git a/openapi-sdk.yaml b/openapi-sdk.yaml index 13d588586..3f426a906 100644 --- a/openapi-sdk.yaml +++ b/openapi-sdk.yaml @@ -1554,8 +1554,11 @@ paths: post: tags: - Fax - summary: 'Create Embedded Fax Draft' - description: 'Creates an embedded Fax draft and returns a URL that can be opened in an approved iframe for preparation and sending.' + summary: 'Create Fax Draft' + description: |- + Creates a Fax draft and returns a URL for preparing and sending the Fax. + + When `client_id` is provided, the draft is embedded and the returned URL must be opened in an approved iframe. When `client_id` is omitted, the draft is a normal Fax draft that opens in Dropbox Fax. operationId: faxDraftCreate requestBody: required: true @@ -1566,6 +1569,8 @@ paths: examples: example: $ref: '#/components/examples/FaxDraftCreateRequest' + embedded_fax_example: + $ref: '#/components/examples/FaxDraftCreateEmbeddedRequest' multipart/form-data: schema: $ref: '#/components/schemas/FaxDraftCreateRequest' @@ -1586,6 +1591,8 @@ paths: examples: example: $ref: '#/components/examples/FaxDraftCreateResponse' + embedded_fax_example: + $ref: '#/components/examples/FaxDraftCreateEmbeddedResponse' '4XX': description: failed_operation content: @@ -1648,8 +1655,8 @@ paths: $ref: examples/FaxDraftCreateExample.sh x-meta: seo: - title: 'Create Embedded Fax Draft | API Documentation | Dropbox Fax for Developers' - description: 'Create an embedded Fax draft, then prepare and send it from an approved iframe in your application.' + title: 'Create Fax Draft | API Documentation | Dropbox Fax for Developers' + description: 'Create a normal or embedded Fax draft, then prepare and send it from Dropbox Fax or an approved iframe.' '/fax/files/{fax_id}': get: tags: @@ -8077,33 +8084,31 @@ components: default: false type: object FaxDraftCreateRequest: - required: - - client_id properties: files: description: |- - Use `files[]` to upload the file(s) for the embedded Fax draft. + Use `files[]` to upload the file(s) for the Fax draft. - This endpoint accepts either **files** or **file_urls[]**, but not both. Files can be added later in the embedded flow when neither is provided. + This endpoint accepts either **files** or **file_urls[]**, but not both. Files can be added later when neither is provided. type: array items: type: string format: binary file_urls: description: |- - Use `file_urls[]` to have Dropbox Fax download the file(s) for the embedded Fax draft. + Use `file_urls[]` to have Dropbox Fax download the file(s) for the Fax draft. - This endpoint accepts either **files** or **file_urls[]**, but not both. Files can be added later in the embedded flow when neither is provided. + This endpoint accepts either **files** or **file_urls[]**, but not both. Files can be added later when neither is provided. type: array items: type: string client_id: - description: 'Client ID of the API app that owns the embedded Fax draft.' + description: 'Optional client ID of the API app that owns the embedded Fax draft. When omitted, a normal non-embedded Fax draft is created.' type: string editor_options: $ref: '#/components/schemas/SubEditorPageOptions' recipients: - description: 'Fax numbers to prefill in the embedded flow. Each fax number must be in a supported international format. A maximum of 20 unique fax numbers can be provided.' + description: 'For embedded Fax drafts only. Fax numbers to prefill in the embedded flow. Each fax number must be in a supported international format. A maximum of 20 unique fax numbers can be provided.' type: array items: type: string @@ -9687,7 +9692,7 @@ components: default: false type: object SubEditorPageOptions: - description: 'Controls which completed pages are shown again when the embedded Fax draft is opened.' + description: 'For embedded Fax drafts only. Controls which completed pages are shown again when the draft is opened.' properties: force_upload_page: description: 'When set to `true`, always shows the upload page, even when files are already attached. Defaults to `false`.' @@ -12200,7 +12205,7 @@ components: type: object x-internal-class: true FaxDraftResponse: - description: 'Contains the embedded Fax draft ID, iframe URL, and expiration timestamp.' + description: 'Contains the Fax draft ID, prep-and-send URL, and expiration timestamp.' required: - fax_id - url @@ -12210,10 +12215,10 @@ components: description: 'ID of the Fax draft.' type: string url: - description: 'URL to open in an approved iframe for preparing and sending the Fax.' + description: 'URL for preparing and sending the Fax. Embedded draft URLs must be opened in an approved iframe; normal draft URLs open in Dropbox Fax.' type: string expires_at: - description: 'Unix timestamp indicating when the embedded Fax draft URL expires.' + description: 'Unix timestamp indicating when the Fax draft URL expires.' type: integer type: object x-internal-class: true @@ -14076,6 +14081,10 @@ components: summary: 'Default Example' value: $ref: examples/json/FaxDraftCreateRequest.json + FaxDraftCreateEmbeddedRequest: + summary: 'Embedded Fax Draft Request' + value: + $ref: examples/json/FaxDraftCreateEmbeddedRequest.json FaxLineAddUserRequest: summary: 'Default Example' value: @@ -14365,9 +14374,13 @@ components: value: $ref: examples/json/Error4XXResponse.json FaxDraftCreateResponse: - summary: 'Embedded Fax Draft Response' + summary: 'Fax Draft Response' value: $ref: examples/json/FaxDraftCreateResponse.json + FaxDraftCreateEmbeddedResponse: + summary: 'Embedded Fax Draft Response' + value: + $ref: examples/json/FaxDraftCreateEmbeddedResponse.json FaxGetResponse: summary: 'Fax Response' value: diff --git a/openapi.yaml b/openapi.yaml index 65f0b33c9..db73bc545 100644 --- a/openapi.yaml +++ b/openapi.yaml @@ -1554,8 +1554,11 @@ paths: post: tags: - Fax - summary: 'Create Embedded Fax Draft' - description: 'Creates an embedded Fax draft and returns a URL that can be opened in an approved iframe for preparation and sending.' + summary: 'Create Fax Draft' + description: |- + Creates a Fax draft and returns a URL for preparing and sending the Fax. + + When `client_id` is provided, the draft is embedded and the returned URL must be opened in an approved iframe. When `client_id` is omitted, the draft is a normal Fax draft that opens in Dropbox Fax. operationId: faxDraftCreate requestBody: required: true @@ -1566,6 +1569,8 @@ paths: examples: example: $ref: '#/components/examples/FaxDraftCreateRequest' + embedded_fax_example: + $ref: '#/components/examples/FaxDraftCreateEmbeddedRequest' multipart/form-data: schema: $ref: '#/components/schemas/FaxDraftCreateRequest' @@ -1586,6 +1591,8 @@ paths: examples: example: $ref: '#/components/examples/FaxDraftCreateResponse' + embedded_fax_example: + $ref: '#/components/examples/FaxDraftCreateEmbeddedResponse' '4XX': description: failed_operation content: @@ -1648,8 +1655,8 @@ paths: $ref: examples/FaxDraftCreateExample.sh x-meta: seo: - title: 'Create Embedded Fax Draft | API Documentation | Dropbox Fax for Developers' - description: 'Create an embedded Fax draft, then prepare and send it from an approved iframe in your application.' + title: 'Create Fax Draft | API Documentation | Dropbox Fax for Developers' + description: 'Create a normal or embedded Fax draft, then prepare and send it from Dropbox Fax or an approved iframe.' '/fax/files/{fax_id}': get: tags: @@ -8077,33 +8084,31 @@ components: default: false type: object FaxDraftCreateRequest: - required: - - client_id properties: files: description: |- - Use `files[]` to upload the file(s) for the embedded Fax draft. + Use `files[]` to upload the file(s) for the Fax draft. - This endpoint accepts either **files** or **file_urls[]**, but not both. Files can be added later in the embedded flow when neither is provided. + This endpoint accepts either **files** or **file_urls[]**, but not both. Files can be added later when neither is provided. type: array items: type: string format: binary file_urls: description: |- - Use `file_urls[]` to have Dropbox Fax download the file(s) for the embedded Fax draft. + Use `file_urls[]` to have Dropbox Fax download the file(s) for the Fax draft. - This endpoint accepts either **files** or **file_urls[]**, but not both. Files can be added later in the embedded flow when neither is provided. + This endpoint accepts either **files** or **file_urls[]**, but not both. Files can be added later when neither is provided. type: array items: type: string client_id: - description: 'Client ID of the API app that owns the embedded Fax draft.' + description: 'Optional client ID of the API app that owns the embedded Fax draft. When omitted, a normal non-embedded Fax draft is created.' type: string editor_options: $ref: '#/components/schemas/SubEditorPageOptions' recipients: - description: 'Fax numbers to prefill in the embedded flow. Each fax number must be in a supported international format. A maximum of 20 unique fax numbers can be provided.' + description: 'For embedded Fax drafts only. Fax numbers to prefill in the embedded flow. Each fax number must be in a supported international format. A maximum of 20 unique fax numbers can be provided.' type: array items: type: string @@ -9667,7 +9672,7 @@ components: default: false type: object SubEditorPageOptions: - description: 'Controls which completed pages are shown again when the embedded Fax draft is opened.' + description: 'For embedded Fax drafts only. Controls which completed pages are shown again when the draft is opened.' properties: force_upload_page: description: 'When set to `true`, always shows the upload page, even when files are already attached. Defaults to `false`.' @@ -12180,7 +12185,7 @@ components: type: object x-internal-class: true FaxDraftResponse: - description: 'Contains the embedded Fax draft ID, iframe URL, and expiration timestamp.' + description: 'Contains the Fax draft ID, prep-and-send URL, and expiration timestamp.' required: - fax_id - url @@ -12190,10 +12195,10 @@ components: description: 'ID of the Fax draft.' type: string url: - description: 'URL to open in an approved iframe for preparing and sending the Fax.' + description: 'URL for preparing and sending the Fax. Embedded draft URLs must be opened in an approved iframe; normal draft URLs open in Dropbox Fax.' type: string expires_at: - description: 'Unix timestamp indicating when the embedded Fax draft URL expires.' + description: 'Unix timestamp indicating when the Fax draft URL expires.' type: integer type: object x-internal-class: true @@ -14572,6 +14577,10 @@ components: summary: 'Default Example' value: $ref: examples/json/FaxDraftCreateRequest.json + FaxDraftCreateEmbeddedRequest: + summary: 'Embedded Fax Draft Request' + value: + $ref: examples/json/FaxDraftCreateEmbeddedRequest.json FaxLineAddUserRequest: summary: 'Default Example' value: @@ -14861,9 +14870,13 @@ components: value: $ref: examples/json/Error4XXResponse.json FaxDraftCreateResponse: - summary: 'Embedded Fax Draft Response' + summary: 'Fax Draft Response' value: $ref: examples/json/FaxDraftCreateResponse.json + FaxDraftCreateEmbeddedResponse: + summary: 'Embedded Fax Draft Response' + value: + $ref: examples/json/FaxDraftCreateEmbeddedResponse.json FaxGetResponse: summary: 'Fax Response' value: diff --git a/sdks/dotnet/README.md b/sdks/dotnet/README.md index 096169b4a..4080d0197 100644 --- a/sdks/dotnet/README.md +++ b/sdks/dotnet/README.md @@ -145,7 +145,7 @@ Class | Method | HTTP request | Description *EmbeddedApi* | [**EmbeddedEditUrl**](docs/EmbeddedApi.md#embeddedediturl) | **POST** /embedded/edit_url/{template_id} | Get Embedded Template Edit URL *EmbeddedApi* | [**EmbeddedSignUrl**](docs/EmbeddedApi.md#embeddedsignurl) | **GET** /embedded/sign_url/{signature_id} | Get Embedded Sign URL *FaxApi* | [**FaxDelete**](docs/FaxApi.md#faxdelete) | **DELETE** /fax/{fax_id} | Delete Fax -*FaxApi* | [**FaxDraftCreate**](docs/FaxApi.md#faxdraftcreate) | **POST** /fax/draft/create | Create Embedded Fax Draft +*FaxApi* | [**FaxDraftCreate**](docs/FaxApi.md#faxdraftcreate) | **POST** /fax/draft/create | Create Fax Draft *FaxApi* | [**FaxFiles**](docs/FaxApi.md#faxfiles) | **GET** /fax/files/{fax_id} | Download Fax Files *FaxApi* | [**FaxGet**](docs/FaxApi.md#faxget) | **GET** /fax/{fax_id} | Get Fax *FaxApi* | [**FaxList**](docs/FaxApi.md#faxlist) | **GET** /fax/list | Lists Faxes diff --git a/sdks/dotnet/docs/FaxApi.md b/sdks/dotnet/docs/FaxApi.md index 440c311f4..eb0512142 100644 --- a/sdks/dotnet/docs/FaxApi.md +++ b/sdks/dotnet/docs/FaxApi.md @@ -5,7 +5,7 @@ All URIs are relative to *https://api.hellosign.com/v3* | Method | HTTP request | Description | |--------|--------------|-------------| | [**FaxDelete**](FaxApi.md#faxdelete) | **DELETE** /fax/{fax_id} | Delete Fax | -| [**FaxDraftCreate**](FaxApi.md#faxdraftcreate) | **POST** /fax/draft/create | Create Embedded Fax Draft | +| [**FaxDraftCreate**](FaxApi.md#faxdraftcreate) | **POST** /fax/draft/create | Create Fax Draft | | [**FaxFiles**](FaxApi.md#faxfiles) | **GET** /fax/files/{fax_id} | Download Fax Files | | [**FaxGet**](FaxApi.md#faxget) | **GET** /fax/{fax_id} | Get Fax | | [**FaxList**](FaxApi.md#faxlist) | **GET** /fax/list | Lists Faxes | @@ -105,9 +105,9 @@ void (empty response body) # **FaxDraftCreate** > FaxDraftCreateResponse FaxDraftCreate (FaxDraftCreateRequest faxDraftCreateRequest) -Create Embedded Fax Draft +Create Fax Draft -Creates an embedded Fax draft and returns a URL that can be opened in an approved iframe for preparation and sending. +Creates a Fax draft and returns a URL for preparing and sending the Fax. When `client_id` is provided, the draft is embedded and the returned URL must be opened in an approved iframe. When `client_id` is omitted, the draft is a normal Fax draft that opens in Dropbox Fax. ### Example ```csharp @@ -171,7 +171,7 @@ This returns an ApiResponse object which contains the response data, status code ```csharp try { - // Create Embedded Fax Draft + // Create Fax Draft ApiResponse response = apiInstance.FaxDraftCreateWithHttpInfo(faxDraftCreateRequest); Debug.Write("Status Code: " + response.StatusCode); Debug.Write("Response Headers: " + response.Headers); diff --git a/sdks/dotnet/docs/FaxDraftCreateRequest.md b/sdks/dotnet/docs/FaxDraftCreateRequest.md index 636b6dceb..21ce3ffb1 100644 --- a/sdks/dotnet/docs/FaxDraftCreateRequest.md +++ b/sdks/dotnet/docs/FaxDraftCreateRequest.md @@ -4,7 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**ClientId** | **string** | Client ID of the API app that owns the embedded Fax draft. | **Files** | **List<System.IO.Stream>** | Use `files[]` to upload the file(s) for the embedded Fax draft.

This endpoint accepts either **files** or **file_urls[]**, but not both. Files can be added later in the embedded flow when neither is provided. | [optional] **FileUrls** | **List<string>** | Use `file_urls[]` to have Dropbox Fax download the file(s) for the embedded Fax draft.

This endpoint accepts either **files** or **file_urls[]**, but not both. Files can be added later in the embedded flow when neither is provided. | [optional] **EditorOptions** | [**SubEditorPageOptions**](SubEditorPageOptions.md) | | [optional] **Recipients** | **List<string>** | Fax numbers to prefill in the embedded flow. Each fax number must be in a supported international format. A maximum of 20 unique fax numbers can be provided. | [optional] **TestMode** | **bool** | When set to `true`, the completed draft will not send a Fax or consume Fax pages. Defaults to `false`. | [optional] [default to false] +**Files** | **List<System.IO.Stream>** | Use `files[]` to upload the file(s) for the Fax draft.

This endpoint accepts either **files** or **file_urls[]**, but not both. Files can be added later when neither is provided. | [optional] **FileUrls** | **List<string>** | Use `file_urls[]` to have Dropbox Fax download the file(s) for the Fax draft.

This endpoint accepts either **files** or **file_urls[]**, but not both. Files can be added later when neither is provided. | [optional] **ClientId** | **string** | Optional client ID of the API app that owns the embedded Fax draft. When omitted, a normal non-embedded Fax draft is created. | [optional] **EditorOptions** | [**SubEditorPageOptions**](SubEditorPageOptions.md) | | [optional] **Recipients** | **List<string>** | For embedded Fax drafts only. Fax numbers to prefill in the embedded flow. Each fax number must be in a supported international format. A maximum of 20 unique fax numbers can be provided. | [optional] **TestMode** | **bool** | When set to `true`, the completed draft will not send a Fax or consume Fax pages. Defaults to `false`. | [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/FaxDraftResponse.md b/sdks/dotnet/docs/FaxDraftResponse.md index 02a10b5c0..6eb010b0d 100644 --- a/sdks/dotnet/docs/FaxDraftResponse.md +++ b/sdks/dotnet/docs/FaxDraftResponse.md @@ -1,11 +1,11 @@ # Dropbox.Sign.Model.FaxDraftResponse -Contains the embedded Fax draft ID, iframe URL, and expiration timestamp. +Contains the Fax draft ID, prep-and-send URL, and expiration timestamp. ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**FaxId** | **string** | ID of the Fax draft. | **Url** | **string** | URL to open in an approved iframe for preparing and sending the Fax. | **ExpiresAt** | **int** | Unix timestamp indicating when the embedded Fax draft URL expires. | +**FaxId** | **string** | ID of the Fax draft. | **Url** | **string** | URL for preparing and sending the Fax. Embedded draft URLs must be opened in an approved iframe; normal draft URLs open in Dropbox Fax. | **ExpiresAt** | **int** | Unix timestamp indicating when the Fax draft URL expires. | [[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/SubEditorPageOptions.md b/sdks/dotnet/docs/SubEditorPageOptions.md index 888e4167c..2680efe29 100644 --- a/sdks/dotnet/docs/SubEditorPageOptions.md +++ b/sdks/dotnet/docs/SubEditorPageOptions.md @@ -1,5 +1,5 @@ # Dropbox.Sign.Model.SubEditorPageOptions -Controls which completed pages are shown again when the embedded Fax draft is opened. +For embedded Fax drafts only. Controls which completed pages are shown again when the draft is opened. ## Properties diff --git a/sdks/dotnet/src/Dropbox.Sign/Api/FaxApi.cs b/sdks/dotnet/src/Dropbox.Sign/Api/FaxApi.cs index 894768095..a954f528a 100644 --- a/sdks/dotnet/src/Dropbox.Sign/Api/FaxApi.cs +++ b/sdks/dotnet/src/Dropbox.Sign/Api/FaxApi.cs @@ -51,10 +51,10 @@ public interface IFaxApiSync : IApiAccessor /// ApiResponse of Object(void) ApiResponse FaxDeleteWithHttpInfo(string faxId, int operationIndex = 0); /// - /// Create Embedded Fax Draft + /// Create Fax Draft /// /// - /// Creates an embedded Fax draft and returns a URL that can be opened in an approved iframe for preparation and sending. + /// Creates a Fax draft and returns a URL for preparing and sending the Fax. When `client_id` is provided, the draft is embedded and the returned URL must be opened in an approved iframe. When `client_id` is omitted, the draft is a normal Fax draft that opens in Dropbox Fax. /// /// Thrown when fails to make API call /// @@ -63,10 +63,10 @@ public interface IFaxApiSync : IApiAccessor FaxDraftCreateResponse FaxDraftCreate(FaxDraftCreateRequest faxDraftCreateRequest, int operationIndex = 0); /// - /// Create Embedded Fax Draft + /// Create Fax Draft /// /// - /// Creates an embedded Fax draft and returns a URL that can be opened in an approved iframe for preparation and sending. + /// Creates a Fax draft and returns a URL for preparing and sending the Fax. When `client_id` is provided, the draft is embedded and the returned URL must be opened in an approved iframe. When `client_id` is omitted, the draft is a normal Fax draft that opens in Dropbox Fax. /// /// Thrown when fails to make API call /// @@ -202,10 +202,10 @@ public interface IFaxApiAsync : IApiAccessor /// Task of ApiResponse System.Threading.Tasks.Task> FaxDeleteWithHttpInfoAsync(string faxId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); /// - /// Create Embedded Fax Draft + /// Create Fax Draft /// /// - /// Creates an embedded Fax draft and returns a URL that can be opened in an approved iframe for preparation and sending. + /// Creates a Fax draft and returns a URL for preparing and sending the Fax. When `client_id` is provided, the draft is embedded and the returned URL must be opened in an approved iframe. When `client_id` is omitted, the draft is a normal Fax draft that opens in Dropbox Fax. /// /// Thrown when fails to make API call /// @@ -215,10 +215,10 @@ public interface IFaxApiAsync : IApiAccessor System.Threading.Tasks.Task FaxDraftCreateAsync(FaxDraftCreateRequest faxDraftCreateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); /// - /// Create Embedded Fax Draft + /// Create Fax Draft /// /// - /// Creates an embedded Fax draft and returns a URL that can be opened in an approved iframe for preparation and sending. + /// Creates a Fax draft and returns a URL for preparing and sending the Fax. When `client_id` is provided, the draft is embedded and the returned URL must be opened in an approved iframe. When `client_id` is omitted, the draft is a normal Fax draft that opens in Dropbox Fax. /// /// Thrown when fails to make API call /// @@ -603,7 +603,7 @@ public Dropbox.Sign.Client.ApiResponse FaxDeleteWithHttpInfo(string faxI } /// - /// Create Embedded Fax Draft Creates an embedded Fax draft and returns a URL that can be opened in an approved iframe for preparation and sending. + /// Create Fax Draft Creates a Fax draft and returns a URL for preparing and sending the Fax. When `client_id` is provided, the draft is embedded and the returned URL must be opened in an approved iframe. When `client_id` is omitted, the draft is a normal Fax draft that opens in Dropbox Fax. /// /// Thrown when fails to make API call /// @@ -616,7 +616,7 @@ public FaxDraftCreateResponse FaxDraftCreate(FaxDraftCreateRequest faxDraftCreat } /// - /// Create Embedded Fax Draft Creates an embedded Fax draft and returns a URL that can be opened in an approved iframe for preparation and sending. + /// Create Fax Draft Creates a Fax draft and returns a URL for preparing and sending the Fax. When `client_id` is provided, the draft is embedded and the returned URL must be opened in an approved iframe. When `client_id` is omitted, the draft is a normal Fax draft that opens in Dropbox Fax. /// /// Thrown when fails to make API call /// @@ -687,7 +687,7 @@ public Dropbox.Sign.Client.ApiResponse FaxDraftCreateWit } /// - /// Create Embedded Fax Draft Creates an embedded Fax draft and returns a URL that can be opened in an approved iframe for preparation and sending. + /// Create Fax Draft Creates a Fax draft and returns a URL for preparing and sending the Fax. When `client_id` is provided, the draft is embedded and the returned URL must be opened in an approved iframe. When `client_id` is omitted, the draft is a normal Fax draft that opens in Dropbox Fax. /// /// Thrown when fails to make API call /// @@ -701,7 +701,7 @@ public Dropbox.Sign.Client.ApiResponse FaxDraftCreateWit } /// - /// Create Embedded Fax Draft Creates an embedded Fax draft and returns a URL that can be opened in an approved iframe for preparation and sending. + /// Create Fax Draft Creates a Fax draft and returns a URL for preparing and sending the Fax. When `client_id` is provided, the draft is embedded and the returned URL must be opened in an approved iframe. When `client_id` is omitted, the draft is a normal Fax draft that opens in Dropbox Fax. /// /// Thrown when fails to make API call /// diff --git a/sdks/dotnet/src/Dropbox.Sign/Model/FaxDraftCreateRequest.cs b/sdks/dotnet/src/Dropbox.Sign/Model/FaxDraftCreateRequest.cs index 9d336784c..d5247a7cf 100644 --- a/sdks/dotnet/src/Dropbox.Sign/Model/FaxDraftCreateRequest.cs +++ b/sdks/dotnet/src/Dropbox.Sign/Model/FaxDraftCreateRequest.cs @@ -41,23 +41,18 @@ protected FaxDraftCreateRequest() { } /// /// Initializes a new instance of the class. /// - /// Use `files[]` to upload the file(s) for the embedded Fax draft. This endpoint accepts either **files** or **file_urls[]**, but not both. Files can be added later in the embedded flow when neither is provided.. - /// Use `file_urls[]` to have Dropbox Fax download the file(s) for the embedded Fax draft. This endpoint accepts either **files** or **file_urls[]**, but not both. Files can be added later in the embedded flow when neither is provided.. - /// Client ID of the API app that owns the embedded Fax draft. (required). + /// Use `files[]` to upload the file(s) for the Fax draft. This endpoint accepts either **files** or **file_urls[]**, but not both. Files can be added later when neither is provided.. + /// Use `file_urls[]` to have Dropbox Fax download the file(s) for the Fax draft. This endpoint accepts either **files** or **file_urls[]**, but not both. Files can be added later when neither is provided.. + /// Optional client ID of the API app that owns the embedded Fax draft. When omitted, a normal non-embedded Fax draft is created.. /// editorOptions. - /// Fax numbers to prefill in the embedded flow. Each fax number must be in a supported international format. A maximum of 20 unique fax numbers can be provided.. + /// For embedded Fax drafts only. Fax numbers to prefill in the embedded flow. Each fax number must be in a supported international format. A maximum of 20 unique fax numbers can be provided.. /// When set to `true`, the completed draft will not send a Fax or consume Fax pages. Defaults to `false`. (default to false). public FaxDraftCreateRequest(List files = default(List), List fileUrls = default(List), string clientId = default(string), SubEditorPageOptions editorOptions = default(SubEditorPageOptions), List recipients = default(List), bool testMode = false) { - // to ensure "clientId" is required (not null) - if (clientId == null) - { - throw new ArgumentNullException("clientId is a required property for FaxDraftCreateRequest and cannot be null"); - } - this.ClientId = clientId; this.Files = files; this.FileUrls = fileUrls; + this.ClientId = clientId; this.EditorOptions = editorOptions; this.Recipients = recipients; this.TestMode = testMode; @@ -80,26 +75,26 @@ public static FaxDraftCreateRequest Init(string jsonData) } /// - /// Client ID of the API app that owns the embedded Fax draft. - /// - /// Client ID of the API app that owns the embedded Fax draft. - [DataMember(Name = "client_id", IsRequired = true, EmitDefaultValue = true)] - public string ClientId { get; set; } - - /// - /// Use `files[]` to upload the file(s) for the embedded Fax draft. This endpoint accepts either **files** or **file_urls[]**, but not both. Files can be added later in the embedded flow when neither is provided. + /// Use `files[]` to upload the file(s) for the Fax draft. This endpoint accepts either **files** or **file_urls[]**, but not both. Files can be added later when neither is provided. /// - /// Use `files[]` to upload the file(s) for the embedded Fax draft. This endpoint accepts either **files** or **file_urls[]**, but not both. Files can be added later in the embedded flow when neither is provided. + /// Use `files[]` to upload the file(s) for the Fax draft. This endpoint accepts either **files** or **file_urls[]**, but not both. Files can be added later when neither is provided. [DataMember(Name = "files", EmitDefaultValue = true)] public List Files { get; set; } /// - /// Use `file_urls[]` to have Dropbox Fax download the file(s) for the embedded Fax draft. This endpoint accepts either **files** or **file_urls[]**, but not both. Files can be added later in the embedded flow when neither is provided. + /// Use `file_urls[]` to have Dropbox Fax download the file(s) for the Fax draft. This endpoint accepts either **files** or **file_urls[]**, but not both. Files can be added later when neither is provided. /// - /// Use `file_urls[]` to have Dropbox Fax download the file(s) for the embedded Fax draft. This endpoint accepts either **files** or **file_urls[]**, but not both. Files can be added later in the embedded flow when neither is provided. + /// Use `file_urls[]` to have Dropbox Fax download the file(s) for the Fax draft. This endpoint accepts either **files** or **file_urls[]**, but not both. Files can be added later when neither is provided. [DataMember(Name = "file_urls", EmitDefaultValue = true)] public List FileUrls { get; set; } + /// + /// Optional client ID of the API app that owns the embedded Fax draft. When omitted, a normal non-embedded Fax draft is created. + /// + /// Optional client ID of the API app that owns the embedded Fax draft. When omitted, a normal non-embedded Fax draft is created. + [DataMember(Name = "client_id", EmitDefaultValue = true)] + public string ClientId { get; set; } + /// /// Gets or Sets EditorOptions /// @@ -107,9 +102,9 @@ public static FaxDraftCreateRequest Init(string jsonData) public SubEditorPageOptions EditorOptions { get; set; } /// - /// Fax numbers to prefill in the embedded flow. Each fax number must be in a supported international format. A maximum of 20 unique fax numbers can be provided. + /// For embedded Fax drafts only. Fax numbers to prefill in the embedded flow. Each fax number must be in a supported international format. A maximum of 20 unique fax numbers can be provided. /// - /// Fax numbers to prefill in the embedded flow. Each fax number must be in a supported international format. A maximum of 20 unique fax numbers can be provided. + /// For embedded Fax drafts only. Fax numbers to prefill in the embedded flow. Each fax number must be in a supported international format. A maximum of 20 unique fax numbers can be provided. [DataMember(Name = "recipients", EmitDefaultValue = true)] public List Recipients { get; set; } @@ -128,9 +123,9 @@ public override string ToString() { StringBuilder sb = new StringBuilder(); sb.Append("class FaxDraftCreateRequest {\n"); - sb.Append(" ClientId: ").Append(ClientId).Append("\n"); sb.Append(" Files: ").Append(Files).Append("\n"); sb.Append(" FileUrls: ").Append(FileUrls).Append("\n"); + sb.Append(" ClientId: ").Append(ClientId).Append("\n"); sb.Append(" EditorOptions: ").Append(EditorOptions).Append("\n"); sb.Append(" Recipients: ").Append(Recipients).Append("\n"); sb.Append(" TestMode: ").Append(TestMode).Append("\n"); @@ -169,11 +164,6 @@ public bool Equals(FaxDraftCreateRequest input) return false; } return - ( - this.ClientId == input.ClientId || - (this.ClientId != null && - this.ClientId.Equals(input.ClientId)) - ) && ( this.Files == input.Files || this.Files != null && @@ -186,6 +176,11 @@ public bool Equals(FaxDraftCreateRequest input) input.FileUrls != null && this.FileUrls.SequenceEqual(input.FileUrls) ) && + ( + this.ClientId == input.ClientId || + (this.ClientId != null && + this.ClientId.Equals(input.ClientId)) + ) && ( this.EditorOptions == input.EditorOptions || (this.EditorOptions != null && @@ -212,10 +207,6 @@ 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(); @@ -224,6 +215,10 @@ public override int GetHashCode() { hashCode = (hashCode * 59) + this.FileUrls.GetHashCode(); } + if (this.ClientId != null) + { + hashCode = (hashCode * 59) + this.ClientId.GetHashCode(); + } if (this.EditorOptions != null) { hashCode = (hashCode * 59) + this.EditorOptions.GetHashCode(); @@ -250,13 +245,6 @@ 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", @@ -271,6 +259,13 @@ public List GetOpenApiTypes() Value = FileUrls, }); types.Add(new OpenApiType() + { + Name = "client_id", + Property = "ClientId", + Type = "string", + Value = ClientId, + }); + types.Add(new OpenApiType() { Name = "editor_options", Property = "EditorOptions", diff --git a/sdks/dotnet/src/Dropbox.Sign/Model/FaxDraftResponse.cs b/sdks/dotnet/src/Dropbox.Sign/Model/FaxDraftResponse.cs index 671c8fd4d..1ae33c1a4 100644 --- a/sdks/dotnet/src/Dropbox.Sign/Model/FaxDraftResponse.cs +++ b/sdks/dotnet/src/Dropbox.Sign/Model/FaxDraftResponse.cs @@ -27,7 +27,7 @@ namespace Dropbox.Sign.Model { /// - /// Contains the embedded Fax draft ID, iframe URL, and expiration timestamp. + /// Contains the Fax draft ID, prep-and-send URL, and expiration timestamp. /// [DataContract(Name = "FaxDraftResponse")] [JsonObject(ItemNullValueHandling = NullValueHandling.Ignore)] @@ -42,8 +42,8 @@ protected FaxDraftResponse() { } /// Initializes a new instance of the class. /// /// ID of the Fax draft. (required). - /// URL to open in an approved iframe for preparing and sending the Fax. (required). - /// Unix timestamp indicating when the embedded Fax draft URL expires. (required). + /// URL for preparing and sending the Fax. Embedded draft URLs must be opened in an approved iframe; normal draft URLs open in Dropbox Fax. (required). + /// Unix timestamp indicating when the Fax draft URL expires. (required). public FaxDraftResponse(string faxId = default(string), string url = default(string), int expiresAt = default(int)) { @@ -86,16 +86,16 @@ public static FaxDraftResponse Init(string jsonData) public string FaxId { get; set; } /// - /// URL to open in an approved iframe for preparing and sending the Fax. + /// URL for preparing and sending the Fax. Embedded draft URLs must be opened in an approved iframe; normal draft URLs open in Dropbox Fax. /// - /// URL to open in an approved iframe for preparing and sending the Fax. + /// URL for preparing and sending the Fax. Embedded draft URLs must be opened in an approved iframe; normal draft URLs open in Dropbox Fax. [DataMember(Name = "url", IsRequired = true, EmitDefaultValue = true)] public string Url { get; set; } /// - /// Unix timestamp indicating when the embedded Fax draft URL expires. + /// Unix timestamp indicating when the Fax draft URL expires. /// - /// Unix timestamp indicating when the embedded Fax draft URL expires. + /// Unix timestamp indicating when the Fax draft URL expires. [DataMember(Name = "expires_at", IsRequired = true, EmitDefaultValue = true)] public int ExpiresAt { get; set; } diff --git a/sdks/dotnet/src/Dropbox.Sign/Model/SubEditorPageOptions.cs b/sdks/dotnet/src/Dropbox.Sign/Model/SubEditorPageOptions.cs index bfad09bfb..be751b23e 100644 --- a/sdks/dotnet/src/Dropbox.Sign/Model/SubEditorPageOptions.cs +++ b/sdks/dotnet/src/Dropbox.Sign/Model/SubEditorPageOptions.cs @@ -27,7 +27,7 @@ namespace Dropbox.Sign.Model { /// - /// Controls which completed pages are shown again when the embedded Fax draft is opened. + /// For embedded Fax drafts only. Controls which completed pages are shown again when the draft is opened. /// [DataContract(Name = "SubEditorPageOptions")] [JsonObject(ItemNullValueHandling = NullValueHandling.Ignore)] diff --git a/sdks/java-v1/README.md b/sdks/java-v1/README.md index 224ff8b48..24c7b7a96 100644 --- a/sdks/java-v1/README.md +++ b/sdks/java-v1/README.md @@ -188,7 +188,7 @@ Class | Method | HTTP request | Description *EmbeddedApi* | [**embeddedEditUrl**](docs/EmbeddedApi.md#embeddedEditUrl) | **POST** /embedded/edit_url/{template_id} | Get Embedded Template Edit URL *EmbeddedApi* | [**embeddedSignUrl**](docs/EmbeddedApi.md#embeddedSignUrl) | **GET** /embedded/sign_url/{signature_id} | Get Embedded Sign URL *FaxApi* | [**faxDelete**](docs/FaxApi.md#faxDelete) | **DELETE** /fax/{fax_id} | Delete Fax -*FaxApi* | [**faxDraftCreate**](docs/FaxApi.md#faxDraftCreate) | **POST** /fax/draft/create | Create Embedded Fax Draft +*FaxApi* | [**faxDraftCreate**](docs/FaxApi.md#faxDraftCreate) | **POST** /fax/draft/create | Create Fax Draft *FaxApi* | [**faxFiles**](docs/FaxApi.md#faxFiles) | **GET** /fax/files/{fax_id} | Download Fax Files *FaxApi* | [**faxGet**](docs/FaxApi.md#faxGet) | **GET** /fax/{fax_id} | Get Fax *FaxApi* | [**faxList**](docs/FaxApi.md#faxList) | **GET** /fax/list | Lists Faxes diff --git a/sdks/java-v1/docs/FaxApi.md b/sdks/java-v1/docs/FaxApi.md index 69431ab4d..f48ca3543 100644 --- a/sdks/java-v1/docs/FaxApi.md +++ b/sdks/java-v1/docs/FaxApi.md @@ -5,7 +5,7 @@ All URIs are relative to *https://api.hellosign.com/v3* | Method | HTTP request | Description | |------------- | ------------- | -------------| [**faxDelete**](FaxApi.md#faxDelete) | **DELETE** /fax/{fax_id} | Delete Fax -[**faxDraftCreate**](FaxApi.md#faxDraftCreate) | **POST** /fax/draft/create | Create Embedded Fax Draft +[**faxDraftCreate**](FaxApi.md#faxDraftCreate) | **POST** /fax/draft/create | Create Fax Draft [**faxFiles**](FaxApi.md#faxFiles) | **GET** /fax/files/{fax_id} | Download Fax Files [**faxGet**](FaxApi.md#faxGet) | **GET** /fax/{fax_id} | Get Fax [**faxList**](FaxApi.md#faxList) | **GET** /fax/list | Lists Faxes @@ -96,9 +96,11 @@ null (empty response body) > FaxDraftCreateResponse faxDraftCreate(faxDraftCreateRequest) -Create Embedded Fax Draft +Create Fax Draft -Creates an embedded Fax draft and returns a URL that can be opened in an approved iframe for preparation and sending. +Creates a Fax draft and returns a URL for preparing and sending the Fax. + +When `client_id` is provided, the draft is embedded and the returned URL must be opened in an approved iframe. When `client_id` is omitted, the draft is a normal Fax draft that opens in Dropbox Fax. ### Example diff --git a/sdks/java-v1/docs/FaxDraftCreateRequest.md b/sdks/java-v1/docs/FaxDraftCreateRequest.md index 1d58bb9a2..d0bf7b751 100644 --- a/sdks/java-v1/docs/FaxDraftCreateRequest.md +++ b/sdks/java-v1/docs/FaxDraftCreateRequest.md @@ -8,11 +8,11 @@ | Name | Type | Description | Notes | |------------ | ------------- | ------------- | -------------| -| `clientId`*_required_ | ```String``` | Client ID of the API app that owns the embedded Fax draft. | | -| `files` | ```List``` | Use `files[]` to upload the file(s) for the embedded Fax draft.

This endpoint accepts either **files** or **file_urls[]**, but not both. Files can be added later in the embedded flow when neither is provided. | | -| `fileUrls` | ```List``` | Use `file_urls[]` to have Dropbox Fax download the file(s) for the embedded Fax draft.

This endpoint accepts either **files** or **file_urls[]**, but not both. Files can be added later in the embedded flow when neither is provided. | | +| `files` | ```List``` | Use `files[]` to upload the file(s) for the Fax draft.

This endpoint accepts either **files** or **file_urls[]**, but not both. Files can be added later when neither is provided. | | +| `fileUrls` | ```List``` | Use `file_urls[]` to have Dropbox Fax download the file(s) for the Fax draft.

This endpoint accepts either **files** or **file_urls[]**, but not both. Files can be added later when neither is provided. | | +| `clientId` | ```String``` | Optional client ID of the API app that owns the embedded Fax draft. When omitted, a normal non-embedded Fax draft is created. | | | `editorOptions` | [```SubEditorPageOptions```](SubEditorPageOptions.md) | | | -| `recipients` | ```Set``` | Fax numbers to prefill in the embedded flow. Each fax number must be in a supported international format. A maximum of 20 unique fax numbers can be provided. | | +| `recipients` | ```Set``` | For embedded Fax drafts only. Fax numbers to prefill in the embedded flow. Each fax number must be in a supported international format. A maximum of 20 unique fax numbers can be provided. | | | `testMode` | ```Boolean``` | When set to `true`, the completed draft will not send a Fax or consume Fax pages. Defaults to `false`. | | diff --git a/sdks/java-v1/docs/FaxDraftResponse.md b/sdks/java-v1/docs/FaxDraftResponse.md index 0e56b7bad..c329079cd 100644 --- a/sdks/java-v1/docs/FaxDraftResponse.md +++ b/sdks/java-v1/docs/FaxDraftResponse.md @@ -2,15 +2,15 @@ # FaxDraftResponse -Contains the embedded Fax draft ID, iframe URL, and expiration timestamp. +Contains the Fax draft ID, prep-and-send URL, and expiration timestamp. ## Properties | Name | Type | Description | Notes | |------------ | ------------- | ------------- | -------------| | `faxId`*_required_ | ```String``` | ID of the Fax draft. | | -| `url`*_required_ | ```String``` | URL to open in an approved iframe for preparing and sending the Fax. | | -| `expiresAt`*_required_ | ```Integer``` | Unix timestamp indicating when the embedded Fax draft URL expires. | | +| `url`*_required_ | ```String``` | URL for preparing and sending the Fax. Embedded draft URLs must be opened in an approved iframe; normal draft URLs open in Dropbox Fax. | | +| `expiresAt`*_required_ | ```Integer``` | Unix timestamp indicating when the Fax draft URL expires. | | diff --git a/sdks/java-v1/docs/SubEditorPageOptions.md b/sdks/java-v1/docs/SubEditorPageOptions.md index 18161f25c..1bf96ca60 100644 --- a/sdks/java-v1/docs/SubEditorPageOptions.md +++ b/sdks/java-v1/docs/SubEditorPageOptions.md @@ -2,7 +2,7 @@ # SubEditorPageOptions -Controls which completed pages are shown again when the embedded Fax draft is opened. +For embedded Fax drafts only. Controls which completed pages are shown again when the draft is opened. ## Properties diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/api/FaxApi.java b/sdks/java-v1/src/main/java/com/dropbox/sign/api/FaxApi.java index 8d0dc2fb9..d1108370e 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/api/FaxApi.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/api/FaxApi.java @@ -117,8 +117,10 @@ public ApiResponse faxDeleteWithHttpInfo(String faxId) throws ApiException } /** - * Create Embedded Fax Draft Creates an embedded Fax draft and returns a URL that can be opened - * in an approved iframe for preparation and sending. + * Create Fax Draft Creates a Fax draft and returns a URL for preparing and sending the Fax. + * When `client_id` is provided, the draft is embedded and the returned URL must be + * opened in an approved iframe. When `client_id` is omitted, the draft is a normal + * Fax draft that opens in Dropbox Fax. * * @param faxDraftCreateRequest (required) * @return FaxDraftCreateResponse @@ -137,8 +139,10 @@ public FaxDraftCreateResponse faxDraftCreate(FaxDraftCreateRequest faxDraftCreat } /** - * Create Embedded Fax Draft Creates an embedded Fax draft and returns a URL that can be opened - * in an approved iframe for preparation and sending. + * Create Fax Draft Creates a Fax draft and returns a URL for preparing and sending the Fax. + * When `client_id` is provided, the draft is embedded and the returned URL must be + * opened in an approved iframe. When `client_id` is omitted, the draft is a normal + * Fax draft that opens in Dropbox Fax. * * @param faxDraftCreateRequest (required) * @return ApiResponse<FaxDraftCreateResponse> diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/model/FaxDraftCreateRequest.java b/sdks/java-v1/src/main/java/com/dropbox/sign/model/FaxDraftCreateRequest.java index 2cab759de..709e1bf9d 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/model/FaxDraftCreateRequest.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/model/FaxDraftCreateRequest.java @@ -31,9 +31,9 @@ /** FaxDraftCreateRequest */ @JsonPropertyOrder({ - FaxDraftCreateRequest.JSON_PROPERTY_CLIENT_ID, FaxDraftCreateRequest.JSON_PROPERTY_FILES, FaxDraftCreateRequest.JSON_PROPERTY_FILE_URLS, + FaxDraftCreateRequest.JSON_PROPERTY_CLIENT_ID, FaxDraftCreateRequest.JSON_PROPERTY_EDITOR_OPTIONS, FaxDraftCreateRequest.JSON_PROPERTY_RECIPIENTS, FaxDraftCreateRequest.JSON_PROPERTY_TEST_MODE @@ -43,15 +43,15 @@ comments = "Generator version: 7.12.0") @JsonIgnoreProperties(ignoreUnknown = true) public class FaxDraftCreateRequest { - public static final String JSON_PROPERTY_CLIENT_ID = "client_id"; - @javax.annotation.Nonnull private String clientId; - public static final String JSON_PROPERTY_FILES = "files"; @javax.annotation.Nullable private List files = null; public static final String JSON_PROPERTY_FILE_URLS = "file_urls"; @javax.annotation.Nullable private List fileUrls = null; + public static final String JSON_PROPERTY_CLIENT_ID = "client_id"; + @javax.annotation.Nullable private String clientId; + public static final String JSON_PROPERTY_EDITOR_OPTIONS = "editor_options"; @javax.annotation.Nullable private SubEditorPageOptions editorOptions; @@ -78,29 +78,6 @@ public static FaxDraftCreateRequest init(HashMap data) throws Exception { new ObjectMapper().writeValueAsString(data), FaxDraftCreateRequest.class); } - public FaxDraftCreateRequest clientId(@javax.annotation.Nonnull String clientId) { - this.clientId = clientId; - return this; - } - - /** - * Client ID of the API app that owns the embedded Fax draft. - * - * @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(@javax.annotation.Nonnull String clientId) { - this.clientId = clientId; - } - public FaxDraftCreateRequest files(@javax.annotation.Nullable List files) { this.files = files; return this; @@ -115,9 +92,9 @@ public FaxDraftCreateRequest addFilesItem(File filesItem) { } /** - * Use `files[]` to upload the file(s) for the embedded Fax draft. This endpoint - * accepts either **files** or **file_urls[]**, but not both. Files can be added later in the - * embedded flow when neither is provided. + * Use `files[]` to upload the file(s) for the Fax draft. This endpoint accepts either + * **files** or **file_urls[]**, but not both. Files can be added later when neither is + * provided. * * @return files */ @@ -147,9 +124,9 @@ public FaxDraftCreateRequest addFileUrlsItem(String fileUrlsItem) { } /** - * Use `file_urls[]` to have Dropbox Fax download the file(s) for the embedded Fax - * draft. This endpoint accepts either **files** or **file_urls[]**, but not both. Files can be - * added later in the embedded flow when neither is provided. + * Use `file_urls[]` to have Dropbox Fax download the file(s) for the Fax draft. This + * endpoint accepts either **files** or **file_urls[]**, but not both. Files can be added later + * when neither is provided. * * @return fileUrls */ @@ -165,6 +142,29 @@ public void setFileUrls(@javax.annotation.Nullable List fileUrls) { this.fileUrls = fileUrls; } + public FaxDraftCreateRequest clientId(@javax.annotation.Nullable String clientId) { + this.clientId = clientId; + return this; + } + + /** + * Optional client ID of the API app that owns the embedded Fax draft. When omitted, a normal + * non-embedded Fax draft is created. + * + * @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(@javax.annotation.Nullable String clientId) { + this.clientId = clientId; + } + public FaxDraftCreateRequest editorOptions( @javax.annotation.Nullable SubEditorPageOptions editorOptions) { this.editorOptions = editorOptions; @@ -202,8 +202,9 @@ public FaxDraftCreateRequest addRecipientsItem(String recipientsItem) { } /** - * Fax numbers to prefill in the embedded flow. Each fax number must be in a supported - * international format. A maximum of 20 unique fax numbers can be provided. + * For embedded Fax drafts only. Fax numbers to prefill in the embedded flow. Each fax number + * must be in a supported international format. A maximum of 20 unique fax numbers can be + * provided. * * @return recipients */ @@ -253,9 +254,9 @@ public boolean equals(Object o) { return false; } FaxDraftCreateRequest faxDraftCreateRequest = (FaxDraftCreateRequest) o; - return Objects.equals(this.clientId, faxDraftCreateRequest.clientId) - && Objects.equals(this.files, faxDraftCreateRequest.files) + return Objects.equals(this.files, faxDraftCreateRequest.files) && Objects.equals(this.fileUrls, faxDraftCreateRequest.fileUrls) + && Objects.equals(this.clientId, faxDraftCreateRequest.clientId) && Objects.equals(this.editorOptions, faxDraftCreateRequest.editorOptions) && Objects.equals(this.recipients, faxDraftCreateRequest.recipients) && Objects.equals(this.testMode, faxDraftCreateRequest.testMode); @@ -263,16 +264,16 @@ public boolean equals(Object o) { @Override public int hashCode() { - return Objects.hash(clientId, files, fileUrls, editorOptions, recipients, testMode); + return Objects.hash(files, fileUrls, clientId, editorOptions, recipients, testMode); } @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class FaxDraftCreateRequest {\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(" clientId: ").append(toIndentedString(clientId)).append("\n"); sb.append(" editorOptions: ").append(toIndentedString(editorOptions)).append("\n"); sb.append(" recipients: ").append(toIndentedString(recipients)).append("\n"); sb.append(" testMode: ").append(toIndentedString(testMode)).append("\n"); @@ -284,26 +285,6 @@ 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; @@ -342,6 +323,26 @@ public Map createFormData() throws ApiException { JSON.getDefault().getMapper().writeValueAsString(fileUrls)); } } + 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 (editorOptions != null) { if (isFileTypeOrListOfFiles(editorOptions)) { fileTypeFound = true; diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/model/FaxDraftResponse.java b/sdks/java-v1/src/main/java/com/dropbox/sign/model/FaxDraftResponse.java index 314bca218..3c6a3ec0a 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/model/FaxDraftResponse.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/model/FaxDraftResponse.java @@ -23,7 +23,7 @@ import java.util.Map; import java.util.Objects; -/** Contains the embedded Fax draft ID, iframe URL, and expiration timestamp. */ +/** Contains the Fax draft ID, prep-and-send URL, and expiration timestamp. */ @JsonPropertyOrder({ FaxDraftResponse.JSON_PROPERTY_FAX_ID, FaxDraftResponse.JSON_PROPERTY_URL, @@ -88,7 +88,8 @@ public FaxDraftResponse url(@javax.annotation.Nonnull String url) { } /** - * URL to open in an approved iframe for preparing and sending the Fax. + * URL for preparing and sending the Fax. Embedded draft URLs must be opened in an approved + * iframe; normal draft URLs open in Dropbox Fax. * * @return url */ @@ -111,7 +112,7 @@ public FaxDraftResponse expiresAt(@javax.annotation.Nonnull Integer expiresAt) { } /** - * Unix timestamp indicating when the embedded Fax draft URL expires. + * Unix timestamp indicating when the Fax draft URL expires. * * @return expiresAt */ diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/model/SubEditorPageOptions.java b/sdks/java-v1/src/main/java/com/dropbox/sign/model/SubEditorPageOptions.java index d43170c4f..9a0251b98 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/model/SubEditorPageOptions.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/model/SubEditorPageOptions.java @@ -23,7 +23,10 @@ import java.util.Map; import java.util.Objects; -/** Controls which completed pages are shown again when the embedded Fax draft is opened. */ +/** + * For embedded Fax drafts only. Controls which completed pages are shown again when the draft is + * opened. + */ @JsonPropertyOrder({ SubEditorPageOptions.JSON_PROPERTY_FORCE_UPLOAD_PAGE, SubEditorPageOptions.JSON_PROPERTY_FORCE_EDITOR_PAGE, diff --git a/sdks/java-v2/README.md b/sdks/java-v2/README.md index 4f0f88675..c78ed7e28 100644 --- a/sdks/java-v2/README.md +++ b/sdks/java-v2/README.md @@ -164,7 +164,7 @@ Class | Method | HTTP request | Description *EmbeddedApi* | [**embeddedEditUrl**](docs/EmbeddedApi.md#embeddedEditUrl) | **POST** /embedded/edit_url/{template_id} | Get Embedded Template Edit URL *EmbeddedApi* | [**embeddedSignUrl**](docs/EmbeddedApi.md#embeddedSignUrl) | **GET** /embedded/sign_url/{signature_id} | Get Embedded Sign URL *FaxApi* | [**faxDelete**](docs/FaxApi.md#faxDelete) | **DELETE** /fax/{fax_id} | Delete Fax -*FaxApi* | [**faxDraftCreate**](docs/FaxApi.md#faxDraftCreate) | **POST** /fax/draft/create | Create Embedded Fax Draft +*FaxApi* | [**faxDraftCreate**](docs/FaxApi.md#faxDraftCreate) | **POST** /fax/draft/create | Create Fax Draft *FaxApi* | [**faxFiles**](docs/FaxApi.md#faxFiles) | **GET** /fax/files/{fax_id} | Download Fax Files *FaxApi* | [**faxGet**](docs/FaxApi.md#faxGet) | **GET** /fax/{fax_id} | Get Fax *FaxApi* | [**faxList**](docs/FaxApi.md#faxList) | **GET** /fax/list | Lists Faxes diff --git a/sdks/java-v2/docs/FaxApi.md b/sdks/java-v2/docs/FaxApi.md index 69431ab4d..f48ca3543 100644 --- a/sdks/java-v2/docs/FaxApi.md +++ b/sdks/java-v2/docs/FaxApi.md @@ -5,7 +5,7 @@ All URIs are relative to *https://api.hellosign.com/v3* | Method | HTTP request | Description | |------------- | ------------- | -------------| [**faxDelete**](FaxApi.md#faxDelete) | **DELETE** /fax/{fax_id} | Delete Fax -[**faxDraftCreate**](FaxApi.md#faxDraftCreate) | **POST** /fax/draft/create | Create Embedded Fax Draft +[**faxDraftCreate**](FaxApi.md#faxDraftCreate) | **POST** /fax/draft/create | Create Fax Draft [**faxFiles**](FaxApi.md#faxFiles) | **GET** /fax/files/{fax_id} | Download Fax Files [**faxGet**](FaxApi.md#faxGet) | **GET** /fax/{fax_id} | Get Fax [**faxList**](FaxApi.md#faxList) | **GET** /fax/list | Lists Faxes @@ -96,9 +96,11 @@ null (empty response body) > FaxDraftCreateResponse faxDraftCreate(faxDraftCreateRequest) -Create Embedded Fax Draft +Create Fax Draft -Creates an embedded Fax draft and returns a URL that can be opened in an approved iframe for preparation and sending. +Creates a Fax draft and returns a URL for preparing and sending the Fax. + +When `client_id` is provided, the draft is embedded and the returned URL must be opened in an approved iframe. When `client_id` is omitted, the draft is a normal Fax draft that opens in Dropbox Fax. ### Example diff --git a/sdks/java-v2/docs/FaxDraftCreateRequest.md b/sdks/java-v2/docs/FaxDraftCreateRequest.md index 1d58bb9a2..d0bf7b751 100644 --- a/sdks/java-v2/docs/FaxDraftCreateRequest.md +++ b/sdks/java-v2/docs/FaxDraftCreateRequest.md @@ -8,11 +8,11 @@ | Name | Type | Description | Notes | |------------ | ------------- | ------------- | -------------| -| `clientId`*_required_ | ```String``` | Client ID of the API app that owns the embedded Fax draft. | | -| `files` | ```List``` | Use `files[]` to upload the file(s) for the embedded Fax draft.

This endpoint accepts either **files** or **file_urls[]**, but not both. Files can be added later in the embedded flow when neither is provided. | | -| `fileUrls` | ```List``` | Use `file_urls[]` to have Dropbox Fax download the file(s) for the embedded Fax draft.

This endpoint accepts either **files** or **file_urls[]**, but not both. Files can be added later in the embedded flow when neither is provided. | | +| `files` | ```List``` | Use `files[]` to upload the file(s) for the Fax draft.

This endpoint accepts either **files** or **file_urls[]**, but not both. Files can be added later when neither is provided. | | +| `fileUrls` | ```List``` | Use `file_urls[]` to have Dropbox Fax download the file(s) for the Fax draft.

This endpoint accepts either **files** or **file_urls[]**, but not both. Files can be added later when neither is provided. | | +| `clientId` | ```String``` | Optional client ID of the API app that owns the embedded Fax draft. When omitted, a normal non-embedded Fax draft is created. | | | `editorOptions` | [```SubEditorPageOptions```](SubEditorPageOptions.md) | | | -| `recipients` | ```Set``` | Fax numbers to prefill in the embedded flow. Each fax number must be in a supported international format. A maximum of 20 unique fax numbers can be provided. | | +| `recipients` | ```Set``` | For embedded Fax drafts only. Fax numbers to prefill in the embedded flow. Each fax number must be in a supported international format. A maximum of 20 unique fax numbers can be provided. | | | `testMode` | ```Boolean``` | When set to `true`, the completed draft will not send a Fax or consume Fax pages. Defaults to `false`. | | diff --git a/sdks/java-v2/docs/FaxDraftResponse.md b/sdks/java-v2/docs/FaxDraftResponse.md index 0e56b7bad..c329079cd 100644 --- a/sdks/java-v2/docs/FaxDraftResponse.md +++ b/sdks/java-v2/docs/FaxDraftResponse.md @@ -2,15 +2,15 @@ # FaxDraftResponse -Contains the embedded Fax draft ID, iframe URL, and expiration timestamp. +Contains the Fax draft ID, prep-and-send URL, and expiration timestamp. ## Properties | Name | Type | Description | Notes | |------------ | ------------- | ------------- | -------------| | `faxId`*_required_ | ```String``` | ID of the Fax draft. | | -| `url`*_required_ | ```String``` | URL to open in an approved iframe for preparing and sending the Fax. | | -| `expiresAt`*_required_ | ```Integer``` | Unix timestamp indicating when the embedded Fax draft URL expires. | | +| `url`*_required_ | ```String``` | URL for preparing and sending the Fax. Embedded draft URLs must be opened in an approved iframe; normal draft URLs open in Dropbox Fax. | | +| `expiresAt`*_required_ | ```Integer``` | Unix timestamp indicating when the Fax draft URL expires. | | diff --git a/sdks/java-v2/docs/SubEditorPageOptions.md b/sdks/java-v2/docs/SubEditorPageOptions.md index 18161f25c..1bf96ca60 100644 --- a/sdks/java-v2/docs/SubEditorPageOptions.md +++ b/sdks/java-v2/docs/SubEditorPageOptions.md @@ -2,7 +2,7 @@ # SubEditorPageOptions -Controls which completed pages are shown again when the embedded Fax draft is opened. +For embedded Fax drafts only. Controls which completed pages are shown again when the draft is opened. ## Properties diff --git a/sdks/java-v2/src/main/java/com/dropbox/sign/api/FaxApi.java b/sdks/java-v2/src/main/java/com/dropbox/sign/api/FaxApi.java index 83093f7d1..9fd05c6d3 100644 --- a/sdks/java-v2/src/main/java/com/dropbox/sign/api/FaxApi.java +++ b/sdks/java-v2/src/main/java/com/dropbox/sign/api/FaxApi.java @@ -118,8 +118,8 @@ public ApiResponse faxDeleteWithHttpInfo(String faxId) throws ApiException ); } /** - * Create Embedded Fax Draft - * Creates an embedded Fax draft and returns a URL that can be opened in an approved iframe for preparation and sending. + * Create Fax Draft + * Creates a Fax draft and returns a URL for preparing and sending the Fax. When `client_id` is provided, the draft is embedded and the returned URL must be opened in an approved iframe. When `client_id` is omitted, the draft is a normal Fax draft that opens in Dropbox Fax. * @param faxDraftCreateRequest (required) * @return FaxDraftCreateResponse * @throws ApiException if fails to make API call @@ -137,8 +137,8 @@ public FaxDraftCreateResponse faxDraftCreate(FaxDraftCreateRequest faxDraftCreat /** - * Create Embedded Fax Draft - * Creates an embedded Fax draft and returns a URL that can be opened in an approved iframe for preparation and sending. + * Create Fax Draft + * Creates a Fax draft and returns a URL for preparing and sending the Fax. When `client_id` is provided, the draft is embedded and the returned URL must be opened in an approved iframe. When `client_id` is omitted, the draft is a normal Fax draft that opens in Dropbox Fax. * @param faxDraftCreateRequest (required) * @return ApiResponse<FaxDraftCreateResponse> * @throws ApiException if fails to make API call diff --git a/sdks/java-v2/src/main/java/com/dropbox/sign/model/FaxDraftCreateRequest.java b/sdks/java-v2/src/main/java/com/dropbox/sign/model/FaxDraftCreateRequest.java index 4a0bf78d1..388a7670b 100644 --- a/sdks/java-v2/src/main/java/com/dropbox/sign/model/FaxDraftCreateRequest.java +++ b/sdks/java-v2/src/main/java/com/dropbox/sign/model/FaxDraftCreateRequest.java @@ -40,9 +40,9 @@ * FaxDraftCreateRequest */ @JsonPropertyOrder({ - FaxDraftCreateRequest.JSON_PROPERTY_CLIENT_ID, FaxDraftCreateRequest.JSON_PROPERTY_FILES, FaxDraftCreateRequest.JSON_PROPERTY_FILE_URLS, + FaxDraftCreateRequest.JSON_PROPERTY_CLIENT_ID, FaxDraftCreateRequest.JSON_PROPERTY_EDITOR_OPTIONS, FaxDraftCreateRequest.JSON_PROPERTY_RECIPIENTS, FaxDraftCreateRequest.JSON_PROPERTY_TEST_MODE @@ -50,10 +50,6 @@ @jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.12.0") @JsonIgnoreProperties(ignoreUnknown=true) public class FaxDraftCreateRequest { - public static final String JSON_PROPERTY_CLIENT_ID = "client_id"; - @jakarta.annotation.Nonnull - private String clientId; - public static final String JSON_PROPERTY_FILES = "files"; @jakarta.annotation.Nullable private List files = null; @@ -62,6 +58,10 @@ public class FaxDraftCreateRequest { @jakarta.annotation.Nullable private List fileUrls = null; + public static final String JSON_PROPERTY_CLIENT_ID = "client_id"; + @jakarta.annotation.Nullable + private String clientId; + public static final String JSON_PROPERTY_EDITOR_OPTIONS = "editor_options"; @jakarta.annotation.Nullable private SubEditorPageOptions editorOptions; @@ -92,31 +92,6 @@ static public FaxDraftCreateRequest init(HashMap data) throws Exception { ); } - public FaxDraftCreateRequest clientId(@jakarta.annotation.Nonnull String clientId) { - this.clientId = clientId; - return this; - } - - /** - * Client ID of the API app that owns the embedded Fax draft. - * @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(@jakarta.annotation.Nonnull String clientId) { - this.clientId = clientId; - } - - public FaxDraftCreateRequest files(@jakarta.annotation.Nullable List files) { this.files = files; return this; @@ -131,7 +106,7 @@ public FaxDraftCreateRequest addFilesItem(File filesItem) { } /** - * Use `files[]` to upload the file(s) for the embedded Fax draft. This endpoint accepts either **files** or **file_urls[]**, but not both. Files can be added later in the embedded flow when neither is provided. + * Use `files[]` to upload the file(s) for the Fax draft. This endpoint accepts either **files** or **file_urls[]**, but not both. Files can be added later when neither is provided. * @return files */ @jakarta.annotation.Nullable @@ -164,7 +139,7 @@ public FaxDraftCreateRequest addFileUrlsItem(String fileUrlsItem) { } /** - * Use `file_urls[]` to have Dropbox Fax download the file(s) for the embedded Fax draft. This endpoint accepts either **files** or **file_urls[]**, but not both. Files can be added later in the embedded flow when neither is provided. + * Use `file_urls[]` to have Dropbox Fax download the file(s) for the Fax draft. This endpoint accepts either **files** or **file_urls[]**, but not both. Files can be added later when neither is provided. * @return fileUrls */ @jakarta.annotation.Nullable @@ -183,6 +158,31 @@ public void setFileUrls(@jakarta.annotation.Nullable List fileUrls) { } + public FaxDraftCreateRequest clientId(@jakarta.annotation.Nullable String clientId) { + this.clientId = clientId; + return this; + } + + /** + * Optional client ID of the API app that owns the embedded Fax draft. When omitted, a normal non-embedded Fax draft is created. + * @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(@jakarta.annotation.Nullable String clientId) { + this.clientId = clientId; + } + + public FaxDraftCreateRequest editorOptions(@jakarta.annotation.Nullable SubEditorPageOptions editorOptions) { this.editorOptions = editorOptions; return this; @@ -222,7 +222,7 @@ public FaxDraftCreateRequest addRecipientsItem(String recipientsItem) { } /** - * Fax numbers to prefill in the embedded flow. Each fax number must be in a supported international format. A maximum of 20 unique fax numbers can be provided. + * For embedded Fax drafts only. Fax numbers to prefill in the embedded flow. Each fax number must be in a supported international format. A maximum of 20 unique fax numbers can be provided. * @return recipients */ @jakarta.annotation.Nullable @@ -279,9 +279,9 @@ public boolean equals(Object o) { return false; } FaxDraftCreateRequest faxDraftCreateRequest = (FaxDraftCreateRequest) o; - return Objects.equals(this.clientId, faxDraftCreateRequest.clientId) && - Objects.equals(this.files, faxDraftCreateRequest.files) && + return Objects.equals(this.files, faxDraftCreateRequest.files) && Objects.equals(this.fileUrls, faxDraftCreateRequest.fileUrls) && + Objects.equals(this.clientId, faxDraftCreateRequest.clientId) && Objects.equals(this.editorOptions, faxDraftCreateRequest.editorOptions) && Objects.equals(this.recipients, faxDraftCreateRequest.recipients) && Objects.equals(this.testMode, faxDraftCreateRequest.testMode); @@ -289,16 +289,16 @@ public boolean equals(Object o) { @Override public int hashCode() { - return Objects.hash(clientId, files, fileUrls, editorOptions, recipients, testMode); + return Objects.hash(files, fileUrls, clientId, editorOptions, recipients, testMode); } @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class FaxDraftCreateRequest {\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(" clientId: ").append(toIndentedString(clientId)).append("\n"); sb.append(" editorOptions: ").append(toIndentedString(editorOptions)).append("\n"); sb.append(" recipients: ").append(toIndentedString(recipients)).append("\n"); sb.append(" testMode: ").append(toIndentedString(testMode)).append("\n"); @@ -310,25 +310,6 @@ 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; @@ -367,6 +348,25 @@ public Map createFormData() throws ApiException { map.put("file_urls", JSON.getDefault().getMapper().writeValueAsString(fileUrls)); } } + 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 (editorOptions != null) { if (isFileTypeOrListOfFiles(editorOptions)) { fileTypeFound = true; diff --git a/sdks/java-v2/src/main/java/com/dropbox/sign/model/FaxDraftResponse.java b/sdks/java-v2/src/main/java/com/dropbox/sign/model/FaxDraftResponse.java index 0ece9cdff..40a7eb5da 100644 --- a/sdks/java-v2/src/main/java/com/dropbox/sign/model/FaxDraftResponse.java +++ b/sdks/java-v2/src/main/java/com/dropbox/sign/model/FaxDraftResponse.java @@ -30,7 +30,7 @@ import com.dropbox.sign.ApiException; /** - * Contains the embedded Fax draft ID, iframe URL, and expiration timestamp. + * Contains the Fax draft ID, prep-and-send URL, and expiration timestamp. */ @JsonPropertyOrder({ FaxDraftResponse.JSON_PROPERTY_FAX_ID, @@ -101,7 +101,7 @@ public FaxDraftResponse url(@jakarta.annotation.Nonnull String url) { } /** - * URL to open in an approved iframe for preparing and sending the Fax. + * URL for preparing and sending the Fax. Embedded draft URLs must be opened in an approved iframe; normal draft URLs open in Dropbox Fax. * @return url */ @jakarta.annotation.Nonnull @@ -126,7 +126,7 @@ public FaxDraftResponse expiresAt(@jakarta.annotation.Nonnull Integer expiresAt) } /** - * Unix timestamp indicating when the embedded Fax draft URL expires. + * Unix timestamp indicating when the Fax draft URL expires. * @return expiresAt */ @jakarta.annotation.Nonnull diff --git a/sdks/java-v2/src/main/java/com/dropbox/sign/model/SubEditorPageOptions.java b/sdks/java-v2/src/main/java/com/dropbox/sign/model/SubEditorPageOptions.java index 81d20bfb7..f3caad643 100644 --- a/sdks/java-v2/src/main/java/com/dropbox/sign/model/SubEditorPageOptions.java +++ b/sdks/java-v2/src/main/java/com/dropbox/sign/model/SubEditorPageOptions.java @@ -30,7 +30,7 @@ import com.dropbox.sign.ApiException; /** - * Controls which completed pages are shown again when the embedded Fax draft is opened. + * For embedded Fax drafts only. Controls which completed pages are shown again when the draft is opened. */ @JsonPropertyOrder({ SubEditorPageOptions.JSON_PROPERTY_FORCE_UPLOAD_PAGE, diff --git a/sdks/node/README.md b/sdks/node/README.md index 75bd6eacf..26ae361a4 100644 --- a/sdks/node/README.md +++ b/sdks/node/README.md @@ -93,7 +93,7 @@ All URIs are relative to *https://api.hellosign.com/v3* | *EmbeddedApi* | [**embeddedEditUrl**](./docs/api/EmbeddedApi.md#embeddedediturl) | **POST** /embedded/edit_url/{template_id} | Get Embedded Template Edit URL | | *EmbeddedApi* | [**embeddedSignUrl**](./docs/api/EmbeddedApi.md#embeddedsignurl) | **GET** /embedded/sign_url/{signature_id} | Get Embedded Sign URL | | *FaxApi* | [**faxDelete**](./docs/api/FaxApi.md#faxdelete) | **DELETE** /fax/{fax_id} | Delete Fax | -| *FaxApi* | [**faxDraftCreate**](./docs/api/FaxApi.md#faxdraftcreate) | **POST** /fax/draft/create | Create Embedded Fax Draft | +| *FaxApi* | [**faxDraftCreate**](./docs/api/FaxApi.md#faxdraftcreate) | **POST** /fax/draft/create | Create Fax Draft | | *FaxApi* | [**faxFiles**](./docs/api/FaxApi.md#faxfiles) | **GET** /fax/files/{fax_id} | Download Fax Files | | *FaxApi* | [**faxGet**](./docs/api/FaxApi.md#faxget) | **GET** /fax/{fax_id} | Get Fax | | *FaxApi* | [**faxList**](./docs/api/FaxApi.md#faxlist) | **GET** /fax/list | Lists Faxes | diff --git a/sdks/node/api/faxApi.ts b/sdks/node/api/faxApi.ts index cbcefc0d2..2bd50ff74 100644 --- a/sdks/node/api/faxApi.ts +++ b/sdks/node/api/faxApi.ts @@ -222,8 +222,8 @@ export class FaxApi { }); } /** - * Creates an embedded Fax draft and returns a URL that can be opened in an approved iframe for preparation and sending. - * @summary Create Embedded Fax Draft + * Creates a Fax draft and returns a URL for preparing and sending the Fax. When `client_id` is provided, the draft is embedded and the returned URL must be opened in an approved iframe. When `client_id` is omitted, the draft is a normal Fax draft that opens in Dropbox Fax. + * @summary Create Fax Draft * @param faxDraftCreateRequest * @param options */ diff --git a/sdks/node/dist/api.js b/sdks/node/dist/api.js index abc7781fd..6fcc5565c 100644 --- a/sdks/node/dist/api.js +++ b/sdks/node/dist/api.js @@ -18224,11 +18224,6 @@ var FaxDraftCreateRequest = class _FaxDraftCreateRequest { } static { this.attributeTypeMap = [ - { - name: "clientId", - baseName: "client_id", - type: "string" - }, { name: "files", baseName: "files", @@ -18239,6 +18234,11 @@ var FaxDraftCreateRequest = class _FaxDraftCreateRequest { baseName: "file_urls", type: "Array" }, + { + name: "clientId", + baseName: "client_id", + type: "string" + }, { name: "editorOptions", baseName: "editor_options", @@ -29186,8 +29186,8 @@ var FaxApi = class { }); } /** - * Creates an embedded Fax draft and returns a URL that can be opened in an approved iframe for preparation and sending. - * @summary Create Embedded Fax Draft + * Creates a Fax draft and returns a URL for preparing and sending the Fax. When `client_id` is provided, the draft is embedded and the returned URL must be opened in an approved iframe. When `client_id` is omitted, the draft is a normal Fax draft that opens in Dropbox Fax. + * @summary Create Fax Draft * @param faxDraftCreateRequest * @param options */ diff --git a/sdks/node/docs/api/FaxApi.md b/sdks/node/docs/api/FaxApi.md index e49af9b5c..bbac951ac 100644 --- a/sdks/node/docs/api/FaxApi.md +++ b/sdks/node/docs/api/FaxApi.md @@ -5,7 +5,7 @@ All URIs are relative to https://api.hellosign.com/v3. | Method | HTTP request | Description | | ------------- | ------------- | ------------- | | [**faxDelete()**](FaxApi.md#faxDelete) | **DELETE** /fax/{fax_id} | Delete Fax | -| [**faxDraftCreate()**](FaxApi.md#faxDraftCreate) | **POST** /fax/draft/create | Create Embedded Fax Draft | +| [**faxDraftCreate()**](FaxApi.md#faxDraftCreate) | **POST** /fax/draft/create | Create Fax Draft | | [**faxFiles()**](FaxApi.md#faxFiles) | **GET** /fax/files/{fax_id} | Download Fax Files | | [**faxGet()**](FaxApi.md#faxGet) | **GET** /fax/{fax_id} | Get Fax | | [**faxList()**](FaxApi.md#faxList) | **GET** /fax/list | Lists Faxes | @@ -70,9 +70,9 @@ void (empty response body) faxDraftCreate(faxDraftCreateRequest: FaxDraftCreateRequest): FaxDraftCreateResponse ``` -Create Embedded Fax Draft +Create Fax Draft -Creates an embedded Fax draft and returns a URL that can be opened in an approved iframe for preparation and sending. +Creates a Fax draft and returns a URL for preparing and sending the Fax. When `client_id` is provided, the draft is embedded and the returned URL must be opened in an approved iframe. When `client_id` is omitted, the draft is a normal Fax draft that opens in Dropbox Fax. ### TypeScript Example diff --git a/sdks/node/docs/model/FaxDraftCreateRequest.md b/sdks/node/docs/model/FaxDraftCreateRequest.md index bbfc7c24b..df84649d7 100644 --- a/sdks/node/docs/model/FaxDraftCreateRequest.md +++ b/sdks/node/docs/model/FaxDraftCreateRequest.md @@ -6,11 +6,11 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -| `clientId`*_required_ | ```string``` | Client ID of the API app that owns the embedded Fax draft. | | -| `files` | ```Array``` | Use `files[]` to upload the file(s) for the embedded Fax draft.

This endpoint accepts either **files** or **file_urls[]**, but not both. Files can be added later in the embedded flow when neither is provided. | | -| `fileUrls` | ```Array``` | Use `file_urls[]` to have Dropbox Fax download the file(s) for the embedded Fax draft.

This endpoint accepts either **files** or **file_urls[]**, but not both. Files can be added later in the embedded flow when neither is provided. | | +| `files` | ```Array``` | Use `files[]` to upload the file(s) for the Fax draft.

This endpoint accepts either **files** or **file_urls[]**, but not both. Files can be added later when neither is provided. | | +| `fileUrls` | ```Array``` | Use `file_urls[]` to have Dropbox Fax download the file(s) for the Fax draft.

This endpoint accepts either **files** or **file_urls[]**, but not both. Files can be added later when neither is provided. | | +| `clientId` | ```string``` | Optional client ID of the API app that owns the embedded Fax draft. When omitted, a normal non-embedded Fax draft is created. | | | `editorOptions` | [```SubEditorPageOptions```](SubEditorPageOptions.md) | | | -| `recipients` | ```Set``` | Fax numbers to prefill in the embedded flow. Each fax number must be in a supported international format. A maximum of 20 unique fax numbers can be provided. | | +| `recipients` | ```Set``` | For embedded Fax drafts only. Fax numbers to prefill in the embedded flow. Each fax number must be in a supported international format. A maximum of 20 unique fax numbers can be provided. | | | `testMode` | ```boolean``` | When set to `true`, the completed draft will not send a Fax or consume Fax pages. Defaults to `false`. | [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/FaxDraftResponse.md b/sdks/node/docs/model/FaxDraftResponse.md index 5d4b2de94..99ceb54ed 100644 --- a/sdks/node/docs/model/FaxDraftResponse.md +++ b/sdks/node/docs/model/FaxDraftResponse.md @@ -1,13 +1,13 @@ # # FaxDraftResponse -Contains the embedded Fax draft ID, iframe URL, and expiration timestamp. +Contains the Fax draft ID, prep-and-send URL, and expiration timestamp. ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- | `faxId`*_required_ | ```string``` | ID of the Fax draft. | | -| `url`*_required_ | ```string``` | URL to open in an approved iframe for preparing and sending the Fax. | | -| `expiresAt`*_required_ | ```number``` | Unix timestamp indicating when the embedded Fax draft URL expires. | | +| `url`*_required_ | ```string``` | URL for preparing and sending the Fax. Embedded draft URLs must be opened in an approved iframe; normal draft URLs open in Dropbox Fax. | | +| `expiresAt`*_required_ | ```number``` | Unix timestamp indicating when the Fax draft URL expires. | | [[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/SubEditorPageOptions.md b/sdks/node/docs/model/SubEditorPageOptions.md index a4f3a9cdb..991824b40 100644 --- a/sdks/node/docs/model/SubEditorPageOptions.md +++ b/sdks/node/docs/model/SubEditorPageOptions.md @@ -1,6 +1,6 @@ # # SubEditorPageOptions -Controls which completed pages are shown again when the embedded Fax draft is opened. +For embedded Fax drafts only. Controls which completed pages are shown again when the draft is opened. ## Properties diff --git a/sdks/node/model/faxDraftCreateRequest.ts b/sdks/node/model/faxDraftCreateRequest.ts index cb81bfa47..933bdd7ae 100644 --- a/sdks/node/model/faxDraftCreateRequest.ts +++ b/sdks/node/model/faxDraftCreateRequest.ts @@ -27,20 +27,20 @@ import { SubEditorPageOptions } from "./subEditorPageOptions"; export class FaxDraftCreateRequest { /** - * Client ID of the API app that owns the embedded Fax draft. - */ - "clientId": string; - /** - * Use `files[]` to upload the file(s) for the embedded Fax draft. This endpoint accepts either **files** or **file_urls[]**, but not both. Files can be added later in the embedded flow when neither is provided. + * Use `files[]` to upload the file(s) for the Fax draft. This endpoint accepts either **files** or **file_urls[]**, but not both. Files can be added later when neither is provided. */ "files"?: Array; /** - * Use `file_urls[]` to have Dropbox Fax download the file(s) for the embedded Fax draft. This endpoint accepts either **files** or **file_urls[]**, but not both. Files can be added later in the embedded flow when neither is provided. + * Use `file_urls[]` to have Dropbox Fax download the file(s) for the Fax draft. This endpoint accepts either **files** or **file_urls[]**, but not both. Files can be added later when neither is provided. */ "fileUrls"?: Array; + /** + * Optional client ID of the API app that owns the embedded Fax draft. When omitted, a normal non-embedded Fax draft is created. + */ + "clientId"?: string; "editorOptions"?: SubEditorPageOptions; /** - * Fax numbers to prefill in the embedded flow. Each fax number must be in a supported international format. A maximum of 20 unique fax numbers can be provided. + * For embedded Fax drafts only. Fax numbers to prefill in the embedded flow. Each fax number must be in a supported international format. A maximum of 20 unique fax numbers can be provided. */ "recipients"?: Set; /** @@ -51,11 +51,6 @@ export class FaxDraftCreateRequest { static discriminator: string | undefined = undefined; static attributeTypeMap: AttributeTypeMap = [ - { - name: "clientId", - baseName: "client_id", - type: "string", - }, { name: "files", baseName: "files", @@ -66,6 +61,11 @@ export class FaxDraftCreateRequest { baseName: "file_urls", type: "Array", }, + { + name: "clientId", + baseName: "client_id", + type: "string", + }, { name: "editorOptions", baseName: "editor_options", diff --git a/sdks/node/model/faxDraftResponse.ts b/sdks/node/model/faxDraftResponse.ts index bba821eaf..d0994a1a0 100644 --- a/sdks/node/model/faxDraftResponse.ts +++ b/sdks/node/model/faxDraftResponse.ts @@ -25,7 +25,7 @@ import { AttributeTypeMap, ObjectSerializer } from "./"; /** - * Contains the embedded Fax draft ID, iframe URL, and expiration timestamp. + * Contains the Fax draft ID, prep-and-send URL, and expiration timestamp. */ export class FaxDraftResponse { /** @@ -33,11 +33,11 @@ export class FaxDraftResponse { */ "faxId": string; /** - * URL to open in an approved iframe for preparing and sending the Fax. + * URL for preparing and sending the Fax. Embedded draft URLs must be opened in an approved iframe; normal draft URLs open in Dropbox Fax. */ "url": string; /** - * Unix timestamp indicating when the embedded Fax draft URL expires. + * Unix timestamp indicating when the Fax draft URL expires. */ "expiresAt": number; diff --git a/sdks/node/model/subEditorPageOptions.ts b/sdks/node/model/subEditorPageOptions.ts index a7f0f5875..99f9b1f5e 100644 --- a/sdks/node/model/subEditorPageOptions.ts +++ b/sdks/node/model/subEditorPageOptions.ts @@ -25,7 +25,7 @@ import { AttributeTypeMap, ObjectSerializer } from "./"; /** - * Controls which completed pages are shown again when the embedded Fax draft is opened. + * For embedded Fax drafts only. Controls which completed pages are shown again when the draft is opened. */ export class SubEditorPageOptions { /** diff --git a/sdks/node/types/model/faxDraftCreateRequest.d.ts b/sdks/node/types/model/faxDraftCreateRequest.d.ts index 207e0f515..6e6a257b6 100644 --- a/sdks/node/types/model/faxDraftCreateRequest.d.ts +++ b/sdks/node/types/model/faxDraftCreateRequest.d.ts @@ -1,9 +1,9 @@ import { AttributeTypeMap, RequestFile } from "./"; import { SubEditorPageOptions } from "./subEditorPageOptions"; export declare class FaxDraftCreateRequest { - "clientId": string; "files"?: Array; "fileUrls"?: Array; + "clientId"?: string; "editorOptions"?: SubEditorPageOptions; "recipients"?: Set; "testMode"?: boolean; diff --git a/sdks/php/README.md b/sdks/php/README.md index 474d905a4..643240b10 100644 --- a/sdks/php/README.md +++ b/sdks/php/README.md @@ -161,7 +161,7 @@ All URIs are relative to *https://api.hellosign.com/v3* | *EmbeddedApi* | [**embeddedEditUrl**](docs/Api/EmbeddedApi.md#embeddedediturl) | **POST** /embedded/edit_url/{template_id} | Get Embedded Template Edit URL | | *EmbeddedApi* | [**embeddedSignUrl**](docs/Api/EmbeddedApi.md#embeddedsignurl) | **GET** /embedded/sign_url/{signature_id} | Get Embedded Sign URL | | *FaxApi* | [**faxDelete**](docs/Api/FaxApi.md#faxdelete) | **DELETE** /fax/{fax_id} | Delete Fax | -| *FaxApi* | [**faxDraftCreate**](docs/Api/FaxApi.md#faxdraftcreate) | **POST** /fax/draft/create | Create Embedded Fax Draft | +| *FaxApi* | [**faxDraftCreate**](docs/Api/FaxApi.md#faxdraftcreate) | **POST** /fax/draft/create | Create Fax Draft | | *FaxApi* | [**faxFiles**](docs/Api/FaxApi.md#faxfiles) | **GET** /fax/files/{fax_id} | Download Fax Files | | *FaxApi* | [**faxGet**](docs/Api/FaxApi.md#faxget) | **GET** /fax/{fax_id} | Get Fax | | *FaxApi* | [**faxList**](docs/Api/FaxApi.md#faxlist) | **GET** /fax/list | Lists Faxes | diff --git a/sdks/php/docs/Api/FaxApi.md b/sdks/php/docs/Api/FaxApi.md index cafbaac3c..b044a9233 100644 --- a/sdks/php/docs/Api/FaxApi.md +++ b/sdks/php/docs/Api/FaxApi.md @@ -5,7 +5,7 @@ All URIs are relative to https://api.hellosign.com/v3. | Method | HTTP request | Description | | ------------- | ------------- | ------------- | | [**faxDelete()**](FaxApi.md#faxDelete) | **DELETE** /fax/{fax_id} | Delete Fax | -| [**faxDraftCreate()**](FaxApi.md#faxDraftCreate) | **POST** /fax/draft/create | Create Embedded Fax Draft | +| [**faxDraftCreate()**](FaxApi.md#faxDraftCreate) | **POST** /fax/draft/create | Create Fax Draft | | [**faxFiles()**](FaxApi.md#faxFiles) | **GET** /fax/files/{fax_id} | Download Fax Files | | [**faxGet()**](FaxApi.md#faxGet) | **GET** /fax/{fax_id} | Get Fax | | [**faxList()**](FaxApi.md#faxList) | **GET** /fax/list | Lists Faxes | @@ -74,9 +74,9 @@ void (empty response body) ```php faxDraftCreate($fax_draft_create_request): \Dropbox\Sign\Model\FaxDraftCreateResponse ``` -Create Embedded Fax Draft +Create Fax Draft -Creates an embedded Fax draft and returns a URL that can be opened in an approved iframe for preparation and sending. +Creates a Fax draft and returns a URL for preparing and sending the Fax. When `client_id` is provided, the draft is embedded and the returned URL must be opened in an approved iframe. When `client_id` is omitted, the draft is a normal Fax draft that opens in Dropbox Fax. ### Example diff --git a/sdks/php/docs/Model/FaxDraftCreateRequest.md b/sdks/php/docs/Model/FaxDraftCreateRequest.md index 749fe84b7..ef6265aa4 100644 --- a/sdks/php/docs/Model/FaxDraftCreateRequest.md +++ b/sdks/php/docs/Model/FaxDraftCreateRequest.md @@ -6,11 +6,11 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -| `client_id`*_required_ | ```string``` | Client ID of the API app that owns the embedded Fax draft. | | -| `files` | ```\SplFileObject[]``` | Use `files[]` to upload the file(s) for the embedded Fax draft.

This endpoint accepts either **files** or **file_urls[]**, but not both. Files can be added later in the embedded flow when neither is provided. | | -| `file_urls` | ```string[]``` | Use `file_urls[]` to have Dropbox Fax download the file(s) for the embedded Fax draft.

This endpoint accepts either **files** or **file_urls[]**, but not both. Files can be added later in the embedded flow when neither is provided. | | +| `files` | ```\SplFileObject[]``` | Use `files[]` to upload the file(s) for the Fax draft.

This endpoint accepts either **files** or **file_urls[]**, but not both. Files can be added later when neither is provided. | | +| `file_urls` | ```string[]``` | Use `file_urls[]` to have Dropbox Fax download the file(s) for the Fax draft.

This endpoint accepts either **files** or **file_urls[]**, but not both. Files can be added later when neither is provided. | | +| `client_id` | ```string``` | Optional client ID of the API app that owns the embedded Fax draft. When omitted, a normal non-embedded Fax draft is created. | | | `editor_options` | [```\Dropbox\Sign\Model\SubEditorPageOptions```](SubEditorPageOptions.md) | | | -| `recipients` | ```string[]``` | Fax numbers to prefill in the embedded flow. Each fax number must be in a supported international format. A maximum of 20 unique fax numbers can be provided. | | +| `recipients` | ```string[]``` | For embedded Fax drafts only. Fax numbers to prefill in the embedded flow. Each fax number must be in a supported international format. A maximum of 20 unique fax numbers can be provided. | | | `test_mode` | ```bool``` | When set to `true`, the completed draft will not send a Fax or consume Fax pages. Defaults to `false`. | [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/FaxDraftResponse.md b/sdks/php/docs/Model/FaxDraftResponse.md index 228c88d95..67fbdab32 100644 --- a/sdks/php/docs/Model/FaxDraftResponse.md +++ b/sdks/php/docs/Model/FaxDraftResponse.md @@ -1,13 +1,13 @@ # # FaxDraftResponse -Contains the embedded Fax draft ID, iframe URL, and expiration timestamp. +Contains the Fax draft ID, prep-and-send URL, and expiration timestamp. ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- | `fax_id`*_required_ | ```string``` | ID of the Fax draft. | | -| `url`*_required_ | ```string``` | URL to open in an approved iframe for preparing and sending the Fax. | | -| `expires_at`*_required_ | ```int``` | Unix timestamp indicating when the embedded Fax draft URL expires. | | +| `url`*_required_ | ```string``` | URL for preparing and sending the Fax. Embedded draft URLs must be opened in an approved iframe; normal draft URLs open in Dropbox Fax. | | +| `expires_at`*_required_ | ```int``` | Unix timestamp indicating when the Fax draft URL expires. | | [[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/SubEditorPageOptions.md b/sdks/php/docs/Model/SubEditorPageOptions.md index 263953c9a..5a07d50f9 100644 --- a/sdks/php/docs/Model/SubEditorPageOptions.md +++ b/sdks/php/docs/Model/SubEditorPageOptions.md @@ -1,6 +1,6 @@ # # SubEditorPageOptions -Controls which completed pages are shown again when the embedded Fax draft is opened. +For embedded Fax drafts only. Controls which completed pages are shown again when the draft is opened. ## Properties diff --git a/sdks/php/src/Api/FaxApi.php b/sdks/php/src/Api/FaxApi.php index 82ae6d598..130438685 100644 --- a/sdks/php/src/Api/FaxApi.php +++ b/sdks/php/src/Api/FaxApi.php @@ -376,7 +376,7 @@ public function faxDeleteRequest(string $fax_id, string $contentType = self::con /** * Operation faxDraftCreate * - * Create Embedded Fax Draft + * Create Fax Draft * * @param Model\FaxDraftCreateRequest $fax_draft_create_request fax_draft_create_request (required) * @@ -393,7 +393,7 @@ public function faxDraftCreate(Model\FaxDraftCreateRequest $fax_draft_create_req /** * Operation faxDraftCreateWithHttpInfo * - * Create Embedded Fax Draft + * Create Fax Draft * * @param Model\FaxDraftCreateRequest $fax_draft_create_request (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['faxDraftCreate'] to see the possible values for this operation @@ -530,7 +530,7 @@ public function faxDraftCreateWithHttpInfo(Model\FaxDraftCreateRequest $fax_draf /** * Operation faxDraftCreateAsync * - * Create Embedded Fax Draft + * Create Fax Draft * * @param Model\FaxDraftCreateRequest $fax_draft_create_request (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['faxDraftCreate'] to see the possible values for this operation @@ -552,7 +552,7 @@ function ($response) { /** * Operation faxDraftCreateAsyncWithHttpInfo * - * Create Embedded Fax Draft + * Create Fax Draft * * @param Model\FaxDraftCreateRequest $fax_draft_create_request (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['faxDraftCreate'] to see the possible values for this operation diff --git a/sdks/php/src/Model/FaxDraftCreateRequest.php b/sdks/php/src/Model/FaxDraftCreateRequest.php index 53b925d26..b4c8be092 100644 --- a/sdks/php/src/Model/FaxDraftCreateRequest.php +++ b/sdks/php/src/Model/FaxDraftCreateRequest.php @@ -58,9 +58,9 @@ class FaxDraftCreateRequest implements ModelInterface, ArrayAccess, JsonSerializ * @var string[] */ protected static $openAPITypes = [ - 'client_id' => 'string', 'files' => '\SplFileObject[]', 'file_urls' => 'string[]', + 'client_id' => 'string', 'editor_options' => '\Dropbox\Sign\Model\SubEditorPageOptions', 'recipients' => 'string[]', 'test_mode' => 'bool', @@ -74,9 +74,9 @@ class FaxDraftCreateRequest implements ModelInterface, ArrayAccess, JsonSerializ * @psalm-var array */ protected static $openAPIFormats = [ - 'client_id' => null, 'files' => 'binary', 'file_urls' => null, + 'client_id' => null, 'editor_options' => null, 'recipients' => null, 'test_mode' => null, @@ -88,9 +88,9 @@ class FaxDraftCreateRequest implements ModelInterface, ArrayAccess, JsonSerializ * @var bool[] */ protected static array $openAPINullables = [ - 'client_id' => false, 'files' => false, 'file_urls' => false, + 'client_id' => false, 'editor_options' => false, 'recipients' => false, 'test_mode' => false, @@ -174,9 +174,9 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $attributeMap = [ - 'client_id' => 'client_id', 'files' => 'files', 'file_urls' => 'file_urls', + 'client_id' => 'client_id', 'editor_options' => 'editor_options', 'recipients' => 'recipients', 'test_mode' => 'test_mode', @@ -188,9 +188,9 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $setters = [ - 'client_id' => 'setClientId', 'files' => 'setFiles', 'file_urls' => 'setFileUrls', + 'client_id' => 'setClientId', 'editor_options' => 'setEditorOptions', 'recipients' => 'setRecipients', 'test_mode' => 'setTestMode', @@ -202,9 +202,9 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $getters = [ - 'client_id' => 'getClientId', 'files' => 'getFiles', 'file_urls' => 'getFileUrls', + 'client_id' => 'getClientId', 'editor_options' => 'getEditorOptions', 'recipients' => 'getRecipients', 'test_mode' => 'getTestMode', @@ -266,9 +266,9 @@ public function getModelName() */ 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('client_id', $data ?? [], null); $this->setIfExists('editor_options', $data ?? [], null); $this->setIfExists('recipients', $data ?? [], null); $this->setIfExists('test_mode', $data ?? [], false); @@ -319,9 +319,6 @@ public function listInvalidProperties() { $invalidProperties = []; - if ($this->container['client_id'] === null) { - $invalidProperties[] = "'client_id' can't be null"; - } if (!is_null($this->container['recipients']) && (count($this->container['recipients']) > 20)) { $invalidProperties[] = "invalid value for 'recipients', number of items must be less than or equal to 20."; } @@ -340,33 +337,6 @@ 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 API app that owns the embedded Fax draft - * - * @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 * @@ -380,7 +350,7 @@ public function getFiles() /** * Sets files * - * @param SplFileObject[]|null $files Use `files[]` to upload the file(s) for the embedded Fax draft. This endpoint accepts either **files** or **file_urls[]**, but not both. Files can be added later in the embedded flow when neither is provided. + * @param SplFileObject[]|null $files Use `files[]` to upload the file(s) for the Fax draft. This endpoint accepts either **files** or **file_urls[]**, but not both. Files can be added later when neither is provided. * * @return self */ @@ -407,7 +377,7 @@ public function getFileUrls() /** * Sets file_urls * - * @param string[]|null $file_urls Use `file_urls[]` to have Dropbox Fax download the file(s) for the embedded Fax draft. This endpoint accepts either **files** or **file_urls[]**, but not both. Files can be added later in the embedded flow when neither is provided. + * @param string[]|null $file_urls Use `file_urls[]` to have Dropbox Fax download the file(s) for the Fax draft. This endpoint accepts either **files** or **file_urls[]**, but not both. Files can be added later when neither is provided. * * @return self */ @@ -421,6 +391,33 @@ public function setFileUrls(?array $file_urls) return $this; } + /** + * Gets client_id + * + * @return string|null + */ + public function getClientId() + { + return $this->container['client_id']; + } + + /** + * Sets client_id + * + * @param string|null $client_id Optional client ID of the API app that owns the embedded Fax draft. When omitted, a normal non-embedded Fax draft is created. + * + * @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 editor_options * @@ -461,7 +458,7 @@ public function getRecipients() /** * Sets recipients * - * @param string[]|null $recipients Fax numbers to prefill in the embedded flow. Each fax number must be in a supported international format. A maximum of 20 unique fax numbers can be provided. + * @param string[]|null $recipients For embedded Fax drafts only. Fax numbers to prefill in the embedded flow. Each fax number must be in a supported international format. A maximum of 20 unique fax numbers can be provided. * * @return self */ diff --git a/sdks/php/src/Model/FaxDraftResponse.php b/sdks/php/src/Model/FaxDraftResponse.php index b46848995..7fee5484f 100644 --- a/sdks/php/src/Model/FaxDraftResponse.php +++ b/sdks/php/src/Model/FaxDraftResponse.php @@ -37,7 +37,7 @@ * FaxDraftResponse Class Doc Comment * * @category Class - * @description Contains the embedded Fax draft ID, iframe URL, and expiration timestamp. + * @description Contains the Fax draft ID, prep-and-send URL, and expiration timestamp. * @see https://openapi-generator.tech * @implements ArrayAccess */ @@ -361,7 +361,7 @@ public function getUrl() /** * Sets url * - * @param string $url URL to open in an approved iframe for preparing and sending the Fax + * @param string $url URL for preparing and sending the Fax. Embedded draft URLs must be opened in an approved iframe; normal draft URLs open in Dropbox Fax. * * @return self */ @@ -388,7 +388,7 @@ public function getExpiresAt() /** * Sets expires_at * - * @param int $expires_at unix timestamp indicating when the embedded Fax draft URL expires + * @param int $expires_at unix timestamp indicating when the Fax draft URL expires * * @return self */ diff --git a/sdks/php/src/Model/SubEditorPageOptions.php b/sdks/php/src/Model/SubEditorPageOptions.php index d6d3e26f6..12df31ef8 100644 --- a/sdks/php/src/Model/SubEditorPageOptions.php +++ b/sdks/php/src/Model/SubEditorPageOptions.php @@ -37,7 +37,7 @@ * SubEditorPageOptions Class Doc Comment * * @category Class - * @description Controls which completed pages are shown again when the embedded Fax draft is opened. + * @description For embedded Fax drafts only. Controls which completed pages are shown again when the draft is opened. * @see https://openapi-generator.tech * @implements ArrayAccess */ diff --git a/sdks/python/README.md b/sdks/python/README.md index f7bd672df..bea9e9c4b 100644 --- a/sdks/python/README.md +++ b/sdks/python/README.md @@ -117,7 +117,7 @@ Class | Method | HTTP request | Description |```EmbeddedApi``` | [```embedded_edit_url```](docs/EmbeddedApi.md#embedded_edit_url) | ```POST /embedded/edit_url/{template_id}``` | Get Embedded Template Edit URL| ```EmbeddedApi``` | [```embedded_sign_url```](docs/EmbeddedApi.md#embedded_sign_url) | ```GET /embedded/sign_url/{signature_id}``` | Get Embedded Sign URL| |```FaxApi``` | [```fax_delete```](docs/FaxApi.md#fax_delete) | ```DELETE /fax/{fax_id}``` | Delete Fax| -```FaxApi``` | [```fax_draft_create```](docs/FaxApi.md#fax_draft_create) | ```POST /fax/draft/create``` | Create Embedded Fax Draft| +```FaxApi``` | [```fax_draft_create```](docs/FaxApi.md#fax_draft_create) | ```POST /fax/draft/create``` | Create Fax Draft| ```FaxApi``` | [```fax_files```](docs/FaxApi.md#fax_files) | ```GET /fax/files/{fax_id}``` | Download Fax Files| ```FaxApi``` | [```fax_get```](docs/FaxApi.md#fax_get) | ```GET /fax/{fax_id}``` | Get Fax| ```FaxApi``` | [```fax_list```](docs/FaxApi.md#fax_list) | ```GET /fax/list``` | Lists Faxes| diff --git a/sdks/python/docs/FaxApi.md b/sdks/python/docs/FaxApi.md index 2233a9886..78bec2a7b 100644 --- a/sdks/python/docs/FaxApi.md +++ b/sdks/python/docs/FaxApi.md @@ -5,7 +5,7 @@ All URIs are relative to *https://api.hellosign.com/v3* Method | HTTP request | Description ------------- | ------------- | ------------- |[```fax_delete```](FaxApi.md#fax_delete) | ```DELETE /fax/{fax_id}``` | Delete Fax| -|[```fax_draft_create```](FaxApi.md#fax_draft_create) | ```POST /fax/draft/create``` | Create Embedded Fax Draft| +|[```fax_draft_create```](FaxApi.md#fax_draft_create) | ```POST /fax/draft/create``` | Create Fax Draft| |[```fax_files```](FaxApi.md#fax_files) | ```GET /fax/files/{fax_id}``` | Download Fax Files| |[```fax_get```](FaxApi.md#fax_get) | ```GET /fax/{fax_id}``` | Get Fax| |[```fax_list```](FaxApi.md#fax_list) | ```GET /fax/list``` | Lists Faxes| @@ -75,9 +75,11 @@ void (empty response body) # ```fax_draft_create``` > ```FaxDraftCreateResponse fax_draft_create(fax_draft_create_request)``` -Create Embedded Fax Draft +Create Fax Draft -Creates an embedded Fax draft and returns a URL that can be opened in an approved iframe for preparation and sending. +Creates a Fax draft and returns a URL for preparing and sending the Fax. + +When `client_id` is provided, the draft is embedded and the returned URL must be opened in an approved iframe. When `client_id` is omitted, the draft is a normal Fax draft that opens in Dropbox Fax. ### Example diff --git a/sdks/python/docs/FaxDraftCreateRequest.md b/sdks/python/docs/FaxDraftCreateRequest.md index 99a41ed58..c30e7ba61 100644 --- a/sdks/python/docs/FaxDraftCreateRequest.md +++ b/sdks/python/docs/FaxDraftCreateRequest.md @@ -5,11 +5,11 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -| `client_id`*_required_ | ```str``` | Client ID of the API app that owns the embedded Fax draft. | | -| `files` | ```List[io.IOBase]``` | Use `files[]` to upload the file(s) for the embedded Fax draft.

This endpoint accepts either **files** or **file_urls[]**, but not both. Files can be added later in the embedded flow when neither is provided. | | -| `file_urls` | ```List[str]``` | Use `file_urls[]` to have Dropbox Fax download the file(s) for the embedded Fax draft.

This endpoint accepts either **files** or **file_urls[]**, but not both. Files can be added later in the embedded flow when neither is provided. | | +| `files` | ```List[io.IOBase]``` | Use `files[]` to upload the file(s) for the Fax draft.

This endpoint accepts either **files** or **file_urls[]**, but not both. Files can be added later when neither is provided. | | +| `file_urls` | ```List[str]``` | Use `file_urls[]` to have Dropbox Fax download the file(s) for the Fax draft.

This endpoint accepts either **files** or **file_urls[]**, but not both. Files can be added later when neither is provided. | | +| `client_id` | ```str``` | Optional client ID of the API app that owns the embedded Fax draft. When omitted, a normal non-embedded Fax draft is created. | | | `editor_options` | [```SubEditorPageOptions```](SubEditorPageOptions.md) | | | -| `recipients` | ```List[str]``` | Fax numbers to prefill in the embedded flow. Each fax number must be in a supported international format. A maximum of 20 unique fax numbers can be provided. | | +| `recipients` | ```List[str]``` | For embedded Fax drafts only. Fax numbers to prefill in the embedded flow. Each fax number must be in a supported international format. A maximum of 20 unique fax numbers can be provided. | | | `test_mode` | ```bool``` | When set to `true`, the completed draft will not send a Fax or consume Fax pages. Defaults to `false`. | [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/FaxDraftResponse.md b/sdks/python/docs/FaxDraftResponse.md index 2329ff885..39ed8c7b6 100644 --- a/sdks/python/docs/FaxDraftResponse.md +++ b/sdks/python/docs/FaxDraftResponse.md @@ -1,13 +1,13 @@ # FaxDraftResponse -Contains the embedded Fax draft ID, iframe URL, and expiration timestamp. +Contains the Fax draft ID, prep-and-send URL, and expiration timestamp. ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- | `fax_id`*_required_ | ```str``` | ID of the Fax draft. | | -| `url`*_required_ | ```str``` | URL to open in an approved iframe for preparing and sending the Fax. | | -| `expires_at`*_required_ | ```int``` | Unix timestamp indicating when the embedded Fax draft URL expires. | | +| `url`*_required_ | ```str``` | URL for preparing and sending the Fax. Embedded draft URLs must be opened in an approved iframe; normal draft URLs open in Dropbox Fax. | | +| `expires_at`*_required_ | ```int``` | Unix timestamp indicating when the Fax draft URL expires. | | [[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/SubEditorPageOptions.md b/sdks/python/docs/SubEditorPageOptions.md index 164980152..64a0430fc 100644 --- a/sdks/python/docs/SubEditorPageOptions.md +++ b/sdks/python/docs/SubEditorPageOptions.md @@ -1,6 +1,6 @@ # SubEditorPageOptions -Controls which completed pages are shown again when the embedded Fax draft is opened. +For embedded Fax drafts only. Controls which completed pages are shown again when the draft is opened. ## Properties Name | Type | Description | Notes diff --git a/sdks/python/dropbox_sign/api/fax_api.py b/sdks/python/dropbox_sign/api/fax_api.py index cd8545fb6..f78126a22 100644 --- a/sdks/python/dropbox_sign/api/fax_api.py +++ b/sdks/python/dropbox_sign/api/fax_api.py @@ -305,9 +305,9 @@ def fax_draft_create( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> FaxDraftCreateResponse: - """Create Embedded Fax Draft + """Create Fax Draft - Creates an embedded Fax draft and returns a URL that can be opened in an approved iframe for preparation and sending. + Creates a Fax draft and returns a URL for preparing and sending the Fax. When `client_id` is provided, the draft is embedded and the returned URL must be opened in an approved iframe. When `client_id` is omitted, the draft is a normal Fax draft that opens in Dropbox Fax. :param fax_draft_create_request: (required) :type fax_draft_create_request: FaxDraftCreateRequest @@ -370,9 +370,9 @@ def fax_draft_create_with_http_info( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> ApiResponse[FaxDraftCreateResponse]: - """Create Embedded Fax Draft + """Create Fax Draft - Creates an embedded Fax draft and returns a URL that can be opened in an approved iframe for preparation and sending. + Creates a Fax draft and returns a URL for preparing and sending the Fax. When `client_id` is provided, the draft is embedded and the returned URL must be opened in an approved iframe. When `client_id` is omitted, the draft is a normal Fax draft that opens in Dropbox Fax. :param fax_draft_create_request: (required) :type fax_draft_create_request: FaxDraftCreateRequest @@ -435,9 +435,9 @@ def fax_draft_create_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """Create Embedded Fax Draft + """Create Fax Draft - Creates an embedded Fax draft and returns a URL that can be opened in an approved iframe for preparation and sending. + Creates a Fax draft and returns a URL for preparing and sending the Fax. When `client_id` is provided, the draft is embedded and the returned URL must be opened in an approved iframe. When `client_id` is omitted, the draft is a normal Fax draft that opens in Dropbox Fax. :param fax_draft_create_request: (required) :type fax_draft_create_request: FaxDraftCreateRequest diff --git a/sdks/python/dropbox_sign/models/fax_draft_create_request.py b/sdks/python/dropbox_sign/models/fax_draft_create_request.py index 641e5196c..775f04a2b 100644 --- a/sdks/python/dropbox_sign/models/fax_draft_create_request.py +++ b/sdks/python/dropbox_sign/models/fax_draft_create_request.py @@ -34,32 +34,33 @@ class FaxDraftCreateRequest(BaseModel): FaxDraftCreateRequest """ # noqa: E501 - client_id: StrictStr = Field( - description="Client ID of the API app that owns the embedded Fax draft." - ) files: Optional[ List[Union[StrictBytes, StrictStr, io.IOBase, Tuple[StrictStr, StrictBytes, io.IOBase]]] ] = Field( default=None, - description="Use `files[]` to upload the file(s) for the embedded Fax draft. This endpoint accepts either **files** or **file_urls[]**, but not both. Files can be added later in the embedded flow when neither is provided.", + description="Use `files[]` to upload the file(s) for the Fax draft. This endpoint accepts either **files** or **file_urls[]**, but not both. Files can be added later when neither is provided.", ) file_urls: Optional[List[StrictStr]] = Field( default=None, - description="Use `file_urls[]` to have Dropbox Fax download the file(s) for the embedded Fax draft. This endpoint accepts either **files** or **file_urls[]**, but not both. Files can be added later in the embedded flow when neither is provided.", + description="Use `file_urls[]` to have Dropbox Fax download the file(s) for the Fax draft. This endpoint accepts either **files** or **file_urls[]**, but not both. Files can be added later when neither is provided.", + ) + client_id: Optional[StrictStr] = Field( + default=None, + description="Optional client ID of the API app that owns the embedded Fax draft. When omitted, a normal non-embedded Fax draft is created.", ) editor_options: Optional[SubEditorPageOptions] = None recipients: Optional[Annotated[List[StrictStr], Field(max_length=20)]] = Field( default=None, - description="Fax numbers to prefill in the embedded flow. Each fax number must be in a supported international format. A maximum of 20 unique fax numbers can be provided.", + description="For embedded Fax drafts only. Fax numbers to prefill in the embedded flow. Each fax number must be in a supported international format. A maximum of 20 unique fax numbers can be provided.", ) test_mode: Optional[StrictBool] = Field( default=False, description="When set to `true`, the completed draft will not send a Fax or consume Fax pages. Defaults to `false`.", ) __properties: ClassVar[List[str]] = [ - "client_id", "files", "file_urls", + "client_id", "editor_options", "recipients", "test_mode", @@ -131,9 +132,9 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: _obj = cls.model_validate( { - "client_id": obj.get("client_id"), "files": obj.get("files"), "file_urls": obj.get("file_urls"), + "client_id": obj.get("client_id"), "editor_options": ( SubEditorPageOptions.from_dict(obj["editor_options"]) if obj.get("editor_options") is not None @@ -160,9 +161,9 @@ def init(cls, data: Any) -> Self: @classmethod def openapi_types(cls) -> Dict[str, str]: return { - "client_id": "(str,)", "files": "(List[io.IOBase],)", "file_urls": "(List[str],)", + "client_id": "(str,)", "editor_options": "(SubEditorPageOptions,)", "recipients": "(List[str],)", "test_mode": "(bool,)", diff --git a/sdks/python/dropbox_sign/models/fax_draft_response.py b/sdks/python/dropbox_sign/models/fax_draft_response.py index fc9ab3535..4079c5762 100644 --- a/sdks/python/dropbox_sign/models/fax_draft_response.py +++ b/sdks/python/dropbox_sign/models/fax_draft_response.py @@ -29,15 +29,15 @@ class FaxDraftResponse(BaseModel): """ - Contains the embedded Fax draft ID, iframe URL, and expiration timestamp. + Contains the Fax draft ID, prep-and-send URL, and expiration timestamp. """ # noqa: E501 fax_id: StrictStr = Field(description="ID of the Fax draft.") url: StrictStr = Field( - description="URL to open in an approved iframe for preparing and sending the Fax." + description="URL for preparing and sending the Fax. Embedded draft URLs must be opened in an approved iframe; normal draft URLs open in Dropbox Fax." ) expires_at: StrictInt = Field( - description="Unix timestamp indicating when the embedded Fax draft URL expires." + description="Unix timestamp indicating when the Fax draft URL expires." ) __properties: ClassVar[List[str]] = ["fax_id", "url", "expires_at"] diff --git a/sdks/python/dropbox_sign/models/sub_editor_page_options.py b/sdks/python/dropbox_sign/models/sub_editor_page_options.py index c60f3d6e4..c280cb909 100644 --- a/sdks/python/dropbox_sign/models/sub_editor_page_options.py +++ b/sdks/python/dropbox_sign/models/sub_editor_page_options.py @@ -29,7 +29,7 @@ class SubEditorPageOptions(BaseModel): """ - Controls which completed pages are shown again when the embedded Fax draft is opened. + For embedded Fax drafts only. Controls which completed pages are shown again when the draft is opened. """ # noqa: E501 force_upload_page: Optional[StrictBool] = Field( diff --git a/sdks/ruby/README.md b/sdks/ruby/README.md index 9a309574f..a3d11b2bc 100644 --- a/sdks/ruby/README.md +++ b/sdks/ruby/README.md @@ -121,7 +121,7 @@ All URIs are relative to *https://api.hellosign.com/v3* |*Dropbox::Sign::EmbeddedApi* | [**embedded_edit_url**](docs/EmbeddedApi.md#embedded_edit_url) | **POST** /embedded/edit_url/{template_id} | Get Embedded Template Edit URL | |*Dropbox::Sign::EmbeddedApi* | [**embedded_sign_url**](docs/EmbeddedApi.md#embedded_sign_url) | **GET** /embedded/sign_url/{signature_id} | Get Embedded Sign URL | |*Dropbox::Sign::FaxApi* | [**fax_delete**](docs/FaxApi.md#fax_delete) | **DELETE** /fax/{fax_id} | Delete Fax | -|*Dropbox::Sign::FaxApi* | [**fax_draft_create**](docs/FaxApi.md#fax_draft_create) | **POST** /fax/draft/create | Create Embedded Fax Draft | +|*Dropbox::Sign::FaxApi* | [**fax_draft_create**](docs/FaxApi.md#fax_draft_create) | **POST** /fax/draft/create | Create Fax Draft | |*Dropbox::Sign::FaxApi* | [**fax_files**](docs/FaxApi.md#fax_files) | **GET** /fax/files/{fax_id} | Download Fax Files | |*Dropbox::Sign::FaxApi* | [**fax_get**](docs/FaxApi.md#fax_get) | **GET** /fax/{fax_id} | Get Fax | |*Dropbox::Sign::FaxApi* | [**fax_list**](docs/FaxApi.md#fax_list) | **GET** /fax/list | Lists Faxes | diff --git a/sdks/ruby/docs/FaxApi.md b/sdks/ruby/docs/FaxApi.md index a5151fd0f..0dc3d61d1 100644 --- a/sdks/ruby/docs/FaxApi.md +++ b/sdks/ruby/docs/FaxApi.md @@ -5,7 +5,7 @@ All URIs are relative to *https://api.hellosign.com/v3* | Method | HTTP request | Description | | ------ | ------------ | ----------- | | [`fax_delete`](FaxApi.md#fax_delete) | **DELETE** `/fax/{fax_id}` | Delete Fax | -| [`fax_draft_create`](FaxApi.md#fax_draft_create) | **POST** `/fax/draft/create` | Create Embedded Fax Draft | +| [`fax_draft_create`](FaxApi.md#fax_draft_create) | **POST** `/fax/draft/create` | Create Fax Draft | | [`fax_files`](FaxApi.md#fax_files) | **GET** `/fax/files/{fax_id}` | Download Fax Files | | [`fax_get`](FaxApi.md#fax_get) | **GET** `/fax/{fax_id}` | Get Fax | | [`fax_list`](FaxApi.md#fax_list) | **GET** `/fax/list` | Lists Faxes | @@ -82,9 +82,9 @@ nil (empty response body) > ` fax_draft_create(fax_draft_create_request)` -Create Embedded Fax Draft +Create Fax Draft -Creates an embedded Fax draft and returns a URL that can be opened in an approved iframe for preparation and sending. +Creates a Fax draft and returns a URL for preparing and sending the Fax. When `client_id` is provided, the draft is embedded and the returned URL must be opened in an approved iframe. When `client_id` is omitted, the draft is a normal Fax draft that opens in Dropbox Fax. ### Examples @@ -130,7 +130,7 @@ This returns an Array which contains the response data, status code and headers. ```ruby begin - # Create Embedded Fax Draft + # Create Fax Draft data, status_code, headers = api_instance.fax_draft_create_with_http_info(fax_draft_create_request) p status_code # => 2xx p headers # => { ... } diff --git a/sdks/ruby/docs/FaxDraftCreateRequest.md b/sdks/ruby/docs/FaxDraftCreateRequest.md index 7f4202090..14dec63d7 100644 --- a/sdks/ruby/docs/FaxDraftCreateRequest.md +++ b/sdks/ruby/docs/FaxDraftCreateRequest.md @@ -6,10 +6,10 @@ | Name | Type | Description | Notes | | ---- | ---- | ----------- | ----- | -| `client_id`*_required_ | ```String``` | Client ID of the API app that owns the embedded Fax draft. | | -| `files` | ```Array``` | Use `files[]` to upload the file(s) for the embedded Fax draft.

This endpoint accepts either **files** or **file_urls[]**, but not both. Files can be added later in the embedded flow when neither is provided. | | -| `file_urls` | ```Array``` | Use `file_urls[]` to have Dropbox Fax download the file(s) for the embedded Fax draft.

This endpoint accepts either **files** or **file_urls[]**, but not both. Files can be added later in the embedded flow when neither is provided. | | +| `files` | ```Array``` | Use `files[]` to upload the file(s) for the Fax draft.

This endpoint accepts either **files** or **file_urls[]**, but not both. Files can be added later when neither is provided. | | +| `file_urls` | ```Array``` | Use `file_urls[]` to have Dropbox Fax download the file(s) for the Fax draft.

This endpoint accepts either **files** or **file_urls[]**, but not both. Files can be added later when neither is provided. | | +| `client_id` | ```String``` | Optional client ID of the API app that owns the embedded Fax draft. When omitted, a normal non-embedded Fax draft is created. | | | `editor_options` | [```SubEditorPageOptions```](SubEditorPageOptions.md) | | | -| `recipients` | ```Array``` | Fax numbers to prefill in the embedded flow. Each fax number must be in a supported international format. A maximum of 20 unique fax numbers can be provided. | | +| `recipients` | ```Array``` | For embedded Fax drafts only. Fax numbers to prefill in the embedded flow. Each fax number must be in a supported international format. A maximum of 20 unique fax numbers can be provided. | | | `test_mode` | ```Boolean``` | When set to `true`, the completed draft will not send a Fax or consume Fax pages. Defaults to `false`. | [default to false] | diff --git a/sdks/ruby/docs/FaxDraftResponse.md b/sdks/ruby/docs/FaxDraftResponse.md index 72a3c664c..06394fb8c 100644 --- a/sdks/ruby/docs/FaxDraftResponse.md +++ b/sdks/ruby/docs/FaxDraftResponse.md @@ -1,12 +1,12 @@ # Dropbox::Sign::FaxDraftResponse -Contains the embedded Fax draft ID, iframe URL, and expiration timestamp. +Contains the Fax draft ID, prep-and-send URL, and expiration timestamp. ## Properties | Name | Type | Description | Notes | | ---- | ---- | ----------- | ----- | | `fax_id`*_required_ | ```String``` | ID of the Fax draft. | | -| `url`*_required_ | ```String``` | URL to open in an approved iframe for preparing and sending the Fax. | | -| `expires_at`*_required_ | ```Integer``` | Unix timestamp indicating when the embedded Fax draft URL expires. | | +| `url`*_required_ | ```String``` | URL for preparing and sending the Fax. Embedded draft URLs must be opened in an approved iframe; normal draft URLs open in Dropbox Fax. | | +| `expires_at`*_required_ | ```Integer``` | Unix timestamp indicating when the Fax draft URL expires. | | diff --git a/sdks/ruby/docs/SubEditorPageOptions.md b/sdks/ruby/docs/SubEditorPageOptions.md index 02a22df81..5b690b4db 100644 --- a/sdks/ruby/docs/SubEditorPageOptions.md +++ b/sdks/ruby/docs/SubEditorPageOptions.md @@ -1,6 +1,6 @@ # Dropbox::Sign::SubEditorPageOptions -Controls which completed pages are shown again when the embedded Fax draft is opened. +For embedded Fax drafts only. Controls which completed pages are shown again when the draft is opened. ## Properties diff --git a/sdks/ruby/lib/dropbox-sign/api/fax_api.rb b/sdks/ruby/lib/dropbox-sign/api/fax_api.rb index 49d2e7a6b..99a0085de 100644 --- a/sdks/ruby/lib/dropbox-sign/api/fax_api.rb +++ b/sdks/ruby/lib/dropbox-sign/api/fax_api.rb @@ -90,8 +90,8 @@ def fax_delete_with_http_info(fax_id, opts = {}) return data, status_code, headers end - # Create Embedded Fax Draft - # Creates an embedded Fax draft and returns a URL that can be opened in an approved iframe for preparation and sending. + # Create Fax Draft + # Creates a Fax draft and returns a URL for preparing and sending the Fax. When `client_id` is provided, the draft is embedded and the returned URL must be opened in an approved iframe. When `client_id` is omitted, the draft is a normal Fax draft that opens in Dropbox Fax. # @param fax_draft_create_request [FaxDraftCreateRequest] # @param [Hash] opts the optional parameters # @return [FaxDraftCreateResponse] @@ -100,8 +100,8 @@ def fax_draft_create(fax_draft_create_request, opts = {}) data end - # Create Embedded Fax Draft - # Creates an embedded Fax draft and returns a URL that can be opened in an approved iframe for preparation and sending. + # Create Fax Draft + # Creates a Fax draft and returns a URL for preparing and sending the Fax. When `client_id` is provided, the draft is embedded and the returned URL must be opened in an approved iframe. When `client_id` is omitted, the draft is a normal Fax draft that opens in Dropbox Fax. # @param fax_draft_create_request [FaxDraftCreateRequest] # @param [Hash] opts the optional parameters # @return [Array<(FaxDraftCreateResponse, Integer, Hash)>] FaxDraftCreateResponse data, response status code and response headers diff --git a/sdks/ruby/lib/dropbox-sign/models/fax_draft_create_request.rb b/sdks/ruby/lib/dropbox-sign/models/fax_draft_create_request.rb index 4a1f8783d..fe89eb9fb 100644 --- a/sdks/ruby/lib/dropbox-sign/models/fax_draft_create_request.rb +++ b/sdks/ruby/lib/dropbox-sign/models/fax_draft_create_request.rb @@ -18,22 +18,22 @@ module Dropbox module Dropbox::Sign class FaxDraftCreateRequest - # Client ID of the API app that owns the embedded Fax draft. - # @return [String] - attr_accessor :client_id - - # Use `files[]` to upload the file(s) for the embedded Fax draft. This endpoint accepts either **files** or **file_urls[]**, but not both. Files can be added later in the embedded flow when neither is provided. + # Use `files[]` to upload the file(s) for the Fax draft. This endpoint accepts either **files** or **file_urls[]**, but not both. Files can be added later when neither is provided. # @return [Array] attr_accessor :files - # Use `file_urls[]` to have Dropbox Fax download the file(s) for the embedded Fax draft. This endpoint accepts either **files** or **file_urls[]**, but not both. Files can be added later in the embedded flow when neither is provided. + # Use `file_urls[]` to have Dropbox Fax download the file(s) for the Fax draft. This endpoint accepts either **files** or **file_urls[]**, but not both. Files can be added later when neither is provided. # @return [Array] attr_accessor :file_urls + # Optional client ID of the API app that owns the embedded Fax draft. When omitted, a normal non-embedded Fax draft is created. + # @return [String] + attr_accessor :client_id + # @return [SubEditorPageOptions] attr_accessor :editor_options - # Fax numbers to prefill in the embedded flow. Each fax number must be in a supported international format. A maximum of 20 unique fax numbers can be provided. + # For embedded Fax drafts only. Fax numbers to prefill in the embedded flow. Each fax number must be in a supported international format. A maximum of 20 unique fax numbers can be provided. # @return [Array] attr_accessor :recipients @@ -44,9 +44,9 @@ class FaxDraftCreateRequest # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { - :'client_id' => :'client_id', :'files' => :'files', :'file_urls' => :'file_urls', + :'client_id' => :'client_id', :'editor_options' => :'editor_options', :'recipients' => :'recipients', :'test_mode' => :'test_mode' @@ -66,9 +66,9 @@ def self.acceptable_attributes # Attribute type mapping. def self.openapi_types { - :'client_id' => :'String', :'files' => :'Array', :'file_urls' => :'Array', + :'client_id' => :'String', :'editor_options' => :'SubEditorPageOptions', :'recipients' => :'Array', :'test_mode' => :'Boolean' @@ -122,10 +122,6 @@ def initialize(attributes = {}) 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 @@ -138,6 +134,10 @@ def initialize(attributes = {}) end end + if attributes.key?(:'client_id') + self.client_id = attributes[:'client_id'] + end + if attributes.key?(:'editor_options') self.editor_options = attributes[:'editor_options'] end @@ -159,10 +159,6 @@ def initialize(attributes = {}) # @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 !@recipients.nil? && @recipients.length > 20 invalid_properties.push('invalid value for "recipients", number of items must be less than or equal to 20.') end @@ -173,21 +169,10 @@ def list_invalid_properties # 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 !@recipients.nil? && @recipients.length > 20 true end - # Custom attribute writer method with validation - # @param [Object] client_id Value to be assigned - def client_id=(client_id) - if client_id.nil? - fail ArgumentError, 'client_id cannot be nil' - end - - @client_id = client_id - end - # Custom attribute writer method with validation # @param [Object] recipients Value to be assigned def recipients=(recipients) @@ -203,9 +188,9 @@ def recipients=(recipients) 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 && + client_id == o.client_id && editor_options == o.editor_options && recipients == o.recipients && test_mode == o.test_mode @@ -220,7 +205,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [client_id, files, file_urls, editor_options, recipients, test_mode].hash + [files, file_urls, client_id, editor_options, recipients, test_mode].hash end # Builds the object from hash diff --git a/sdks/ruby/lib/dropbox-sign/models/fax_draft_response.rb b/sdks/ruby/lib/dropbox-sign/models/fax_draft_response.rb index 0833caead..735fd88ac 100644 --- a/sdks/ruby/lib/dropbox-sign/models/fax_draft_response.rb +++ b/sdks/ruby/lib/dropbox-sign/models/fax_draft_response.rb @@ -17,17 +17,17 @@ module Dropbox end module Dropbox::Sign - # Contains the embedded Fax draft ID, iframe URL, and expiration timestamp. + # Contains the Fax draft ID, prep-and-send URL, and expiration timestamp. class FaxDraftResponse # ID of the Fax draft. # @return [String] attr_accessor :fax_id - # URL to open in an approved iframe for preparing and sending the Fax. + # URL for preparing and sending the Fax. Embedded draft URLs must be opened in an approved iframe; normal draft URLs open in Dropbox Fax. # @return [String] attr_accessor :url - # Unix timestamp indicating when the embedded Fax draft URL expires. + # Unix timestamp indicating when the Fax draft URL expires. # @return [Integer] attr_accessor :expires_at diff --git a/sdks/ruby/lib/dropbox-sign/models/sub_editor_page_options.rb b/sdks/ruby/lib/dropbox-sign/models/sub_editor_page_options.rb index 4c4ee643c..30d242007 100644 --- a/sdks/ruby/lib/dropbox-sign/models/sub_editor_page_options.rb +++ b/sdks/ruby/lib/dropbox-sign/models/sub_editor_page_options.rb @@ -17,7 +17,7 @@ module Dropbox end module Dropbox::Sign - # Controls which completed pages are shown again when the embedded Fax draft is opened. + # For embedded Fax drafts only. Controls which completed pages are shown again when the draft is opened. class SubEditorPageOptions # When set to `true`, always shows the upload page, even when files are already attached. Defaults to `false`. # @return [Boolean] diff --git a/translations/en.yaml b/translations/en.yaml index 43eebe5b9..1962a5780 100644 --- a/translations/en.yaml +++ b/translations/en.yaml @@ -163,28 +163,33 @@ "FaxSend::COVER_PAGE_FROM": Fax cover page sender information "FaxSend::COVER_PAGE_MESSAGE": Fax Cover Page Message "FaxSend::TITLE": Fax Title -"FaxDraftCreate::SUMMARY": Create Embedded Fax Draft -"FaxDraftCreate::DESCRIPTION": Creates an embedded Fax draft and returns a URL that can be opened in an approved iframe for preparation and sending. +"FaxDraftCreate::SUMMARY": Create Fax Draft +"FaxDraftCreate::DESCRIPTION": |- + Creates a Fax draft and returns a URL for preparing and sending the Fax. + + When `client_id` is provided, the draft is embedded and the returned URL must be opened in an approved iframe. When `client_id` is omitted, the draft is a normal Fax draft that opens in Dropbox Fax. "FaxDraftCreate::FILES": |- - Use `files[]` to upload the file(s) for the embedded Fax draft. + Use `files[]` to upload the file(s) for the Fax draft. - This endpoint accepts either **files** or **file_urls[]**, but not both. Files can be added later in the embedded flow when neither is provided. + This endpoint accepts either **files** or **file_urls[]**, but not both. Files can be added later when neither is provided. "FaxDraftCreate::FILE_URLS": |- - Use `file_urls[]` to have Dropbox Fax download the file(s) for the embedded Fax draft. + Use `file_urls[]` to have Dropbox Fax download the file(s) for the Fax draft. - This endpoint accepts either **files** or **file_urls[]**, but not both. Files can be added later in the embedded flow when neither is provided. -"FaxDraftCreate::CLIENT_ID": Client ID of the API app that owns the embedded Fax draft. -"FaxDraftCreate::RECIPIENTS": Fax numbers to prefill in the embedded flow. Each fax number must be in a supported international format. A maximum of 20 unique fax numbers can be provided. + This endpoint accepts either **files** or **file_urls[]**, but not both. Files can be added later when neither is provided. +"FaxDraftCreate::CLIENT_ID": Optional client ID of the API app that owns the embedded Fax draft. When omitted, a normal non-embedded Fax draft is created. +"FaxDraftCreate::RECIPIENTS": For embedded Fax drafts only. Fax numbers to prefill in the embedded flow. Each fax number must be in a supported international format. A maximum of 20 unique fax numbers can be provided. "FaxDraftCreate::TEST_MODE": When set to `true`, the completed draft will not send a Fax or consume Fax pages. Defaults to `false`. -"Sub::EditorPageOptions::DESCRIPTION": Controls which completed pages are shown again when the embedded Fax draft is opened. +"Sub::EditorPageOptions::DESCRIPTION": For embedded Fax drafts only. Controls which completed pages are shown again when the draft is opened. "Sub::EditorPageOptions::FORCE_UPLOAD_PAGE": When set to `true`, always shows the upload page, even when files are already attached. Defaults to `false`. "Sub::EditorPageOptions::FORCE_EDITOR_PAGE": When set to `true`, always shows the editor page, even when the document is already prepared. Defaults to `false`. "Sub::EditorPageOptions::FORCE_REVIEW_PAGE": When set to `true`, always shows the review page, even when recipients and Fax details are already provided. Defaults to `false`. -"FaxDraftCreateResponseExample::SUMMARY": Embedded Fax Draft Response -"FaxDraftResponse::DESCRIPTION": Contains the embedded Fax draft ID, iframe URL, and expiration timestamp. +"FaxDraftCreateResponseExample::SUMMARY": Fax Draft Response +"FaxDraftCreateEmbeddedRequestExample::SUMMARY": Embedded Fax Draft Request +"FaxDraftCreateEmbeddedResponseExample::SUMMARY": Embedded Fax Draft Response +"FaxDraftResponse::DESCRIPTION": Contains the Fax draft ID, prep-and-send URL, and expiration timestamp. "FaxDraftResponse::FAX_ID": ID of the Fax draft. -"FaxDraftResponse::URL": URL to open in an approved iframe for preparing and sending the Fax. -"FaxDraftResponse::EXPIRES_AT": Unix timestamp indicating when the embedded Fax draft URL expires. +"FaxDraftResponse::URL": URL for preparing and sending the Fax. Embedded draft URLs must be opened in an approved iframe; normal draft URLs open in Dropbox Fax. +"FaxDraftResponse::EXPIRES_AT": Unix timestamp indicating when the Fax draft URL expires. "FaxGetResponseExample::SUMMARY": Fax Response "FaxResponse::FAX_ID": Fax ID "FaxResponse::TITLE": Fax Title @@ -1899,8 +1904,8 @@ "FaxList::SEO::DESCRIPTION": "The Dropbox Fax API allows you to build custom integrations. To find out how to list your faxes, click here." "FaxSend::SEO::TITLE": "Send Fax | API Documentation | Dropbox Fax for Developers" "FaxSend::SEO::DESCRIPTION": "The Dropbox Fax API allows you to build custom integrations. To find out how to send a fax, click here." -"FaxDraftCreate::SEO::TITLE": "Create Embedded Fax Draft | API Documentation | Dropbox Fax for Developers" -"FaxDraftCreate::SEO::DESCRIPTION": "Create an embedded Fax draft, then prepare and send it from an approved iframe in your application." +"FaxDraftCreate::SEO::TITLE": "Create Fax Draft | API Documentation | Dropbox Fax for Developers" +"FaxDraftCreate::SEO::DESCRIPTION": "Create a normal or embedded Fax draft, then prepare and send it from Dropbox Fax or an approved iframe." "FaxLineAddUser::SEO::TITLE": "Fax Line Add User | API Documentation | Dropbox Fax for Developers" "FaxLineAddUser::SEO::DESCRIPTION": "The Dropbox Fax API allows you to build custom integrations. To find out how to add a user to an existing fax line, click here." "FaxLineAreaCodeGet::SEO::TITLE": "Fax Line Get Area Codes | API Documentation | Dropbox Fax for Developers"