From 271fa0fbd0bad6f37869a78d00a910ed2568ce7d Mon Sep 17 00:00:00 2001 From: Maksud Aghayev Date: Thu, 19 Sep 2024 14:48:31 -0700 Subject: [PATCH] Fax API SDK + OpenAPI --- examples/FaxDelete.cs | 28 + examples/FaxDelete.java | 25 + examples/FaxDelete.js | 14 + examples/FaxDelete.php | 18 + examples/FaxDelete.py | 16 + examples/FaxDelete.rb | 14 + examples/FaxDelete.sh | 2 + examples/FaxDelete.ts | 13 + examples/FaxFiles.cs | 30 + examples/FaxFiles.java | 27 + examples/FaxFiles.js | 16 + examples/FaxFiles.php | 20 + examples/FaxFiles.py | 18 + examples/FaxFiles.rb | 17 + examples/FaxFiles.sh | 2 + examples/FaxFiles.ts | 16 + examples/FaxGet.cs | 31 + examples/FaxGet.java | 27 + examples/FaxGet.js | 16 + examples/FaxGet.php | 21 + examples/FaxGet.py | 19 + examples/FaxGet.rb | 17 + examples/FaxGet.sh | 2 + examples/FaxGet.ts | 16 + examples/FaxList.cs | 32 + examples/FaxList.java | 28 + examples/FaxList.js | 17 + examples/FaxList.php | 22 + examples/FaxList.py | 23 + examples/FaxList.rb | 18 + examples/FaxList.sh | 2 + examples/FaxList.ts | 17 + examples/FaxSend.cs | 40 + examples/FaxSend.java | 30 + examples/FaxSend.js | 19 + examples/FaxSend.php | 23 + examples/FaxSend.py | 22 + examples/FaxSend.rb | 19 + examples/FaxSend.sh | 4 + examples/FaxSend.ts | 19 + examples/json/FaxListResponseExample.json | 29 + examples/json/FaxResponseExample.json | 21 + examples/json/FaxSendRequestExample.json | 12 + openapi-raw.yaml | 635 ++++++ openapi-sdk.yaml | 635 ++++++ openapi.yaml | 635 ++++++ sdks/dotnet/README.md | 11 + sdks/dotnet/docs/FaxApi.md | 472 +++++ sdks/dotnet/docs/FaxListResponse.md | 10 + sdks/dotnet/docs/FaxResponse.md | 10 + sdks/dotnet/docs/FaxResponseFax.md | 10 + .../dotnet/docs/FaxResponseFaxTransmission.md | 10 + sdks/dotnet/docs/FaxSendRequest.md | 10 + sdks/dotnet/docs/SubFile.md | 11 + sdks/dotnet/src/Dropbox.Sign/Api/FaxApi.cs | 1190 ++++++++++++ .../src/Dropbox.Sign/Model/FaxListResponse.cs | 201 ++ .../src/Dropbox.Sign/Model/FaxResponse.cs | 195 ++ .../src/Dropbox.Sign/Model/FaxResponseFax.cs | 397 ++++ .../Model/FaxResponseFaxTransmission.cs | 240 +++ .../src/Dropbox.Sign/Model/FaxSendRequest.cs | 406 ++++ sdks/dotnet/src/Dropbox.Sign/Model/SubFile.cs | 167 ++ sdks/java-v1/README.md | 11 + sdks/java-v1/docs/FaxApi.md | 355 ++++ sdks/java-v1/docs/FaxListResponse.md | 15 + sdks/java-v1/docs/FaxResponse.md | 15 + sdks/java-v1/docs/FaxResponseFax.md | 23 + .../docs/FaxResponseFaxTransmission.md | 17 + sdks/java-v1/docs/FaxSendRequest.md | 23 + sdks/java-v1/docs/SubFile.md | 14 + .../java/com/dropbox/sign/api/FaxApi.java | 381 ++++ .../dropbox/sign/model/FaxListResponse.java | 224 +++ .../com/dropbox/sign/model/FaxResponse.java | 211 ++ .../dropbox/sign/model/FaxResponseFax.java | 609 ++++++ .../model/FaxResponseFaxTransmission.java | 311 +++ .../dropbox/sign/model/FaxSendRequest.java | 627 ++++++ .../java/com/dropbox/sign/model/SubFile.java | 165 ++ sdks/java-v2/README.md | 11 + sdks/java-v2/docs/FaxApi.md | 355 ++++ sdks/java-v2/docs/FaxListResponse.md | 15 + sdks/java-v2/docs/FaxResponse.md | 15 + sdks/java-v2/docs/FaxResponseFax.md | 23 + .../docs/FaxResponseFaxTransmission.md | 17 + sdks/java-v2/docs/FaxSendRequest.md | 23 + sdks/java-v2/docs/SubFile.md | 14 + .../java/com/dropbox/sign/api/FaxApi.java | 374 ++++ .../dropbox/sign/model/FaxListResponse.java | 240 +++ .../com/dropbox/sign/model/FaxResponse.java | 230 +++ .../dropbox/sign/model/FaxResponseFax.java | 639 ++++++ .../model/FaxResponseFaxTransmission.java | 328 ++++ .../dropbox/sign/model/FaxSendRequest.java | 655 +++++++ .../java/com/dropbox/sign/model/SubFile.java | 178 ++ sdks/node/README.md | 11 + sdks/node/api/faxApi.ts | 777 ++++++++ sdks/node/api/index.ts | 3 + sdks/node/dist/api.js | 1400 ++++++++++--- sdks/node/docs/api/FaxApi.md | 401 ++++ sdks/node/docs/model/FaxListResponse.md | 12 + sdks/node/docs/model/FaxResponse.md | 12 + sdks/node/docs/model/FaxResponseFax.md | 20 + .../docs/model/FaxResponseFaxTransmission.md | 14 + sdks/node/docs/model/FaxSendRequest.md | 20 + sdks/node/docs/model/SubFile.md | 11 + sdks/node/model/faxListResponse.ts | 56 + sdks/node/model/faxResponse.ts | 56 + sdks/node/model/faxResponseFax.ts | 133 ++ sdks/node/model/faxResponseFaxTransmission.ts | 78 + sdks/node/model/faxSendRequest.ts | 133 ++ sdks/node/model/index.ts | 18 + sdks/node/model/subFile.ts | 54 + sdks/node/types/api/faxApi.d.ts | 32 + sdks/node/types/api/index.d.ts | 5 +- sdks/node/types/model/faxListResponse.d.ts | 11 + sdks/node/types/model/faxResponse.d.ts | 11 + sdks/node/types/model/faxResponseFax.d.ts | 18 + .../model/faxResponseFaxTransmission.d.ts | 11 + sdks/node/types/model/faxSendRequest.d.ts | 18 + sdks/node/types/model/index.d.ts | 8 +- sdks/node/types/model/subFile.d.ts | 8 + sdks/php/README.md | 11 + sdks/php/docs/Api/FaxApi.md | 307 +++ sdks/php/docs/Model/FaxListResponse.md | 12 + sdks/php/docs/Model/FaxResponse.md | 12 + sdks/php/docs/Model/FaxResponseFax.md | 20 + .../docs/Model/FaxResponseFaxTransmission.md | 14 + sdks/php/docs/Model/FaxSendRequest.md | 20 + sdks/php/docs/Model/SubFile.md | 11 + sdks/php/src/Api/FaxApi.php | 1725 +++++++++++++++++ sdks/php/src/Model/FaxListResponse.php | 453 +++++ sdks/php/src/Model/FaxResponse.php | 450 +++++ sdks/php/src/Model/FaxResponseFax.php | 717 +++++++ .../src/Model/FaxResponseFaxTransmission.php | 513 +++++ sdks/php/src/Model/FaxSendRequest.php | 752 +++++++ sdks/php/src/Model/SubFile.php | 412 ++++ sdks/python/README.md | 11 + sdks/python/docs/FaxApi.md | 326 ++++ sdks/python/docs/FaxListResponse.md | 12 + sdks/python/docs/FaxResponse.md | 12 + sdks/python/docs/FaxResponseFax.md | 20 + .../python/docs/FaxResponseFaxTransmission.md | 14 + sdks/python/docs/FaxSendRequest.md | 20 + sdks/python/docs/SubFile.md | 11 + sdks/python/dropbox_sign/__init__.py | 6 + sdks/python/dropbox_sign/api/__init__.py | 1 + sdks/python/dropbox_sign/api/fax_api.py | 1311 +++++++++++++ sdks/python/dropbox_sign/apis/__init__.py | 1 + sdks/python/dropbox_sign/models/__init__.py | 6 + .../dropbox_sign/models/fax_list_response.py | 149 ++ .../dropbox_sign/models/fax_response.py | 143 ++ .../dropbox_sign/models/fax_response_fax.py | 187 ++ .../models/fax_response_fax_transmission.py | 146 ++ .../dropbox_sign/models/fax_send_request.py | 194 ++ sdks/python/dropbox_sign/models/sub_file.py | 125 ++ sdks/ruby/README.md | 11 + sdks/ruby/docs/FaxApi.md | 358 ++++ sdks/ruby/docs/FaxListResponse.md | 11 + sdks/ruby/docs/FaxResponse.md | 11 + sdks/ruby/docs/FaxResponseFax.md | 19 + sdks/ruby/docs/FaxResponseFaxTransmission.md | 13 + sdks/ruby/docs/FaxSendRequest.md | 19 + sdks/ruby/docs/SubFile.md | 10 + sdks/ruby/lib/dropbox-sign.rb | 7 + sdks/ruby/lib/dropbox-sign/api/fax_api.rb | 476 +++++ .../dropbox-sign/models/fax_list_response.rb | 267 +++ .../lib/dropbox-sign/models/fax_response.rb | 260 +++ .../dropbox-sign/models/fax_response_fax.rb | 347 ++++ .../models/fax_response_fax_transmission.rb | 279 +++ .../dropbox-sign/models/fax_send_request.rb | 356 ++++ sdks/ruby/lib/dropbox-sign/models/sub_file.rb | 249 +++ translations/en.yaml | 53 + 169 files changed, 26078 insertions(+), 308 deletions(-) create mode 100644 examples/FaxDelete.cs create mode 100644 examples/FaxDelete.java create mode 100644 examples/FaxDelete.js create mode 100644 examples/FaxDelete.php create mode 100644 examples/FaxDelete.py create mode 100644 examples/FaxDelete.rb create mode 100644 examples/FaxDelete.sh create mode 100644 examples/FaxDelete.ts create mode 100644 examples/FaxFiles.cs create mode 100644 examples/FaxFiles.java create mode 100644 examples/FaxFiles.js create mode 100644 examples/FaxFiles.php create mode 100644 examples/FaxFiles.py create mode 100644 examples/FaxFiles.rb create mode 100644 examples/FaxFiles.sh create mode 100644 examples/FaxFiles.ts create mode 100644 examples/FaxGet.cs create mode 100644 examples/FaxGet.java create mode 100644 examples/FaxGet.js create mode 100644 examples/FaxGet.php create mode 100644 examples/FaxGet.py create mode 100644 examples/FaxGet.rb create mode 100644 examples/FaxGet.sh create mode 100644 examples/FaxGet.ts create mode 100644 examples/FaxList.cs create mode 100644 examples/FaxList.java create mode 100644 examples/FaxList.js create mode 100644 examples/FaxList.php create mode 100644 examples/FaxList.py create mode 100644 examples/FaxList.rb create mode 100644 examples/FaxList.sh create mode 100644 examples/FaxList.ts create mode 100644 examples/FaxSend.cs create mode 100644 examples/FaxSend.java create mode 100644 examples/FaxSend.js create mode 100644 examples/FaxSend.php create mode 100644 examples/FaxSend.py create mode 100644 examples/FaxSend.rb create mode 100644 examples/FaxSend.sh create mode 100644 examples/FaxSend.ts create mode 100644 examples/json/FaxListResponseExample.json create mode 100644 examples/json/FaxResponseExample.json create mode 100644 examples/json/FaxSendRequestExample.json create mode 100644 sdks/dotnet/docs/FaxApi.md create mode 100644 sdks/dotnet/docs/FaxListResponse.md create mode 100644 sdks/dotnet/docs/FaxResponse.md create mode 100644 sdks/dotnet/docs/FaxResponseFax.md create mode 100644 sdks/dotnet/docs/FaxResponseFaxTransmission.md create mode 100644 sdks/dotnet/docs/FaxSendRequest.md create mode 100644 sdks/dotnet/docs/SubFile.md create mode 100644 sdks/dotnet/src/Dropbox.Sign/Api/FaxApi.cs create mode 100644 sdks/dotnet/src/Dropbox.Sign/Model/FaxListResponse.cs create mode 100644 sdks/dotnet/src/Dropbox.Sign/Model/FaxResponse.cs create mode 100644 sdks/dotnet/src/Dropbox.Sign/Model/FaxResponseFax.cs create mode 100644 sdks/dotnet/src/Dropbox.Sign/Model/FaxResponseFaxTransmission.cs create mode 100644 sdks/dotnet/src/Dropbox.Sign/Model/FaxSendRequest.cs create mode 100644 sdks/dotnet/src/Dropbox.Sign/Model/SubFile.cs create mode 100644 sdks/java-v1/docs/FaxApi.md create mode 100644 sdks/java-v1/docs/FaxListResponse.md create mode 100644 sdks/java-v1/docs/FaxResponse.md create mode 100644 sdks/java-v1/docs/FaxResponseFax.md create mode 100644 sdks/java-v1/docs/FaxResponseFaxTransmission.md create mode 100644 sdks/java-v1/docs/FaxSendRequest.md create mode 100644 sdks/java-v1/docs/SubFile.md create mode 100644 sdks/java-v1/src/main/java/com/dropbox/sign/api/FaxApi.java create mode 100644 sdks/java-v1/src/main/java/com/dropbox/sign/model/FaxListResponse.java create mode 100644 sdks/java-v1/src/main/java/com/dropbox/sign/model/FaxResponse.java create mode 100644 sdks/java-v1/src/main/java/com/dropbox/sign/model/FaxResponseFax.java create mode 100644 sdks/java-v1/src/main/java/com/dropbox/sign/model/FaxResponseFaxTransmission.java create mode 100644 sdks/java-v1/src/main/java/com/dropbox/sign/model/FaxSendRequest.java create mode 100644 sdks/java-v1/src/main/java/com/dropbox/sign/model/SubFile.java create mode 100644 sdks/java-v2/docs/FaxApi.md create mode 100644 sdks/java-v2/docs/FaxListResponse.md create mode 100644 sdks/java-v2/docs/FaxResponse.md create mode 100644 sdks/java-v2/docs/FaxResponseFax.md create mode 100644 sdks/java-v2/docs/FaxResponseFaxTransmission.md create mode 100644 sdks/java-v2/docs/FaxSendRequest.md create mode 100644 sdks/java-v2/docs/SubFile.md create mode 100644 sdks/java-v2/src/main/java/com/dropbox/sign/api/FaxApi.java create mode 100644 sdks/java-v2/src/main/java/com/dropbox/sign/model/FaxListResponse.java create mode 100644 sdks/java-v2/src/main/java/com/dropbox/sign/model/FaxResponse.java create mode 100644 sdks/java-v2/src/main/java/com/dropbox/sign/model/FaxResponseFax.java create mode 100644 sdks/java-v2/src/main/java/com/dropbox/sign/model/FaxResponseFaxTransmission.java create mode 100644 sdks/java-v2/src/main/java/com/dropbox/sign/model/FaxSendRequest.java create mode 100644 sdks/java-v2/src/main/java/com/dropbox/sign/model/SubFile.java create mode 100644 sdks/node/api/faxApi.ts create mode 100644 sdks/node/docs/api/FaxApi.md create mode 100644 sdks/node/docs/model/FaxListResponse.md create mode 100644 sdks/node/docs/model/FaxResponse.md create mode 100644 sdks/node/docs/model/FaxResponseFax.md create mode 100644 sdks/node/docs/model/FaxResponseFaxTransmission.md create mode 100644 sdks/node/docs/model/FaxSendRequest.md create mode 100644 sdks/node/docs/model/SubFile.md create mode 100644 sdks/node/model/faxListResponse.ts create mode 100644 sdks/node/model/faxResponse.ts create mode 100644 sdks/node/model/faxResponseFax.ts create mode 100644 sdks/node/model/faxResponseFaxTransmission.ts create mode 100644 sdks/node/model/faxSendRequest.ts create mode 100644 sdks/node/model/subFile.ts create mode 100644 sdks/node/types/api/faxApi.d.ts create mode 100644 sdks/node/types/model/faxListResponse.d.ts create mode 100644 sdks/node/types/model/faxResponse.d.ts create mode 100644 sdks/node/types/model/faxResponseFax.d.ts create mode 100644 sdks/node/types/model/faxResponseFaxTransmission.d.ts create mode 100644 sdks/node/types/model/faxSendRequest.d.ts create mode 100644 sdks/node/types/model/subFile.d.ts create mode 100644 sdks/php/docs/Api/FaxApi.md create mode 100644 sdks/php/docs/Model/FaxListResponse.md create mode 100644 sdks/php/docs/Model/FaxResponse.md create mode 100644 sdks/php/docs/Model/FaxResponseFax.md create mode 100644 sdks/php/docs/Model/FaxResponseFaxTransmission.md create mode 100644 sdks/php/docs/Model/FaxSendRequest.md create mode 100644 sdks/php/docs/Model/SubFile.md create mode 100644 sdks/php/src/Api/FaxApi.php create mode 100644 sdks/php/src/Model/FaxListResponse.php create mode 100644 sdks/php/src/Model/FaxResponse.php create mode 100644 sdks/php/src/Model/FaxResponseFax.php create mode 100644 sdks/php/src/Model/FaxResponseFaxTransmission.php create mode 100644 sdks/php/src/Model/FaxSendRequest.php create mode 100644 sdks/php/src/Model/SubFile.php create mode 100644 sdks/python/docs/FaxApi.md create mode 100644 sdks/python/docs/FaxListResponse.md create mode 100644 sdks/python/docs/FaxResponse.md create mode 100644 sdks/python/docs/FaxResponseFax.md create mode 100644 sdks/python/docs/FaxResponseFaxTransmission.md create mode 100644 sdks/python/docs/FaxSendRequest.md create mode 100644 sdks/python/docs/SubFile.md create mode 100644 sdks/python/dropbox_sign/api/fax_api.py create mode 100644 sdks/python/dropbox_sign/models/fax_list_response.py create mode 100644 sdks/python/dropbox_sign/models/fax_response.py create mode 100644 sdks/python/dropbox_sign/models/fax_response_fax.py create mode 100644 sdks/python/dropbox_sign/models/fax_response_fax_transmission.py create mode 100644 sdks/python/dropbox_sign/models/fax_send_request.py create mode 100644 sdks/python/dropbox_sign/models/sub_file.py create mode 100644 sdks/ruby/docs/FaxApi.md create mode 100644 sdks/ruby/docs/FaxListResponse.md create mode 100644 sdks/ruby/docs/FaxResponse.md create mode 100644 sdks/ruby/docs/FaxResponseFax.md create mode 100644 sdks/ruby/docs/FaxResponseFaxTransmission.md create mode 100644 sdks/ruby/docs/FaxSendRequest.md create mode 100644 sdks/ruby/docs/SubFile.md create mode 100644 sdks/ruby/lib/dropbox-sign/api/fax_api.rb create mode 100644 sdks/ruby/lib/dropbox-sign/models/fax_list_response.rb create mode 100644 sdks/ruby/lib/dropbox-sign/models/fax_response.rb create mode 100644 sdks/ruby/lib/dropbox-sign/models/fax_response_fax.rb create mode 100644 sdks/ruby/lib/dropbox-sign/models/fax_response_fax_transmission.rb create mode 100644 sdks/ruby/lib/dropbox-sign/models/fax_send_request.rb create mode 100644 sdks/ruby/lib/dropbox-sign/models/sub_file.rb diff --git a/examples/FaxDelete.cs b/examples/FaxDelete.cs new file mode 100644 index 000000000..b9ad35465 --- /dev/null +++ b/examples/FaxDelete.cs @@ -0,0 +1,28 @@ +using System; +using System.Collections.Generic; +using System.IO; +using Dropbox.Sign.Api; +using Dropbox.Sign.Client; +using Dropbox.Sign.Model; + +public class Example +{ + public static void Main() + { + var config = new Configuration(); + config.Username = "YOUR_API_KEY"; + + var faxApi = new FaxApi(config); + + try + { + faxApi.DeleteFax("[FAX_NUMBER]"); + } + catch (ApiException e) + { + Console.WriteLine("Exception when calling Dropbox Sign API: " + e.Message); + Console.WriteLine("Status Code: " + e.ErrorCode); + Console.WriteLine(e.StackTrace); + } + } +} diff --git a/examples/FaxDelete.java b/examples/FaxDelete.java new file mode 100644 index 000000000..55eda6b65 --- /dev/null +++ b/examples/FaxDelete.java @@ -0,0 +1,25 @@ +import com.dropbox.sign.ApiException; +import com.dropbox.sign.Configuration; +import com.dropbox.sign.api.*; +import com.dropbox.sign.auth.*; +import com.dropbox.sign.model.*; + +import java.util.List; + +public class Example { + public static void main(String[] args) { + var apiClient = Configuration.getDefaultApiClient() + .setApiKey("YOUR_API_KEY"); + + var faxAPi = new FaxApi(apiClient); + + try { + faxAPi.deleteFax("[FAX_NUMBER]"); + } catch (ApiException e) { + 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/FaxDelete.js b/examples/FaxDelete.js new file mode 100644 index 000000000..0eeb87049 --- /dev/null +++ b/examples/FaxDelete.js @@ -0,0 +1,14 @@ +import * as DropboxSign from "@dropbox/sign"; + +const faxApi = new DropboxSign.FaxApi(); + +// Configure HTTP basic authorization: api_key +faxApi.username = "YOUR_API_KEY"; + + +const result = faxApi.deleteFax("[FAX_NUMBER]"); + +result.catch(error => { + console.log("Exception when calling Dropbox Sign API:"); + console.log(error.body); +}); diff --git a/examples/FaxDelete.php b/examples/FaxDelete.php new file mode 100644 index 000000000..9ccd95d1a --- /dev/null +++ b/examples/FaxDelete.php @@ -0,0 +1,18 @@ +setUsername("YOUR_API_KEY"); + +$faxDelete = new Dropbox\Sign\Api\FaxApi($config); + +try { + $faxDelete->deleteFax("[FAX_NUMBER]"); +} catch (Dropbox\Sign\ApiException $e) { + $error = $e->getResponseObject(); + echo "Exception when calling Dropbox Sign API: " + . print_r($error->getError()); +} diff --git a/examples/FaxDelete.py b/examples/FaxDelete.py new file mode 100644 index 000000000..9edbe2a39 --- /dev/null +++ b/examples/FaxDelete.py @@ -0,0 +1,16 @@ +from pprint import pprint + +from dropbox_sign import ApiClient, ApiException, Configuration, apis, models + +configuration = Configuration( + # Configure HTTP basic authorization: api_key + username="YOUR_API_KEY", +) + +with ApiClient(configuration) as api_client: + fax_api = apis.FaxApi(api_client) + + try: + fax_api.delete_fax("[FAX_NUMBER]") + except ApiException as e: + print("Exception when calling Dropbox Sign API: %s\n" % e) diff --git a/examples/FaxDelete.rb b/examples/FaxDelete.rb new file mode 100644 index 000000000..7e2ebb155 --- /dev/null +++ b/examples/FaxDelete.rb @@ -0,0 +1,14 @@ +require "dropbox-sign" + +Dropbox::Sign.configure do |config| + # Configure HTTP basic authorization: api_key + config.username = "YOUR_API_KEY" +end + +fax_api = Dropbox::Sign::FaxApi.new + +begin + fax_api.delete_fax("[FAX_NUMBER]") +rescue Dropbox::Sign::ApiError => e + puts "Exception when calling Dropbox Sign API: #{e}" +end diff --git a/examples/FaxDelete.sh b/examples/FaxDelete.sh new file mode 100644 index 000000000..3f8bf21e7 --- /dev/null +++ b/examples/FaxDelete.sh @@ -0,0 +1,2 @@ +curl -X DELETE 'https://api.hellosign.com/v3/fax/{fax_id}' \ + -u 'YOUR_API_KEY:' diff --git a/examples/FaxDelete.ts b/examples/FaxDelete.ts new file mode 100644 index 000000000..aeb2a2088 --- /dev/null +++ b/examples/FaxDelete.ts @@ -0,0 +1,13 @@ +import * as DropboxSign from "@dropbox/sign"; + +const faxApi = new DropboxSign.FaxApi(); + +// Configure HTTP basic authorization: api_key +faxApi.username = "YOUR_API_KEY"; + +const result = faxApi.deleteFax("[FAX_NUMBER]"); + +result.catch(error => { + console.log("Exception when calling Dropbox Sign API:"); + console.log(error.body); +}); diff --git a/examples/FaxFiles.cs b/examples/FaxFiles.cs new file mode 100644 index 000000000..44d267685 --- /dev/null +++ b/examples/FaxFiles.cs @@ -0,0 +1,30 @@ +using System; +using System.Collections.Generic; +using System.IO; +using Dropbox.Sign.Api; +using Dropbox.Sign.Client; +using Dropbox.Sign.Model; + +public class Example +{ + public static void Main() + { + var config = new Configuration(); + config.Username = "YOUR_API_KEY"; + + var faxApi = new FaxApi(config); + + var faxId = "fa5c8a0b0f492d768749333ad6fcc214c111e967"; + + try + { + faxApi.GetFaxFiles(faxId); + } + catch (ApiException e) + { + Console.WriteLine("Exception when calling Dropbox Sign API: " + e.Message); + Console.WriteLine("Status Code: " + e.ErrorCode); + Console.WriteLine(e.StackTrace); + } + } +} diff --git a/examples/FaxFiles.java b/examples/FaxFiles.java new file mode 100644 index 000000000..57733a233 --- /dev/null +++ b/examples/FaxFiles.java @@ -0,0 +1,27 @@ +import com.dropbox.sign.ApiException; +import com.dropbox.sign.Configuration; +import com.dropbox.sign.api.*; +import com.dropbox.sign.auth.*; +import com.dropbox.sign.model.*; + +import java.util.List; + +public class Example { + public static void main(String[] args) { + var apiClient = Configuration.getDefaultApiClient() + .setApiKey("YOUR_API_KEY"); + + var faxApi = new FaxApi(apiClient); + + var faxId = "fa5c8a0b0f492d768749333ad6fcc214c111e967"; + + try { + faxApi.getFaxFiles(faxId); + } catch (ApiException e) { + 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/FaxFiles.js b/examples/FaxFiles.js new file mode 100644 index 000000000..3e5e14d7d --- /dev/null +++ b/examples/FaxFiles.js @@ -0,0 +1,16 @@ +import * as DropboxSign from "@dropbox/sign"; + +const faxApi = new DropboxSign.FaxApi(); + +// Configure HTTP basic authorization: api_key +faxApi.username = "YOUR_API_KEY"; + +const faxId = "fa5c8a0b0f492d768749333ad6fcc214c111e967"; + +const result = faxApi.getFaxFiles(faxId); +result.then(response => { + console.log(response.body); +}).catch(error => { + console.log("Exception when calling Dropbox Sign API:"); + console.log(error.body); +}); diff --git a/examples/FaxFiles.php b/examples/FaxFiles.php new file mode 100644 index 000000000..301bcdcb9 --- /dev/null +++ b/examples/FaxFiles.php @@ -0,0 +1,20 @@ +setUsername("YOUR_API_KEY"); + +$faxApi = new Dropbox\Sign\Api\FaxApi($config); + +$faxId = "fa5c8a0b0f492d768749333ad6fcc214c111e967"; + +try { + $faxApi->getFaxFiles($faxId); +} catch (Dropbox\Sign\ApiException $e) { + $error = $e->getResponseObject(); + echo "Exception when calling Dropbox Sign API: " + . print_r($error->getError()); +} diff --git a/examples/FaxFiles.py b/examples/FaxFiles.py new file mode 100644 index 000000000..aaddadc05 --- /dev/null +++ b/examples/FaxFiles.py @@ -0,0 +1,18 @@ +from pprint import pprint + +from dropbox_sign import ApiClient, ApiException, Configuration, apis, models + +configuration = Configuration( + # Configure HTTP basic authorization: api_key + username="YOUR_API_KEY", +) + +with ApiClient(configuration) as api_client: + fax_api = apis.FaxApi(api_client) + + fax_id = "fa5c8a0b0f492d768749333ad6fcc214c111e967" + + try: + fax_api.get_fax_files(fax_id) + except ApiException as e: + print("Exception when calling Dropbox Sign API: %s\n" % e) diff --git a/examples/FaxFiles.rb b/examples/FaxFiles.rb new file mode 100644 index 000000000..3c5ee18de --- /dev/null +++ b/examples/FaxFiles.rb @@ -0,0 +1,17 @@ +require "dropbox-sign" + +Dropbox::Sign.configure do |config| + # Configure HTTP basic authorization: api_key + config.username = "YOUR_API_KEY" +end + +fax_api = Dropbox::Sign::FaxApi.new + +faxId = "fa5c8a0b0f492d768749333ad6fcc214c111e967"; + +begin + result = fax_api.get_fax_files(data) + p result +rescue Dropbox::Sign::ApiError => e + puts "Exception when calling Dropbox Sign API: #{e}" +end diff --git a/examples/FaxFiles.sh b/examples/FaxFiles.sh new file mode 100644 index 000000000..427a5cda3 --- /dev/null +++ b/examples/FaxFiles.sh @@ -0,0 +1,2 @@ +curl -X POST 'https://api.hellosign.com/v3/fax/files/{fax_id}' \ + -u 'YOUR_API_KEY:' diff --git a/examples/FaxFiles.ts b/examples/FaxFiles.ts new file mode 100644 index 000000000..3e5e14d7d --- /dev/null +++ b/examples/FaxFiles.ts @@ -0,0 +1,16 @@ +import * as DropboxSign from "@dropbox/sign"; + +const faxApi = new DropboxSign.FaxApi(); + +// Configure HTTP basic authorization: api_key +faxApi.username = "YOUR_API_KEY"; + +const faxId = "fa5c8a0b0f492d768749333ad6fcc214c111e967"; + +const result = faxApi.getFaxFiles(faxId); +result.then(response => { + console.log(response.body); +}).catch(error => { + console.log("Exception when calling Dropbox Sign API:"); + console.log(error.body); +}); diff --git a/examples/FaxGet.cs b/examples/FaxGet.cs new file mode 100644 index 000000000..b698b5846 --- /dev/null +++ b/examples/FaxGet.cs @@ -0,0 +1,31 @@ +using System; + +using Dropbox.Sign.Api; +using Dropbox.Sign.Client; +using Dropbox.Sign.Model; + +public class Example +{ + public static void Main() + { + var config = new Configuration(); + // Configure HTTP basic authorization: api_key + config.Username = "YOUR_API_KEY"; + + var faxApi = new FaxApi(config); + + var faxId = "fa5c8a0b0f492d768749333ad6fcc214c111e967"; + + try + { + var result = faxApi.GetFaxById(faxId); + Console.WriteLine(result); + } + catch (ApiException e) + { + Console.WriteLine("Exception when calling Dropbox Sign API: " + e.Message); + Console.WriteLine("Status Code: " + e.ErrorCode); + Console.WriteLine(e.StackTrace); + } + } +} diff --git a/examples/FaxGet.java b/examples/FaxGet.java new file mode 100644 index 000000000..f4abb0683 --- /dev/null +++ b/examples/FaxGet.java @@ -0,0 +1,27 @@ +import com.dropbox.sign.ApiException; +import com.dropbox.sign.Configuration; +import com.dropbox.sign.api.*; +import com.dropbox.sign.auth.*; +import com.dropbox.sign.model.*; + +public class Example { + public static void main(String[] args) { + var apiClient = Configuration.getDefaultApiClient() + .setApiKey("YOUR_API_KEY"); + + var faxApi = new FaxApi(apiClient); + + var faxId = "fa5c8a0b0f492d768749333ad6fcc214c111e967"; + + try { + FaxGetResponse result = faxApi.getFaxById(faxId); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling AccountApi#accountCreate"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} diff --git a/examples/FaxGet.js b/examples/FaxGet.js new file mode 100644 index 000000000..3b18e0b35 --- /dev/null +++ b/examples/FaxGet.js @@ -0,0 +1,16 @@ +import * as DropboxSign from "@dropbox/sign"; + +const faxApi = new DropboxSign.FaxApi(); + +// Configure HTTP basic authorization: api_key +faxApi.username = "YOUR_API_KEY"; + +const faxId = "fa5c8a0b0f492d768749333ad6fcc214c111e967" + +const result = faxApi.getFaxById(faxId); +result.then(response => { + console.log(response.body); +}).catch(error => { + console.log("Exception when calling Dropbox Sign API:"); + console.log(error.body); +}); diff --git a/examples/FaxGet.php b/examples/FaxGet.php new file mode 100644 index 000000000..919f2486b --- /dev/null +++ b/examples/FaxGet.php @@ -0,0 +1,21 @@ +setUsername("YOUR_API_KEY"); + +$faxApi = new Dropbox\Sign\Api\FaxApi($config); + +$faxId = "fa5c8a0b0f492d768749333ad6fcc214c111e967"; + +try { + $result = $faxApi->getFaxById($faxId); + print_r($result); +} catch (Dropbox\Sign\ApiException $e) { + $error = $e->getResponseObject(); + echo "Exception when calling Dropbox Sign API: " + . print_r($error->getError()); +} diff --git a/examples/FaxGet.py b/examples/FaxGet.py new file mode 100644 index 000000000..ada81e29f --- /dev/null +++ b/examples/FaxGet.py @@ -0,0 +1,19 @@ +from pprint import pprint + +from dropbox_sign import ApiClient, ApiException, Configuration, apis + +configuration = Configuration( + # Configure HTTP basic authorization: api_key + username="YOUR_API_KEY", +) + +with ApiClient(configuration) as api_client: + fax_api = apis.FaxApi(api_client) + + faxId = "fa5c8a0b0f492d768749333ad6fcc214c111e967" + + try: + response = fax_api.get_fax_by_id(client_id) + pprint(response) + except ApiException as e: + print("Exception when calling Dropbox Sign API: %s\n" % e) diff --git a/examples/FaxGet.rb b/examples/FaxGet.rb new file mode 100644 index 000000000..5b19344dd --- /dev/null +++ b/examples/FaxGet.rb @@ -0,0 +1,17 @@ +require "dropbox-sign" + +Dropbox::Sign.configure do |config| + # Configure HTTP basic authorization: api_key + config.username = "YOUR_API_KEY" +end + +fax_api = Dropbox::Sign::FaxApi.new + +fax_id = "fa5c8a0b0f492d768749333ad6fcc214c111e967" + +begin + result = fax_api.get_fax_by_id(fax_id) + p result +rescue Dropbox::Sign::ApiError => e + puts "Exception when calling Dropbox Sign API: #{e}" +end diff --git a/examples/FaxGet.sh b/examples/FaxGet.sh new file mode 100644 index 000000000..03aad0e46 --- /dev/null +++ b/examples/FaxGet.sh @@ -0,0 +1,2 @@ +curl -X GET 'https://api.hellosign.com/v3/fax/{fax_id}' \ + -u 'YOUR_API_KEY:' diff --git a/examples/FaxGet.ts b/examples/FaxGet.ts new file mode 100644 index 000000000..061b92ab4 --- /dev/null +++ b/examples/FaxGet.ts @@ -0,0 +1,16 @@ +import * as DropboxSign from "@dropbox/sign"; + +const faxApi = new DropboxSign.ApiAppApi(); + +// Configure HTTP basic authorization: api_key +faxApi.username = "YOUR_API_KEY"; + +const faxId = "fa5c8a0b0f492d768749333ad6fcc214c111e967" + +const result = faxApi.getFaxById(faxId); +result.then(response => { + console.log(response.body); +}).catch(error => { + console.log("Exception when calling Dropbox Sign API:"); + console.log(error.body); +}); diff --git a/examples/FaxList.cs b/examples/FaxList.cs new file mode 100644 index 000000000..a8670c9e3 --- /dev/null +++ b/examples/FaxList.cs @@ -0,0 +1,32 @@ +using System; + +using Dropbox.Sign.Api; +using Dropbox.Sign.Client; +using Dropbox.Sign.Model; + +public class Example +{ + public static void Main() + { + var config = new Configuration(); + // Configure HTTP basic authorization: api_key + config.Username = "YOUR_API_KEY"; + + var faxApi = new FaxApi(config); + + var page = 1; + var pageSize = 2; + + try + { + var result = faxApi.ListFaxes(page, pageSize); + Console.WriteLine(result); + } + catch (ApiException e) + { + Console.WriteLine("Exception when calling Dropbox Sign API: " + e.Message); + Console.WriteLine("Status Code: " + e.ErrorCode); + Console.WriteLine(e.StackTrace); + } + } +} diff --git a/examples/FaxList.java b/examples/FaxList.java new file mode 100644 index 000000000..8f9b3858f --- /dev/null +++ b/examples/FaxList.java @@ -0,0 +1,28 @@ +import com.dropbox.sign.ApiException; +import com.dropbox.sign.Configuration; +import com.dropbox.sign.api.*; +import com.dropbox.sign.auth.*; +import com.dropbox.sign.model.*; + +public class Example { + public static void main(String[] args) { + var apiClient = Configuration.getDefaultApiClient() + .setApiKey("YOUR_API_KEY"); + + var faxApi = new FaxApi(apiClient); + + var page = 1; + var pageSize = 2; + + try { + FaxListResponse result = faxApi.listFaxes(page, pageSize); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling AccountApi#accountCreate"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} diff --git a/examples/FaxList.js b/examples/FaxList.js new file mode 100644 index 000000000..593791683 --- /dev/null +++ b/examples/FaxList.js @@ -0,0 +1,17 @@ +import * as DropboxSign from "@dropbox/sign"; + +const faxApi = new DropboxSign.FaxApi(); + +// Configure HTTP basic authorization: api_key +faxApi.username = "YOUR_API_KEY"; + +const page = 1; +const pageSize = 2; + +const result = faxApi.listFaxes(page, pageSize); +result.then(response => { + console.log(response.body); +}).catch(error => { + console.log("Exception when calling Dropbox Sign API:"); + console.log(error.body); +}); diff --git a/examples/FaxList.php b/examples/FaxList.php new file mode 100644 index 000000000..48cb361dc --- /dev/null +++ b/examples/FaxList.php @@ -0,0 +1,22 @@ +setUsername("YOUR_API_KEY"); + +$faxApi = new Dropbox\Sign\Api\FaxApi($config); + +$page = 1; +$pageSize = 2; + +try { + $result = $faxApi->listFaxes($page, $pageSize); + print_r($result); +} catch (Dropbox\Sign\ApiException $e) { + $error = $e->getResponseObject(); + echo "Exception when calling Dropbox Sign API: " + . print_r($error->getError()); +} diff --git a/examples/FaxList.py b/examples/FaxList.py new file mode 100644 index 000000000..8cb2e10b3 --- /dev/null +++ b/examples/FaxList.py @@ -0,0 +1,23 @@ +from pprint import pprint + +from dropbox_sign import ApiClient, ApiException, Configuration, apis + +configuration = Configuration( + # Configure HTTP basic authorization: api_key + username="YOUR_API_KEY", +) + +with ApiClient(configuration) as api_client: + fax_api = apis.FaxApi(api_client) + + page = 1 + page_size = 2 + + try: + response = fax_api.list_faxes( + page=page, + page_size=page_size, + ) + pprint(response) + except ApiException as e: + print("Exception when calling Dropbox Sign API: %s\n" % e) diff --git a/examples/FaxList.rb b/examples/FaxList.rb new file mode 100644 index 000000000..8d0c2c21a --- /dev/null +++ b/examples/FaxList.rb @@ -0,0 +1,18 @@ +require "dropbox-sign" + +Dropbox::Sign.configure do |config| + # Configure HTTP basic authorization: api_key + config.username = "YOUR_API_KEY" +end + +fax_api = Dropbox::Sign::FaxApi.new + +page = 1 +page_size = 2 + +begin + result = fax_api.list_faxes({ page: page, page_size: page_size }) + p result +rescue Dropbox::Sign::ApiError => e + puts "Exception when calling Dropbox Sign API: #{e}" +end diff --git a/examples/FaxList.sh b/examples/FaxList.sh new file mode 100644 index 000000000..9739d65dc --- /dev/null +++ b/examples/FaxList.sh @@ -0,0 +1,2 @@ +curl -X GET 'https://api.hellosign.com/v3/fax/list?page=1&page_size=20' \ + -u 'YOUR_API_KEY:' diff --git a/examples/FaxList.ts b/examples/FaxList.ts new file mode 100644 index 000000000..593791683 --- /dev/null +++ b/examples/FaxList.ts @@ -0,0 +1,17 @@ +import * as DropboxSign from "@dropbox/sign"; + +const faxApi = new DropboxSign.FaxApi(); + +// Configure HTTP basic authorization: api_key +faxApi.username = "YOUR_API_KEY"; + +const page = 1; +const pageSize = 2; + +const result = faxApi.listFaxes(page, pageSize); +result.then(response => { + console.log(response.body); +}).catch(error => { + console.log("Exception when calling Dropbox Sign API:"); + console.log(error.body); +}); diff --git a/examples/FaxSend.cs b/examples/FaxSend.cs new file mode 100644 index 000000000..e33c7e8b5 --- /dev/null +++ b/examples/FaxSend.cs @@ -0,0 +1,40 @@ +using System; +using System.Collections.Generic; +using System.IO; +using Dropbox.Sign.Api; +using Dropbox.Sign.Client; +using Dropbox.Sign.Model; + +public class Example +{ + public static void Main() + { + var config = new Configuration(); + config.Username = "YOUR_API_KEY"; + + var faxApi = new FaxApi(config); + + var data = new FaxCreateRequest( + file: "", + test_mode: "1", + to: 16690000001, + from: 16690000000, + cover_page_to: "Jill Fax", + cover_page_message: "I'm sending you a fax!", + cover_page_from: "Faxer Faxerson", + title: "This is what the fax is about!" + ); + + try + { + var result = faxApi.FaxCreate(data); + Console.WriteLine(result); + } + catch (ApiException e) + { + Console.WriteLine("Exception when calling Dropbox Sign API: " + e.Message); + Console.WriteLine("Status Code: " + e.ErrorCode); + Console.WriteLine(e.StackTrace); + } + } +} diff --git a/examples/FaxSend.java b/examples/FaxSend.java new file mode 100644 index 000000000..69594b4a8 --- /dev/null +++ b/examples/FaxSend.java @@ -0,0 +1,30 @@ +import com.dropbox.sign.ApiException; +import com.dropbox.sign.Configuration; +import com.dropbox.sign.api.*; +import com.dropbox.sign.auth.*; +import com.dropbox.sign.model.*; + +import java.util.List; + +public class Example { + public static void main(String[] args) { + var apiClient = Configuration.getDefaultApiClient() + .setApiKey("YOUR_API_KEY"); + + var faxApi = new FaxApi(apiClient); + + var data = new FaxCreateRequest() + .areaCode(209) + .country("US"); + + try { + FaxCreateResponse result = faxApi.faxCreate(data); + System.out.println(result); + } catch (ApiException e) { + 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/FaxSend.js b/examples/FaxSend.js new file mode 100644 index 000000000..f2b7f441e --- /dev/null +++ b/examples/FaxSend.js @@ -0,0 +1,19 @@ +import * as DropboxSign from "@dropbox/sign"; + +const faxApi = new DropboxSign.FaxApi(); + +// Configure HTTP basic authorization: api_key +faxApi.username = "YOUR_API_KEY"; + +const data = { + areaCode: 209, + country: "US", +}; + +const result = faxApi.faxCreate(data); +result.then(response => { + console.log(response.body); +}).catch(error => { + console.log("Exception when calling Dropbox Sign API:"); + console.log(error.body); +}); diff --git a/examples/FaxSend.php b/examples/FaxSend.php new file mode 100644 index 000000000..afab877bc --- /dev/null +++ b/examples/FaxSend.php @@ -0,0 +1,23 @@ +setUsername("YOUR_API_KEY"); + +$faxApi = new Dropbox\Sign\Api\FaxApi($config); + +$data = new Dropbox\Sign\Model\FaxCreateRequest(); +$data->setAreaCode(209) + ->setCountry("US"); + +try { + $result = $faxApi->faxCreate($data); + print_r($result); +} catch (Dropbox\Sign\ApiException $e) { + $error = $e->getResponseObject(); + echo "Exception when calling Dropbox Sign API: " + . print_r($error->getError()); +} diff --git a/examples/FaxSend.py b/examples/FaxSend.py new file mode 100644 index 000000000..829105113 --- /dev/null +++ b/examples/FaxSend.py @@ -0,0 +1,22 @@ +from pprint import pprint + +from dropbox_sign import ApiClient, ApiException, Configuration, apis, models + +configuration = Configuration( + # Configure HTTP basic authorization: api_key + username="YOUR_API_KEY", +) + +with ApiClient(configuration) as api_client: + fax_api = apis.FaxApi(api_client) + + data = models.FaxCreateRequest( + area_code=209, + country="US", + ) + + try: + response = fax_api.fax_create(data) + pprint(response) + except ApiException as e: + print("Exception when calling Dropbox Sign API: %s\n" % e) diff --git a/examples/FaxSend.rb b/examples/FaxSend.rb new file mode 100644 index 000000000..1d46dd797 --- /dev/null +++ b/examples/FaxSend.rb @@ -0,0 +1,19 @@ +require "dropbox-sign" + +Dropbox::Sign.configure do |config| + # Configure HTTP basic authorization: api_key + config.username = "YOUR_API_KEY" +end + +fax_api = Dropbox::Sign::FaxApi.new + +data = Dropbox::Sign::FaxCreateRequest.new +data.area_code = 209 +data.country = "US" + +begin + result = fax_api.fax_create(data) + p result +rescue Dropbox::Sign::ApiError => e + puts "Exception when calling Dropbox Sign API: #{e}" +end diff --git a/examples/FaxSend.sh b/examples/FaxSend.sh new file mode 100644 index 000000000..212b8b46d --- /dev/null +++ b/examples/FaxSend.sh @@ -0,0 +1,4 @@ +curl -X POST 'https://api.hellosign.com/v3/fax/send' \ + -u 'YOUR_API_KEY:' \ + -F 'area_code=209' \ + -F 'country=US' diff --git a/examples/FaxSend.ts b/examples/FaxSend.ts new file mode 100644 index 000000000..61d54476e --- /dev/null +++ b/examples/FaxSend.ts @@ -0,0 +1,19 @@ +import * as DropboxSign from "@dropbox/sign"; + +const faxApi = new DropboxSign.FaxApi(); + +// Configure HTTP basic authorization: api_key +faxApi.username = "YOUR_API_KEY"; + +const data: DropboxSign.FaxCreateRequest = { + areaCode: 209, + country: "US", +}; + +const result = faxApi.faxCreate(data); +result.then(response => { + console.log(response.body); +}).catch(error => { + console.log("Exception when calling Dropbox Sign API:"); + console.log(error.body); +}); diff --git a/examples/json/FaxListResponseExample.json b/examples/json/FaxListResponseExample.json new file mode 100644 index 000000000..b1176d486 --- /dev/null +++ b/examples/json/FaxListResponseExample.json @@ -0,0 +1,29 @@ +{ + "list_info": { + "num_pages": 1, + "num_results": 1, + "page": 1, + "page_size": 1 + }, + "faxes": [ + { + "fax_id": "c2e9691c85d9d6fa6ae773842e3680b2b8650f1d", + "title": "example title", + "original_title": "example original title", + "subject": "example subject", + "message": "example message", + "metadata": [], + "created_at": 1726774555, + "from": "me@dropboxsign.com", + "transmissions": [ + { + "recipient": "recipient@dropboxsign.com", + "sender": "me@dropboxsign.com", + "sent_at": 1723231831, + "status_code": "success" + } + ], + "files_url": "" + } + ] +} diff --git a/examples/json/FaxResponseExample.json b/examples/json/FaxResponseExample.json new file mode 100644 index 000000000..590eaca52 --- /dev/null +++ b/examples/json/FaxResponseExample.json @@ -0,0 +1,21 @@ +{ + "fax": { + "fax_id": "c2e9691c85d9d6fa6ae773842e3680b2b8650f1d", + "title": "example title", + "original_title": "example original title", + "subject": "example subject", + "message": "example message", + "metadata": [], + "created_at": 1726774555, + "from": "me@dropboxsign.com", + "transmissions": [ + { + "recipient": "recipient@dropboxsign.com", + "sender": "me@dropboxsign.com", + "sent_at": 1723231831, + "status_code": "success" + } + ], + "files_url": "" + } +} \ No newline at end of file diff --git a/examples/json/FaxSendRequestExample.json b/examples/json/FaxSendRequestExample.json new file mode 100644 index 000000000..b873f81d8 --- /dev/null +++ b/examples/json/FaxSendRequestExample.json @@ -0,0 +1,12 @@ +{ + "file": "", + "file_url[0]": "", + "file_url_names[0]": "File name for a file in URL", + "test_mode": "1", + "to": 16690000001, + "from": 16690000000, + "cover_page_to": "Jill Fax", + "cover_page_message": "I'm sending you a fax!", + "cover_page_from": "Faxer Faxerson", + "title": "This is what the fax is about!" +} \ No newline at end of file diff --git a/openapi-raw.yaml b/openapi-raw.yaml index a0d21f20e..14549124e 100644 --- a/openapi-raw.yaml +++ b/openapi-raw.yaml @@ -1403,6 +1403,284 @@ paths: seo: title: '_t__EmbeddedSignUrl::SEO::TITLE' description: '_t__EmbeddedSignUrl::SEO::DESCRIPTION' + '/fax/{fax_id}': + get: + tags: + - Fax + summary: '_t__FaxGet::SUMMARY' + description: '_t__FaxGet::DESCRIPTION' + operationId: getFaxById + parameters: + - + name: fax_id + in: path + description: '_t__FaxParam::FAX_ID' + required: true + schema: + type: string + example: fa5c8a0b0f492d768749333ad6fcc214c111e967 + 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/FaxResponse' + examples: + default_example: + $ref: '#/components/examples/FaxResponseExample' + 4XX: + description: failed_operation + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + 400_example: + $ref: '#/components/examples/Error400ResponseExample' + 401_example: + $ref: '#/components/examples/Error401ResponseExample' + 402_example: + $ref: '#/components/examples/Error402ResponseExample' + 403_example: + $ref: '#/components/examples/Error403ResponseExample' + 404_example: + $ref: '#/components/examples/Error404ResponseExample' + 4XX_example: + $ref: '#/components/examples/Error4XXResponseExample' + security: + - + api_key: [] + x-codeSamples: + - + lang: PHP + label: PHP + source: + $ref: examples/FaxGet.php + - + lang: 'C#' + label: 'C#' + source: + $ref: examples/FaxGet.cs + - + lang: JavaScript + label: JavaScript + source: + $ref: examples/FaxGet.js + - + lang: TypeScript + label: TypeScript + source: + $ref: examples/FaxGet.ts + - + lang: Java + label: Java + source: + $ref: examples/FaxGet.java + - + lang: Ruby + label: Ruby + source: + $ref: examples/FaxGet.rb + - + lang: Python + label: Python + source: + $ref: examples/FaxGet.py + - + lang: cURL + label: cURL + source: + $ref: examples/FaxGet.sh + x-meta: + seo: + title: '_t__FaxGet::SEO::TITLE' + description: '_t__FaxGet::SEO::DESCRIPTION' + delete: + tags: + - Fax + summary: '_t__FaxDelete::SUMMARY' + description: '_t__FaxDelete::DESCRIPTION' + operationId: deleteFax + parameters: + - + name: fax_id + in: path + description: '_t__FaxParam::FAX_ID' + required: true + schema: + type: string + example: fa5c8a0b0f492d768749333ad6fcc214c111e967 + 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: { } + 4XX: + description: failed_operation + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + 400_example: + $ref: '#/components/examples/Error400ResponseExample' + 401_example: + $ref: '#/components/examples/Error401ResponseExample' + 402_example: + $ref: '#/components/examples/Error402ResponseExample' + 403_example: + $ref: '#/components/examples/Error403ResponseExample' + 404_example: + $ref: '#/components/examples/Error404ResponseExample' + 4XX_example: + $ref: '#/components/examples/Error4XXResponseExample' + security: + - + api_key: [] + x-codeSamples: + - + lang: PHP + label: PHP + source: + $ref: examples/FaxDelete.php + - + lang: 'C#' + label: 'C#' + source: + $ref: examples/FaxDelete.cs + - + lang: JavaScript + label: JavaScript + source: + $ref: examples/FaxDelete.js + - + lang: TypeScript + label: TypeScript + source: + $ref: examples/FaxDelete.ts + - + lang: Java + label: Java + source: + $ref: examples/FaxDelete.java + - + lang: Ruby + label: Ruby + source: + $ref: examples/FaxDelete.rb + - + lang: Python + label: Python + source: + $ref: examples/FaxDelete.py + - + lang: cURL + label: cURL + source: + $ref: examples/FaxDelete.sh + x-meta: + seo: + title: '_t__FaxDelete::SEO::TITLE' + description: '_t__FaxDelete::SEO::DESCRIPTION' + '/fax/files/{fax_id}': + get: + tags: + - Fax + summary: '_t__FaxFiles::SUMMARY' + description: '_t__FaxFiles::DESCRIPTION' + operationId: getFaxFiles + parameters: + - + name: fax_id + in: path + description: '_t__FaxParam::FAX_ID' + required: true + schema: + type: string + example: fa5c8a0b0f492d768749333ad6fcc214c111e967 + responses: + 4XX: + description: failed_operation + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + 400_example: + $ref: '#/components/examples/Error400ResponseExample' + 401_example: + $ref: '#/components/examples/Error401ResponseExample' + 402_example: + $ref: '#/components/examples/Error402ResponseExample' + 403_example: + $ref: '#/components/examples/Error403ResponseExample' + 404_example: + $ref: '#/components/examples/Error404ResponseExample' + 4XX_example: + $ref: '#/components/examples/Error4XXResponseExample' + security: + - + api_key: [] + x-codeSamples: + - + lang: PHP + label: PHP + source: + $ref: examples/FaxFiles.php + - + lang: 'C#' + label: 'C#' + source: + $ref: examples/FaxFiles.cs + - + lang: JavaScript + label: JavaScript + source: + $ref: examples/FaxFiles.js + - + lang: TypeScript + label: TypeScript + source: + $ref: examples/FaxFiles.ts + - + lang: Java + label: Java + source: + $ref: examples/FaxFiles.java + - + lang: Ruby + label: Ruby + source: + $ref: examples/FaxFiles.rb + - + lang: Python + label: Python + source: + $ref: examples/FaxFiles.py + - + lang: cURL + label: cURL + source: + $ref: examples/FaxFiles.sh + x-meta: + seo: + title: '_t__FaxFiles::SEO::TITLE' + description: '_t__FaxFiles::SEO::DESCRIPTION' /fax_line/add_user: put: tags: @@ -2200,6 +2478,217 @@ paths: seo: title: '_t__FaxLineRemoveUser::SEO::TITLE' description: '_t__FaxLineRemoveUser::SEO::DESCRIPTION' + /fax/list: + get: + tags: + - Fax + summary: '_t__FaxList::SUMMARY' + description: '_t__FaxList::DESCRIPTION' + operationId: listFaxes + parameters: + - + name: page + in: query + description: '_t__FaxList::PAGE' + required: true + schema: + type: integer + minimum: 1 + example: 1 + - + name: page_size + in: query + description: '_t__FaxList::PAGE_SIZE' + required: true + schema: + type: integer + maximum: 100 + minimum: 1 + example: 20 + 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/FaxListResponse' + examples: + default_example: + $ref: '#/components/examples/FaxListResponseExample' + 4XX: + description: failed_operation + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + 400_example: + $ref: '#/components/examples/Error400ResponseExample' + 401_example: + $ref: '#/components/examples/Error401ResponseExample' + 402_example: + $ref: '#/components/examples/Error402ResponseExample' + 403_example: + $ref: '#/components/examples/Error403ResponseExample' + 404_example: + $ref: '#/components/examples/Error404ResponseExample' + 4XX_example: + $ref: '#/components/examples/Error4XXResponseExample' + security: + - + api_key: [] + x-codeSamples: + - + lang: PHP + label: PHP + source: + $ref: examples/FaxList.php + - + lang: 'C#' + label: 'C#' + source: + $ref: examples/FaxList.cs + - + lang: JavaScript + label: JavaScript + source: + $ref: examples/FaxList.js + - + lang: TypeScript + label: TypeScript + source: + $ref: examples/FaxList.ts + - + lang: Java + label: Java + source: + $ref: examples/FaxList.java + - + lang: Ruby + label: Ruby + source: + $ref: examples/FaxList.rb + - + lang: Python + label: Python + source: + $ref: examples/FaxList.py + - + lang: cURL + label: cURL + source: + $ref: examples/FaxList.sh + x-meta: + seo: + title: '_t__FaxList::SEO::TITLE' + description: '_t__FaxList::SEO::DESCRIPTION' + /fax/send: + post: + tags: + - Fax + summary: '_t__FaxSend::SUMMARY' + description: '_t__FaxSend::DESCRIPTION' + operationId: sendFax + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/FaxSendRequest' + examples: + default_example: + $ref: '#/components/examples/FaxSendRequestExample' + 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/FaxResponse' + examples: + default_example: + $ref: '#/components/examples/FaxResponseExample' + 4XX: + description: failed_operation + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + 400_example: + $ref: '#/components/examples/Error400ResponseExample' + 401_example: + $ref: '#/components/examples/Error401ResponseExample' + 402_example: + $ref: '#/components/examples/Error402ResponseExample' + 403_example: + $ref: '#/components/examples/Error403ResponseExample' + 404_example: + $ref: '#/components/examples/Error404ResponseExample' + 4XX_example: + $ref: '#/components/examples/Error4XXResponseExample' + security: + - + api_key: [] + x-codeSamples: + - + lang: PHP + label: PHP + source: + $ref: examples/FaxSend.php + - + lang: 'C#' + label: 'C#' + source: + $ref: examples/FaxSend.cs + - + lang: JavaScript + label: JavaScript + source: + $ref: examples/FaxSend.js + - + lang: TypeScript + label: TypeScript + source: + $ref: examples/FaxSend.ts + - + lang: Java + label: Java + source: + $ref: examples/FaxSend.java + - + lang: Ruby + label: Ruby + source: + $ref: examples/FaxSend.rb + - + lang: Python + label: Python + source: + $ref: examples/FaxSend.py + - + lang: cURL + label: cURL + source: + $ref: examples/FaxSend.sh + x-meta: + seo: + title: '_t__FaxSend::SEO::TITLE' + description: '_t__FaxSend::SEO::DESCRIPTION' /oauth/token: post: tags: @@ -7251,6 +7740,57 @@ components: type: string format: email type: object + FaxSendRequest: + properties: + to: + description: '_t__FaxSend::TO' + type: string + example: recipient@example.com + from: + description: '_t__FaxSend::FROM' + type: string + example: sender@example.com + nullable: true + file: + description: '_t__FaxSend::FILE' + type: array + items: + $ref: '#/components/schemas/SubFile' + file_url: + description: '_t__FaxSend::FILE_URL' + type: array + items: + type: string + file_url_names: + description: '_t__FaxSend::FILE_URL_NAMES' + type: array + items: + type: string + test_mode: + description: '_t__FaxSend::TEST_MODE' + type: boolean + example: false + cover_page_to: + description: '_t__FaxSend::COVER_PAGE_TO' + type: string + example: 'Recipient Name' + nullable: true + cover_page_from: + description: '_t__FaxSend::COVER_PAGE_FROM' + type: string + example: 'Sender Name' + nullable: true + cover_page_message: + description: '_t__FaxSend::COVER_PAGE_MESSAGE' + type: string + example: 'Please find the attached documents.' + nullable: true + title: + description: '_t__FaxSend::TITLE' + type: string + example: 'Fax Title' + nullable: true + type: object OAuthTokenGenerateRequest: required: - client_id @@ -7953,6 +8493,14 @@ components: - YYYYMMDD - YYYY_MM_DD type: object + SubFile: + description: '_t__Sub::File::DESCRIPTION' + properties: + name: + description: '_t__Sub::File::NAME' + type: string + default: '' + type: object SubFormFieldGroup: required: - group_id @@ -9603,6 +10151,16 @@ components: error: $ref: '#/components/schemas/ErrorResponseError' type: object + FaxResponse: + required: + - fax + properties: + fax: + $ref: '#/components/schemas/FaxResponseFax' + warnings: + $ref: '#/components/schemas/WarningResponse' + type: object + x-internal-class: true FaxLineResponse: required: - fax_line @@ -9638,6 +10196,19 @@ components: $ref: '#/components/schemas/WarningResponse' type: object x-internal-class: true + FaxListResponse: + required: + - faxes + - list_info + properties: + faxes: + type: array + items: + $ref: '#/components/schemas/FaxResponseFax' + list_info: + $ref: '#/components/schemas/ListInfoResponse' + type: object + x-internal-class: true FileResponse: required: - file_url @@ -9981,6 +10552,42 @@ components: description: '_t__ErrorResponseError::ERROR_NAME' type: string type: object + FaxResponseFax: + properties: + fax_id: + description: '_t__FaxResponseFax::FAX_ID' + type: string + title: + description: '_t__FaxResponseFax::TITLE' + type: string + original_title: + description: '_t__FaxResponseFax::ORIGINAL_TITLE' + type: string + subject: + description: '_t__FaxResponseFax::SUBJECT' + type: string + message: + description: '_t__FaxResponseFax::MESSAGE' + type: string + metadata: + description: '_t__FaxResponseFax::METADATA' + type: object + created_at: + description: '_t__FaxResponseFax::CREATED_AT' + type: integer + from: + description: '_t__FaxResponseFax::FROM' + type: string + transmissions: + description: '_t__FaxResponseFax::TRANSMISSIONS' + type: array + items: + $ref: '#/components/schemas/FaxResponseFaxTransmission' + files_url: + description: '_t__FaxResponseFax::FILES_URL' + type: string + type: object + x-internal-class: true FaxLineResponseFaxLine: properties: number: @@ -9998,6 +10605,22 @@ components: $ref: '#/components/schemas/AccountResponse' type: object x-internal-class: true + FaxResponseFaxTransmission: + properties: + recipient: + description: '_t__FaxResponseFaxTransmission::RECIPIENT' + type: string + sender: + description: '_t__FaxResponseFaxTransmission::SENDER' + type: string + status_code: + description: '_t__FaxResponseFaxTransmission::STATUS_CODE' + type: string + sent_at: + description: '_t__FaxResponseFaxTransmission::SENT_AT' + type: integer + type: object + x-internal-class: true ListInfoResponse: description: '_t__ListInfoResponse::DESCRIPTION' properties: @@ -11626,6 +12249,10 @@ components: summary: 'Default Example' value: $ref: examples/json/FaxLineRemoveUserRequestExample.json + FaxSendRequestExample: + summary: 'Default Example' + value: + $ref: examples/json/FaxSendRequestExample.json OAuthTokenGenerateRequestExample: summary: 'OAuth Token Generate Example' value: @@ -11870,6 +12497,10 @@ components: summary: '_t__Error::4XX' value: $ref: examples/json/Error4XXResponseExample.json + FaxResponseExample: + summary: '_t__FaxResponseExample::SUMMARY' + value: + $ref: examples/json/FaxResponseExample.json FaxLineResponseExample: summary: '_t__FaxLineResponseExample::SUMMARY' value: @@ -11882,6 +12513,10 @@ components: summary: '_t__FaxLineListResponseExample::SUMMARY' value: $ref: examples/json/FaxLineListResponseExample.json + FaxListResponseExample: + summary: '_t__FaxListResponseExample::SUMMARY' + value: + $ref: examples/json/FaxListResponseExample.json ReportCreateResponseExample: summary: '_t__ReportCreateResponseExample::SUMMARY' value: diff --git a/openapi-sdk.yaml b/openapi-sdk.yaml index c7189fd24..2487d165a 100644 --- a/openapi-sdk.yaml +++ b/openapi-sdk.yaml @@ -1409,6 +1409,284 @@ paths: seo: title: 'Get Embedded Sign URL | iFrame | Dropbox Sign for Developers' description: 'The Dropbox Sign API allows you to build custom integrations. To find out how to retrieve an embedded iFrame object containing a signature url, click here.' + '/fax/{fax_id}': + get: + tags: + - Fax + summary: 'Get Fax' + description: 'Returns information about fax' + operationId: getFaxById + parameters: + - + name: fax_id + in: path + description: 'Fax ID' + required: true + schema: + type: string + example: fa5c8a0b0f492d768749333ad6fcc214c111e967 + 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/FaxResponse' + examples: + default_example: + $ref: '#/components/examples/FaxResponseExample' + 4XX: + description: failed_operation + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + 400_example: + $ref: '#/components/examples/Error400ResponseExample' + 401_example: + $ref: '#/components/examples/Error401ResponseExample' + 402_example: + $ref: '#/components/examples/Error402ResponseExample' + 403_example: + $ref: '#/components/examples/Error403ResponseExample' + 404_example: + $ref: '#/components/examples/Error404ResponseExample' + 4XX_example: + $ref: '#/components/examples/Error4XXResponseExample' + security: + - + api_key: [] + x-codeSamples: + - + lang: PHP + label: PHP + source: + $ref: examples/FaxGet.php + - + lang: 'C#' + label: 'C#' + source: + $ref: examples/FaxGet.cs + - + lang: JavaScript + label: JavaScript + source: + $ref: examples/FaxGet.js + - + lang: TypeScript + label: TypeScript + source: + $ref: examples/FaxGet.ts + - + lang: Java + label: Java + source: + $ref: examples/FaxGet.java + - + lang: Ruby + label: Ruby + source: + $ref: examples/FaxGet.rb + - + lang: Python + label: Python + source: + $ref: examples/FaxGet.py + - + lang: cURL + label: cURL + source: + $ref: examples/FaxGet.sh + x-meta: + seo: + title: 'Get Fax | API Documentation | Dropbox Fax for Developers' + description: 'The Dropbox Fax API allows you to build custom integrations. To find out how to retrieve a fax, click here.' + delete: + tags: + - Fax + summary: 'Delete Fax' + description: 'Deletes the specified Fax from the system.' + operationId: deleteFax + parameters: + - + name: fax_id + in: path + description: 'Fax ID' + required: true + schema: + type: string + example: fa5c8a0b0f492d768749333ad6fcc214c111e967 + 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: {} + 4XX: + description: failed_operation + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + 400_example: + $ref: '#/components/examples/Error400ResponseExample' + 401_example: + $ref: '#/components/examples/Error401ResponseExample' + 402_example: + $ref: '#/components/examples/Error402ResponseExample' + 403_example: + $ref: '#/components/examples/Error403ResponseExample' + 404_example: + $ref: '#/components/examples/Error404ResponseExample' + 4XX_example: + $ref: '#/components/examples/Error4XXResponseExample' + security: + - + api_key: [] + x-codeSamples: + - + lang: PHP + label: PHP + source: + $ref: examples/FaxDelete.php + - + lang: 'C#' + label: 'C#' + source: + $ref: examples/FaxDelete.cs + - + lang: JavaScript + label: JavaScript + source: + $ref: examples/FaxDelete.js + - + lang: TypeScript + label: TypeScript + source: + $ref: examples/FaxDelete.ts + - + lang: Java + label: Java + source: + $ref: examples/FaxDelete.java + - + lang: Ruby + label: Ruby + source: + $ref: examples/FaxDelete.rb + - + lang: Python + label: Python + source: + $ref: examples/FaxDelete.py + - + lang: cURL + label: cURL + source: + $ref: examples/FaxDelete.sh + x-meta: + 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/files/{fax_id}': + get: + tags: + - Fax + summary: 'List Fax Files' + description: 'Returns list of fax files' + operationId: getFaxFiles + parameters: + - + name: fax_id + in: path + description: 'Fax ID' + required: true + schema: + type: string + example: fa5c8a0b0f492d768749333ad6fcc214c111e967 + responses: + 4XX: + description: failed_operation + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + 400_example: + $ref: '#/components/examples/Error400ResponseExample' + 401_example: + $ref: '#/components/examples/Error401ResponseExample' + 402_example: + $ref: '#/components/examples/Error402ResponseExample' + 403_example: + $ref: '#/components/examples/Error403ResponseExample' + 404_example: + $ref: '#/components/examples/Error404ResponseExample' + 4XX_example: + $ref: '#/components/examples/Error4XXResponseExample' + security: + - + api_key: [] + x-codeSamples: + - + lang: PHP + label: PHP + source: + $ref: examples/FaxFiles.php + - + lang: 'C#' + label: 'C#' + source: + $ref: examples/FaxFiles.cs + - + lang: JavaScript + label: JavaScript + source: + $ref: examples/FaxFiles.js + - + lang: TypeScript + label: TypeScript + source: + $ref: examples/FaxFiles.ts + - + lang: Java + label: Java + source: + $ref: examples/FaxFiles.java + - + lang: Ruby + label: Ruby + source: + $ref: examples/FaxFiles.rb + - + lang: Python + label: Python + source: + $ref: examples/FaxFiles.py + - + lang: cURL + label: cURL + source: + $ref: examples/FaxFiles.sh + x-meta: + seo: + title: 'Fax Files | API Documentation | Dropbox Fax for Developers' + description: 'The Dropbox Fax API allows you to build custom integrations. To find out how to list fax files, click here.' /fax_line/add_user: put: tags: @@ -2206,6 +2484,217 @@ paths: seo: title: 'Fax Line Remove User | API Documentation | Dropbox Fax for Developers' description: 'The Dropbox Fax API allows you to build custom integrations. To find out how to remove a user from an existing fax line, click here.' + /fax/list: + get: + tags: + - Fax + summary: 'Lists Faxes' + description: 'Returns properties of multiple faxes' + operationId: listFaxes + parameters: + - + name: page + in: query + description: Page + required: true + schema: + type: integer + minimum: 1 + example: 1 + - + name: page_size + in: query + description: 'Page size' + required: true + schema: + type: integer + maximum: 100 + minimum: 1 + example: 20 + 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/FaxListResponse' + examples: + default_example: + $ref: '#/components/examples/FaxListResponseExample' + 4XX: + description: failed_operation + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + 400_example: + $ref: '#/components/examples/Error400ResponseExample' + 401_example: + $ref: '#/components/examples/Error401ResponseExample' + 402_example: + $ref: '#/components/examples/Error402ResponseExample' + 403_example: + $ref: '#/components/examples/Error403ResponseExample' + 404_example: + $ref: '#/components/examples/Error404ResponseExample' + 4XX_example: + $ref: '#/components/examples/Error4XXResponseExample' + security: + - + api_key: [] + x-codeSamples: + - + lang: PHP + label: PHP + source: + $ref: examples/FaxList.php + - + lang: 'C#' + label: 'C#' + source: + $ref: examples/FaxList.cs + - + lang: JavaScript + label: JavaScript + source: + $ref: examples/FaxList.js + - + lang: TypeScript + label: TypeScript + source: + $ref: examples/FaxList.ts + - + lang: Java + label: Java + source: + $ref: examples/FaxList.java + - + lang: Ruby + label: Ruby + source: + $ref: examples/FaxList.rb + - + lang: Python + label: Python + source: + $ref: examples/FaxList.py + - + lang: cURL + label: cURL + source: + $ref: examples/FaxList.sh + x-meta: + seo: + title: 'List Faxes | API Documentation | Dropbox Fax for Developers' + description: 'The Dropbox Fax API allows you to build custom integrations. To find out how to list your faxes, click here.' + /fax/send: + post: + tags: + - Fax + summary: 'Send Fax' + description: 'Action to prepare and send a fax' + operationId: sendFax + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/FaxSendRequest' + examples: + default_example: + $ref: '#/components/examples/FaxSendRequestExample' + 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/FaxResponse' + examples: + default_example: + $ref: '#/components/examples/FaxResponseExample' + 4XX: + description: failed_operation + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + 400_example: + $ref: '#/components/examples/Error400ResponseExample' + 401_example: + $ref: '#/components/examples/Error401ResponseExample' + 402_example: + $ref: '#/components/examples/Error402ResponseExample' + 403_example: + $ref: '#/components/examples/Error403ResponseExample' + 404_example: + $ref: '#/components/examples/Error404ResponseExample' + 4XX_example: + $ref: '#/components/examples/Error4XXResponseExample' + security: + - + api_key: [] + x-codeSamples: + - + lang: PHP + label: PHP + source: + $ref: examples/FaxSend.php + - + lang: 'C#' + label: 'C#' + source: + $ref: examples/FaxSend.cs + - + lang: JavaScript + label: JavaScript + source: + $ref: examples/FaxSend.js + - + lang: TypeScript + label: TypeScript + source: + $ref: examples/FaxSend.ts + - + lang: Java + label: Java + source: + $ref: examples/FaxSend.java + - + lang: Ruby + label: Ruby + source: + $ref: examples/FaxSend.rb + - + lang: Python + label: Python + source: + $ref: examples/FaxSend.py + - + lang: cURL + label: cURL + source: + $ref: examples/FaxSend.sh + x-meta: + seo: + title: 'Send Fax| API Documentation | Dropbox Fax for Developers' + description: 'The Dropbox Fax API allows you to build custom integrations. To find out how to send a fax, click here.' /oauth/token: post: tags: @@ -7345,6 +7834,57 @@ components: type: string format: email type: object + FaxSendRequest: + properties: + to: + description: 'Fax Send To Recipient' + type: string + example: recipient@example.com + from: + description: 'Fax Send From Sender (used only with fax number)' + type: string + example: sender@example.com + nullable: true + file: + description: 'Fax File to Send' + type: array + items: + $ref: '#/components/schemas/SubFile' + file_url: + description: 'Fax File URL to Send' + type: array + items: + type: string + file_url_names: + description: 'Fax File URL Names' + type: array + items: + type: string + test_mode: + description: 'API Test Mode Setting' + type: boolean + example: false + cover_page_to: + description: 'Fax Cover Page for Recipient' + type: string + example: 'Recipient Name' + nullable: true + cover_page_from: + description: 'Fax Cover Page for Sender' + type: string + example: 'Sender Name' + nullable: true + cover_page_message: + description: 'Fax Cover Page Message' + type: string + example: 'Please find the attached documents.' + nullable: true + title: + description: 'Fax Title' + type: string + example: 'Fax Title' + nullable: true + type: object OAuthTokenGenerateRequest: required: - client_id @@ -8252,6 +8792,14 @@ components: - YYYYMMDD - YYYY_MM_DD type: object + SubFile: + description: 'Actual uploaded physical file' + properties: + name: + description: 'Actual physical uploaded file name that is derived during upload. Not settable parameter.' + type: string + default: '' + type: object SubFormFieldGroup: required: - group_id @@ -10211,6 +10759,16 @@ components: error: $ref: '#/components/schemas/ErrorResponseError' type: object + FaxResponse: + required: + - fax + properties: + fax: + $ref: '#/components/schemas/FaxResponseFax' + warnings: + $ref: '#/components/schemas/WarningResponse' + type: object + x-internal-class: true FaxLineResponse: required: - fax_line @@ -10246,6 +10804,19 @@ components: $ref: '#/components/schemas/WarningResponse' type: object x-internal-class: true + FaxListResponse: + required: + - faxes + - list_info + properties: + faxes: + type: array + items: + $ref: '#/components/schemas/FaxResponseFax' + list_info: + $ref: '#/components/schemas/ListInfoResponse' + type: object + x-internal-class: true FileResponse: required: - file_url @@ -10589,6 +11160,42 @@ components: description: 'Name of the error.' type: string type: object + FaxResponseFax: + properties: + fax_id: + description: 'Fax ID' + type: string + title: + description: 'Fax Title' + type: string + original_title: + description: 'Fax Original Title' + type: string + subject: + description: 'Fax Subject' + type: string + message: + description: 'Fax Message' + type: string + metadata: + description: 'Fax Metadata' + type: object + created_at: + description: 'Fax Created At Timestamp' + type: integer + from: + description: 'Fax Sender Email' + type: string + transmissions: + description: 'Fax Transmissions List' + type: array + items: + $ref: '#/components/schemas/FaxResponseFaxTransmission' + files_url: + description: 'Fax Files URL' + type: string + type: object + x-internal-class: true FaxLineResponseFaxLine: properties: number: @@ -10606,6 +11213,22 @@ components: $ref: '#/components/schemas/AccountResponse' type: object x-internal-class: true + FaxResponseFaxTransmission: + properties: + recipient: + description: 'Fax Transmission Recipient' + type: string + sender: + description: 'Fax Transmission Sender' + type: string + status_code: + description: 'Fax Transmission Status Code' + type: string + sent_at: + description: 'Fax Transmission Sent Timestamp' + type: integer + type: object + x-internal-class: true ListInfoResponse: description: 'Contains pagination information about the data returned.' properties: @@ -12418,6 +13041,10 @@ components: summary: 'Default Example' value: $ref: examples/json/FaxLineRemoveUserRequestExample.json + FaxSendRequestExample: + summary: 'Default Example' + value: + $ref: examples/json/FaxSendRequestExample.json OAuthTokenGenerateRequestExample: summary: 'OAuth Token Generate Example' value: @@ -12662,6 +13289,10 @@ components: summary: 'Error 4XX failed_operation' value: $ref: examples/json/Error4XXResponseExample.json + FaxResponseExample: + summary: 'Fax Response' + value: + $ref: examples/json/FaxResponseExample.json FaxLineResponseExample: summary: 'Sample Fax Line Response' value: @@ -12674,6 +13305,10 @@ components: summary: 'Sample Fax Line List Response' value: $ref: examples/json/FaxLineListResponseExample.json + FaxListResponseExample: + summary: 'Returns the properties and settings of multiple Faxes.' + value: + $ref: examples/json/FaxListResponseExample.json ReportCreateResponseExample: summary: Report value: diff --git a/openapi.yaml b/openapi.yaml index 304a8d67b..60f4cc0ea 100644 --- a/openapi.yaml +++ b/openapi.yaml @@ -1409,6 +1409,284 @@ paths: seo: title: 'Get Embedded Sign URL | iFrame | Dropbox Sign for Developers' description: 'The Dropbox Sign API allows you to build custom integrations. To find out how to retrieve an embedded iFrame object containing a signature url, click here.' + '/fax/{fax_id}': + get: + tags: + - Fax + summary: 'Get Fax' + description: 'Returns information about fax' + operationId: getFaxById + parameters: + - + name: fax_id + in: path + description: 'Fax ID' + required: true + schema: + type: string + example: fa5c8a0b0f492d768749333ad6fcc214c111e967 + 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/FaxResponse' + examples: + default_example: + $ref: '#/components/examples/FaxResponseExample' + 4XX: + description: failed_operation + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + 400_example: + $ref: '#/components/examples/Error400ResponseExample' + 401_example: + $ref: '#/components/examples/Error401ResponseExample' + 402_example: + $ref: '#/components/examples/Error402ResponseExample' + 403_example: + $ref: '#/components/examples/Error403ResponseExample' + 404_example: + $ref: '#/components/examples/Error404ResponseExample' + 4XX_example: + $ref: '#/components/examples/Error4XXResponseExample' + security: + - + api_key: [] + x-codeSamples: + - + lang: PHP + label: PHP + source: + $ref: examples/FaxGet.php + - + lang: 'C#' + label: 'C#' + source: + $ref: examples/FaxGet.cs + - + lang: JavaScript + label: JavaScript + source: + $ref: examples/FaxGet.js + - + lang: TypeScript + label: TypeScript + source: + $ref: examples/FaxGet.ts + - + lang: Java + label: Java + source: + $ref: examples/FaxGet.java + - + lang: Ruby + label: Ruby + source: + $ref: examples/FaxGet.rb + - + lang: Python + label: Python + source: + $ref: examples/FaxGet.py + - + lang: cURL + label: cURL + source: + $ref: examples/FaxGet.sh + x-meta: + seo: + title: 'Get Fax | API Documentation | Dropbox Fax for Developers' + description: 'The Dropbox Fax API allows you to build custom integrations. To find out how to retrieve a fax, click here.' + delete: + tags: + - Fax + summary: 'Delete Fax' + description: 'Deletes the specified Fax from the system.' + operationId: deleteFax + parameters: + - + name: fax_id + in: path + description: 'Fax ID' + required: true + schema: + type: string + example: fa5c8a0b0f492d768749333ad6fcc214c111e967 + 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: {} + 4XX: + description: failed_operation + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + 400_example: + $ref: '#/components/examples/Error400ResponseExample' + 401_example: + $ref: '#/components/examples/Error401ResponseExample' + 402_example: + $ref: '#/components/examples/Error402ResponseExample' + 403_example: + $ref: '#/components/examples/Error403ResponseExample' + 404_example: + $ref: '#/components/examples/Error404ResponseExample' + 4XX_example: + $ref: '#/components/examples/Error4XXResponseExample' + security: + - + api_key: [] + x-codeSamples: + - + lang: PHP + label: PHP + source: + $ref: examples/FaxDelete.php + - + lang: 'C#' + label: 'C#' + source: + $ref: examples/FaxDelete.cs + - + lang: JavaScript + label: JavaScript + source: + $ref: examples/FaxDelete.js + - + lang: TypeScript + label: TypeScript + source: + $ref: examples/FaxDelete.ts + - + lang: Java + label: Java + source: + $ref: examples/FaxDelete.java + - + lang: Ruby + label: Ruby + source: + $ref: examples/FaxDelete.rb + - + lang: Python + label: Python + source: + $ref: examples/FaxDelete.py + - + lang: cURL + label: cURL + source: + $ref: examples/FaxDelete.sh + x-meta: + 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/files/{fax_id}': + get: + tags: + - Fax + summary: 'List Fax Files' + description: 'Returns list of fax files' + operationId: getFaxFiles + parameters: + - + name: fax_id + in: path + description: 'Fax ID' + required: true + schema: + type: string + example: fa5c8a0b0f492d768749333ad6fcc214c111e967 + responses: + 4XX: + description: failed_operation + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + 400_example: + $ref: '#/components/examples/Error400ResponseExample' + 401_example: + $ref: '#/components/examples/Error401ResponseExample' + 402_example: + $ref: '#/components/examples/Error402ResponseExample' + 403_example: + $ref: '#/components/examples/Error403ResponseExample' + 404_example: + $ref: '#/components/examples/Error404ResponseExample' + 4XX_example: + $ref: '#/components/examples/Error4XXResponseExample' + security: + - + api_key: [] + x-codeSamples: + - + lang: PHP + label: PHP + source: + $ref: examples/FaxFiles.php + - + lang: 'C#' + label: 'C#' + source: + $ref: examples/FaxFiles.cs + - + lang: JavaScript + label: JavaScript + source: + $ref: examples/FaxFiles.js + - + lang: TypeScript + label: TypeScript + source: + $ref: examples/FaxFiles.ts + - + lang: Java + label: Java + source: + $ref: examples/FaxFiles.java + - + lang: Ruby + label: Ruby + source: + $ref: examples/FaxFiles.rb + - + lang: Python + label: Python + source: + $ref: examples/FaxFiles.py + - + lang: cURL + label: cURL + source: + $ref: examples/FaxFiles.sh + x-meta: + seo: + title: 'Fax Files | API Documentation | Dropbox Fax for Developers' + description: 'The Dropbox Fax API allows you to build custom integrations. To find out how to list fax files, click here.' /fax_line/add_user: put: tags: @@ -2206,6 +2484,217 @@ paths: seo: title: 'Fax Line Remove User | API Documentation | Dropbox Fax for Developers' description: 'The Dropbox Fax API allows you to build custom integrations. To find out how to remove a user from an existing fax line, click here.' + /fax/list: + get: + tags: + - Fax + summary: 'Lists Faxes' + description: 'Returns properties of multiple faxes' + operationId: listFaxes + parameters: + - + name: page + in: query + description: Page + required: true + schema: + type: integer + minimum: 1 + example: 1 + - + name: page_size + in: query + description: 'Page size' + required: true + schema: + type: integer + maximum: 100 + minimum: 1 + example: 20 + 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/FaxListResponse' + examples: + default_example: + $ref: '#/components/examples/FaxListResponseExample' + 4XX: + description: failed_operation + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + 400_example: + $ref: '#/components/examples/Error400ResponseExample' + 401_example: + $ref: '#/components/examples/Error401ResponseExample' + 402_example: + $ref: '#/components/examples/Error402ResponseExample' + 403_example: + $ref: '#/components/examples/Error403ResponseExample' + 404_example: + $ref: '#/components/examples/Error404ResponseExample' + 4XX_example: + $ref: '#/components/examples/Error4XXResponseExample' + security: + - + api_key: [] + x-codeSamples: + - + lang: PHP + label: PHP + source: + $ref: examples/FaxList.php + - + lang: 'C#' + label: 'C#' + source: + $ref: examples/FaxList.cs + - + lang: JavaScript + label: JavaScript + source: + $ref: examples/FaxList.js + - + lang: TypeScript + label: TypeScript + source: + $ref: examples/FaxList.ts + - + lang: Java + label: Java + source: + $ref: examples/FaxList.java + - + lang: Ruby + label: Ruby + source: + $ref: examples/FaxList.rb + - + lang: Python + label: Python + source: + $ref: examples/FaxList.py + - + lang: cURL + label: cURL + source: + $ref: examples/FaxList.sh + x-meta: + seo: + title: 'List Faxes | API Documentation | Dropbox Fax for Developers' + description: 'The Dropbox Fax API allows you to build custom integrations. To find out how to list your faxes, click here.' + /fax/send: + post: + tags: + - Fax + summary: 'Send Fax' + description: 'Action to prepare and send a fax' + operationId: sendFax + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/FaxSendRequest' + examples: + default_example: + $ref: '#/components/examples/FaxSendRequestExample' + 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/FaxResponse' + examples: + default_example: + $ref: '#/components/examples/FaxResponseExample' + 4XX: + description: failed_operation + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + 400_example: + $ref: '#/components/examples/Error400ResponseExample' + 401_example: + $ref: '#/components/examples/Error401ResponseExample' + 402_example: + $ref: '#/components/examples/Error402ResponseExample' + 403_example: + $ref: '#/components/examples/Error403ResponseExample' + 404_example: + $ref: '#/components/examples/Error404ResponseExample' + 4XX_example: + $ref: '#/components/examples/Error4XXResponseExample' + security: + - + api_key: [] + x-codeSamples: + - + lang: PHP + label: PHP + source: + $ref: examples/FaxSend.php + - + lang: 'C#' + label: 'C#' + source: + $ref: examples/FaxSend.cs + - + lang: JavaScript + label: JavaScript + source: + $ref: examples/FaxSend.js + - + lang: TypeScript + label: TypeScript + source: + $ref: examples/FaxSend.ts + - + lang: Java + label: Java + source: + $ref: examples/FaxSend.java + - + lang: Ruby + label: Ruby + source: + $ref: examples/FaxSend.rb + - + lang: Python + label: Python + source: + $ref: examples/FaxSend.py + - + lang: cURL + label: cURL + source: + $ref: examples/FaxSend.sh + x-meta: + seo: + title: 'Send Fax| API Documentation | Dropbox Fax for Developers' + description: 'The Dropbox Fax API allows you to build custom integrations. To find out how to send a fax, click here.' /oauth/token: post: tags: @@ -7345,6 +7834,57 @@ components: type: string format: email type: object + FaxSendRequest: + properties: + to: + description: 'Fax Send To Recipient' + type: string + example: recipient@example.com + from: + description: 'Fax Send From Sender (used only with fax number)' + type: string + example: sender@example.com + nullable: true + file: + description: 'Fax File to Send' + type: array + items: + $ref: '#/components/schemas/SubFile' + file_url: + description: 'Fax File URL to Send' + type: array + items: + type: string + file_url_names: + description: 'Fax File URL Names' + type: array + items: + type: string + test_mode: + description: 'API Test Mode Setting' + type: boolean + example: false + cover_page_to: + description: 'Fax Cover Page for Recipient' + type: string + example: 'Recipient Name' + nullable: true + cover_page_from: + description: 'Fax Cover Page for Sender' + type: string + example: 'Sender Name' + nullable: true + cover_page_message: + description: 'Fax Cover Page Message' + type: string + example: 'Please find the attached documents.' + nullable: true + title: + description: 'Fax Title' + type: string + example: 'Fax Title' + nullable: true + type: object OAuthTokenGenerateRequest: required: - client_id @@ -8230,6 +8770,14 @@ components: - YYYYMMDD - YYYY_MM_DD type: object + SubFile: + description: 'Actual uploaded physical file' + properties: + name: + description: 'Actual physical uploaded file name that is derived during upload. Not settable parameter.' + type: string + default: '' + type: object SubFormFieldGroup: required: - group_id @@ -10189,6 +10737,16 @@ components: error: $ref: '#/components/schemas/ErrorResponseError' type: object + FaxResponse: + required: + - fax + properties: + fax: + $ref: '#/components/schemas/FaxResponseFax' + warnings: + $ref: '#/components/schemas/WarningResponse' + type: object + x-internal-class: true FaxLineResponse: required: - fax_line @@ -10224,6 +10782,19 @@ components: $ref: '#/components/schemas/WarningResponse' type: object x-internal-class: true + FaxListResponse: + required: + - faxes + - list_info + properties: + faxes: + type: array + items: + $ref: '#/components/schemas/FaxResponseFax' + list_info: + $ref: '#/components/schemas/ListInfoResponse' + type: object + x-internal-class: true FileResponse: required: - file_url @@ -10567,6 +11138,42 @@ components: description: 'Name of the error.' type: string type: object + FaxResponseFax: + properties: + fax_id: + description: 'Fax ID' + type: string + title: + description: 'Fax Title' + type: string + original_title: + description: 'Fax Original Title' + type: string + subject: + description: 'Fax Subject' + type: string + message: + description: 'Fax Message' + type: string + metadata: + description: 'Fax Metadata' + type: object + created_at: + description: 'Fax Created At Timestamp' + type: integer + from: + description: 'Fax Sender Email' + type: string + transmissions: + description: 'Fax Transmissions List' + type: array + items: + $ref: '#/components/schemas/FaxResponseFaxTransmission' + files_url: + description: 'Fax Files URL' + type: string + type: object + x-internal-class: true FaxLineResponseFaxLine: properties: number: @@ -10584,6 +11191,22 @@ components: $ref: '#/components/schemas/AccountResponse' type: object x-internal-class: true + FaxResponseFaxTransmission: + properties: + recipient: + description: 'Fax Transmission Recipient' + type: string + sender: + description: 'Fax Transmission Sender' + type: string + status_code: + description: 'Fax Transmission Status Code' + type: string + sent_at: + description: 'Fax Transmission Sent Timestamp' + type: integer + type: object + x-internal-class: true ListInfoResponse: description: 'Contains pagination information about the data returned.' properties: @@ -12396,6 +13019,10 @@ components: summary: 'Default Example' value: $ref: examples/json/FaxLineRemoveUserRequestExample.json + FaxSendRequestExample: + summary: 'Default Example' + value: + $ref: examples/json/FaxSendRequestExample.json OAuthTokenGenerateRequestExample: summary: 'OAuth Token Generate Example' value: @@ -12640,6 +13267,10 @@ components: summary: 'Error 4XX failed_operation' value: $ref: examples/json/Error4XXResponseExample.json + FaxResponseExample: + summary: 'Fax Response' + value: + $ref: examples/json/FaxResponseExample.json FaxLineResponseExample: summary: 'Sample Fax Line Response' value: @@ -12652,6 +13283,10 @@ components: summary: 'Sample Fax Line List Response' value: $ref: examples/json/FaxLineListResponseExample.json + FaxListResponseExample: + summary: 'Returns the properties and settings of multiple Faxes.' + value: + $ref: examples/json/FaxListResponseExample.json ReportCreateResponseExample: summary: Report value: diff --git a/sdks/dotnet/README.md b/sdks/dotnet/README.md index e3507dbe3..de7d6e09c 100644 --- a/sdks/dotnet/README.md +++ b/sdks/dotnet/README.md @@ -141,6 +141,11 @@ Class | Method | HTTP request | Description *BulkSendJobApi* | [**BulkSendJobList**](docs/BulkSendJobApi.md#bulksendjoblist) | **GET** /bulk_send_job/list | List Bulk Send Jobs *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* | [**DeleteFax**](docs/FaxApi.md#deletefax) | **DELETE** /fax/{fax_id} | Delete Fax +*FaxApi* | [**GetFaxById**](docs/FaxApi.md#getfaxbyid) | **GET** /fax/{fax_id} | Get Fax +*FaxApi* | [**GetFaxFiles**](docs/FaxApi.md#getfaxfiles) | **GET** /fax/files/{fax_id} | List Fax Files +*FaxApi* | [**ListFaxes**](docs/FaxApi.md#listfaxes) | **GET** /fax/list | Lists Faxes +*FaxApi* | [**SendFax**](docs/FaxApi.md#sendfax) | **POST** /fax/send | Send Fax *FaxLineApi* | [**FaxLineAddUser**](docs/FaxLineApi.md#faxlineadduser) | **PUT** /fax_line/add_user | Add Fax Line User *FaxLineApi* | [**FaxLineAreaCodeGet**](docs/FaxLineApi.md#faxlineareacodeget) | **GET** /fax_line/area_codes | Get Available Fax Line Area Codes *FaxLineApi* | [**FaxLineCreate**](docs/FaxLineApi.md#faxlinecreate) | **POST** /fax_line/create | Purchase Fax Line @@ -242,6 +247,11 @@ Class | Method | HTTP request | Description - [Model.FaxLineRemoveUserRequest](docs/FaxLineRemoveUserRequest.md) - [Model.FaxLineResponse](docs/FaxLineResponse.md) - [Model.FaxLineResponseFaxLine](docs/FaxLineResponseFaxLine.md) + - [Model.FaxListResponse](docs/FaxListResponse.md) + - [Model.FaxResponse](docs/FaxResponse.md) + - [Model.FaxResponseFax](docs/FaxResponseFax.md) + - [Model.FaxResponseFaxTransmission](docs/FaxResponseFaxTransmission.md) + - [Model.FaxSendRequest](docs/FaxSendRequest.md) - [Model.FileResponse](docs/FileResponse.md) - [Model.FileResponseDataUri](docs/FileResponseDataUri.md) - [Model.ListInfoResponse](docs/ListInfoResponse.md) @@ -286,6 +296,7 @@ Class | Method | HTTP request | Description - [Model.SubCustomField](docs/SubCustomField.md) - [Model.SubEditorOptions](docs/SubEditorOptions.md) - [Model.SubFieldOptions](docs/SubFieldOptions.md) + - [Model.SubFile](docs/SubFile.md) - [Model.SubFormFieldGroup](docs/SubFormFieldGroup.md) - [Model.SubFormFieldRule](docs/SubFormFieldRule.md) - [Model.SubFormFieldRuleAction](docs/SubFormFieldRuleAction.md) diff --git a/sdks/dotnet/docs/FaxApi.md b/sdks/dotnet/docs/FaxApi.md new file mode 100644 index 000000000..966e16e1b --- /dev/null +++ b/sdks/dotnet/docs/FaxApi.md @@ -0,0 +1,472 @@ +# Dropbox.Sign.Api.FaxApi + +All URIs are relative to *https://api.hellosign.com/v3* + +| Method | HTTP request | Description | +|--------|--------------|-------------| +| [**DeleteFax**](FaxApi.md#deletefax) | **DELETE** /fax/{fax_id} | Delete Fax | +| [**GetFaxById**](FaxApi.md#getfaxbyid) | **GET** /fax/{fax_id} | Get Fax | +| [**GetFaxFiles**](FaxApi.md#getfaxfiles) | **GET** /fax/files/{fax_id} | List Fax Files | +| [**ListFaxes**](FaxApi.md#listfaxes) | **GET** /fax/list | Lists Faxes | +| [**SendFax**](FaxApi.md#sendfax) | **POST** /fax/send | Send Fax | + + +# **DeleteFax** +> void DeleteFax (string faxId) + +Delete Fax + +Deletes the specified Fax from the system. + +### Example +```csharp +using System; +using System.Collections.Generic; +using System.IO; +using Dropbox.Sign.Api; +using Dropbox.Sign.Client; +using Dropbox.Sign.Model; + +public class Example +{ + public static void Main() + { + var config = new Configuration(); + config.Username = "YOUR_API_KEY"; + + var faxApi = new FaxApi(config); + + try + { + faxApi.DeleteFax("[FAX_NUMBER]"); + } + catch (ApiException e) + { + Console.WriteLine("Exception when calling Dropbox Sign API: " + e.Message); + Console.WriteLine("Status Code: " + e.ErrorCode); + Console.WriteLine(e.StackTrace); + } + } +} + +``` + +#### Using the DeleteFaxWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // Delete Fax + apiInstance.DeleteFaxWithHttpInfo(faxId); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling FaxApi.DeleteFaxWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **faxId** | **string** | Fax ID | | + +### Return type + +void (empty response body) + +### Authorization + +[api_key](../README.md#api_key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **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) + + +# **GetFaxById** +> FaxResponse GetFaxById (string faxId) + +Get Fax + +Returns information about fax + +### Example +```csharp +using System; + +using Dropbox.Sign.Api; +using Dropbox.Sign.Client; +using Dropbox.Sign.Model; + +public class Example +{ + public static void Main() + { + var config = new Configuration(); + // Configure HTTP basic authorization: api_key + config.Username = "YOUR_API_KEY"; + + var faxApi = new FaxApi(config); + + var faxId = "fa5c8a0b0f492d768749333ad6fcc214c111e967"; + + try + { + var result = faxApi.GetFaxById(faxId); + Console.WriteLine(result); + } + catch (ApiException e) + { + Console.WriteLine("Exception when calling Dropbox Sign API: " + e.Message); + Console.WriteLine("Status Code: " + e.ErrorCode); + Console.WriteLine(e.StackTrace); + } + } +} + +``` + +#### Using the GetFaxByIdWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // Get Fax + ApiResponse response = apiInstance.GetFaxByIdWithHttpInfo(faxId); + 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.GetFaxByIdWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **faxId** | **string** | Fax ID | | + +### Return type + +[**FaxResponse**](FaxResponse.md) + +### Authorization + +[api_key](../README.md#api_key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **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) + + +# **GetFaxFiles** +> void GetFaxFiles (string faxId) + +List Fax Files + +Returns list of fax files + +### Example +```csharp +using System; +using System.Collections.Generic; +using System.IO; +using Dropbox.Sign.Api; +using Dropbox.Sign.Client; +using Dropbox.Sign.Model; + +public class Example +{ + public static void Main() + { + var config = new Configuration(); + config.Username = "YOUR_API_KEY"; + + var faxApi = new FaxApi(config); + + var faxId = "fa5c8a0b0f492d768749333ad6fcc214c111e967"; + + try + { + faxApi.GetFaxFiles(faxId); + } + catch (ApiException e) + { + Console.WriteLine("Exception when calling Dropbox Sign API: " + e.Message); + Console.WriteLine("Status Code: " + e.ErrorCode); + Console.WriteLine(e.StackTrace); + } + } +} + +``` + +#### Using the GetFaxFilesWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // List Fax Files + apiInstance.GetFaxFilesWithHttpInfo(faxId); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling FaxApi.GetFaxFilesWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **faxId** | **string** | Fax ID | | + +### Return type + +void (empty response body) + +### Authorization + +[api_key](../README.md#api_key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **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) + + +# **ListFaxes** +> FaxListResponse ListFaxes (int page, int pageSize) + +Lists Faxes + +Returns properties of multiple faxes + +### Example +```csharp +using System; + +using Dropbox.Sign.Api; +using Dropbox.Sign.Client; +using Dropbox.Sign.Model; + +public class Example +{ + public static void Main() + { + var config = new Configuration(); + // Configure HTTP basic authorization: api_key + config.Username = "YOUR_API_KEY"; + + var faxApi = new FaxApi(config); + + var page = 1; + var pageSize = 2; + + try + { + var result = faxApi.ListFaxes(page, pageSize); + Console.WriteLine(result); + } + catch (ApiException e) + { + Console.WriteLine("Exception when calling Dropbox Sign API: " + e.Message); + Console.WriteLine("Status Code: " + e.ErrorCode); + Console.WriteLine(e.StackTrace); + } + } +} + +``` + +#### Using the ListFaxesWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // Lists Faxes + ApiResponse response = apiInstance.ListFaxesWithHttpInfo(page, pageSize); + 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.ListFaxesWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **page** | **int** | Page | | +| **pageSize** | **int** | Page size | | + +### Return type + +[**FaxListResponse**](FaxListResponse.md) + +### Authorization + +[api_key](../README.md#api_key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **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) + + +# **SendFax** +> FaxResponse SendFax (FaxSendRequest faxSendRequest) + +Send Fax + +Action to prepare and send a fax + +### Example +```csharp +using System; +using System.Collections.Generic; +using System.IO; +using Dropbox.Sign.Api; +using Dropbox.Sign.Client; +using Dropbox.Sign.Model; + +public class Example +{ + public static void Main() + { + var config = new Configuration(); + config.Username = "YOUR_API_KEY"; + + var faxApi = new FaxApi(config); + + var data = new FaxCreateRequest( + file: "", + test_mode: "1", + to: 16690000001, + from: 16690000000, + cover_page_to: "Jill Fax", + cover_page_message: "I'm sending you a fax!", + cover_page_from: "Faxer Faxerson", + title: "This is what the fax is about!" + ); + + try + { + var result = faxApi.FaxCreate(data); + Console.WriteLine(result); + } + catch (ApiException e) + { + Console.WriteLine("Exception when calling Dropbox Sign API: " + e.Message); + Console.WriteLine("Status Code: " + e.ErrorCode); + Console.WriteLine(e.StackTrace); + } + } +} + +``` + +#### Using the SendFaxWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // Send Fax + ApiResponse response = apiInstance.SendFaxWithHttpInfo(faxSendRequest); + 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.SendFaxWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **faxSendRequest** | [**FaxSendRequest**](FaxSendRequest.md) | | | + +### Return type + +[**FaxResponse**](FaxResponse.md) + +### Authorization + +[api_key](../README.md#api_key) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
| +| **4XX** | failed_operation | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/sdks/dotnet/docs/FaxListResponse.md b/sdks/dotnet/docs/FaxListResponse.md new file mode 100644 index 000000000..d6b0a28b7 --- /dev/null +++ b/sdks/dotnet/docs/FaxListResponse.md @@ -0,0 +1,10 @@ +# Dropbox.Sign.Model.FaxListResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Faxes** | [**List<FaxResponseFax>**](FaxResponseFax.md) | | **ListInfo** | [**ListInfoResponse**](ListInfoResponse.md) | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/sdks/dotnet/docs/FaxResponse.md b/sdks/dotnet/docs/FaxResponse.md new file mode 100644 index 000000000..5536e2411 --- /dev/null +++ b/sdks/dotnet/docs/FaxResponse.md @@ -0,0 +1,10 @@ +# Dropbox.Sign.Model.FaxResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Fax** | [**FaxResponseFax**](FaxResponseFax.md) | | **Warnings** | [**WarningResponse**](WarningResponse.md) | | [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/FaxResponseFax.md b/sdks/dotnet/docs/FaxResponseFax.md new file mode 100644 index 000000000..1debcc0a4 --- /dev/null +++ b/sdks/dotnet/docs/FaxResponseFax.md @@ -0,0 +1,10 @@ +# Dropbox.Sign.Model.FaxResponseFax + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**FaxId** | **string** | Fax ID | [optional] **Title** | **string** | Fax Title | [optional] **OriginalTitle** | **string** | Fax Original Title | [optional] **Subject** | **string** | Fax Subject | [optional] **Message** | **string** | Fax Message | [optional] **Metadata** | **Object** | Fax Metadata | [optional] **CreatedAt** | **int** | Fax Created At Timestamp | [optional] **From** | **string** | Fax Sender Email | [optional] **Transmissions** | [**List<FaxResponseFaxTransmission>**](FaxResponseFaxTransmission.md) | Fax Transmissions List | [optional] **FilesUrl** | **string** | Fax Files URL | [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/FaxResponseFaxTransmission.md b/sdks/dotnet/docs/FaxResponseFaxTransmission.md new file mode 100644 index 000000000..92a8827b9 --- /dev/null +++ b/sdks/dotnet/docs/FaxResponseFaxTransmission.md @@ -0,0 +1,10 @@ +# Dropbox.Sign.Model.FaxResponseFaxTransmission + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Recipient** | **string** | Fax Transmission Recipient | [optional] **Sender** | **string** | Fax Transmission Sender | [optional] **StatusCode** | **string** | Fax Transmission Status Code | [optional] **SentAt** | **int** | Fax Transmission Sent Timestamp | [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/FaxSendRequest.md b/sdks/dotnet/docs/FaxSendRequest.md new file mode 100644 index 000000000..7b20abdc2 --- /dev/null +++ b/sdks/dotnet/docs/FaxSendRequest.md @@ -0,0 +1,10 @@ +# Dropbox.Sign.Model.FaxSendRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**To** | **string** | Fax Send To Recipient | [optional] **From** | **string** | Fax Send From Sender (used only with fax number) | [optional] **File** | [**List<SubFile>**](SubFile.md) | Fax File to Send | [optional] **FileUrl** | **List<string>** | Fax File URL to Send | [optional] **FileUrlNames** | **List<string>** | Fax File URL Names | [optional] **TestMode** | **bool** | API Test Mode Setting | [optional] **CoverPageTo** | **string** | Fax Cover Page for Recipient | [optional] **CoverPageFrom** | **string** | Fax Cover Page for Sender | [optional] **CoverPageMessage** | **string** | Fax Cover Page Message | [optional] **Title** | **string** | Fax Title | [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/SubFile.md b/sdks/dotnet/docs/SubFile.md new file mode 100644 index 000000000..2fc19429d --- /dev/null +++ b/sdks/dotnet/docs/SubFile.md @@ -0,0 +1,11 @@ +# Dropbox.Sign.Model.SubFile +Actual uploaded physical file + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Name** | **string** | Actual physical uploaded file name that is derived during upload. Not settable parameter. | [optional] [default to ""] + +[[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 new file mode 100644 index 000000000..f1e3d64df --- /dev/null +++ b/sdks/dotnet/src/Dropbox.Sign/Api/FaxApi.cs @@ -0,0 +1,1190 @@ +/* + * Dropbox Sign API + * + * Dropbox Sign v3 API + * + * The version of the OpenAPI document: 3.0.0 + * Contact: apisupport@hellosign.com + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.Net; +using System.Net.Mime; +using Dropbox.Sign.Client; +using Dropbox.Sign.Model; + +namespace Dropbox.Sign.Api +{ + + /// + /// Represents a collection of functions to interact with the API endpoints + /// + public interface IFaxApiSync : IApiAccessor + { + #region Synchronous Operations + /// + /// Delete Fax + /// + /// + /// Deletes the specified Fax from the system. + /// + /// Thrown when fails to make API call + /// Fax ID + /// Index associated with the operation. + /// + void DeleteFax(string faxId, int operationIndex = 0); + + /// + /// Delete Fax + /// + /// + /// Deletes the specified Fax from the system. + /// + /// Thrown when fails to make API call + /// Fax ID + /// Index associated with the operation. + /// ApiResponse of Object(void) + ApiResponse DeleteFaxWithHttpInfo(string faxId, int operationIndex = 0); + /// + /// Get Fax + /// + /// + /// Returns information about fax + /// + /// Thrown when fails to make API call + /// Fax ID + /// Index associated with the operation. + /// FaxResponse + FaxResponse GetFaxById(string faxId, int operationIndex = 0); + + /// + /// Get Fax + /// + /// + /// Returns information about fax + /// + /// Thrown when fails to make API call + /// Fax ID + /// Index associated with the operation. + /// ApiResponse of FaxResponse + ApiResponse GetFaxByIdWithHttpInfo(string faxId, int operationIndex = 0); + /// + /// List Fax Files + /// + /// + /// Returns list of fax files + /// + /// Thrown when fails to make API call + /// Fax ID + /// Index associated with the operation. + /// + void GetFaxFiles(string faxId, int operationIndex = 0); + + /// + /// List Fax Files + /// + /// + /// Returns list of fax files + /// + /// Thrown when fails to make API call + /// Fax ID + /// Index associated with the operation. + /// ApiResponse of Object(void) + ApiResponse GetFaxFilesWithHttpInfo(string faxId, int operationIndex = 0); + /// + /// Lists Faxes + /// + /// + /// Returns properties of multiple faxes + /// + /// Thrown when fails to make API call + /// Page + /// Page size + /// Index associated with the operation. + /// FaxListResponse + FaxListResponse ListFaxes(int page, int pageSize, int operationIndex = 0); + + /// + /// Lists Faxes + /// + /// + /// Returns properties of multiple faxes + /// + /// Thrown when fails to make API call + /// Page + /// Page size + /// Index associated with the operation. + /// ApiResponse of FaxListResponse + ApiResponse ListFaxesWithHttpInfo(int page, int pageSize, int operationIndex = 0); + /// + /// Send Fax + /// + /// + /// Action to prepare and send a fax + /// + /// Thrown when fails to make API call + /// + /// Index associated with the operation. + /// FaxResponse + FaxResponse SendFax(FaxSendRequest faxSendRequest, int operationIndex = 0); + + /// + /// Send Fax + /// + /// + /// Action to prepare and send a fax + /// + /// Thrown when fails to make API call + /// + /// Index associated with the operation. + /// ApiResponse of FaxResponse + ApiResponse SendFaxWithHttpInfo(FaxSendRequest faxSendRequest, int operationIndex = 0); + #endregion Synchronous Operations + } + + /// + /// Represents a collection of functions to interact with the API endpoints + /// + public interface IFaxApiAsync : IApiAccessor + { + #region Asynchronous Operations + /// + /// Delete Fax + /// + /// + /// Deletes the specified Fax from the system. + /// + /// Thrown when fails to make API call + /// Fax ID + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of void + System.Threading.Tasks.Task DeleteFaxAsync(string faxId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + + /// + /// Delete Fax + /// + /// + /// Deletes the specified Fax from the system. + /// + /// Thrown when fails to make API call + /// Fax ID + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse + System.Threading.Tasks.Task> DeleteFaxWithHttpInfoAsync(string faxId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + /// + /// Get Fax + /// + /// + /// Returns information about fax + /// + /// Thrown when fails to make API call + /// Fax ID + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of FaxResponse + System.Threading.Tasks.Task GetFaxByIdAsync(string faxId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + + /// + /// Get Fax + /// + /// + /// Returns information about fax + /// + /// Thrown when fails to make API call + /// Fax ID + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (FaxResponse) + System.Threading.Tasks.Task> GetFaxByIdWithHttpInfoAsync(string faxId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + /// + /// List Fax Files + /// + /// + /// Returns list of fax files + /// + /// Thrown when fails to make API call + /// Fax ID + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of void + System.Threading.Tasks.Task GetFaxFilesAsync(string faxId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + + /// + /// List Fax Files + /// + /// + /// Returns list of fax files + /// + /// Thrown when fails to make API call + /// Fax ID + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse + System.Threading.Tasks.Task> GetFaxFilesWithHttpInfoAsync(string faxId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + /// + /// Lists Faxes + /// + /// + /// Returns properties of multiple faxes + /// + /// Thrown when fails to make API call + /// Page + /// Page size + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of FaxListResponse + System.Threading.Tasks.Task ListFaxesAsync(int page, int pageSize, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + + /// + /// Lists Faxes + /// + /// + /// Returns properties of multiple faxes + /// + /// Thrown when fails to make API call + /// Page + /// Page size + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (FaxListResponse) + System.Threading.Tasks.Task> ListFaxesWithHttpInfoAsync(int page, int pageSize, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + /// + /// Send Fax + /// + /// + /// Action to prepare and send a fax + /// + /// Thrown when fails to make API call + /// + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of FaxResponse + System.Threading.Tasks.Task SendFaxAsync(FaxSendRequest faxSendRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + + /// + /// Send Fax + /// + /// + /// Action to prepare and send a fax + /// + /// Thrown when fails to make API call + /// + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (FaxResponse) + System.Threading.Tasks.Task> SendFaxWithHttpInfoAsync(FaxSendRequest faxSendRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + #endregion Asynchronous Operations + } + + /// + /// Represents a collection of functions to interact with the API endpoints + /// + public interface IFaxApi : IFaxApiSync, IFaxApiAsync + { + + } + + /// + /// Represents a collection of functions to interact with the API endpoints + /// + public partial class FaxApi : IFaxApi + { + private Dropbox.Sign.Client.ExceptionFactory _exceptionFactory = (name, response) => null; + + /// + /// Initializes a new instance of the class. + /// + /// + public FaxApi() : this((string)null) + { + } + + /// + /// Initializes a new instance of the class. + /// + /// + public FaxApi(string basePath) + { + this.Configuration = Dropbox.Sign.Client.Configuration.MergeConfigurations( + Dropbox.Sign.Client.GlobalConfiguration.Instance, + new Dropbox.Sign.Client.Configuration { BasePath = basePath } + ); + this.Client = new Dropbox.Sign.Client.ApiClient(this.Configuration.BasePath); + this.AsynchronousClient = new Dropbox.Sign.Client.ApiClient(this.Configuration.BasePath); + this.ExceptionFactory = Dropbox.Sign.Client.Configuration.DefaultExceptionFactory; + } + + /// + /// Initializes a new instance of the class + /// using Configuration object + /// + /// An instance of Configuration + /// + public FaxApi(Dropbox.Sign.Client.Configuration configuration) + { + if (configuration == null) throw new ArgumentNullException("configuration"); + + this.Configuration = Dropbox.Sign.Client.Configuration.MergeConfigurations( + Dropbox.Sign.Client.GlobalConfiguration.Instance, + configuration + ); + this.Client = new Dropbox.Sign.Client.ApiClient(this.Configuration.BasePath); + this.AsynchronousClient = new Dropbox.Sign.Client.ApiClient(this.Configuration.BasePath); + ExceptionFactory = Dropbox.Sign.Client.Configuration.DefaultExceptionFactory; + } + + /// + /// Initializes a new instance of the class + /// using a Configuration object and client instance. + /// + /// The client interface for synchronous API access. + /// The client interface for asynchronous API access. + /// The configuration object. + public FaxApi(Dropbox.Sign.Client.ISynchronousClient client, Dropbox.Sign.Client.IAsynchronousClient asyncClient, Dropbox.Sign.Client.IReadableConfiguration configuration) + { + if (client == null) throw new ArgumentNullException("client"); + if (asyncClient == null) throw new ArgumentNullException("asyncClient"); + if (configuration == null) throw new ArgumentNullException("configuration"); + + this.Client = client; + this.AsynchronousClient = asyncClient; + this.Configuration = configuration; + this.ExceptionFactory = Dropbox.Sign.Client.Configuration.DefaultExceptionFactory; + } + + /// + /// The client for accessing this underlying API asynchronously. + /// + public Dropbox.Sign.Client.IAsynchronousClient AsynchronousClient { get; set; } + + /// + /// The client for accessing this underlying API synchronously. + /// + public Dropbox.Sign.Client.ISynchronousClient Client { get; set; } + + /// + /// Gets the base path of the API client. + /// + /// The base path + public string GetBasePath() + { + return this.Configuration.BasePath; + } + + /// + /// Gets or sets the configuration object + /// + /// An instance of the Configuration + public Dropbox.Sign.Client.IReadableConfiguration Configuration { get; set; } + + /// + /// Provides a factory method hook for the creation of exceptions. + /// + public Dropbox.Sign.Client.ExceptionFactory ExceptionFactory + { + get + { + if (_exceptionFactory != null && _exceptionFactory.GetInvocationList().Length > 1) + { + throw new InvalidOperationException("Multicast delegate for ExceptionFactory is unsupported."); + } + return _exceptionFactory; + } + set { _exceptionFactory = value; } + } + + /// + /// Delete Fax Deletes the specified Fax from the system. + /// + /// Thrown when fails to make API call + /// Fax ID + /// Index associated with the operation. + /// + public void DeleteFax(string faxId, int operationIndex = 0) + { + DeleteFaxWithHttpInfo(faxId); + } + + /// + /// Delete Fax Deletes the specified Fax from the system. + /// + /// Thrown when fails to make API call + /// Fax ID + /// Index associated with the operation. + /// ApiResponse of Object(void) + public Dropbox.Sign.Client.ApiResponse DeleteFaxWithHttpInfo(string faxId, int operationIndex = 0) + { + // verify the required parameter 'faxId' is set + if (faxId == null) + { + throw new Dropbox.Sign.Client.ApiException(400, "Missing required parameter 'faxId' when calling FaxApi->DeleteFax"); + } + + Dropbox.Sign.Client.RequestOptions localVarRequestOptions = new Dropbox.Sign.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + var localVarContentType = Dropbox.Sign.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } + + var localVarAccept = Dropbox.Sign.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } + + localVarRequestOptions.PathParameters.Add("fax_id", Dropbox.Sign.Client.ClientUtils.ParameterToString(faxId)); // path parameter + + localVarRequestOptions.Operation = "FaxApi.DeleteFax"; + 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.Delete("/fax/{fax_id}", localVarRequestOptions, this.Configuration); + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("DeleteFax", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + + /// + /// Delete Fax Deletes the specified Fax from the system. + /// + /// Thrown when fails to make API call + /// Fax ID + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of void + public async System.Threading.Tasks.Task DeleteFaxAsync(string faxId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + { + await DeleteFaxWithHttpInfoAsync(faxId, operationIndex, cancellationToken).ConfigureAwait(false); + } + + /// + /// Delete Fax Deletes the specified Fax from the system. + /// + /// Thrown when fails to make API call + /// Fax ID + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse + public async System.Threading.Tasks.Task> DeleteFaxWithHttpInfoAsync(string faxId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + { + // verify the required parameter 'faxId' is set + if (faxId == null) + { + throw new Dropbox.Sign.Client.ApiException(400, "Missing required parameter 'faxId' when calling FaxApi->DeleteFax"); + } + + + Dropbox.Sign.Client.RequestOptions localVarRequestOptions = new Dropbox.Sign.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + var localVarContentType = Dropbox.Sign.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } + + var localVarAccept = Dropbox.Sign.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } + + localVarRequestOptions.PathParameters.Add("fax_id", Dropbox.Sign.Client.ClientUtils.ParameterToString(faxId)); // path parameter + + localVarRequestOptions.Operation = "FaxApi.DeleteFax"; + 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.DeleteAsync("/fax/{fax_id}", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("DeleteFax", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + + /// + /// Get Fax Returns information about fax + /// + /// Thrown when fails to make API call + /// Fax ID + /// Index associated with the operation. + /// FaxResponse + public FaxResponse GetFaxById(string faxId, int operationIndex = 0) + { + Dropbox.Sign.Client.ApiResponse localVarResponse = GetFaxByIdWithHttpInfo(faxId); + return localVarResponse.Data; + } + + /// + /// Get Fax Returns information about fax + /// + /// Thrown when fails to make API call + /// Fax ID + /// Index associated with the operation. + /// ApiResponse of FaxResponse + public Dropbox.Sign.Client.ApiResponse GetFaxByIdWithHttpInfo(string faxId, int operationIndex = 0) + { + // verify the required parameter 'faxId' is set + if (faxId == null) + { + throw new Dropbox.Sign.Client.ApiException(400, "Missing required parameter 'faxId' when calling FaxApi->GetFaxById"); + } + + Dropbox.Sign.Client.RequestOptions localVarRequestOptions = new Dropbox.Sign.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + var localVarContentType = Dropbox.Sign.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } + + var localVarAccept = Dropbox.Sign.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } + + localVarRequestOptions.PathParameters.Add("fax_id", Dropbox.Sign.Client.ClientUtils.ParameterToString(faxId)); // path parameter + + localVarRequestOptions.Operation = "FaxApi.GetFaxById"; + 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.Get("/fax/{fax_id}", localVarRequestOptions, this.Configuration); + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("GetFaxById", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + + /// + /// Get Fax Returns information about fax + /// + /// Thrown when fails to make API call + /// Fax ID + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of FaxResponse + public async System.Threading.Tasks.Task GetFaxByIdAsync(string faxId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + { + Dropbox.Sign.Client.ApiResponse localVarResponse = await GetFaxByIdWithHttpInfoAsync(faxId, operationIndex, cancellationToken).ConfigureAwait(false); + return localVarResponse.Data; + } + + /// + /// Get Fax Returns information about fax + /// + /// Thrown when fails to make API call + /// Fax ID + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (FaxResponse) + public async System.Threading.Tasks.Task> GetFaxByIdWithHttpInfoAsync(string faxId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + { + // verify the required parameter 'faxId' is set + if (faxId == null) + { + throw new Dropbox.Sign.Client.ApiException(400, "Missing required parameter 'faxId' when calling FaxApi->GetFaxById"); + } + + + Dropbox.Sign.Client.RequestOptions localVarRequestOptions = new Dropbox.Sign.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + var localVarContentType = Dropbox.Sign.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } + + var localVarAccept = Dropbox.Sign.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } + + localVarRequestOptions.PathParameters.Add("fax_id", Dropbox.Sign.Client.ClientUtils.ParameterToString(faxId)); // path parameter + + localVarRequestOptions.Operation = "FaxApi.GetFaxById"; + 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.GetAsync("/fax/{fax_id}", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("GetFaxById", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + + /// + /// List Fax Files Returns list of fax files + /// + /// Thrown when fails to make API call + /// Fax ID + /// Index associated with the operation. + /// + public void GetFaxFiles(string faxId, int operationIndex = 0) + { + GetFaxFilesWithHttpInfo(faxId); + } + + /// + /// List Fax Files Returns list of fax files + /// + /// Thrown when fails to make API call + /// Fax ID + /// Index associated with the operation. + /// ApiResponse of Object(void) + public Dropbox.Sign.Client.ApiResponse GetFaxFilesWithHttpInfo(string faxId, int operationIndex = 0) + { + // verify the required parameter 'faxId' is set + if (faxId == null) + { + throw new Dropbox.Sign.Client.ApiException(400, "Missing required parameter 'faxId' when calling FaxApi->GetFaxFiles"); + } + + Dropbox.Sign.Client.RequestOptions localVarRequestOptions = new Dropbox.Sign.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + var localVarContentType = Dropbox.Sign.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } + + var localVarAccept = Dropbox.Sign.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } + + localVarRequestOptions.PathParameters.Add("fax_id", Dropbox.Sign.Client.ClientUtils.ParameterToString(faxId)); // path parameter + + localVarRequestOptions.Operation = "FaxApi.GetFaxFiles"; + 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.Get("/fax/files/{fax_id}", localVarRequestOptions, this.Configuration); + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("GetFaxFiles", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + + /// + /// List Fax Files Returns list of fax files + /// + /// Thrown when fails to make API call + /// Fax ID + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of void + public async System.Threading.Tasks.Task GetFaxFilesAsync(string faxId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + { + await GetFaxFilesWithHttpInfoAsync(faxId, operationIndex, cancellationToken).ConfigureAwait(false); + } + + /// + /// List Fax Files Returns list of fax files + /// + /// Thrown when fails to make API call + /// Fax ID + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse + public async System.Threading.Tasks.Task> GetFaxFilesWithHttpInfoAsync(string faxId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + { + // verify the required parameter 'faxId' is set + if (faxId == null) + { + throw new Dropbox.Sign.Client.ApiException(400, "Missing required parameter 'faxId' when calling FaxApi->GetFaxFiles"); + } + + + Dropbox.Sign.Client.RequestOptions localVarRequestOptions = new Dropbox.Sign.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + var localVarContentType = Dropbox.Sign.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } + + var localVarAccept = Dropbox.Sign.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } + + localVarRequestOptions.PathParameters.Add("fax_id", Dropbox.Sign.Client.ClientUtils.ParameterToString(faxId)); // path parameter + + localVarRequestOptions.Operation = "FaxApi.GetFaxFiles"; + 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.GetAsync("/fax/files/{fax_id}", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("GetFaxFiles", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + + /// + /// Lists Faxes Returns properties of multiple faxes + /// + /// Thrown when fails to make API call + /// Page + /// Page size + /// Index associated with the operation. + /// FaxListResponse + public FaxListResponse ListFaxes(int page, int pageSize, int operationIndex = 0) + { + Dropbox.Sign.Client.ApiResponse localVarResponse = ListFaxesWithHttpInfo(page, pageSize); + return localVarResponse.Data; + } + + /// + /// Lists Faxes Returns properties of multiple faxes + /// + /// Thrown when fails to make API call + /// Page + /// Page size + /// Index associated with the operation. + /// ApiResponse of FaxListResponse + public Dropbox.Sign.Client.ApiResponse ListFaxesWithHttpInfo(int page, int pageSize, int operationIndex = 0) + { + Dropbox.Sign.Client.RequestOptions localVarRequestOptions = new Dropbox.Sign.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + var localVarContentType = Dropbox.Sign.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + + // 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.QueryParameters.Add(Dropbox.Sign.Client.ClientUtils.ParameterToMultiMap("", "page", page)); + localVarRequestOptions.QueryParameters.Add(Dropbox.Sign.Client.ClientUtils.ParameterToMultiMap("", "page_size", pageSize)); + + localVarRequestOptions.Operation = "FaxApi.ListFaxes"; + 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.Get("/fax/list", localVarRequestOptions, this.Configuration); + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("ListFaxes", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + + /// + /// Lists Faxes Returns properties of multiple faxes + /// + /// Thrown when fails to make API call + /// Page + /// Page size + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of FaxListResponse + public async System.Threading.Tasks.Task ListFaxesAsync(int page, int pageSize, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + { + Dropbox.Sign.Client.ApiResponse localVarResponse = await ListFaxesWithHttpInfoAsync(page, pageSize, operationIndex, cancellationToken).ConfigureAwait(false); + return localVarResponse.Data; + } + + /// + /// Lists Faxes Returns properties of multiple faxes + /// + /// Thrown when fails to make API call + /// Page + /// Page size + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (FaxListResponse) + public async System.Threading.Tasks.Task> ListFaxesWithHttpInfoAsync(int page, int pageSize, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + { + + Dropbox.Sign.Client.RequestOptions localVarRequestOptions = new Dropbox.Sign.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + var localVarContentType = Dropbox.Sign.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + + // 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.QueryParameters.Add(Dropbox.Sign.Client.ClientUtils.ParameterToMultiMap("", "page", page)); + localVarRequestOptions.QueryParameters.Add(Dropbox.Sign.Client.ClientUtils.ParameterToMultiMap("", "page_size", pageSize)); + + localVarRequestOptions.Operation = "FaxApi.ListFaxes"; + 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.GetAsync("/fax/list", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("ListFaxes", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + + /// + /// Send Fax Action to prepare and send a fax + /// + /// Thrown when fails to make API call + /// + /// Index associated with the operation. + /// FaxResponse + public FaxResponse SendFax(FaxSendRequest faxSendRequest, int operationIndex = 0) + { + Dropbox.Sign.Client.ApiResponse localVarResponse = SendFaxWithHttpInfo(faxSendRequest); + return localVarResponse.Data; + } + + /// + /// Send Fax Action to prepare and send a fax + /// + /// Thrown when fails to make API call + /// + /// Index associated with the operation. + /// ApiResponse of FaxResponse + public Dropbox.Sign.Client.ApiResponse SendFaxWithHttpInfo(FaxSendRequest faxSendRequest, int operationIndex = 0) + { + // verify the required parameter 'faxSendRequest' is set + if (faxSendRequest == null) + { + throw new Dropbox.Sign.Client.ApiException(400, "Missing required parameter 'faxSendRequest' when calling FaxApi->SendFax"); + } + + Dropbox.Sign.Client.RequestOptions localVarRequestOptions = new Dropbox.Sign.Client.RequestOptions(); + + var localVarContentType = ""; + var openApiTypes = faxSendRequest.GetOpenApiTypes(); + if (ClientUtils.HasFileType(openApiTypes)) + { + ClientUtils.SetFormData(localVarRequestOptions, openApiTypes); + localVarContentType = "multipart/form-data"; + } + else + { + localVarContentType = "application/json"; + localVarRequestOptions.Data = faxSendRequest; + } + + // 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.SendFax"; + 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/send", localVarRequestOptions, this.Configuration); + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("SendFax", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + + /// + /// Send Fax Action to prepare and send a fax + /// + /// Thrown when fails to make API call + /// + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of FaxResponse + public async System.Threading.Tasks.Task SendFaxAsync(FaxSendRequest faxSendRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + { + Dropbox.Sign.Client.ApiResponse localVarResponse = await SendFaxWithHttpInfoAsync(faxSendRequest, operationIndex, cancellationToken).ConfigureAwait(false); + return localVarResponse.Data; + } + + /// + /// Send Fax Action to prepare and send a fax + /// + /// Thrown when fails to make API call + /// + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (FaxResponse) + public async System.Threading.Tasks.Task> SendFaxWithHttpInfoAsync(FaxSendRequest faxSendRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + { + // verify the required parameter 'faxSendRequest' is set + if (faxSendRequest == null) + { + throw new Dropbox.Sign.Client.ApiException(400, "Missing required parameter 'faxSendRequest' when calling FaxApi->SendFax"); + } + + + Dropbox.Sign.Client.RequestOptions localVarRequestOptions = new Dropbox.Sign.Client.RequestOptions(); + + var localVarContentType = ""; + var openApiTypes = faxSendRequest.GetOpenApiTypes(); + if (ClientUtils.HasFileType(openApiTypes)) + { + ClientUtils.SetFormData(localVarRequestOptions, openApiTypes); + localVarContentType = "multipart/form-data"; + } + else + { + localVarContentType = "application/json"; + localVarRequestOptions.Data = faxSendRequest; + } + + // 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.SendFax"; + 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/send", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("SendFax", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + + } +} diff --git a/sdks/dotnet/src/Dropbox.Sign/Model/FaxListResponse.cs b/sdks/dotnet/src/Dropbox.Sign/Model/FaxListResponse.cs new file mode 100644 index 000000000..fb04b1b4e --- /dev/null +++ b/sdks/dotnet/src/Dropbox.Sign/Model/FaxListResponse.cs @@ -0,0 +1,201 @@ +/* + * 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 +{ + /// + /// FaxListResponse + /// + [DataContract(Name = "FaxListResponse")] + [JsonObject(ItemNullValueHandling = NullValueHandling.Ignore)] + public partial class FaxListResponse : IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + [JsonConstructorAttribute] + protected FaxListResponse() { } + /// + /// Initializes a new instance of the class. + /// + /// faxes (required). + /// listInfo (required). + public FaxListResponse(List faxes = default(List), ListInfoResponse listInfo = default(ListInfoResponse)) + { + + // to ensure "faxes" is required (not null) + if (faxes == null) + { + throw new ArgumentNullException("faxes is a required property for FaxListResponse and cannot be null"); + } + this.Faxes = faxes; + // to ensure "listInfo" is required (not null) + if (listInfo == null) + { + throw new ArgumentNullException("listInfo is a required property for FaxListResponse and cannot be null"); + } + this.ListInfo = listInfo; + } + + /// + /// Attempt to instantiate and hydrate a new instance of this class + /// + /// String of JSON data representing target object + public static FaxListResponse Init(string jsonData) + { + var obj = JsonConvert.DeserializeObject(jsonData); + + if (obj == null) + { + throw new Exception("Unable to deserialize JSON to instance of FaxListResponse"); + } + + return obj; + } + + /// + /// Gets or Sets Faxes + /// + [DataMember(Name = "faxes", IsRequired = true, EmitDefaultValue = true)] + public List Faxes { get; set; } + + /// + /// Gets or Sets ListInfo + /// + [DataMember(Name = "list_info", IsRequired = true, EmitDefaultValue = true)] + public ListInfoResponse ListInfo { 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 FaxListResponse {\n"); + sb.Append(" Faxes: ").Append(Faxes).Append("\n"); + sb.Append(" ListInfo: ").Append(ListInfo).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 FaxListResponse); + } + + /// + /// Returns true if FaxListResponse instances are equal + /// + /// Instance of FaxListResponse to be compared + /// Boolean + public bool Equals(FaxListResponse input) + { + if (input == null) + { + return false; + } + return + ( + this.Faxes == input.Faxes || + this.Faxes != null && + input.Faxes != null && + this.Faxes.SequenceEqual(input.Faxes) + ) && + ( + this.ListInfo == input.ListInfo || + (this.ListInfo != null && + this.ListInfo.Equals(input.ListInfo)) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.Faxes != null) + { + hashCode = (hashCode * 59) + this.Faxes.GetHashCode(); + } + if (this.ListInfo != null) + { + hashCode = (hashCode * 59) + this.ListInfo.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 = "faxes", + Property = "Faxes", + Type = "List", + Value = Faxes, + }); + types.Add(new OpenApiType() + { + Name = "list_info", + Property = "ListInfo", + Type = "ListInfoResponse", + Value = ListInfo, + }); + + return types; + } + } + +} diff --git a/sdks/dotnet/src/Dropbox.Sign/Model/FaxResponse.cs b/sdks/dotnet/src/Dropbox.Sign/Model/FaxResponse.cs new file mode 100644 index 000000000..0110cc4df --- /dev/null +++ b/sdks/dotnet/src/Dropbox.Sign/Model/FaxResponse.cs @@ -0,0 +1,195 @@ +/* + * 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 +{ + /// + /// FaxResponse + /// + [DataContract(Name = "FaxResponse")] + [JsonObject(ItemNullValueHandling = NullValueHandling.Ignore)] + public partial class FaxResponse : IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + [JsonConstructorAttribute] + protected FaxResponse() { } + /// + /// Initializes a new instance of the class. + /// + /// fax (required). + /// warnings. + public FaxResponse(FaxResponseFax fax = default(FaxResponseFax), WarningResponse warnings = default(WarningResponse)) + { + + // to ensure "fax" is required (not null) + if (fax == null) + { + throw new ArgumentNullException("fax is a required property for FaxResponse and cannot be null"); + } + this.Fax = fax; + this.Warnings = warnings; + } + + /// + /// Attempt to instantiate and hydrate a new instance of this class + /// + /// String of JSON data representing target object + public static FaxResponse Init(string jsonData) + { + var obj = JsonConvert.DeserializeObject(jsonData); + + if (obj == null) + { + throw new Exception("Unable to deserialize JSON to instance of FaxResponse"); + } + + return obj; + } + + /// + /// Gets or Sets Fax + /// + [DataMember(Name = "fax", IsRequired = true, EmitDefaultValue = true)] + public FaxResponseFax Fax { get; set; } + + /// + /// Gets or Sets Warnings + /// + [DataMember(Name = "warnings", EmitDefaultValue = true)] + public WarningResponse 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 FaxResponse {\n"); + sb.Append(" Fax: ").Append(Fax).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 FaxResponse); + } + + /// + /// Returns true if FaxResponse instances are equal + /// + /// Instance of FaxResponse to be compared + /// Boolean + public bool Equals(FaxResponse input) + { + if (input == null) + { + return false; + } + return + ( + this.Fax == input.Fax || + (this.Fax != null && + this.Fax.Equals(input.Fax)) + ) && + ( + this.Warnings == input.Warnings || + (this.Warnings != null && + this.Warnings.Equals(input.Warnings)) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.Fax != null) + { + hashCode = (hashCode * 59) + this.Fax.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", + Property = "Fax", + Type = "FaxResponseFax", + Value = Fax, + }); + types.Add(new OpenApiType() + { + Name = "warnings", + Property = "Warnings", + Type = "WarningResponse", + Value = Warnings, + }); + + return types; + } + } + +} diff --git a/sdks/dotnet/src/Dropbox.Sign/Model/FaxResponseFax.cs b/sdks/dotnet/src/Dropbox.Sign/Model/FaxResponseFax.cs new file mode 100644 index 000000000..abb8cab5f --- /dev/null +++ b/sdks/dotnet/src/Dropbox.Sign/Model/FaxResponseFax.cs @@ -0,0 +1,397 @@ +/* + * 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 +{ + /// + /// FaxResponseFax + /// + [DataContract(Name = "FaxResponseFax")] + [JsonObject(ItemNullValueHandling = NullValueHandling.Ignore)] + public partial class FaxResponseFax : IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + [JsonConstructorAttribute] + protected FaxResponseFax() { } + /// + /// Initializes a new instance of the class. + /// + /// Fax ID. + /// Fax Title. + /// Fax Original Title. + /// Fax Subject. + /// Fax Message. + /// Fax Metadata. + /// Fax Created At Timestamp. + /// Fax Sender Email. + /// Fax Transmissions List. + /// Fax Files URL. + public FaxResponseFax(string faxId = default(string), string title = default(string), string originalTitle = default(string), string subject = default(string), string message = default(string), Object metadata = default(Object), int createdAt = default(int), string from = default(string), List transmissions = default(List), string filesUrl = default(string)) + { + + this.FaxId = faxId; + this.Title = title; + this.OriginalTitle = originalTitle; + this.Subject = subject; + this.Message = message; + this.Metadata = metadata; + this.CreatedAt = createdAt; + this.From = from; + this.Transmissions = transmissions; + this.FilesUrl = filesUrl; + } + + /// + /// Attempt to instantiate and hydrate a new instance of this class + /// + /// String of JSON data representing target object + public static FaxResponseFax Init(string jsonData) + { + var obj = JsonConvert.DeserializeObject(jsonData); + + if (obj == null) + { + throw new Exception("Unable to deserialize JSON to instance of FaxResponseFax"); + } + + return obj; + } + + /// + /// Fax ID + /// + /// Fax ID + [DataMember(Name = "fax_id", EmitDefaultValue = true)] + public string FaxId { get; set; } + + /// + /// Fax Title + /// + /// Fax Title + [DataMember(Name = "title", EmitDefaultValue = true)] + public string Title { get; set; } + + /// + /// Fax Original Title + /// + /// Fax Original Title + [DataMember(Name = "original_title", EmitDefaultValue = true)] + public string OriginalTitle { get; set; } + + /// + /// Fax Subject + /// + /// Fax Subject + [DataMember(Name = "subject", EmitDefaultValue = true)] + public string Subject { get; set; } + + /// + /// Fax Message + /// + /// Fax Message + [DataMember(Name = "message", EmitDefaultValue = true)] + public string Message { get; set; } + + /// + /// Fax Metadata + /// + /// Fax Metadata + [DataMember(Name = "metadata", EmitDefaultValue = true)] + public Object Metadata { get; set; } + + /// + /// Fax Created At Timestamp + /// + /// Fax Created At Timestamp + [DataMember(Name = "created_at", EmitDefaultValue = true)] + public int CreatedAt { get; set; } + + /// + /// Fax Sender Email + /// + /// Fax Sender Email + [DataMember(Name = "from", EmitDefaultValue = true)] + public string From { get; set; } + + /// + /// Fax Transmissions List + /// + /// Fax Transmissions List + [DataMember(Name = "transmissions", EmitDefaultValue = true)] + public List Transmissions { get; set; } + + /// + /// Fax Files URL + /// + /// Fax Files URL + [DataMember(Name = "files_url", EmitDefaultValue = true)] + public string FilesUrl { 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 FaxResponseFax {\n"); + sb.Append(" FaxId: ").Append(FaxId).Append("\n"); + sb.Append(" Title: ").Append(Title).Append("\n"); + sb.Append(" OriginalTitle: ").Append(OriginalTitle).Append("\n"); + sb.Append(" Subject: ").Append(Subject).Append("\n"); + sb.Append(" Message: ").Append(Message).Append("\n"); + sb.Append(" Metadata: ").Append(Metadata).Append("\n"); + sb.Append(" CreatedAt: ").Append(CreatedAt).Append("\n"); + sb.Append(" From: ").Append(From).Append("\n"); + sb.Append(" Transmissions: ").Append(Transmissions).Append("\n"); + sb.Append(" FilesUrl: ").Append(FilesUrl).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 FaxResponseFax); + } + + /// + /// Returns true if FaxResponseFax instances are equal + /// + /// Instance of FaxResponseFax to be compared + /// Boolean + public bool Equals(FaxResponseFax input) + { + if (input == null) + { + return false; + } + return + ( + this.FaxId == input.FaxId || + (this.FaxId != null && + this.FaxId.Equals(input.FaxId)) + ) && + ( + this.Title == input.Title || + (this.Title != null && + this.Title.Equals(input.Title)) + ) && + ( + this.OriginalTitle == input.OriginalTitle || + (this.OriginalTitle != null && + this.OriginalTitle.Equals(input.OriginalTitle)) + ) && + ( + this.Subject == input.Subject || + (this.Subject != null && + this.Subject.Equals(input.Subject)) + ) && + ( + this.Message == input.Message || + (this.Message != null && + this.Message.Equals(input.Message)) + ) && + ( + this.Metadata == input.Metadata || + (this.Metadata != null && + this.Metadata.Equals(input.Metadata)) + ) && + ( + this.CreatedAt == input.CreatedAt || + this.CreatedAt.Equals(input.CreatedAt) + ) && + ( + this.From == input.From || + (this.From != null && + this.From.Equals(input.From)) + ) && + ( + this.Transmissions == input.Transmissions || + this.Transmissions != null && + input.Transmissions != null && + this.Transmissions.SequenceEqual(input.Transmissions) + ) && + ( + this.FilesUrl == input.FilesUrl || + (this.FilesUrl != null && + this.FilesUrl.Equals(input.FilesUrl)) + ); + } + + /// + /// 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.Title != null) + { + hashCode = (hashCode * 59) + this.Title.GetHashCode(); + } + if (this.OriginalTitle != null) + { + hashCode = (hashCode * 59) + this.OriginalTitle.GetHashCode(); + } + if (this.Subject != null) + { + hashCode = (hashCode * 59) + this.Subject.GetHashCode(); + } + if (this.Message != null) + { + hashCode = (hashCode * 59) + this.Message.GetHashCode(); + } + if (this.Metadata != null) + { + hashCode = (hashCode * 59) + this.Metadata.GetHashCode(); + } + hashCode = (hashCode * 59) + this.CreatedAt.GetHashCode(); + if (this.From != null) + { + hashCode = (hashCode * 59) + this.From.GetHashCode(); + } + if (this.Transmissions != null) + { + hashCode = (hashCode * 59) + this.Transmissions.GetHashCode(); + } + if (this.FilesUrl != null) + { + hashCode = (hashCode * 59) + this.FilesUrl.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 = "title", + Property = "Title", + Type = "string", + Value = Title, + }); + types.Add(new OpenApiType() + { + Name = "original_title", + Property = "OriginalTitle", + Type = "string", + Value = OriginalTitle, + }); + types.Add(new OpenApiType() + { + Name = "subject", + Property = "Subject", + Type = "string", + Value = Subject, + }); + types.Add(new OpenApiType() + { + Name = "message", + Property = "Message", + Type = "string", + Value = Message, + }); + types.Add(new OpenApiType() + { + Name = "metadata", + Property = "Metadata", + Type = "Object", + Value = Metadata, + }); + types.Add(new OpenApiType() + { + Name = "created_at", + Property = "CreatedAt", + Type = "int", + Value = CreatedAt, + }); + types.Add(new OpenApiType() + { + Name = "from", + Property = "From", + Type = "string", + Value = From, + }); + types.Add(new OpenApiType() + { + Name = "transmissions", + Property = "Transmissions", + Type = "List", + Value = Transmissions, + }); + types.Add(new OpenApiType() + { + Name = "files_url", + Property = "FilesUrl", + Type = "string", + Value = FilesUrl, + }); + + return types; + } + } + +} diff --git a/sdks/dotnet/src/Dropbox.Sign/Model/FaxResponseFaxTransmission.cs b/sdks/dotnet/src/Dropbox.Sign/Model/FaxResponseFaxTransmission.cs new file mode 100644 index 000000000..51e666148 --- /dev/null +++ b/sdks/dotnet/src/Dropbox.Sign/Model/FaxResponseFaxTransmission.cs @@ -0,0 +1,240 @@ +/* + * 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 +{ + /// + /// FaxResponseFaxTransmission + /// + [DataContract(Name = "FaxResponseFaxTransmission")] + [JsonObject(ItemNullValueHandling = NullValueHandling.Ignore)] + public partial class FaxResponseFaxTransmission : IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + [JsonConstructorAttribute] + protected FaxResponseFaxTransmission() { } + /// + /// Initializes a new instance of the class. + /// + /// Fax Transmission Recipient. + /// Fax Transmission Sender. + /// Fax Transmission Status Code. + /// Fax Transmission Sent Timestamp. + public FaxResponseFaxTransmission(string recipient = default(string), string sender = default(string), string statusCode = default(string), int sentAt = default(int)) + { + + this.Recipient = recipient; + this.Sender = sender; + this.StatusCode = statusCode; + this.SentAt = sentAt; + } + + /// + /// Attempt to instantiate and hydrate a new instance of this class + /// + /// String of JSON data representing target object + public static FaxResponseFaxTransmission Init(string jsonData) + { + var obj = JsonConvert.DeserializeObject(jsonData); + + if (obj == null) + { + throw new Exception("Unable to deserialize JSON to instance of FaxResponseFaxTransmission"); + } + + return obj; + } + + /// + /// Fax Transmission Recipient + /// + /// Fax Transmission Recipient + [DataMember(Name = "recipient", EmitDefaultValue = true)] + public string Recipient { get; set; } + + /// + /// Fax Transmission Sender + /// + /// Fax Transmission Sender + [DataMember(Name = "sender", EmitDefaultValue = true)] + public string Sender { get; set; } + + /// + /// Fax Transmission Status Code + /// + /// Fax Transmission Status Code + [DataMember(Name = "status_code", EmitDefaultValue = true)] + public string StatusCode { get; set; } + + /// + /// Fax Transmission Sent Timestamp + /// + /// Fax Transmission Sent Timestamp + [DataMember(Name = "sent_at", EmitDefaultValue = true)] + public int SentAt { 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 FaxResponseFaxTransmission {\n"); + sb.Append(" Recipient: ").Append(Recipient).Append("\n"); + sb.Append(" Sender: ").Append(Sender).Append("\n"); + sb.Append(" StatusCode: ").Append(StatusCode).Append("\n"); + sb.Append(" SentAt: ").Append(SentAt).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 FaxResponseFaxTransmission); + } + + /// + /// Returns true if FaxResponseFaxTransmission instances are equal + /// + /// Instance of FaxResponseFaxTransmission to be compared + /// Boolean + public bool Equals(FaxResponseFaxTransmission input) + { + if (input == null) + { + return false; + } + return + ( + this.Recipient == input.Recipient || + (this.Recipient != null && + this.Recipient.Equals(input.Recipient)) + ) && + ( + this.Sender == input.Sender || + (this.Sender != null && + this.Sender.Equals(input.Sender)) + ) && + ( + this.StatusCode == input.StatusCode || + (this.StatusCode != null && + this.StatusCode.Equals(input.StatusCode)) + ) && + ( + this.SentAt == input.SentAt || + this.SentAt.Equals(input.SentAt) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.Recipient != null) + { + hashCode = (hashCode * 59) + this.Recipient.GetHashCode(); + } + if (this.Sender != null) + { + hashCode = (hashCode * 59) + this.Sender.GetHashCode(); + } + if (this.StatusCode != null) + { + hashCode = (hashCode * 59) + this.StatusCode.GetHashCode(); + } + hashCode = (hashCode * 59) + this.SentAt.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 = "recipient", + Property = "Recipient", + Type = "string", + Value = Recipient, + }); + types.Add(new OpenApiType() + { + Name = "sender", + Property = "Sender", + Type = "string", + Value = Sender, + }); + types.Add(new OpenApiType() + { + Name = "status_code", + Property = "StatusCode", + Type = "string", + Value = StatusCode, + }); + types.Add(new OpenApiType() + { + Name = "sent_at", + Property = "SentAt", + Type = "int", + Value = SentAt, + }); + + return types; + } + } + +} diff --git a/sdks/dotnet/src/Dropbox.Sign/Model/FaxSendRequest.cs b/sdks/dotnet/src/Dropbox.Sign/Model/FaxSendRequest.cs new file mode 100644 index 000000000..f7095cf60 --- /dev/null +++ b/sdks/dotnet/src/Dropbox.Sign/Model/FaxSendRequest.cs @@ -0,0 +1,406 @@ +/* + * 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 +{ + /// + /// FaxSendRequest + /// + [DataContract(Name = "FaxSendRequest")] + [JsonObject(ItemNullValueHandling = NullValueHandling.Ignore)] + public partial class FaxSendRequest : IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + [JsonConstructorAttribute] + protected FaxSendRequest() { } + /// + /// Initializes a new instance of the class. + /// + /// Fax Send To Recipient. + /// Fax Send From Sender (used only with fax number). + /// Fax File to Send. + /// Fax File URL to Send. + /// Fax File URL Names. + /// API Test Mode Setting. + /// Fax Cover Page for Recipient. + /// Fax Cover Page for Sender. + /// Fax Cover Page Message. + /// Fax Title. + public FaxSendRequest(string to = default(string), string from = default(string), List file = default(List), List fileUrl = default(List), List fileUrlNames = default(List), bool testMode = default(bool), string coverPageTo = default(string), string coverPageFrom = default(string), string coverPageMessage = default(string), string title = default(string)) + { + + this.To = to; + this.From = from; + this.File = file; + this.FileUrl = fileUrl; + this.FileUrlNames = fileUrlNames; + this.TestMode = testMode; + this.CoverPageTo = coverPageTo; + this.CoverPageFrom = coverPageFrom; + this.CoverPageMessage = coverPageMessage; + this.Title = title; + } + + /// + /// Attempt to instantiate and hydrate a new instance of this class + /// + /// String of JSON data representing target object + public static FaxSendRequest Init(string jsonData) + { + var obj = JsonConvert.DeserializeObject(jsonData); + + if (obj == null) + { + throw new Exception("Unable to deserialize JSON to instance of FaxSendRequest"); + } + + return obj; + } + + /// + /// Fax Send To Recipient + /// + /// Fax Send To Recipient + /// recipient@example.com + [DataMember(Name = "to", EmitDefaultValue = true)] + public string To { get; set; } + + /// + /// Fax Send From Sender (used only with fax number) + /// + /// Fax Send From Sender (used only with fax number) + /// sender@example.com + [DataMember(Name = "from", EmitDefaultValue = true)] + public string From { get; set; } + + /// + /// Fax File to Send + /// + /// Fax File to Send + [DataMember(Name = "file", EmitDefaultValue = true)] + public List File { get; set; } + + /// + /// Fax File URL to Send + /// + /// Fax File URL to Send + [DataMember(Name = "file_url", EmitDefaultValue = true)] + public List FileUrl { get; set; } + + /// + /// Fax File URL Names + /// + /// Fax File URL Names + [DataMember(Name = "file_url_names", EmitDefaultValue = true)] + public List FileUrlNames { get; set; } + + /// + /// API Test Mode Setting + /// + /// API Test Mode Setting + /// false + [DataMember(Name = "test_mode", EmitDefaultValue = true)] + public bool TestMode { get; set; } + + /// + /// Fax Cover Page for Recipient + /// + /// Fax Cover Page for Recipient + /// Recipient Name + [DataMember(Name = "cover_page_to", EmitDefaultValue = true)] + public string CoverPageTo { get; set; } + + /// + /// Fax Cover Page for Sender + /// + /// Fax Cover Page for Sender + /// Sender Name + [DataMember(Name = "cover_page_from", EmitDefaultValue = true)] + public string CoverPageFrom { get; set; } + + /// + /// Fax Cover Page Message + /// + /// Fax Cover Page Message + /// Please find the attached documents. + [DataMember(Name = "cover_page_message", EmitDefaultValue = true)] + public string CoverPageMessage { get; set; } + + /// + /// Fax Title + /// + /// Fax Title + /// Fax Title + [DataMember(Name = "title", EmitDefaultValue = true)] + public string Title { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class FaxSendRequest {\n"); + sb.Append(" To: ").Append(To).Append("\n"); + sb.Append(" From: ").Append(From).Append("\n"); + sb.Append(" File: ").Append(File).Append("\n"); + sb.Append(" FileUrl: ").Append(FileUrl).Append("\n"); + sb.Append(" FileUrlNames: ").Append(FileUrlNames).Append("\n"); + sb.Append(" TestMode: ").Append(TestMode).Append("\n"); + sb.Append(" CoverPageTo: ").Append(CoverPageTo).Append("\n"); + sb.Append(" CoverPageFrom: ").Append(CoverPageFrom).Append("\n"); + sb.Append(" CoverPageMessage: ").Append(CoverPageMessage).Append("\n"); + sb.Append(" Title: ").Append(Title).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return this.Equals(input as FaxSendRequest); + } + + /// + /// Returns true if FaxSendRequest instances are equal + /// + /// Instance of FaxSendRequest to be compared + /// Boolean + public bool Equals(FaxSendRequest input) + { + if (input == null) + { + return false; + } + return + ( + this.To == input.To || + (this.To != null && + this.To.Equals(input.To)) + ) && + ( + this.From == input.From || + (this.From != null && + this.From.Equals(input.From)) + ) && + ( + this.File == input.File || + this.File != null && + input.File != null && + this.File.SequenceEqual(input.File) + ) && + ( + this.FileUrl == input.FileUrl || + this.FileUrl != null && + input.FileUrl != null && + this.FileUrl.SequenceEqual(input.FileUrl) + ) && + ( + this.FileUrlNames == input.FileUrlNames || + this.FileUrlNames != null && + input.FileUrlNames != null && + this.FileUrlNames.SequenceEqual(input.FileUrlNames) + ) && + ( + this.TestMode == input.TestMode || + this.TestMode.Equals(input.TestMode) + ) && + ( + this.CoverPageTo == input.CoverPageTo || + (this.CoverPageTo != null && + this.CoverPageTo.Equals(input.CoverPageTo)) + ) && + ( + this.CoverPageFrom == input.CoverPageFrom || + (this.CoverPageFrom != null && + this.CoverPageFrom.Equals(input.CoverPageFrom)) + ) && + ( + this.CoverPageMessage == input.CoverPageMessage || + (this.CoverPageMessage != null && + this.CoverPageMessage.Equals(input.CoverPageMessage)) + ) && + ( + this.Title == input.Title || + (this.Title != null && + this.Title.Equals(input.Title)) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.To != null) + { + hashCode = (hashCode * 59) + this.To.GetHashCode(); + } + if (this.From != null) + { + hashCode = (hashCode * 59) + this.From.GetHashCode(); + } + if (this.File != null) + { + hashCode = (hashCode * 59) + this.File.GetHashCode(); + } + if (this.FileUrl != null) + { + hashCode = (hashCode * 59) + this.FileUrl.GetHashCode(); + } + if (this.FileUrlNames != null) + { + hashCode = (hashCode * 59) + this.FileUrlNames.GetHashCode(); + } + hashCode = (hashCode * 59) + this.TestMode.GetHashCode(); + if (this.CoverPageTo != null) + { + hashCode = (hashCode * 59) + this.CoverPageTo.GetHashCode(); + } + if (this.CoverPageFrom != null) + { + hashCode = (hashCode * 59) + this.CoverPageFrom.GetHashCode(); + } + if (this.CoverPageMessage != null) + { + hashCode = (hashCode * 59) + this.CoverPageMessage.GetHashCode(); + } + if (this.Title != null) + { + hashCode = (hashCode * 59) + this.Title.GetHashCode(); + } + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + yield break; + } + public List GetOpenApiTypes() + { + var types = new List(); + types.Add(new OpenApiType() + { + Name = "to", + Property = "To", + Type = "string", + Value = To, + }); + types.Add(new OpenApiType() + { + Name = "from", + Property = "From", + Type = "string", + Value = From, + }); + types.Add(new OpenApiType() + { + Name = "file", + Property = "File", + Type = "List", + Value = File, + }); + types.Add(new OpenApiType() + { + Name = "file_url", + Property = "FileUrl", + Type = "List", + Value = FileUrl, + }); + types.Add(new OpenApiType() + { + Name = "file_url_names", + Property = "FileUrlNames", + Type = "List", + Value = FileUrlNames, + }); + types.Add(new OpenApiType() + { + Name = "test_mode", + Property = "TestMode", + Type = "bool", + Value = TestMode, + }); + types.Add(new OpenApiType() + { + Name = "cover_page_to", + Property = "CoverPageTo", + Type = "string", + Value = CoverPageTo, + }); + types.Add(new OpenApiType() + { + Name = "cover_page_from", + Property = "CoverPageFrom", + Type = "string", + Value = CoverPageFrom, + }); + types.Add(new OpenApiType() + { + Name = "cover_page_message", + Property = "CoverPageMessage", + Type = "string", + Value = CoverPageMessage, + }); + types.Add(new OpenApiType() + { + Name = "title", + Property = "Title", + Type = "string", + Value = Title, + }); + + return types; + } + } + +} diff --git a/sdks/dotnet/src/Dropbox.Sign/Model/SubFile.cs b/sdks/dotnet/src/Dropbox.Sign/Model/SubFile.cs new file mode 100644 index 000000000..d17056299 --- /dev/null +++ b/sdks/dotnet/src/Dropbox.Sign/Model/SubFile.cs @@ -0,0 +1,167 @@ +/* + * 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 +{ + /// + /// Actual uploaded physical file + /// + [DataContract(Name = "SubFile")] + [JsonObject(ItemNullValueHandling = NullValueHandling.Ignore)] + public partial class SubFile : IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + [JsonConstructorAttribute] + protected SubFile() { } + /// + /// Initializes a new instance of the class. + /// + /// Actual physical uploaded file name that is derived during upload. Not settable parameter. (default to ""). + public SubFile(string name = @"") + { + + // use default value if no "name" provided + this.Name = name ?? ""; + } + + /// + /// Attempt to instantiate and hydrate a new instance of this class + /// + /// String of JSON data representing target object + public static SubFile Init(string jsonData) + { + var obj = JsonConvert.DeserializeObject(jsonData); + + if (obj == null) + { + throw new Exception("Unable to deserialize JSON to instance of SubFile"); + } + + return obj; + } + + /// + /// Actual physical uploaded file name that is derived during upload. Not settable parameter. + /// + /// Actual physical uploaded file name that is derived during upload. Not settable parameter. + [DataMember(Name = "name", EmitDefaultValue = true)] + public string Name { 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 SubFile {\n"); + sb.Append(" Name: ").Append(Name).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 SubFile); + } + + /// + /// Returns true if SubFile instances are equal + /// + /// Instance of SubFile to be compared + /// Boolean + public bool Equals(SubFile input) + { + if (input == null) + { + return false; + } + return + ( + this.Name == input.Name || + (this.Name != null && + this.Name.Equals(input.Name)) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.Name != null) + { + hashCode = (hashCode * 59) + this.Name.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 = "name", + Property = "Name", + Type = "string", + Value = Name, + }); + + return types; + } + } + +} diff --git a/sdks/java-v1/README.md b/sdks/java-v1/README.md index b78da75be..3d962d543 100644 --- a/sdks/java-v1/README.md +++ b/sdks/java-v1/README.md @@ -177,6 +177,11 @@ Class | Method | HTTP request | Description *BulkSendJobApi* | [**bulkSendJobList**](docs/BulkSendJobApi.md#bulkSendJobList) | **GET** /bulk_send_job/list | List Bulk Send Jobs *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* | [**deleteFax**](docs/FaxApi.md#deleteFax) | **DELETE** /fax/{fax_id} | Delete Fax +*FaxApi* | [**getFaxById**](docs/FaxApi.md#getFaxById) | **GET** /fax/{fax_id} | Get Fax +*FaxApi* | [**getFaxFiles**](docs/FaxApi.md#getFaxFiles) | **GET** /fax/files/{fax_id} | List Fax Files +*FaxApi* | [**listFaxes**](docs/FaxApi.md#listFaxes) | **GET** /fax/list | Lists Faxes +*FaxApi* | [**sendFax**](docs/FaxApi.md#sendFax) | **POST** /fax/send | Send Fax *FaxLineApi* | [**faxLineAddUser**](docs/FaxLineApi.md#faxLineAddUser) | **PUT** /fax_line/add_user | Add Fax Line User *FaxLineApi* | [**faxLineAreaCodeGet**](docs/FaxLineApi.md#faxLineAreaCodeGet) | **GET** /fax_line/area_codes | Get Available Fax Line Area Codes *FaxLineApi* | [**faxLineCreate**](docs/FaxLineApi.md#faxLineCreate) | **POST** /fax_line/create | Purchase Fax Line @@ -277,6 +282,11 @@ Class | Method | HTTP request | Description - [FaxLineRemoveUserRequest](docs/FaxLineRemoveUserRequest.md) - [FaxLineResponse](docs/FaxLineResponse.md) - [FaxLineResponseFaxLine](docs/FaxLineResponseFaxLine.md) + - [FaxListResponse](docs/FaxListResponse.md) + - [FaxResponse](docs/FaxResponse.md) + - [FaxResponseFax](docs/FaxResponseFax.md) + - [FaxResponseFaxTransmission](docs/FaxResponseFaxTransmission.md) + - [FaxSendRequest](docs/FaxSendRequest.md) - [FileResponse](docs/FileResponse.md) - [FileResponseDataUri](docs/FileResponseDataUri.md) - [ListInfoResponse](docs/ListInfoResponse.md) @@ -321,6 +331,7 @@ Class | Method | HTTP request | Description - [SubCustomField](docs/SubCustomField.md) - [SubEditorOptions](docs/SubEditorOptions.md) - [SubFieldOptions](docs/SubFieldOptions.md) + - [SubFile](docs/SubFile.md) - [SubFormFieldGroup](docs/SubFormFieldGroup.md) - [SubFormFieldRule](docs/SubFormFieldRule.md) - [SubFormFieldRuleAction](docs/SubFormFieldRuleAction.md) diff --git a/sdks/java-v1/docs/FaxApi.md b/sdks/java-v1/docs/FaxApi.md new file mode 100644 index 000000000..675e03473 --- /dev/null +++ b/sdks/java-v1/docs/FaxApi.md @@ -0,0 +1,355 @@ +# FaxApi + +All URIs are relative to *https://api.hellosign.com/v3* + +| Method | HTTP request | Description | +|------------- | ------------- | -------------| +[**deleteFax**](FaxApi.md#deleteFax) | **DELETE** /fax/{fax_id} | Delete Fax +[**getFaxById**](FaxApi.md#getFaxById) | **GET** /fax/{fax_id} | Get Fax +[**getFaxFiles**](FaxApi.md#getFaxFiles) | **GET** /fax/files/{fax_id} | List Fax Files +[**listFaxes**](FaxApi.md#listFaxes) | **GET** /fax/list | Lists Faxes +[**sendFax**](FaxApi.md#sendFax) | **POST** /fax/send | Send Fax + + + +## deleteFax + +> deleteFax(faxId) + +Delete Fax + +Deletes the specified Fax from the system. + +### Example + +```java +import com.dropbox.sign.ApiException; +import com.dropbox.sign.Configuration; +import com.dropbox.sign.api.*; +import com.dropbox.sign.auth.*; +import com.dropbox.sign.model.*; + +import java.util.List; + +public class Example { + public static void main(String[] args) { + var apiClient = Configuration.getDefaultApiClient() + .setApiKey("YOUR_API_KEY"); + + var faxAPi = new FaxApi(apiClient); + + try { + faxAPi.deleteFax("[FAX_NUMBER]"); + } catch (ApiException e) { + 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 | +|------------- | ------------- | ------------- | -------------| + **faxId** | **String**| Fax ID | + +### Return type + +null (empty response body) + +### Authorization + +[api_key](../README.md#api_key) + +### HTTP request headers + +- **Content-Type**: Not defined +- **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 | - | + + +## getFaxById + +> FaxResponse getFaxById(faxId) + +Get Fax + +Returns information about fax + +### Example + +```java +import com.dropbox.sign.ApiException; +import com.dropbox.sign.Configuration; +import com.dropbox.sign.api.*; +import com.dropbox.sign.auth.*; +import com.dropbox.sign.model.*; + +public class Example { + public static void main(String[] args) { + var apiClient = Configuration.getDefaultApiClient() + .setApiKey("YOUR_API_KEY"); + + var faxApi = new FaxApi(apiClient); + + var faxId = "fa5c8a0b0f492d768749333ad6fcc214c111e967"; + + try { + FaxGetResponse result = faxApi.getFaxById(faxId); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling AccountApi#accountCreate"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} + +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| + **faxId** | **String**| Fax ID | + +### Return type + +[**FaxResponse**](FaxResponse.md) + +### Authorization + +[api_key](../README.md#api_key) + +### HTTP request headers + +- **Content-Type**: Not defined +- **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 | - | + + +## getFaxFiles + +> getFaxFiles(faxId) + +List Fax Files + +Returns list of fax files + +### Example + +```java +import com.dropbox.sign.ApiException; +import com.dropbox.sign.Configuration; +import com.dropbox.sign.api.*; +import com.dropbox.sign.auth.*; +import com.dropbox.sign.model.*; + +import java.util.List; + +public class Example { + public static void main(String[] args) { + var apiClient = Configuration.getDefaultApiClient() + .setApiKey("YOUR_API_KEY"); + + var faxApi = new FaxApi(apiClient); + + var faxId = "fa5c8a0b0f492d768749333ad6fcc214c111e967"; + + try { + faxApi.getFaxFiles(faxId); + } catch (ApiException e) { + 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 | +|------------- | ------------- | ------------- | -------------| + **faxId** | **String**| Fax ID | + +### Return type + +null (empty response body) + +### Authorization + +[api_key](../README.md#api_key) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **4XX** | failed_operation | - | + + +## listFaxes + +> FaxListResponse listFaxes(page, pageSize) + +Lists Faxes + +Returns properties of multiple faxes + +### Example + +```java +import com.dropbox.sign.ApiException; +import com.dropbox.sign.Configuration; +import com.dropbox.sign.api.*; +import com.dropbox.sign.auth.*; +import com.dropbox.sign.model.*; + +public class Example { + public static void main(String[] args) { + var apiClient = Configuration.getDefaultApiClient() + .setApiKey("YOUR_API_KEY"); + + var faxApi = new FaxApi(apiClient); + + var page = 1; + var pageSize = 2; + + try { + FaxListResponse result = faxApi.listFaxes(page, pageSize); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling AccountApi#accountCreate"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} + +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| + **page** | **Integer**| Page | + **pageSize** | **Integer**| Page size | + +### Return type + +[**FaxListResponse**](FaxListResponse.md) + +### Authorization + +[api_key](../README.md#api_key) + +### HTTP request headers + +- **Content-Type**: Not defined +- **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 | - | + + +## sendFax + +> FaxResponse sendFax(faxSendRequest) + +Send Fax + +Action to prepare and send a fax + +### Example + +```java +import com.dropbox.sign.ApiException; +import com.dropbox.sign.Configuration; +import com.dropbox.sign.api.*; +import com.dropbox.sign.auth.*; +import com.dropbox.sign.model.*; + +import java.util.List; + +public class Example { + public static void main(String[] args) { + var apiClient = Configuration.getDefaultApiClient() + .setApiKey("YOUR_API_KEY"); + + var faxApi = new FaxApi(apiClient); + + var data = new FaxCreateRequest() + .areaCode(209) + .country("US"); + + try { + FaxCreateResponse result = faxApi.faxCreate(data); + System.out.println(result); + } catch (ApiException e) { + 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 | +|------------- | ------------- | ------------- | -------------| + **faxSendRequest** | [**FaxSendRequest**](FaxSendRequest.md)| | + +### Return type + +[**FaxResponse**](FaxResponse.md) + +### Authorization + +[api_key](../README.md#api_key) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
| +| **4XX** | failed_operation | - | + diff --git a/sdks/java-v1/docs/FaxListResponse.md b/sdks/java-v1/docs/FaxListResponse.md new file mode 100644 index 000000000..22e92f955 --- /dev/null +++ b/sdks/java-v1/docs/FaxListResponse.md @@ -0,0 +1,15 @@ + + +# FaxListResponse + + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +| `faxes`*_required_ | [```List```](FaxResponseFax.md) | | | +| `listInfo`*_required_ | [```ListInfoResponse```](ListInfoResponse.md) | | | + + + diff --git a/sdks/java-v1/docs/FaxResponse.md b/sdks/java-v1/docs/FaxResponse.md new file mode 100644 index 000000000..18b586446 --- /dev/null +++ b/sdks/java-v1/docs/FaxResponse.md @@ -0,0 +1,15 @@ + + +# FaxResponse + + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +| `fax`*_required_ | [```FaxResponseFax```](FaxResponseFax.md) | | | +| `warnings` | [```WarningResponse```](WarningResponse.md) | | | + + + diff --git a/sdks/java-v1/docs/FaxResponseFax.md b/sdks/java-v1/docs/FaxResponseFax.md new file mode 100644 index 000000000..ef62af24a --- /dev/null +++ b/sdks/java-v1/docs/FaxResponseFax.md @@ -0,0 +1,23 @@ + + +# FaxResponseFax + + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +| `faxId` | ```String``` | Fax ID | | +| `title` | ```String``` | Fax Title | | +| `originalTitle` | ```String``` | Fax Original Title | | +| `subject` | ```String``` | Fax Subject | | +| `message` | ```String``` | Fax Message | | +| `metadata` | ```Object``` | Fax Metadata | | +| `createdAt` | ```Integer``` | Fax Created At Timestamp | | +| `from` | ```String``` | Fax Sender Email | | +| `transmissions` | [```List```](FaxResponseFaxTransmission.md) | Fax Transmissions List | | +| `filesUrl` | ```String``` | Fax Files URL | | + + + diff --git a/sdks/java-v1/docs/FaxResponseFaxTransmission.md b/sdks/java-v1/docs/FaxResponseFaxTransmission.md new file mode 100644 index 000000000..74a4c7cf2 --- /dev/null +++ b/sdks/java-v1/docs/FaxResponseFaxTransmission.md @@ -0,0 +1,17 @@ + + +# FaxResponseFaxTransmission + + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +| `recipient` | ```String``` | Fax Transmission Recipient | | +| `sender` | ```String``` | Fax Transmission Sender | | +| `statusCode` | ```String``` | Fax Transmission Status Code | | +| `sentAt` | ```Integer``` | Fax Transmission Sent Timestamp | | + + + diff --git a/sdks/java-v1/docs/FaxSendRequest.md b/sdks/java-v1/docs/FaxSendRequest.md new file mode 100644 index 000000000..c77fd7a0e --- /dev/null +++ b/sdks/java-v1/docs/FaxSendRequest.md @@ -0,0 +1,23 @@ + + +# FaxSendRequest + + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +| `to` | ```String``` | Fax Send To Recipient | | +| `from` | ```String``` | Fax Send From Sender (used only with fax number) | | +| `_file` | [```List```](SubFile.md) | Fax File to Send | | +| `fileUrl` | ```List``` | Fax File URL to Send | | +| `fileUrlNames` | ```List``` | Fax File URL Names | | +| `testMode` | ```Boolean``` | API Test Mode Setting | | +| `coverPageTo` | ```String``` | Fax Cover Page for Recipient | | +| `coverPageFrom` | ```String``` | Fax Cover Page for Sender | | +| `coverPageMessage` | ```String``` | Fax Cover Page Message | | +| `title` | ```String``` | Fax Title | | + + + diff --git a/sdks/java-v1/docs/SubFile.md b/sdks/java-v1/docs/SubFile.md new file mode 100644 index 000000000..376475b8c --- /dev/null +++ b/sdks/java-v1/docs/SubFile.md @@ -0,0 +1,14 @@ + + +# SubFile + +Actual uploaded physical file + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +| `name` | ```String``` | Actual physical uploaded file name that is derived during upload. Not settable parameter. | | + + + 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 new file mode 100644 index 000000000..a209273e8 --- /dev/null +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/api/FaxApi.java @@ -0,0 +1,381 @@ +package com.dropbox.sign.api; + +import com.dropbox.sign.ApiClient; +import com.dropbox.sign.ApiException; +import com.dropbox.sign.ApiResponse; +import com.dropbox.sign.Configuration; +import com.dropbox.sign.Pair; +import com.dropbox.sign.model.FaxListResponse; +import com.dropbox.sign.model.FaxResponse; +import com.dropbox.sign.model.FaxSendRequest; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; +import javax.ws.rs.core.GenericType; + +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.8.0") +public class FaxApi { + private ApiClient apiClient; + + public FaxApi() { + this(Configuration.getDefaultApiClient()); + } + + public FaxApi(ApiClient apiClient) { + this.apiClient = apiClient; + } + + /** + * Get the API client + * + * @return API client + */ + public ApiClient getApiClient() { + return apiClient; + } + + /** + * Set the API client + * + * @param apiClient an instance of API client + */ + public void setApiClient(ApiClient apiClient) { + this.apiClient = apiClient; + } + + /** + * Delete Fax. Deletes the specified Fax from the system. + * + * @param faxId Fax ID (required) + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + *
Status Code Description Response Headers
200 successful operation * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
4XX failed_operation -
+ */ + public void deleteFax(String faxId) throws ApiException { + deleteFaxWithHttpInfo(faxId); + } + + /** + * Delete Fax. Deletes the specified Fax from the system. + * + * @param faxId Fax ID (required) + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + *
Status Code Description Response Headers
200 successful operation * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
4XX failed_operation -
+ */ + public ApiResponse deleteFaxWithHttpInfo(String faxId) throws ApiException { + + // Check required parameters + if (faxId == null) { + throw new ApiException( + 400, "Missing the required parameter 'faxId' when calling deleteFax"); + } + + // Path parameters + String localVarPath = + "/fax/{fax_id}".replaceAll("\\{fax_id}", apiClient.escapeString(faxId.toString())); + + String localVarAccept = apiClient.selectHeaderAccept("application/json"); + Map localVarFormParams = new LinkedHashMap<>(); + localVarFormParams = new HashMap(); + boolean isFileTypeFound = !localVarFormParams.isEmpty(); + String localVarContentType = + isFileTypeFound ? "multipart/form-data" : apiClient.selectHeaderContentType(); + String[] localVarAuthNames = new String[] {"api_key"}; + return apiClient.invokeAPI( + "FaxApi.deleteFax", + localVarPath, + "DELETE", + new ArrayList<>(), + null, + new LinkedHashMap<>(), + new LinkedHashMap<>(), + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + null, + false); + } + + /** + * Get Fax. Returns information about fax + * + * @param faxId Fax ID (required) + * @return FaxResponse + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + *
Status Code Description Response Headers
200 successful operation * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
4XX failed_operation -
+ */ + public FaxResponse getFaxById(String faxId) throws ApiException { + return getFaxByIdWithHttpInfo(faxId).getData(); + } + + /** + * Get Fax. Returns information about fax + * + * @param faxId Fax ID (required) + * @return ApiResponse<FaxResponse> + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + *
Status Code Description Response Headers
200 successful operation * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
4XX failed_operation -
+ */ + public ApiResponse getFaxByIdWithHttpInfo(String faxId) throws ApiException { + + // Check required parameters + if (faxId == null) { + throw new ApiException( + 400, "Missing the required parameter 'faxId' when calling getFaxById"); + } + + // Path parameters + String localVarPath = + "/fax/{fax_id}".replaceAll("\\{fax_id}", apiClient.escapeString(faxId.toString())); + + String localVarAccept = apiClient.selectHeaderAccept("application/json"); + Map localVarFormParams = new LinkedHashMap<>(); + localVarFormParams = new HashMap(); + boolean isFileTypeFound = !localVarFormParams.isEmpty(); + String localVarContentType = + isFileTypeFound ? "multipart/form-data" : apiClient.selectHeaderContentType(); + String[] localVarAuthNames = new String[] {"api_key"}; + GenericType localVarReturnType = new GenericType() {}; + return apiClient.invokeAPI( + "FaxApi.getFaxById", + localVarPath, + "GET", + new ArrayList<>(), + null, + new LinkedHashMap<>(), + new LinkedHashMap<>(), + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType, + false); + } + + /** + * List Fax Files. Returns list of fax files + * + * @param faxId Fax ID (required) + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + *
Status Code Description Response Headers
4XX failed_operation -
+ */ + public void getFaxFiles(String faxId) throws ApiException { + getFaxFilesWithHttpInfo(faxId); + } + + /** + * List Fax Files. Returns list of fax files + * + * @param faxId Fax ID (required) + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + *
Status Code Description Response Headers
4XX failed_operation -
+ */ + public ApiResponse getFaxFilesWithHttpInfo(String faxId) throws ApiException { + + // Check required parameters + if (faxId == null) { + throw new ApiException( + 400, "Missing the required parameter 'faxId' when calling getFaxFiles"); + } + + // Path parameters + String localVarPath = + "/fax/files/{fax_id}" + .replaceAll("\\{fax_id}", apiClient.escapeString(faxId.toString())); + + String localVarAccept = apiClient.selectHeaderAccept("application/json"); + Map localVarFormParams = new LinkedHashMap<>(); + localVarFormParams = new HashMap(); + boolean isFileTypeFound = !localVarFormParams.isEmpty(); + String localVarContentType = + isFileTypeFound ? "multipart/form-data" : apiClient.selectHeaderContentType(); + String[] localVarAuthNames = new String[] {"api_key"}; + return apiClient.invokeAPI( + "FaxApi.getFaxFiles", + localVarPath, + "GET", + new ArrayList<>(), + null, + new LinkedHashMap<>(), + new LinkedHashMap<>(), + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + null, + false); + } + + /** + * Lists Faxes. Returns properties of multiple faxes + * + * @param page Page (required) + * @param pageSize Page size (required) + * @return FaxListResponse + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + *
Status Code Description Response Headers
200 successful operation * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
4XX failed_operation -
+ */ + public FaxListResponse listFaxes(Integer page, Integer pageSize) throws ApiException { + return listFaxesWithHttpInfo(page, pageSize).getData(); + } + + /** + * Lists Faxes. Returns properties of multiple faxes + * + * @param page Page (required) + * @param pageSize Page size (required) + * @return ApiResponse<FaxListResponse> + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + *
Status Code Description Response Headers
200 successful operation * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
4XX failed_operation -
+ */ + public ApiResponse listFaxesWithHttpInfo(Integer page, Integer pageSize) + throws ApiException { + + // Check required parameters + if (page == null) { + throw new ApiException( + 400, "Missing the required parameter 'page' when calling listFaxes"); + } + if (pageSize == null) { + throw new ApiException( + 400, "Missing the required parameter 'pageSize' when calling listFaxes"); + } + + // Query parameters + List localVarQueryParams = + new ArrayList<>(apiClient.parameterToPairs("", "page", page)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "page_size", pageSize)); + + String localVarAccept = apiClient.selectHeaderAccept("application/json"); + Map localVarFormParams = new LinkedHashMap<>(); + localVarFormParams = new HashMap(); + boolean isFileTypeFound = !localVarFormParams.isEmpty(); + String localVarContentType = + isFileTypeFound ? "multipart/form-data" : apiClient.selectHeaderContentType(); + String[] localVarAuthNames = new String[] {"api_key"}; + GenericType localVarReturnType = new GenericType() {}; + return apiClient.invokeAPI( + "FaxApi.listFaxes", + "/fax/list", + "GET", + localVarQueryParams, + null, + new LinkedHashMap<>(), + new LinkedHashMap<>(), + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType, + false); + } + + /** + * Send Fax. Action to prepare and send a fax + * + * @param faxSendRequest (required) + * @return FaxResponse + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + *
Status Code Description Response Headers
200 successful operation * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
4XX failed_operation -
+ */ + public FaxResponse sendFax(FaxSendRequest faxSendRequest) throws ApiException { + return sendFaxWithHttpInfo(faxSendRequest).getData(); + } + + /** + * Send Fax. Action to prepare and send a fax + * + * @param faxSendRequest (required) + * @return ApiResponse<FaxResponse> + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + *
Status Code Description Response Headers
200 successful operation * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
4XX failed_operation -
+ */ + public ApiResponse sendFaxWithHttpInfo(FaxSendRequest faxSendRequest) + throws ApiException { + + // Check required parameters + if (faxSendRequest == null) { + throw new ApiException( + 400, "Missing the required parameter 'faxSendRequest' when calling sendFax"); + } + + String localVarAccept = apiClient.selectHeaderAccept("application/json"); + Map localVarFormParams = new LinkedHashMap<>(); + localVarFormParams = faxSendRequest.createFormData(); + boolean isFileTypeFound = !localVarFormParams.isEmpty(); + String localVarContentType = + isFileTypeFound + ? "multipart/form-data" + : apiClient.selectHeaderContentType("application/json"); + String[] localVarAuthNames = new String[] {"api_key"}; + GenericType localVarReturnType = new GenericType() {}; + return apiClient.invokeAPI( + "FaxApi.sendFax", + "/fax/send", + "POST", + new ArrayList<>(), + isFileTypeFound ? null : faxSendRequest, + new LinkedHashMap<>(), + new LinkedHashMap<>(), + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType, + false); + } +} diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/model/FaxListResponse.java b/sdks/java-v1/src/main/java/com/dropbox/sign/model/FaxListResponse.java new file mode 100644 index 000000000..606b204b9 --- /dev/null +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/model/FaxListResponse.java @@ -0,0 +1,224 @@ +/* + * 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; + +/** FaxListResponse */ +@JsonPropertyOrder({FaxListResponse.JSON_PROPERTY_FAXES, FaxListResponse.JSON_PROPERTY_LIST_INFO}) +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.8.0") +@JsonIgnoreProperties(ignoreUnknown = true) +public class FaxListResponse { + public static final String JSON_PROPERTY_FAXES = "faxes"; + private List faxes = new ArrayList<>(); + + public static final String JSON_PROPERTY_LIST_INFO = "list_info"; + private ListInfoResponse listInfo; + + public FaxListResponse() {} + + /** + * Attempt to instantiate and hydrate a new instance of this class + * + * @param jsonData String of JSON data representing target object + */ + public static FaxListResponse init(String jsonData) throws Exception { + return new ObjectMapper().readValue(jsonData, FaxListResponse.class); + } + + public static FaxListResponse init(HashMap data) throws Exception { + return new ObjectMapper() + .readValue(new ObjectMapper().writeValueAsString(data), FaxListResponse.class); + } + + public FaxListResponse faxes(List faxes) { + this.faxes = faxes; + return this; + } + + public FaxListResponse addFaxesItem(FaxResponseFax faxesItem) { + if (this.faxes == null) { + this.faxes = new ArrayList<>(); + } + this.faxes.add(faxesItem); + return this; + } + + /** + * Get faxes + * + * @return faxes + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_FAXES) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public List getFaxes() { + return faxes; + } + + @JsonProperty(JSON_PROPERTY_FAXES) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setFaxes(List faxes) { + this.faxes = faxes; + } + + public FaxListResponse listInfo(ListInfoResponse listInfo) { + this.listInfo = listInfo; + return this; + } + + /** + * Get listInfo + * + * @return listInfo + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_LIST_INFO) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public ListInfoResponse getListInfo() { + return listInfo; + } + + @JsonProperty(JSON_PROPERTY_LIST_INFO) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setListInfo(ListInfoResponse listInfo) { + this.listInfo = listInfo; + } + + /** Return true if this FaxListResponse object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + FaxListResponse faxListResponse = (FaxListResponse) o; + return Objects.equals(this.faxes, faxListResponse.faxes) + && Objects.equals(this.listInfo, faxListResponse.listInfo); + } + + @Override + public int hashCode() { + return Objects.hash(faxes, listInfo); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class FaxListResponse {\n"); + sb.append(" faxes: ").append(toIndentedString(faxes)).append("\n"); + sb.append(" listInfo: ").append(toIndentedString(listInfo)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public Map createFormData() throws ApiException { + Map map = new HashMap<>(); + boolean fileTypeFound = false; + try { + if (faxes != null) { + if (isFileTypeOrListOfFiles(faxes)) { + fileTypeFound = true; + } + + if (faxes.getClass().equals(java.io.File.class) + || faxes.getClass().equals(Integer.class) + || faxes.getClass().equals(String.class) + || faxes.getClass().isEnum()) { + map.put("faxes", faxes); + } else if (isListOfFile(faxes)) { + for (int i = 0; i < getListSize(faxes); i++) { + map.put("faxes[" + i + "]", getFromList(faxes, i)); + } + } else { + map.put("faxes", JSON.getDefault().getMapper().writeValueAsString(faxes)); + } + } + if (listInfo != null) { + if (isFileTypeOrListOfFiles(listInfo)) { + fileTypeFound = true; + } + + if (listInfo.getClass().equals(java.io.File.class) + || listInfo.getClass().equals(Integer.class) + || listInfo.getClass().equals(String.class) + || listInfo.getClass().isEnum()) { + map.put("list_info", listInfo); + } else if (isListOfFile(listInfo)) { + for (int i = 0; i < getListSize(listInfo); i++) { + map.put("list_info[" + i + "]", getFromList(listInfo, i)); + } + } else { + map.put( + "list_info", + JSON.getDefault().getMapper().writeValueAsString(listInfo)); + } + } + } catch (Exception e) { + throw new ApiException(e); + } + + return fileTypeFound ? map : new HashMap<>(); + } + + private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { + return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); + } + + private boolean isListOfFile(Object obj) throws Exception { + return obj instanceof java.util.List + && !isListEmpty(obj) + && getFromList(obj, 0) instanceof java.io.File; + } + + private boolean isListEmpty(Object obj) throws Exception { + return (boolean) + Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); + } + + private Object getFromList(Object obj, int index) throws Exception { + return Class.forName(java.util.List.class.getName()) + .getMethod("get", int.class) + .invoke(obj, index); + } + + private int getListSize(Object obj) throws Exception { + return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/model/FaxResponse.java b/sdks/java-v1/src/main/java/com/dropbox/sign/model/FaxResponse.java new file mode 100644 index 000000000..e3ec84559 --- /dev/null +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/model/FaxResponse.java @@ -0,0 +1,211 @@ +/* + * 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; + +/** FaxResponse */ +@JsonPropertyOrder({FaxResponse.JSON_PROPERTY_FAX, FaxResponse.JSON_PROPERTY_WARNINGS}) +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.8.0") +@JsonIgnoreProperties(ignoreUnknown = true) +public class FaxResponse { + public static final String JSON_PROPERTY_FAX = "fax"; + private FaxResponseFax fax; + + public static final String JSON_PROPERTY_WARNINGS = "warnings"; + private WarningResponse warnings; + + public FaxResponse() {} + + /** + * Attempt to instantiate and hydrate a new instance of this class + * + * @param jsonData String of JSON data representing target object + */ + public static FaxResponse init(String jsonData) throws Exception { + return new ObjectMapper().readValue(jsonData, FaxResponse.class); + } + + public static FaxResponse init(HashMap data) throws Exception { + return new ObjectMapper() + .readValue(new ObjectMapper().writeValueAsString(data), FaxResponse.class); + } + + public FaxResponse fax(FaxResponseFax fax) { + this.fax = fax; + return this; + } + + /** + * Get fax + * + * @return fax + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_FAX) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public FaxResponseFax getFax() { + return fax; + } + + @JsonProperty(JSON_PROPERTY_FAX) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setFax(FaxResponseFax fax) { + this.fax = fax; + } + + public FaxResponse warnings(WarningResponse warnings) { + this.warnings = warnings; + return this; + } + + /** + * Get warnings + * + * @return warnings + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_WARNINGS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public WarningResponse getWarnings() { + return warnings; + } + + @JsonProperty(JSON_PROPERTY_WARNINGS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setWarnings(WarningResponse warnings) { + this.warnings = warnings; + } + + /** Return true if this FaxResponse object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + FaxResponse faxResponse = (FaxResponse) o; + return Objects.equals(this.fax, faxResponse.fax) + && Objects.equals(this.warnings, faxResponse.warnings); + } + + @Override + public int hashCode() { + return Objects.hash(fax, warnings); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class FaxResponse {\n"); + sb.append(" fax: ").append(toIndentedString(fax)).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 (fax != null) { + if (isFileTypeOrListOfFiles(fax)) { + fileTypeFound = true; + } + + if (fax.getClass().equals(java.io.File.class) + || fax.getClass().equals(Integer.class) + || fax.getClass().equals(String.class) + || fax.getClass().isEnum()) { + map.put("fax", fax); + } else if (isListOfFile(fax)) { + for (int i = 0; i < getListSize(fax); i++) { + map.put("fax[" + i + "]", getFromList(fax, i)); + } + } else { + map.put("fax", JSON.getDefault().getMapper().writeValueAsString(fax)); + } + } + 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/FaxResponseFax.java b/sdks/java-v1/src/main/java/com/dropbox/sign/model/FaxResponseFax.java new file mode 100644 index 000000000..23dc3dbcb --- /dev/null +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/model/FaxResponseFax.java @@ -0,0 +1,609 @@ +/* + * 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; + +/** FaxResponseFax */ +@JsonPropertyOrder({ + FaxResponseFax.JSON_PROPERTY_FAX_ID, + FaxResponseFax.JSON_PROPERTY_TITLE, + FaxResponseFax.JSON_PROPERTY_ORIGINAL_TITLE, + FaxResponseFax.JSON_PROPERTY_SUBJECT, + FaxResponseFax.JSON_PROPERTY_MESSAGE, + FaxResponseFax.JSON_PROPERTY_METADATA, + FaxResponseFax.JSON_PROPERTY_CREATED_AT, + FaxResponseFax.JSON_PROPERTY_FROM, + FaxResponseFax.JSON_PROPERTY_TRANSMISSIONS, + FaxResponseFax.JSON_PROPERTY_FILES_URL +}) +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.8.0") +@JsonIgnoreProperties(ignoreUnknown = true) +public class FaxResponseFax { + public static final String JSON_PROPERTY_FAX_ID = "fax_id"; + private String faxId; + + public static final String JSON_PROPERTY_TITLE = "title"; + private String title; + + public static final String JSON_PROPERTY_ORIGINAL_TITLE = "original_title"; + private String originalTitle; + + public static final String JSON_PROPERTY_SUBJECT = "subject"; + private String subject; + + public static final String JSON_PROPERTY_MESSAGE = "message"; + private String message; + + public static final String JSON_PROPERTY_METADATA = "metadata"; + private Object metadata; + + public static final String JSON_PROPERTY_CREATED_AT = "created_at"; + private Integer createdAt; + + public static final String JSON_PROPERTY_FROM = "from"; + private String from; + + public static final String JSON_PROPERTY_TRANSMISSIONS = "transmissions"; + private List transmissions = null; + + public static final String JSON_PROPERTY_FILES_URL = "files_url"; + private String filesUrl; + + public FaxResponseFax() {} + + /** + * Attempt to instantiate and hydrate a new instance of this class + * + * @param jsonData String of JSON data representing target object + */ + public static FaxResponseFax init(String jsonData) throws Exception { + return new ObjectMapper().readValue(jsonData, FaxResponseFax.class); + } + + public static FaxResponseFax init(HashMap data) throws Exception { + return new ObjectMapper() + .readValue(new ObjectMapper().writeValueAsString(data), FaxResponseFax.class); + } + + public FaxResponseFax faxId(String faxId) { + this.faxId = faxId; + return this; + } + + /** + * Fax ID + * + * @return faxId + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_FAX_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getFaxId() { + return faxId; + } + + @JsonProperty(JSON_PROPERTY_FAX_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setFaxId(String faxId) { + this.faxId = faxId; + } + + public FaxResponseFax title(String title) { + this.title = title; + return this; + } + + /** + * Fax Title + * + * @return title + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_TITLE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getTitle() { + return title; + } + + @JsonProperty(JSON_PROPERTY_TITLE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTitle(String title) { + this.title = title; + } + + public FaxResponseFax originalTitle(String originalTitle) { + this.originalTitle = originalTitle; + return this; + } + + /** + * Fax Original Title + * + * @return originalTitle + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ORIGINAL_TITLE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getOriginalTitle() { + return originalTitle; + } + + @JsonProperty(JSON_PROPERTY_ORIGINAL_TITLE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setOriginalTitle(String originalTitle) { + this.originalTitle = originalTitle; + } + + public FaxResponseFax subject(String subject) { + this.subject = subject; + return this; + } + + /** + * Fax Subject + * + * @return subject + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_SUBJECT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getSubject() { + return subject; + } + + @JsonProperty(JSON_PROPERTY_SUBJECT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSubject(String subject) { + this.subject = subject; + } + + public FaxResponseFax message(String message) { + this.message = message; + return this; + } + + /** + * Fax Message + * + * @return message + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_MESSAGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getMessage() { + return message; + } + + @JsonProperty(JSON_PROPERTY_MESSAGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMessage(String message) { + this.message = message; + } + + public FaxResponseFax metadata(Object metadata) { + this.metadata = metadata; + return this; + } + + /** + * Fax Metadata + * + * @return metadata + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_METADATA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Object getMetadata() { + return metadata; + } + + @JsonProperty(JSON_PROPERTY_METADATA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMetadata(Object metadata) { + this.metadata = metadata; + } + + public FaxResponseFax createdAt(Integer createdAt) { + this.createdAt = createdAt; + return this; + } + + /** + * Fax Created At Timestamp + * + * @return createdAt + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_CREATED_AT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getCreatedAt() { + return createdAt; + } + + @JsonProperty(JSON_PROPERTY_CREATED_AT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCreatedAt(Integer createdAt) { + this.createdAt = createdAt; + } + + public FaxResponseFax from(String from) { + this.from = from; + return this; + } + + /** + * Fax Sender Email + * + * @return from + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_FROM) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getFrom() { + return from; + } + + @JsonProperty(JSON_PROPERTY_FROM) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setFrom(String from) { + this.from = from; + } + + public FaxResponseFax transmissions(List transmissions) { + this.transmissions = transmissions; + return this; + } + + public FaxResponseFax addTransmissionsItem(FaxResponseFaxTransmission transmissionsItem) { + if (this.transmissions == null) { + this.transmissions = new ArrayList<>(); + } + this.transmissions.add(transmissionsItem); + return this; + } + + /** + * Fax Transmissions List + * + * @return transmissions + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_TRANSMISSIONS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getTransmissions() { + return transmissions; + } + + @JsonProperty(JSON_PROPERTY_TRANSMISSIONS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTransmissions(List transmissions) { + this.transmissions = transmissions; + } + + public FaxResponseFax filesUrl(String filesUrl) { + this.filesUrl = filesUrl; + return this; + } + + /** + * Fax Files URL + * + * @return filesUrl + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_FILES_URL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getFilesUrl() { + return filesUrl; + } + + @JsonProperty(JSON_PROPERTY_FILES_URL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setFilesUrl(String filesUrl) { + this.filesUrl = filesUrl; + } + + /** Return true if this FaxResponseFax object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + FaxResponseFax faxResponseFax = (FaxResponseFax) o; + return Objects.equals(this.faxId, faxResponseFax.faxId) + && Objects.equals(this.title, faxResponseFax.title) + && Objects.equals(this.originalTitle, faxResponseFax.originalTitle) + && Objects.equals(this.subject, faxResponseFax.subject) + && Objects.equals(this.message, faxResponseFax.message) + && Objects.equals(this.metadata, faxResponseFax.metadata) + && Objects.equals(this.createdAt, faxResponseFax.createdAt) + && Objects.equals(this.from, faxResponseFax.from) + && Objects.equals(this.transmissions, faxResponseFax.transmissions) + && Objects.equals(this.filesUrl, faxResponseFax.filesUrl); + } + + @Override + public int hashCode() { + return Objects.hash( + faxId, + title, + originalTitle, + subject, + message, + metadata, + createdAt, + from, + transmissions, + filesUrl); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class FaxResponseFax {\n"); + sb.append(" faxId: ").append(toIndentedString(faxId)).append("\n"); + sb.append(" title: ").append(toIndentedString(title)).append("\n"); + sb.append(" originalTitle: ").append(toIndentedString(originalTitle)).append("\n"); + sb.append(" subject: ").append(toIndentedString(subject)).append("\n"); + sb.append(" message: ").append(toIndentedString(message)).append("\n"); + sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); + sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); + sb.append(" from: ").append(toIndentedString(from)).append("\n"); + sb.append(" transmissions: ").append(toIndentedString(transmissions)).append("\n"); + sb.append(" filesUrl: ").append(toIndentedString(filesUrl)).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 (title != null) { + if (isFileTypeOrListOfFiles(title)) { + fileTypeFound = true; + } + + if (title.getClass().equals(java.io.File.class) + || title.getClass().equals(Integer.class) + || title.getClass().equals(String.class) + || title.getClass().isEnum()) { + map.put("title", title); + } else if (isListOfFile(title)) { + for (int i = 0; i < getListSize(title); i++) { + map.put("title[" + i + "]", getFromList(title, i)); + } + } else { + map.put("title", JSON.getDefault().getMapper().writeValueAsString(title)); + } + } + if (originalTitle != null) { + if (isFileTypeOrListOfFiles(originalTitle)) { + fileTypeFound = true; + } + + if (originalTitle.getClass().equals(java.io.File.class) + || originalTitle.getClass().equals(Integer.class) + || originalTitle.getClass().equals(String.class) + || originalTitle.getClass().isEnum()) { + map.put("original_title", originalTitle); + } else if (isListOfFile(originalTitle)) { + for (int i = 0; i < getListSize(originalTitle); i++) { + map.put("original_title[" + i + "]", getFromList(originalTitle, i)); + } + } else { + map.put( + "original_title", + JSON.getDefault().getMapper().writeValueAsString(originalTitle)); + } + } + if (subject != null) { + if (isFileTypeOrListOfFiles(subject)) { + fileTypeFound = true; + } + + if (subject.getClass().equals(java.io.File.class) + || subject.getClass().equals(Integer.class) + || subject.getClass().equals(String.class) + || subject.getClass().isEnum()) { + map.put("subject", subject); + } else if (isListOfFile(subject)) { + for (int i = 0; i < getListSize(subject); i++) { + map.put("subject[" + i + "]", getFromList(subject, i)); + } + } else { + map.put("subject", JSON.getDefault().getMapper().writeValueAsString(subject)); + } + } + if (message != null) { + if (isFileTypeOrListOfFiles(message)) { + fileTypeFound = true; + } + + if (message.getClass().equals(java.io.File.class) + || message.getClass().equals(Integer.class) + || message.getClass().equals(String.class) + || message.getClass().isEnum()) { + map.put("message", message); + } else if (isListOfFile(message)) { + for (int i = 0; i < getListSize(message); i++) { + map.put("message[" + i + "]", getFromList(message, i)); + } + } else { + map.put("message", JSON.getDefault().getMapper().writeValueAsString(message)); + } + } + if (metadata != null) { + if (isFileTypeOrListOfFiles(metadata)) { + fileTypeFound = true; + } + + if (metadata.getClass().equals(java.io.File.class) + || metadata.getClass().equals(Integer.class) + || metadata.getClass().equals(String.class) + || metadata.getClass().isEnum()) { + map.put("metadata", metadata); + } else if (isListOfFile(metadata)) { + for (int i = 0; i < getListSize(metadata); i++) { + map.put("metadata[" + i + "]", getFromList(metadata, i)); + } + } else { + map.put("metadata", JSON.getDefault().getMapper().writeValueAsString(metadata)); + } + } + if (createdAt != null) { + if (isFileTypeOrListOfFiles(createdAt)) { + fileTypeFound = true; + } + + if (createdAt.getClass().equals(java.io.File.class) + || createdAt.getClass().equals(Integer.class) + || createdAt.getClass().equals(String.class) + || createdAt.getClass().isEnum()) { + map.put("created_at", createdAt); + } else if (isListOfFile(createdAt)) { + for (int i = 0; i < getListSize(createdAt); i++) { + map.put("created_at[" + i + "]", getFromList(createdAt, i)); + } + } else { + map.put( + "created_at", + JSON.getDefault().getMapper().writeValueAsString(createdAt)); + } + } + if (from != null) { + if (isFileTypeOrListOfFiles(from)) { + fileTypeFound = true; + } + + if (from.getClass().equals(java.io.File.class) + || from.getClass().equals(Integer.class) + || from.getClass().equals(String.class) + || from.getClass().isEnum()) { + map.put("from", from); + } else if (isListOfFile(from)) { + for (int i = 0; i < getListSize(from); i++) { + map.put("from[" + i + "]", getFromList(from, i)); + } + } else { + map.put("from", JSON.getDefault().getMapper().writeValueAsString(from)); + } + } + if (transmissions != null) { + if (isFileTypeOrListOfFiles(transmissions)) { + fileTypeFound = true; + } + + if (transmissions.getClass().equals(java.io.File.class) + || transmissions.getClass().equals(Integer.class) + || transmissions.getClass().equals(String.class) + || transmissions.getClass().isEnum()) { + map.put("transmissions", transmissions); + } else if (isListOfFile(transmissions)) { + for (int i = 0; i < getListSize(transmissions); i++) { + map.put("transmissions[" + i + "]", getFromList(transmissions, i)); + } + } else { + map.put( + "transmissions", + JSON.getDefault().getMapper().writeValueAsString(transmissions)); + } + } + if (filesUrl != null) { + if (isFileTypeOrListOfFiles(filesUrl)) { + fileTypeFound = true; + } + + if (filesUrl.getClass().equals(java.io.File.class) + || filesUrl.getClass().equals(Integer.class) + || filesUrl.getClass().equals(String.class) + || filesUrl.getClass().isEnum()) { + map.put("files_url", filesUrl); + } else if (isListOfFile(filesUrl)) { + for (int i = 0; i < getListSize(filesUrl); i++) { + map.put("files_url[" + i + "]", getFromList(filesUrl, i)); + } + } else { + map.put( + "files_url", + JSON.getDefault().getMapper().writeValueAsString(filesUrl)); + } + } + } 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/FaxResponseFaxTransmission.java b/sdks/java-v1/src/main/java/com/dropbox/sign/model/FaxResponseFaxTransmission.java new file mode 100644 index 000000000..da6b421ac --- /dev/null +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/model/FaxResponseFaxTransmission.java @@ -0,0 +1,311 @@ +/* + * 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; + +/** FaxResponseFaxTransmission */ +@JsonPropertyOrder({ + FaxResponseFaxTransmission.JSON_PROPERTY_RECIPIENT, + FaxResponseFaxTransmission.JSON_PROPERTY_SENDER, + FaxResponseFaxTransmission.JSON_PROPERTY_STATUS_CODE, + FaxResponseFaxTransmission.JSON_PROPERTY_SENT_AT +}) +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.8.0") +@JsonIgnoreProperties(ignoreUnknown = true) +public class FaxResponseFaxTransmission { + public static final String JSON_PROPERTY_RECIPIENT = "recipient"; + private String recipient; + + public static final String JSON_PROPERTY_SENDER = "sender"; + private String sender; + + public static final String JSON_PROPERTY_STATUS_CODE = "status_code"; + private String statusCode; + + public static final String JSON_PROPERTY_SENT_AT = "sent_at"; + private Integer sentAt; + + public FaxResponseFaxTransmission() {} + + /** + * Attempt to instantiate and hydrate a new instance of this class + * + * @param jsonData String of JSON data representing target object + */ + public static FaxResponseFaxTransmission init(String jsonData) throws Exception { + return new ObjectMapper().readValue(jsonData, FaxResponseFaxTransmission.class); + } + + public static FaxResponseFaxTransmission init(HashMap data) throws Exception { + return new ObjectMapper() + .readValue( + new ObjectMapper().writeValueAsString(data), + FaxResponseFaxTransmission.class); + } + + public FaxResponseFaxTransmission recipient(String recipient) { + this.recipient = recipient; + return this; + } + + /** + * Fax Transmission Recipient + * + * @return recipient + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_RECIPIENT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getRecipient() { + return recipient; + } + + @JsonProperty(JSON_PROPERTY_RECIPIENT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setRecipient(String recipient) { + this.recipient = recipient; + } + + public FaxResponseFaxTransmission sender(String sender) { + this.sender = sender; + return this; + } + + /** + * Fax Transmission Sender + * + * @return sender + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_SENDER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getSender() { + return sender; + } + + @JsonProperty(JSON_PROPERTY_SENDER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSender(String sender) { + this.sender = sender; + } + + public FaxResponseFaxTransmission statusCode(String statusCode) { + this.statusCode = statusCode; + return this; + } + + /** + * Fax Transmission Status Code + * + * @return statusCode + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_STATUS_CODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getStatusCode() { + return statusCode; + } + + @JsonProperty(JSON_PROPERTY_STATUS_CODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setStatusCode(String statusCode) { + this.statusCode = statusCode; + } + + public FaxResponseFaxTransmission sentAt(Integer sentAt) { + this.sentAt = sentAt; + return this; + } + + /** + * Fax Transmission Sent Timestamp + * + * @return sentAt + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_SENT_AT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getSentAt() { + return sentAt; + } + + @JsonProperty(JSON_PROPERTY_SENT_AT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSentAt(Integer sentAt) { + this.sentAt = sentAt; + } + + /** Return true if this FaxResponseFaxTransmission object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + FaxResponseFaxTransmission faxResponseFaxTransmission = (FaxResponseFaxTransmission) o; + return Objects.equals(this.recipient, faxResponseFaxTransmission.recipient) + && Objects.equals(this.sender, faxResponseFaxTransmission.sender) + && Objects.equals(this.statusCode, faxResponseFaxTransmission.statusCode) + && Objects.equals(this.sentAt, faxResponseFaxTransmission.sentAt); + } + + @Override + public int hashCode() { + return Objects.hash(recipient, sender, statusCode, sentAt); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class FaxResponseFaxTransmission {\n"); + sb.append(" recipient: ").append(toIndentedString(recipient)).append("\n"); + sb.append(" sender: ").append(toIndentedString(sender)).append("\n"); + sb.append(" statusCode: ").append(toIndentedString(statusCode)).append("\n"); + sb.append(" sentAt: ").append(toIndentedString(sentAt)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public Map createFormData() throws ApiException { + Map map = new HashMap<>(); + boolean fileTypeFound = false; + try { + if (recipient != null) { + if (isFileTypeOrListOfFiles(recipient)) { + fileTypeFound = true; + } + + if (recipient.getClass().equals(java.io.File.class) + || recipient.getClass().equals(Integer.class) + || recipient.getClass().equals(String.class) + || recipient.getClass().isEnum()) { + map.put("recipient", recipient); + } else if (isListOfFile(recipient)) { + for (int i = 0; i < getListSize(recipient); i++) { + map.put("recipient[" + i + "]", getFromList(recipient, i)); + } + } else { + map.put( + "recipient", + JSON.getDefault().getMapper().writeValueAsString(recipient)); + } + } + if (sender != null) { + if (isFileTypeOrListOfFiles(sender)) { + fileTypeFound = true; + } + + if (sender.getClass().equals(java.io.File.class) + || sender.getClass().equals(Integer.class) + || sender.getClass().equals(String.class) + || sender.getClass().isEnum()) { + map.put("sender", sender); + } else if (isListOfFile(sender)) { + for (int i = 0; i < getListSize(sender); i++) { + map.put("sender[" + i + "]", getFromList(sender, i)); + } + } else { + map.put("sender", JSON.getDefault().getMapper().writeValueAsString(sender)); + } + } + if (statusCode != null) { + if (isFileTypeOrListOfFiles(statusCode)) { + fileTypeFound = true; + } + + if (statusCode.getClass().equals(java.io.File.class) + || statusCode.getClass().equals(Integer.class) + || statusCode.getClass().equals(String.class) + || statusCode.getClass().isEnum()) { + map.put("status_code", statusCode); + } else if (isListOfFile(statusCode)) { + for (int i = 0; i < getListSize(statusCode); i++) { + map.put("status_code[" + i + "]", getFromList(statusCode, i)); + } + } else { + map.put( + "status_code", + JSON.getDefault().getMapper().writeValueAsString(statusCode)); + } + } + if (sentAt != null) { + if (isFileTypeOrListOfFiles(sentAt)) { + fileTypeFound = true; + } + + if (sentAt.getClass().equals(java.io.File.class) + || sentAt.getClass().equals(Integer.class) + || sentAt.getClass().equals(String.class) + || sentAt.getClass().isEnum()) { + map.put("sent_at", sentAt); + } else if (isListOfFile(sentAt)) { + for (int i = 0; i < getListSize(sentAt); i++) { + map.put("sent_at[" + i + "]", getFromList(sentAt, i)); + } + } else { + map.put("sent_at", JSON.getDefault().getMapper().writeValueAsString(sentAt)); + } + } + } 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/FaxSendRequest.java b/sdks/java-v1/src/main/java/com/dropbox/sign/model/FaxSendRequest.java new file mode 100644 index 000000000..a5b560f2b --- /dev/null +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/model/FaxSendRequest.java @@ -0,0 +1,627 @@ +/* + * 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; + +/** FaxSendRequest */ +@JsonPropertyOrder({ + FaxSendRequest.JSON_PROPERTY_TO, + FaxSendRequest.JSON_PROPERTY_FROM, + FaxSendRequest.JSON_PROPERTY_FILE, + FaxSendRequest.JSON_PROPERTY_FILE_URL, + FaxSendRequest.JSON_PROPERTY_FILE_URL_NAMES, + FaxSendRequest.JSON_PROPERTY_TEST_MODE, + FaxSendRequest.JSON_PROPERTY_COVER_PAGE_TO, + FaxSendRequest.JSON_PROPERTY_COVER_PAGE_FROM, + FaxSendRequest.JSON_PROPERTY_COVER_PAGE_MESSAGE, + FaxSendRequest.JSON_PROPERTY_TITLE +}) +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.8.0") +@JsonIgnoreProperties(ignoreUnknown = true) +public class FaxSendRequest { + public static final String JSON_PROPERTY_TO = "to"; + private String to; + + public static final String JSON_PROPERTY_FROM = "from"; + private String from; + + public static final String JSON_PROPERTY_FILE = "file"; + private List _file = null; + + public static final String JSON_PROPERTY_FILE_URL = "file_url"; + private List fileUrl = null; + + public static final String JSON_PROPERTY_FILE_URL_NAMES = "file_url_names"; + private List fileUrlNames = null; + + public static final String JSON_PROPERTY_TEST_MODE = "test_mode"; + private Boolean testMode; + + public static final String JSON_PROPERTY_COVER_PAGE_TO = "cover_page_to"; + private String coverPageTo; + + public static final String JSON_PROPERTY_COVER_PAGE_FROM = "cover_page_from"; + private String coverPageFrom; + + public static final String JSON_PROPERTY_COVER_PAGE_MESSAGE = "cover_page_message"; + private String coverPageMessage; + + public static final String JSON_PROPERTY_TITLE = "title"; + private String title; + + public FaxSendRequest() {} + + /** + * Attempt to instantiate and hydrate a new instance of this class + * + * @param jsonData String of JSON data representing target object + */ + public static FaxSendRequest init(String jsonData) throws Exception { + return new ObjectMapper().readValue(jsonData, FaxSendRequest.class); + } + + public static FaxSendRequest init(HashMap data) throws Exception { + return new ObjectMapper() + .readValue(new ObjectMapper().writeValueAsString(data), FaxSendRequest.class); + } + + public FaxSendRequest to(String to) { + this.to = to; + return this; + } + + /** + * Fax Send To Recipient + * + * @return to + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_TO) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getTo() { + return to; + } + + @JsonProperty(JSON_PROPERTY_TO) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTo(String to) { + this.to = to; + } + + public FaxSendRequest from(String from) { + this.from = from; + return this; + } + + /** + * Fax Send From Sender (used only with fax number) + * + * @return from + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_FROM) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getFrom() { + return from; + } + + @JsonProperty(JSON_PROPERTY_FROM) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setFrom(String from) { + this.from = from; + } + + public FaxSendRequest _file(List _file) { + this._file = _file; + return this; + } + + public FaxSendRequest addFileItem(SubFile _fileItem) { + if (this._file == null) { + this._file = new ArrayList<>(); + } + this._file.add(_fileItem); + return this; + } + + /** + * Fax File to Send + * + * @return _file + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_FILE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getFile() { + return _file; + } + + @JsonProperty(JSON_PROPERTY_FILE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setFile(List _file) { + this._file = _file; + } + + public FaxSendRequest fileUrl(List fileUrl) { + this.fileUrl = fileUrl; + return this; + } + + public FaxSendRequest addFileUrlItem(String fileUrlItem) { + if (this.fileUrl == null) { + this.fileUrl = new ArrayList<>(); + } + this.fileUrl.add(fileUrlItem); + return this; + } + + /** + * Fax File URL to Send + * + * @return fileUrl + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_FILE_URL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getFileUrl() { + return fileUrl; + } + + @JsonProperty(JSON_PROPERTY_FILE_URL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setFileUrl(List fileUrl) { + this.fileUrl = fileUrl; + } + + public FaxSendRequest fileUrlNames(List fileUrlNames) { + this.fileUrlNames = fileUrlNames; + return this; + } + + public FaxSendRequest addFileUrlNamesItem(String fileUrlNamesItem) { + if (this.fileUrlNames == null) { + this.fileUrlNames = new ArrayList<>(); + } + this.fileUrlNames.add(fileUrlNamesItem); + return this; + } + + /** + * Fax File URL Names + * + * @return fileUrlNames + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_FILE_URL_NAMES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getFileUrlNames() { + return fileUrlNames; + } + + @JsonProperty(JSON_PROPERTY_FILE_URL_NAMES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setFileUrlNames(List fileUrlNames) { + this.fileUrlNames = fileUrlNames; + } + + public FaxSendRequest testMode(Boolean testMode) { + this.testMode = testMode; + return this; + } + + /** + * API Test Mode Setting + * + * @return testMode + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_TEST_MODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getTestMode() { + return testMode; + } + + @JsonProperty(JSON_PROPERTY_TEST_MODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTestMode(Boolean testMode) { + this.testMode = testMode; + } + + public FaxSendRequest coverPageTo(String coverPageTo) { + this.coverPageTo = coverPageTo; + return this; + } + + /** + * Fax Cover Page for Recipient + * + * @return coverPageTo + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_COVER_PAGE_TO) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getCoverPageTo() { + return coverPageTo; + } + + @JsonProperty(JSON_PROPERTY_COVER_PAGE_TO) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCoverPageTo(String coverPageTo) { + this.coverPageTo = coverPageTo; + } + + public FaxSendRequest coverPageFrom(String coverPageFrom) { + this.coverPageFrom = coverPageFrom; + return this; + } + + /** + * Fax Cover Page for Sender + * + * @return coverPageFrom + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_COVER_PAGE_FROM) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getCoverPageFrom() { + return coverPageFrom; + } + + @JsonProperty(JSON_PROPERTY_COVER_PAGE_FROM) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCoverPageFrom(String coverPageFrom) { + this.coverPageFrom = coverPageFrom; + } + + public FaxSendRequest coverPageMessage(String coverPageMessage) { + this.coverPageMessage = coverPageMessage; + return this; + } + + /** + * Fax Cover Page Message + * + * @return coverPageMessage + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_COVER_PAGE_MESSAGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getCoverPageMessage() { + return coverPageMessage; + } + + @JsonProperty(JSON_PROPERTY_COVER_PAGE_MESSAGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCoverPageMessage(String coverPageMessage) { + this.coverPageMessage = coverPageMessage; + } + + public FaxSendRequest title(String title) { + this.title = title; + return this; + } + + /** + * Fax Title + * + * @return title + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_TITLE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getTitle() { + return title; + } + + @JsonProperty(JSON_PROPERTY_TITLE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTitle(String title) { + this.title = title; + } + + /** Return true if this FaxSendRequest object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + FaxSendRequest faxSendRequest = (FaxSendRequest) o; + return Objects.equals(this.to, faxSendRequest.to) + && Objects.equals(this.from, faxSendRequest.from) + && Objects.equals(this._file, faxSendRequest._file) + && Objects.equals(this.fileUrl, faxSendRequest.fileUrl) + && Objects.equals(this.fileUrlNames, faxSendRequest.fileUrlNames) + && Objects.equals(this.testMode, faxSendRequest.testMode) + && Objects.equals(this.coverPageTo, faxSendRequest.coverPageTo) + && Objects.equals(this.coverPageFrom, faxSendRequest.coverPageFrom) + && Objects.equals(this.coverPageMessage, faxSendRequest.coverPageMessage) + && Objects.equals(this.title, faxSendRequest.title); + } + + @Override + public int hashCode() { + return Objects.hash( + to, + from, + _file, + fileUrl, + fileUrlNames, + testMode, + coverPageTo, + coverPageFrom, + coverPageMessage, + title); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class FaxSendRequest {\n"); + sb.append(" to: ").append(toIndentedString(to)).append("\n"); + sb.append(" from: ").append(toIndentedString(from)).append("\n"); + sb.append(" _file: ").append(toIndentedString(_file)).append("\n"); + sb.append(" fileUrl: ").append(toIndentedString(fileUrl)).append("\n"); + sb.append(" fileUrlNames: ").append(toIndentedString(fileUrlNames)).append("\n"); + sb.append(" testMode: ").append(toIndentedString(testMode)).append("\n"); + sb.append(" coverPageTo: ").append(toIndentedString(coverPageTo)).append("\n"); + sb.append(" coverPageFrom: ").append(toIndentedString(coverPageFrom)).append("\n"); + sb.append(" coverPageMessage: ").append(toIndentedString(coverPageMessage)).append("\n"); + sb.append(" title: ").append(toIndentedString(title)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public Map createFormData() throws ApiException { + Map map = new HashMap<>(); + boolean fileTypeFound = false; + try { + if (to != null) { + if (isFileTypeOrListOfFiles(to)) { + fileTypeFound = true; + } + + if (to.getClass().equals(java.io.File.class) + || to.getClass().equals(Integer.class) + || to.getClass().equals(String.class) + || to.getClass().isEnum()) { + map.put("to", to); + } else if (isListOfFile(to)) { + for (int i = 0; i < getListSize(to); i++) { + map.put("to[" + i + "]", getFromList(to, i)); + } + } else { + map.put("to", JSON.getDefault().getMapper().writeValueAsString(to)); + } + } + if (from != null) { + if (isFileTypeOrListOfFiles(from)) { + fileTypeFound = true; + } + + if (from.getClass().equals(java.io.File.class) + || from.getClass().equals(Integer.class) + || from.getClass().equals(String.class) + || from.getClass().isEnum()) { + map.put("from", from); + } else if (isListOfFile(from)) { + for (int i = 0; i < getListSize(from); i++) { + map.put("from[" + i + "]", getFromList(from, i)); + } + } else { + map.put("from", JSON.getDefault().getMapper().writeValueAsString(from)); + } + } + if (_file != null) { + if (isFileTypeOrListOfFiles(_file)) { + fileTypeFound = true; + } + + if (_file.getClass().equals(java.io.File.class) + || _file.getClass().equals(Integer.class) + || _file.getClass().equals(String.class) + || _file.getClass().isEnum()) { + map.put("file", _file); + } else if (isListOfFile(_file)) { + for (int i = 0; i < getListSize(_file); i++) { + map.put("file[" + i + "]", getFromList(_file, i)); + } + } else { + map.put("file", JSON.getDefault().getMapper().writeValueAsString(_file)); + } + } + if (fileUrl != null) { + if (isFileTypeOrListOfFiles(fileUrl)) { + fileTypeFound = true; + } + + if (fileUrl.getClass().equals(java.io.File.class) + || fileUrl.getClass().equals(Integer.class) + || fileUrl.getClass().equals(String.class) + || fileUrl.getClass().isEnum()) { + map.put("file_url", fileUrl); + } else if (isListOfFile(fileUrl)) { + for (int i = 0; i < getListSize(fileUrl); i++) { + map.put("file_url[" + i + "]", getFromList(fileUrl, i)); + } + } else { + map.put("file_url", JSON.getDefault().getMapper().writeValueAsString(fileUrl)); + } + } + if (fileUrlNames != null) { + if (isFileTypeOrListOfFiles(fileUrlNames)) { + fileTypeFound = true; + } + + if (fileUrlNames.getClass().equals(java.io.File.class) + || fileUrlNames.getClass().equals(Integer.class) + || fileUrlNames.getClass().equals(String.class) + || fileUrlNames.getClass().isEnum()) { + map.put("file_url_names", fileUrlNames); + } else if (isListOfFile(fileUrlNames)) { + for (int i = 0; i < getListSize(fileUrlNames); i++) { + map.put("file_url_names[" + i + "]", getFromList(fileUrlNames, i)); + } + } else { + map.put( + "file_url_names", + JSON.getDefault().getMapper().writeValueAsString(fileUrlNames)); + } + } + if (testMode != null) { + if (isFileTypeOrListOfFiles(testMode)) { + fileTypeFound = true; + } + + if (testMode.getClass().equals(java.io.File.class) + || testMode.getClass().equals(Integer.class) + || testMode.getClass().equals(String.class) + || testMode.getClass().isEnum()) { + map.put("test_mode", testMode); + } else if (isListOfFile(testMode)) { + for (int i = 0; i < getListSize(testMode); i++) { + map.put("test_mode[" + i + "]", getFromList(testMode, i)); + } + } else { + map.put( + "test_mode", + JSON.getDefault().getMapper().writeValueAsString(testMode)); + } + } + if (coverPageTo != null) { + if (isFileTypeOrListOfFiles(coverPageTo)) { + fileTypeFound = true; + } + + if (coverPageTo.getClass().equals(java.io.File.class) + || coverPageTo.getClass().equals(Integer.class) + || coverPageTo.getClass().equals(String.class) + || coverPageTo.getClass().isEnum()) { + map.put("cover_page_to", coverPageTo); + } else if (isListOfFile(coverPageTo)) { + for (int i = 0; i < getListSize(coverPageTo); i++) { + map.put("cover_page_to[" + i + "]", getFromList(coverPageTo, i)); + } + } else { + map.put( + "cover_page_to", + JSON.getDefault().getMapper().writeValueAsString(coverPageTo)); + } + } + if (coverPageFrom != null) { + if (isFileTypeOrListOfFiles(coverPageFrom)) { + fileTypeFound = true; + } + + if (coverPageFrom.getClass().equals(java.io.File.class) + || coverPageFrom.getClass().equals(Integer.class) + || coverPageFrom.getClass().equals(String.class) + || coverPageFrom.getClass().isEnum()) { + map.put("cover_page_from", coverPageFrom); + } else if (isListOfFile(coverPageFrom)) { + for (int i = 0; i < getListSize(coverPageFrom); i++) { + map.put("cover_page_from[" + i + "]", getFromList(coverPageFrom, i)); + } + } else { + map.put( + "cover_page_from", + JSON.getDefault().getMapper().writeValueAsString(coverPageFrom)); + } + } + if (coverPageMessage != null) { + if (isFileTypeOrListOfFiles(coverPageMessage)) { + fileTypeFound = true; + } + + if (coverPageMessage.getClass().equals(java.io.File.class) + || coverPageMessage.getClass().equals(Integer.class) + || coverPageMessage.getClass().equals(String.class) + || coverPageMessage.getClass().isEnum()) { + map.put("cover_page_message", coverPageMessage); + } else if (isListOfFile(coverPageMessage)) { + for (int i = 0; i < getListSize(coverPageMessage); i++) { + map.put("cover_page_message[" + i + "]", getFromList(coverPageMessage, i)); + } + } else { + map.put( + "cover_page_message", + JSON.getDefault().getMapper().writeValueAsString(coverPageMessage)); + } + } + if (title != null) { + if (isFileTypeOrListOfFiles(title)) { + fileTypeFound = true; + } + + if (title.getClass().equals(java.io.File.class) + || title.getClass().equals(Integer.class) + || title.getClass().equals(String.class) + || title.getClass().isEnum()) { + map.put("title", title); + } else if (isListOfFile(title)) { + for (int i = 0; i < getListSize(title); i++) { + map.put("title[" + i + "]", getFromList(title, i)); + } + } else { + map.put("title", JSON.getDefault().getMapper().writeValueAsString(title)); + } + } + } catch (Exception e) { + throw new ApiException(e); + } + + return fileTypeFound ? map : new HashMap<>(); + } + + private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { + return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); + } + + private boolean isListOfFile(Object obj) throws Exception { + return obj instanceof java.util.List + && !isListEmpty(obj) + && getFromList(obj, 0) instanceof java.io.File; + } + + private boolean isListEmpty(Object obj) throws Exception { + return (boolean) + Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); + } + + private Object getFromList(Object obj, int index) throws Exception { + return Class.forName(java.util.List.class.getName()) + .getMethod("get", int.class) + .invoke(obj, index); + } + + private int getListSize(Object obj) throws Exception { + return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/model/SubFile.java b/sdks/java-v1/src/main/java/com/dropbox/sign/model/SubFile.java new file mode 100644 index 000000000..dc4e6c6ba --- /dev/null +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/model/SubFile.java @@ -0,0 +1,165 @@ +/* + * 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; + +/** Actual uploaded physical file */ +@JsonPropertyOrder({SubFile.JSON_PROPERTY_NAME}) +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.8.0") +@JsonIgnoreProperties(ignoreUnknown = true) +public class SubFile { + public static final String JSON_PROPERTY_NAME = "name"; + private String name = ""; + + public SubFile() {} + + /** + * Attempt to instantiate and hydrate a new instance of this class + * + * @param jsonData String of JSON data representing target object + */ + public static SubFile init(String jsonData) throws Exception { + return new ObjectMapper().readValue(jsonData, SubFile.class); + } + + public static SubFile init(HashMap data) throws Exception { + return new ObjectMapper() + .readValue(new ObjectMapper().writeValueAsString(data), SubFile.class); + } + + public SubFile name(String name) { + this.name = name; + return this; + } + + /** + * Actual physical uploaded file name that is derived during upload. Not settable parameter. + * + * @return name + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getName() { + return name; + } + + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setName(String name) { + this.name = name; + } + + /** Return true if this SubFile object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SubFile subFile = (SubFile) o; + return Objects.equals(this.name, subFile.name); + } + + @Override + public int hashCode() { + return Objects.hash(name); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SubFile {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public Map createFormData() throws ApiException { + Map map = new HashMap<>(); + boolean fileTypeFound = false; + try { + if (name != null) { + if (isFileTypeOrListOfFiles(name)) { + fileTypeFound = true; + } + + if (name.getClass().equals(java.io.File.class) + || name.getClass().equals(Integer.class) + || name.getClass().equals(String.class) + || name.getClass().isEnum()) { + map.put("name", name); + } else if (isListOfFile(name)) { + for (int i = 0; i < getListSize(name); i++) { + map.put("name[" + i + "]", getFromList(name, i)); + } + } else { + map.put("name", JSON.getDefault().getMapper().writeValueAsString(name)); + } + } + } 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 75edf1dcb..61d39c288 100644 --- a/sdks/java-v2/README.md +++ b/sdks/java-v2/README.md @@ -153,6 +153,11 @@ Class | Method | HTTP request | Description *BulkSendJobApi* | [**bulkSendJobList**](docs/BulkSendJobApi.md#bulkSendJobList) | **GET** /bulk_send_job/list | List Bulk Send Jobs *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* | [**deleteFax**](docs/FaxApi.md#deleteFax) | **DELETE** /fax/{fax_id} | Delete Fax +*FaxApi* | [**getFaxById**](docs/FaxApi.md#getFaxById) | **GET** /fax/{fax_id} | Get Fax +*FaxApi* | [**getFaxFiles**](docs/FaxApi.md#getFaxFiles) | **GET** /fax/files/{fax_id} | List Fax Files +*FaxApi* | [**listFaxes**](docs/FaxApi.md#listFaxes) | **GET** /fax/list | Lists Faxes +*FaxApi* | [**sendFax**](docs/FaxApi.md#sendFax) | **POST** /fax/send | Send Fax *FaxLineApi* | [**faxLineAddUser**](docs/FaxLineApi.md#faxLineAddUser) | **PUT** /fax_line/add_user | Add Fax Line User *FaxLineApi* | [**faxLineAreaCodeGet**](docs/FaxLineApi.md#faxLineAreaCodeGet) | **GET** /fax_line/area_codes | Get Available Fax Line Area Codes *FaxLineApi* | [**faxLineCreate**](docs/FaxLineApi.md#faxLineCreate) | **POST** /fax_line/create | Purchase Fax Line @@ -253,6 +258,11 @@ Class | Method | HTTP request | Description - [FaxLineRemoveUserRequest](docs/FaxLineRemoveUserRequest.md) - [FaxLineResponse](docs/FaxLineResponse.md) - [FaxLineResponseFaxLine](docs/FaxLineResponseFaxLine.md) + - [FaxListResponse](docs/FaxListResponse.md) + - [FaxResponse](docs/FaxResponse.md) + - [FaxResponseFax](docs/FaxResponseFax.md) + - [FaxResponseFaxTransmission](docs/FaxResponseFaxTransmission.md) + - [FaxSendRequest](docs/FaxSendRequest.md) - [FileResponse](docs/FileResponse.md) - [FileResponseDataUri](docs/FileResponseDataUri.md) - [ListInfoResponse](docs/ListInfoResponse.md) @@ -297,6 +307,7 @@ Class | Method | HTTP request | Description - [SubCustomField](docs/SubCustomField.md) - [SubEditorOptions](docs/SubEditorOptions.md) - [SubFieldOptions](docs/SubFieldOptions.md) + - [SubFile](docs/SubFile.md) - [SubFormFieldGroup](docs/SubFormFieldGroup.md) - [SubFormFieldRule](docs/SubFormFieldRule.md) - [SubFormFieldRuleAction](docs/SubFormFieldRuleAction.md) diff --git a/sdks/java-v2/docs/FaxApi.md b/sdks/java-v2/docs/FaxApi.md new file mode 100644 index 000000000..675e03473 --- /dev/null +++ b/sdks/java-v2/docs/FaxApi.md @@ -0,0 +1,355 @@ +# FaxApi + +All URIs are relative to *https://api.hellosign.com/v3* + +| Method | HTTP request | Description | +|------------- | ------------- | -------------| +[**deleteFax**](FaxApi.md#deleteFax) | **DELETE** /fax/{fax_id} | Delete Fax +[**getFaxById**](FaxApi.md#getFaxById) | **GET** /fax/{fax_id} | Get Fax +[**getFaxFiles**](FaxApi.md#getFaxFiles) | **GET** /fax/files/{fax_id} | List Fax Files +[**listFaxes**](FaxApi.md#listFaxes) | **GET** /fax/list | Lists Faxes +[**sendFax**](FaxApi.md#sendFax) | **POST** /fax/send | Send Fax + + + +## deleteFax + +> deleteFax(faxId) + +Delete Fax + +Deletes the specified Fax from the system. + +### Example + +```java +import com.dropbox.sign.ApiException; +import com.dropbox.sign.Configuration; +import com.dropbox.sign.api.*; +import com.dropbox.sign.auth.*; +import com.dropbox.sign.model.*; + +import java.util.List; + +public class Example { + public static void main(String[] args) { + var apiClient = Configuration.getDefaultApiClient() + .setApiKey("YOUR_API_KEY"); + + var faxAPi = new FaxApi(apiClient); + + try { + faxAPi.deleteFax("[FAX_NUMBER]"); + } catch (ApiException e) { + 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 | +|------------- | ------------- | ------------- | -------------| + **faxId** | **String**| Fax ID | + +### Return type + +null (empty response body) + +### Authorization + +[api_key](../README.md#api_key) + +### HTTP request headers + +- **Content-Type**: Not defined +- **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 | - | + + +## getFaxById + +> FaxResponse getFaxById(faxId) + +Get Fax + +Returns information about fax + +### Example + +```java +import com.dropbox.sign.ApiException; +import com.dropbox.sign.Configuration; +import com.dropbox.sign.api.*; +import com.dropbox.sign.auth.*; +import com.dropbox.sign.model.*; + +public class Example { + public static void main(String[] args) { + var apiClient = Configuration.getDefaultApiClient() + .setApiKey("YOUR_API_KEY"); + + var faxApi = new FaxApi(apiClient); + + var faxId = "fa5c8a0b0f492d768749333ad6fcc214c111e967"; + + try { + FaxGetResponse result = faxApi.getFaxById(faxId); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling AccountApi#accountCreate"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} + +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| + **faxId** | **String**| Fax ID | + +### Return type + +[**FaxResponse**](FaxResponse.md) + +### Authorization + +[api_key](../README.md#api_key) + +### HTTP request headers + +- **Content-Type**: Not defined +- **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 | - | + + +## getFaxFiles + +> getFaxFiles(faxId) + +List Fax Files + +Returns list of fax files + +### Example + +```java +import com.dropbox.sign.ApiException; +import com.dropbox.sign.Configuration; +import com.dropbox.sign.api.*; +import com.dropbox.sign.auth.*; +import com.dropbox.sign.model.*; + +import java.util.List; + +public class Example { + public static void main(String[] args) { + var apiClient = Configuration.getDefaultApiClient() + .setApiKey("YOUR_API_KEY"); + + var faxApi = new FaxApi(apiClient); + + var faxId = "fa5c8a0b0f492d768749333ad6fcc214c111e967"; + + try { + faxApi.getFaxFiles(faxId); + } catch (ApiException e) { + 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 | +|------------- | ------------- | ------------- | -------------| + **faxId** | **String**| Fax ID | + +### Return type + +null (empty response body) + +### Authorization + +[api_key](../README.md#api_key) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **4XX** | failed_operation | - | + + +## listFaxes + +> FaxListResponse listFaxes(page, pageSize) + +Lists Faxes + +Returns properties of multiple faxes + +### Example + +```java +import com.dropbox.sign.ApiException; +import com.dropbox.sign.Configuration; +import com.dropbox.sign.api.*; +import com.dropbox.sign.auth.*; +import com.dropbox.sign.model.*; + +public class Example { + public static void main(String[] args) { + var apiClient = Configuration.getDefaultApiClient() + .setApiKey("YOUR_API_KEY"); + + var faxApi = new FaxApi(apiClient); + + var page = 1; + var pageSize = 2; + + try { + FaxListResponse result = faxApi.listFaxes(page, pageSize); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling AccountApi#accountCreate"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} + +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| + **page** | **Integer**| Page | + **pageSize** | **Integer**| Page size | + +### Return type + +[**FaxListResponse**](FaxListResponse.md) + +### Authorization + +[api_key](../README.md#api_key) + +### HTTP request headers + +- **Content-Type**: Not defined +- **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 | - | + + +## sendFax + +> FaxResponse sendFax(faxSendRequest) + +Send Fax + +Action to prepare and send a fax + +### Example + +```java +import com.dropbox.sign.ApiException; +import com.dropbox.sign.Configuration; +import com.dropbox.sign.api.*; +import com.dropbox.sign.auth.*; +import com.dropbox.sign.model.*; + +import java.util.List; + +public class Example { + public static void main(String[] args) { + var apiClient = Configuration.getDefaultApiClient() + .setApiKey("YOUR_API_KEY"); + + var faxApi = new FaxApi(apiClient); + + var data = new FaxCreateRequest() + .areaCode(209) + .country("US"); + + try { + FaxCreateResponse result = faxApi.faxCreate(data); + System.out.println(result); + } catch (ApiException e) { + 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 | +|------------- | ------------- | ------------- | -------------| + **faxSendRequest** | [**FaxSendRequest**](FaxSendRequest.md)| | + +### Return type + +[**FaxResponse**](FaxResponse.md) + +### Authorization + +[api_key](../README.md#api_key) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
| +| **4XX** | failed_operation | - | + diff --git a/sdks/java-v2/docs/FaxListResponse.md b/sdks/java-v2/docs/FaxListResponse.md new file mode 100644 index 000000000..22e92f955 --- /dev/null +++ b/sdks/java-v2/docs/FaxListResponse.md @@ -0,0 +1,15 @@ + + +# FaxListResponse + + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +| `faxes`*_required_ | [```List```](FaxResponseFax.md) | | | +| `listInfo`*_required_ | [```ListInfoResponse```](ListInfoResponse.md) | | | + + + diff --git a/sdks/java-v2/docs/FaxResponse.md b/sdks/java-v2/docs/FaxResponse.md new file mode 100644 index 000000000..18b586446 --- /dev/null +++ b/sdks/java-v2/docs/FaxResponse.md @@ -0,0 +1,15 @@ + + +# FaxResponse + + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +| `fax`*_required_ | [```FaxResponseFax```](FaxResponseFax.md) | | | +| `warnings` | [```WarningResponse```](WarningResponse.md) | | | + + + diff --git a/sdks/java-v2/docs/FaxResponseFax.md b/sdks/java-v2/docs/FaxResponseFax.md new file mode 100644 index 000000000..ef62af24a --- /dev/null +++ b/sdks/java-v2/docs/FaxResponseFax.md @@ -0,0 +1,23 @@ + + +# FaxResponseFax + + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +| `faxId` | ```String``` | Fax ID | | +| `title` | ```String``` | Fax Title | | +| `originalTitle` | ```String``` | Fax Original Title | | +| `subject` | ```String``` | Fax Subject | | +| `message` | ```String``` | Fax Message | | +| `metadata` | ```Object``` | Fax Metadata | | +| `createdAt` | ```Integer``` | Fax Created At Timestamp | | +| `from` | ```String``` | Fax Sender Email | | +| `transmissions` | [```List```](FaxResponseFaxTransmission.md) | Fax Transmissions List | | +| `filesUrl` | ```String``` | Fax Files URL | | + + + diff --git a/sdks/java-v2/docs/FaxResponseFaxTransmission.md b/sdks/java-v2/docs/FaxResponseFaxTransmission.md new file mode 100644 index 000000000..74a4c7cf2 --- /dev/null +++ b/sdks/java-v2/docs/FaxResponseFaxTransmission.md @@ -0,0 +1,17 @@ + + +# FaxResponseFaxTransmission + + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +| `recipient` | ```String``` | Fax Transmission Recipient | | +| `sender` | ```String``` | Fax Transmission Sender | | +| `statusCode` | ```String``` | Fax Transmission Status Code | | +| `sentAt` | ```Integer``` | Fax Transmission Sent Timestamp | | + + + diff --git a/sdks/java-v2/docs/FaxSendRequest.md b/sdks/java-v2/docs/FaxSendRequest.md new file mode 100644 index 000000000..c77fd7a0e --- /dev/null +++ b/sdks/java-v2/docs/FaxSendRequest.md @@ -0,0 +1,23 @@ + + +# FaxSendRequest + + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +| `to` | ```String``` | Fax Send To Recipient | | +| `from` | ```String``` | Fax Send From Sender (used only with fax number) | | +| `_file` | [```List```](SubFile.md) | Fax File to Send | | +| `fileUrl` | ```List``` | Fax File URL to Send | | +| `fileUrlNames` | ```List``` | Fax File URL Names | | +| `testMode` | ```Boolean``` | API Test Mode Setting | | +| `coverPageTo` | ```String``` | Fax Cover Page for Recipient | | +| `coverPageFrom` | ```String``` | Fax Cover Page for Sender | | +| `coverPageMessage` | ```String``` | Fax Cover Page Message | | +| `title` | ```String``` | Fax Title | | + + + diff --git a/sdks/java-v2/docs/SubFile.md b/sdks/java-v2/docs/SubFile.md new file mode 100644 index 000000000..376475b8c --- /dev/null +++ b/sdks/java-v2/docs/SubFile.md @@ -0,0 +1,14 @@ + + +# SubFile + +Actual uploaded physical file + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +| `name` | ```String``` | Actual physical uploaded file name that is derived during upload. Not settable parameter. | | + + + 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 new file mode 100644 index 000000000..5441feb99 --- /dev/null +++ b/sdks/java-v2/src/main/java/com/dropbox/sign/api/FaxApi.java @@ -0,0 +1,374 @@ +package com.dropbox.sign.api; + +import com.dropbox.sign.ApiException; +import com.dropbox.sign.ApiClient; +import com.dropbox.sign.ApiResponse; +import com.dropbox.sign.Configuration; +import com.dropbox.sign.Pair; + +import jakarta.ws.rs.core.GenericType; + +import com.dropbox.sign.model.ErrorResponse; +import com.dropbox.sign.model.FaxListResponse; +import com.dropbox.sign.model.FaxResponse; +import com.dropbox.sign.model.FaxSendRequest; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; + +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") +public class FaxApi { + private ApiClient apiClient; + + public FaxApi() { + this(Configuration.getDefaultApiClient()); + } + + public FaxApi(ApiClient apiClient) { + this.apiClient = apiClient; + } + + /** + * Get the API client + * + * @return API client + */ + public ApiClient getApiClient() { + return apiClient; + } + + /** + * Set the API client + * + * @param apiClient an instance of API client + */ + public void setApiClient(ApiClient apiClient) { + this.apiClient = apiClient; + } + + /** + * Delete Fax. + * Deletes the specified Fax from the system. + * @param faxId Fax ID (required) + * @throws ApiException if fails to make API call + * @http.response.details + + + + +
Status Code Description Response Headers
200 successful operation * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
4XX failed_operation -
+ */ + public void deleteFax(String faxId) throws ApiException { + deleteFaxWithHttpInfo(faxId); + } + + + /** + * Delete Fax. + * Deletes the specified Fax from the system. + * @param faxId Fax ID (required) + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + * @http.response.details + + + + +
Status Code Description Response Headers
200 successful operation * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
4XX failed_operation -
+ */ + public ApiResponse deleteFaxWithHttpInfo(String faxId) throws ApiException { + + // Check required parameters + if (faxId == null) { + throw new ApiException(400, "Missing the required parameter 'faxId' when calling deleteFax"); + } + + // Path parameters + String localVarPath = "/fax/{fax_id}" + .replaceAll("\\{fax_id}", apiClient.escapeString(faxId.toString())); + + String localVarAccept = apiClient.selectHeaderAccept("application/json"); + Map localVarFormParams = new LinkedHashMap<>(); + localVarFormParams = new HashMap(); + boolean isFileTypeFound = !localVarFormParams.isEmpty(); + String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType(); + String[] localVarAuthNames = new String[] {"api_key"}; + return apiClient.invokeAPI( + "FaxApi.deleteFax", + localVarPath, + "DELETE", + new ArrayList<>(), + null, + new LinkedHashMap<>(), + new LinkedHashMap<>(), + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + null, + false + ); + } + /** + * Get Fax. + * Returns information about fax + * @param faxId Fax ID (required) + * @return FaxResponse + * @throws ApiException if fails to make API call + * @http.response.details + + + + +
Status Code Description Response Headers
200 successful operation * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
4XX failed_operation -
+ */ + public FaxResponse getFaxById(String faxId) throws ApiException { + return getFaxByIdWithHttpInfo(faxId).getData(); + } + + + /** + * Get Fax. + * Returns information about fax + * @param faxId Fax ID (required) + * @return ApiResponse<FaxResponse> + * @throws ApiException if fails to make API call + * @http.response.details + + + + +
Status Code Description Response Headers
200 successful operation * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
4XX failed_operation -
+ */ + public ApiResponse getFaxByIdWithHttpInfo(String faxId) throws ApiException { + + // Check required parameters + if (faxId == null) { + throw new ApiException(400, "Missing the required parameter 'faxId' when calling getFaxById"); + } + + // Path parameters + String localVarPath = "/fax/{fax_id}" + .replaceAll("\\{fax_id}", apiClient.escapeString(faxId.toString())); + + String localVarAccept = apiClient.selectHeaderAccept("application/json"); + Map localVarFormParams = new LinkedHashMap<>(); + localVarFormParams = new HashMap(); + boolean isFileTypeFound = !localVarFormParams.isEmpty(); + String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType(); + String[] localVarAuthNames = new String[] {"api_key"}; + GenericType localVarReturnType = new GenericType() {}; + return apiClient.invokeAPI( + "FaxApi.getFaxById", + localVarPath, + "GET", + new ArrayList<>(), + null, + new LinkedHashMap<>(), + new LinkedHashMap<>(), + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType, + false + ); + } + /** + * List Fax Files. + * Returns list of fax files + * @param faxId Fax ID (required) + * @throws ApiException if fails to make API call + * @http.response.details + + + +
Status Code Description Response Headers
4XX failed_operation -
+ */ + public void getFaxFiles(String faxId) throws ApiException { + getFaxFilesWithHttpInfo(faxId); + } + + + /** + * List Fax Files. + * Returns list of fax files + * @param faxId Fax ID (required) + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + * @http.response.details + + + +
Status Code Description Response Headers
4XX failed_operation -
+ */ + public ApiResponse getFaxFilesWithHttpInfo(String faxId) throws ApiException { + + // Check required parameters + if (faxId == null) { + throw new ApiException(400, "Missing the required parameter 'faxId' when calling getFaxFiles"); + } + + // Path parameters + String localVarPath = "/fax/files/{fax_id}" + .replaceAll("\\{fax_id}", apiClient.escapeString(faxId.toString())); + + String localVarAccept = apiClient.selectHeaderAccept("application/json"); + Map localVarFormParams = new LinkedHashMap<>(); + localVarFormParams = new HashMap(); + boolean isFileTypeFound = !localVarFormParams.isEmpty(); + String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType(); + String[] localVarAuthNames = new String[] {"api_key"}; + return apiClient.invokeAPI( + "FaxApi.getFaxFiles", + localVarPath, + "GET", + new ArrayList<>(), + null, + new LinkedHashMap<>(), + new LinkedHashMap<>(), + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + null, + false + ); + } + /** + * Lists Faxes. + * Returns properties of multiple faxes + * @param page Page (required) + * @param pageSize Page size (required) + * @return FaxListResponse + * @throws ApiException if fails to make API call + * @http.response.details + + + + +
Status Code Description Response Headers
200 successful operation * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
4XX failed_operation -
+ */ + public FaxListResponse listFaxes(Integer page, Integer pageSize) throws ApiException { + return listFaxesWithHttpInfo(page, pageSize).getData(); + } + + + /** + * Lists Faxes. + * Returns properties of multiple faxes + * @param page Page (required) + * @param pageSize Page size (required) + * @return ApiResponse<FaxListResponse> + * @throws ApiException if fails to make API call + * @http.response.details + + + + +
Status Code Description Response Headers
200 successful operation * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
4XX failed_operation -
+ */ + public ApiResponse listFaxesWithHttpInfo(Integer page, Integer pageSize) throws ApiException { + + // Check required parameters + if (page == null) { + throw new ApiException(400, "Missing the required parameter 'page' when calling listFaxes"); + } + if (pageSize == null) { + throw new ApiException(400, "Missing the required parameter 'pageSize' when calling listFaxes"); + } + + // Query parameters + List localVarQueryParams = new ArrayList<>( + apiClient.parameterToPairs("", "page", page) + ); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "page_size", pageSize)); + + String localVarAccept = apiClient.selectHeaderAccept("application/json"); + Map localVarFormParams = new LinkedHashMap<>(); + localVarFormParams = new HashMap(); + boolean isFileTypeFound = !localVarFormParams.isEmpty(); + String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType(); + String[] localVarAuthNames = new String[] {"api_key"}; + GenericType localVarReturnType = new GenericType() {}; + return apiClient.invokeAPI( + "FaxApi.listFaxes", + "/fax/list", + "GET", + localVarQueryParams, + null, + new LinkedHashMap<>(), + new LinkedHashMap<>(), + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType, + false + ); + } + /** + * Send Fax. + * Action to prepare and send a fax + * @param faxSendRequest (required) + * @return FaxResponse + * @throws ApiException if fails to make API call + * @http.response.details + + + + +
Status Code Description Response Headers
200 successful operation * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
4XX failed_operation -
+ */ + public FaxResponse sendFax(FaxSendRequest faxSendRequest) throws ApiException { + return sendFaxWithHttpInfo(faxSendRequest).getData(); + } + + + /** + * Send Fax. + * Action to prepare and send a fax + * @param faxSendRequest (required) + * @return ApiResponse<FaxResponse> + * @throws ApiException if fails to make API call + * @http.response.details + + + + +
Status Code Description Response Headers
200 successful operation * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
4XX failed_operation -
+ */ + public ApiResponse sendFaxWithHttpInfo(FaxSendRequest faxSendRequest) throws ApiException { + + // Check required parameters + if (faxSendRequest == null) { + throw new ApiException(400, "Missing the required parameter 'faxSendRequest' when calling sendFax"); + } + + String localVarAccept = apiClient.selectHeaderAccept("application/json"); + Map localVarFormParams = new LinkedHashMap<>(); + localVarFormParams = faxSendRequest.createFormData(); + boolean isFileTypeFound = !localVarFormParams.isEmpty(); + String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType("application/json"); + String[] localVarAuthNames = new String[] {"api_key"}; + GenericType localVarReturnType = new GenericType() {}; + return apiClient.invokeAPI( + "FaxApi.sendFax", + "/fax/send", + "POST", + new ArrayList<>(), + isFileTypeFound ? null : faxSendRequest, + new LinkedHashMap<>(), + new LinkedHashMap<>(), + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType, + false + ); + } +} \ No newline at end of file diff --git a/sdks/java-v2/src/main/java/com/dropbox/sign/model/FaxListResponse.java b/sdks/java-v2/src/main/java/com/dropbox/sign/model/FaxListResponse.java new file mode 100644 index 000000000..7fb8ccdf9 --- /dev/null +++ b/sdks/java-v2/src/main/java/com/dropbox/sign/model/FaxListResponse.java @@ -0,0 +1,240 @@ +/* + * 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.FaxResponseFax; +import com.dropbox.sign.model.ListInfoResponse; +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; +/** + * FaxListResponse + */ +@JsonPropertyOrder({ + FaxListResponse.JSON_PROPERTY_FAXES, + FaxListResponse.JSON_PROPERTY_LIST_INFO +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") +@JsonIgnoreProperties(ignoreUnknown=true) +public class FaxListResponse { + public static final String JSON_PROPERTY_FAXES = "faxes"; + private List faxes = new ArrayList<>(); + + public static final String JSON_PROPERTY_LIST_INFO = "list_info"; + private ListInfoResponse listInfo; + + public FaxListResponse() { + } + + /** + * Attempt to instantiate and hydrate a new instance of this class + * @param jsonData String of JSON data representing target object + */ + static public FaxListResponse init(String jsonData) throws Exception { + return new ObjectMapper().readValue(jsonData, FaxListResponse.class); + } + + static public FaxListResponse init(HashMap data) throws Exception { + return new ObjectMapper().readValue( + new ObjectMapper().writeValueAsString(data), + FaxListResponse.class + ); + } + + public FaxListResponse faxes(List faxes) { + this.faxes = faxes; + return this; + } + + public FaxListResponse addFaxesItem(FaxResponseFax faxesItem) { + if (this.faxes == null) { + this.faxes = new ArrayList<>(); + } + this.faxes.add(faxesItem); + return this; + } + + /** + * Get faxes + * @return faxes + */ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_FAXES) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public List getFaxes() { + return faxes; + } + + + @JsonProperty(JSON_PROPERTY_FAXES) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setFaxes(List faxes) { + this.faxes = faxes; + } + + + public FaxListResponse listInfo(ListInfoResponse listInfo) { + this.listInfo = listInfo; + return this; + } + + /** + * Get listInfo + * @return listInfo + */ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_LIST_INFO) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public ListInfoResponse getListInfo() { + return listInfo; + } + + + @JsonProperty(JSON_PROPERTY_LIST_INFO) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setListInfo(ListInfoResponse listInfo) { + this.listInfo = listInfo; + } + + + /** + * Return true if this FaxListResponse object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + FaxListResponse faxListResponse = (FaxListResponse) o; + return Objects.equals(this.faxes, faxListResponse.faxes) && + Objects.equals(this.listInfo, faxListResponse.listInfo); + } + + @Override + public int hashCode() { + return Objects.hash(faxes, listInfo); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class FaxListResponse {\n"); + sb.append(" faxes: ").append(toIndentedString(faxes)).append("\n"); + sb.append(" listInfo: ").append(toIndentedString(listInfo)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public Map createFormData() throws ApiException { + Map map = new HashMap<>(); + boolean fileTypeFound = false; + try { + if (faxes != null) { + if (isFileTypeOrListOfFiles(faxes)) { + fileTypeFound = true; + } + + if (faxes.getClass().equals(java.io.File.class) || + faxes.getClass().equals(Integer.class) || + faxes.getClass().equals(String.class) || + faxes.getClass().isEnum()) { + map.put("faxes", faxes); + } else if (isListOfFile(faxes)) { + for(int i = 0; i< getListSize(faxes); i++) { + map.put("faxes[" + i + "]", getFromList(faxes, i)); + } + } + else { + map.put("faxes", JSON.getDefault().getMapper().writeValueAsString(faxes)); + } + } + if (listInfo != null) { + if (isFileTypeOrListOfFiles(listInfo)) { + fileTypeFound = true; + } + + if (listInfo.getClass().equals(java.io.File.class) || + listInfo.getClass().equals(Integer.class) || + listInfo.getClass().equals(String.class) || + listInfo.getClass().isEnum()) { + map.put("list_info", listInfo); + } else if (isListOfFile(listInfo)) { + for(int i = 0; i< getListSize(listInfo); i++) { + map.put("list_info[" + i + "]", getFromList(listInfo, i)); + } + } + else { + map.put("list_info", JSON.getDefault().getMapper().writeValueAsString(listInfo)); + } + } + } catch (Exception e) { + throw new ApiException(e); + } + + return fileTypeFound ? map : new HashMap<>(); + } + + private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { + return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); + } + + private boolean isListOfFile(Object obj) throws Exception { + return obj instanceof java.util.List && !isListEmpty(obj) && getFromList(obj, 0) instanceof java.io.File; + } + + private boolean isListEmpty(Object obj) throws Exception { + return (boolean) Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); + } + + private Object getFromList(Object obj, int index) throws Exception { + return Class.forName(java.util.List.class.getName()).getMethod("get", int.class).invoke(obj, index); + } + + private int getListSize(Object obj) throws Exception { + return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/sdks/java-v2/src/main/java/com/dropbox/sign/model/FaxResponse.java b/sdks/java-v2/src/main/java/com/dropbox/sign/model/FaxResponse.java new file mode 100644 index 000000000..0da52b475 --- /dev/null +++ b/sdks/java-v2/src/main/java/com/dropbox/sign/model/FaxResponse.java @@ -0,0 +1,230 @@ +/* + * 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.FaxResponseFax; +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.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; +/** + * FaxResponse + */ +@JsonPropertyOrder({ + FaxResponse.JSON_PROPERTY_FAX, + FaxResponse.JSON_PROPERTY_WARNINGS +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") +@JsonIgnoreProperties(ignoreUnknown=true) +public class FaxResponse { + public static final String JSON_PROPERTY_FAX = "fax"; + private FaxResponseFax fax; + + public static final String JSON_PROPERTY_WARNINGS = "warnings"; + private WarningResponse warnings; + + public FaxResponse() { + } + + /** + * Attempt to instantiate and hydrate a new instance of this class + * @param jsonData String of JSON data representing target object + */ + static public FaxResponse init(String jsonData) throws Exception { + return new ObjectMapper().readValue(jsonData, FaxResponse.class); + } + + static public FaxResponse init(HashMap data) throws Exception { + return new ObjectMapper().readValue( + new ObjectMapper().writeValueAsString(data), + FaxResponse.class + ); + } + + public FaxResponse fax(FaxResponseFax fax) { + this.fax = fax; + return this; + } + + /** + * Get fax + * @return fax + */ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_FAX) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public FaxResponseFax getFax() { + return fax; + } + + + @JsonProperty(JSON_PROPERTY_FAX) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setFax(FaxResponseFax fax) { + this.fax = fax; + } + + + public FaxResponse warnings(WarningResponse warnings) { + this.warnings = warnings; + return this; + } + + /** + * Get warnings + * @return warnings + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_WARNINGS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public WarningResponse getWarnings() { + return warnings; + } + + + @JsonProperty(JSON_PROPERTY_WARNINGS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setWarnings(WarningResponse warnings) { + this.warnings = warnings; + } + + + /** + * Return true if this FaxResponse object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + FaxResponse faxResponse = (FaxResponse) o; + return Objects.equals(this.fax, faxResponse.fax) && + Objects.equals(this.warnings, faxResponse.warnings); + } + + @Override + public int hashCode() { + return Objects.hash(fax, warnings); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class FaxResponse {\n"); + sb.append(" fax: ").append(toIndentedString(fax)).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 (fax != null) { + if (isFileTypeOrListOfFiles(fax)) { + fileTypeFound = true; + } + + if (fax.getClass().equals(java.io.File.class) || + fax.getClass().equals(Integer.class) || + fax.getClass().equals(String.class) || + fax.getClass().isEnum()) { + map.put("fax", fax); + } else if (isListOfFile(fax)) { + for(int i = 0; i< getListSize(fax); i++) { + map.put("fax[" + i + "]", getFromList(fax, i)); + } + } + else { + map.put("fax", JSON.getDefault().getMapper().writeValueAsString(fax)); + } + } + 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/FaxResponseFax.java b/sdks/java-v2/src/main/java/com/dropbox/sign/model/FaxResponseFax.java new file mode 100644 index 000000000..69274c5ce --- /dev/null +++ b/sdks/java-v2/src/main/java/com/dropbox/sign/model/FaxResponseFax.java @@ -0,0 +1,639 @@ +/* + * 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.FaxResponseFaxTransmission; +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; +/** + * FaxResponseFax + */ +@JsonPropertyOrder({ + FaxResponseFax.JSON_PROPERTY_FAX_ID, + FaxResponseFax.JSON_PROPERTY_TITLE, + FaxResponseFax.JSON_PROPERTY_ORIGINAL_TITLE, + FaxResponseFax.JSON_PROPERTY_SUBJECT, + FaxResponseFax.JSON_PROPERTY_MESSAGE, + FaxResponseFax.JSON_PROPERTY_METADATA, + FaxResponseFax.JSON_PROPERTY_CREATED_AT, + FaxResponseFax.JSON_PROPERTY_FROM, + FaxResponseFax.JSON_PROPERTY_TRANSMISSIONS, + FaxResponseFax.JSON_PROPERTY_FILES_URL +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") +@JsonIgnoreProperties(ignoreUnknown=true) +public class FaxResponseFax { + public static final String JSON_PROPERTY_FAX_ID = "fax_id"; + private String faxId; + + public static final String JSON_PROPERTY_TITLE = "title"; + private String title; + + public static final String JSON_PROPERTY_ORIGINAL_TITLE = "original_title"; + private String originalTitle; + + public static final String JSON_PROPERTY_SUBJECT = "subject"; + private String subject; + + public static final String JSON_PROPERTY_MESSAGE = "message"; + private String message; + + public static final String JSON_PROPERTY_METADATA = "metadata"; + private Object metadata; + + public static final String JSON_PROPERTY_CREATED_AT = "created_at"; + private Integer createdAt; + + public static final String JSON_PROPERTY_FROM = "from"; + private String from; + + public static final String JSON_PROPERTY_TRANSMISSIONS = "transmissions"; + private List transmissions = null; + + public static final String JSON_PROPERTY_FILES_URL = "files_url"; + private String filesUrl; + + public FaxResponseFax() { + } + + /** + * Attempt to instantiate and hydrate a new instance of this class + * @param jsonData String of JSON data representing target object + */ + static public FaxResponseFax init(String jsonData) throws Exception { + return new ObjectMapper().readValue(jsonData, FaxResponseFax.class); + } + + static public FaxResponseFax init(HashMap data) throws Exception { + return new ObjectMapper().readValue( + new ObjectMapper().writeValueAsString(data), + FaxResponseFax.class + ); + } + + public FaxResponseFax faxId(String faxId) { + this.faxId = faxId; + return this; + } + + /** + * Fax ID + * @return faxId + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_FAX_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getFaxId() { + return faxId; + } + + + @JsonProperty(JSON_PROPERTY_FAX_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setFaxId(String faxId) { + this.faxId = faxId; + } + + + public FaxResponseFax title(String title) { + this.title = title; + return this; + } + + /** + * Fax Title + * @return title + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TITLE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getTitle() { + return title; + } + + + @JsonProperty(JSON_PROPERTY_TITLE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTitle(String title) { + this.title = title; + } + + + public FaxResponseFax originalTitle(String originalTitle) { + this.originalTitle = originalTitle; + return this; + } + + /** + * Fax Original Title + * @return originalTitle + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ORIGINAL_TITLE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getOriginalTitle() { + return originalTitle; + } + + + @JsonProperty(JSON_PROPERTY_ORIGINAL_TITLE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setOriginalTitle(String originalTitle) { + this.originalTitle = originalTitle; + } + + + public FaxResponseFax subject(String subject) { + this.subject = subject; + return this; + } + + /** + * Fax Subject + * @return subject + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SUBJECT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getSubject() { + return subject; + } + + + @JsonProperty(JSON_PROPERTY_SUBJECT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSubject(String subject) { + this.subject = subject; + } + + + public FaxResponseFax message(String message) { + this.message = message; + return this; + } + + /** + * Fax Message + * @return message + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_MESSAGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getMessage() { + return message; + } + + + @JsonProperty(JSON_PROPERTY_MESSAGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMessage(String message) { + this.message = message; + } + + + public FaxResponseFax metadata(Object metadata) { + this.metadata = metadata; + return this; + } + + /** + * Fax Metadata + * @return metadata + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_METADATA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Object getMetadata() { + return metadata; + } + + + @JsonProperty(JSON_PROPERTY_METADATA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMetadata(Object metadata) { + this.metadata = metadata; + } + + + public FaxResponseFax createdAt(Integer createdAt) { + this.createdAt = createdAt; + return this; + } + + /** + * Fax Created At Timestamp + * @return createdAt + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CREATED_AT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Integer getCreatedAt() { + return createdAt; + } + + + @JsonProperty(JSON_PROPERTY_CREATED_AT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCreatedAt(Integer createdAt) { + this.createdAt = createdAt; + } + + + public FaxResponseFax from(String from) { + this.from = from; + return this; + } + + /** + * Fax Sender Email + * @return from + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_FROM) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getFrom() { + return from; + } + + + @JsonProperty(JSON_PROPERTY_FROM) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setFrom(String from) { + this.from = from; + } + + + public FaxResponseFax transmissions(List transmissions) { + this.transmissions = transmissions; + return this; + } + + public FaxResponseFax addTransmissionsItem(FaxResponseFaxTransmission transmissionsItem) { + if (this.transmissions == null) { + this.transmissions = new ArrayList<>(); + } + this.transmissions.add(transmissionsItem); + return this; + } + + /** + * Fax Transmissions List + * @return transmissions + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TRANSMISSIONS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getTransmissions() { + return transmissions; + } + + + @JsonProperty(JSON_PROPERTY_TRANSMISSIONS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTransmissions(List transmissions) { + this.transmissions = transmissions; + } + + + public FaxResponseFax filesUrl(String filesUrl) { + this.filesUrl = filesUrl; + return this; + } + + /** + * Fax Files URL + * @return filesUrl + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_FILES_URL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getFilesUrl() { + return filesUrl; + } + + + @JsonProperty(JSON_PROPERTY_FILES_URL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setFilesUrl(String filesUrl) { + this.filesUrl = filesUrl; + } + + + /** + * Return true if this FaxResponseFax object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + FaxResponseFax faxResponseFax = (FaxResponseFax) o; + return Objects.equals(this.faxId, faxResponseFax.faxId) && + Objects.equals(this.title, faxResponseFax.title) && + Objects.equals(this.originalTitle, faxResponseFax.originalTitle) && + Objects.equals(this.subject, faxResponseFax.subject) && + Objects.equals(this.message, faxResponseFax.message) && + Objects.equals(this.metadata, faxResponseFax.metadata) && + Objects.equals(this.createdAt, faxResponseFax.createdAt) && + Objects.equals(this.from, faxResponseFax.from) && + Objects.equals(this.transmissions, faxResponseFax.transmissions) && + Objects.equals(this.filesUrl, faxResponseFax.filesUrl); + } + + @Override + public int hashCode() { + return Objects.hash(faxId, title, originalTitle, subject, message, metadata, createdAt, from, transmissions, filesUrl); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class FaxResponseFax {\n"); + sb.append(" faxId: ").append(toIndentedString(faxId)).append("\n"); + sb.append(" title: ").append(toIndentedString(title)).append("\n"); + sb.append(" originalTitle: ").append(toIndentedString(originalTitle)).append("\n"); + sb.append(" subject: ").append(toIndentedString(subject)).append("\n"); + sb.append(" message: ").append(toIndentedString(message)).append("\n"); + sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); + sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); + sb.append(" from: ").append(toIndentedString(from)).append("\n"); + sb.append(" transmissions: ").append(toIndentedString(transmissions)).append("\n"); + sb.append(" filesUrl: ").append(toIndentedString(filesUrl)).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 (title != null) { + if (isFileTypeOrListOfFiles(title)) { + fileTypeFound = true; + } + + if (title.getClass().equals(java.io.File.class) || + title.getClass().equals(Integer.class) || + title.getClass().equals(String.class) || + title.getClass().isEnum()) { + map.put("title", title); + } else if (isListOfFile(title)) { + for(int i = 0; i< getListSize(title); i++) { + map.put("title[" + i + "]", getFromList(title, i)); + } + } + else { + map.put("title", JSON.getDefault().getMapper().writeValueAsString(title)); + } + } + if (originalTitle != null) { + if (isFileTypeOrListOfFiles(originalTitle)) { + fileTypeFound = true; + } + + if (originalTitle.getClass().equals(java.io.File.class) || + originalTitle.getClass().equals(Integer.class) || + originalTitle.getClass().equals(String.class) || + originalTitle.getClass().isEnum()) { + map.put("original_title", originalTitle); + } else if (isListOfFile(originalTitle)) { + for(int i = 0; i< getListSize(originalTitle); i++) { + map.put("original_title[" + i + "]", getFromList(originalTitle, i)); + } + } + else { + map.put("original_title", JSON.getDefault().getMapper().writeValueAsString(originalTitle)); + } + } + if (subject != null) { + if (isFileTypeOrListOfFiles(subject)) { + fileTypeFound = true; + } + + if (subject.getClass().equals(java.io.File.class) || + subject.getClass().equals(Integer.class) || + subject.getClass().equals(String.class) || + subject.getClass().isEnum()) { + map.put("subject", subject); + } else if (isListOfFile(subject)) { + for(int i = 0; i< getListSize(subject); i++) { + map.put("subject[" + i + "]", getFromList(subject, i)); + } + } + else { + map.put("subject", JSON.getDefault().getMapper().writeValueAsString(subject)); + } + } + if (message != null) { + if (isFileTypeOrListOfFiles(message)) { + fileTypeFound = true; + } + + if (message.getClass().equals(java.io.File.class) || + message.getClass().equals(Integer.class) || + message.getClass().equals(String.class) || + message.getClass().isEnum()) { + map.put("message", message); + } else if (isListOfFile(message)) { + for(int i = 0; i< getListSize(message); i++) { + map.put("message[" + i + "]", getFromList(message, i)); + } + } + else { + map.put("message", JSON.getDefault().getMapper().writeValueAsString(message)); + } + } + if (metadata != null) { + if (isFileTypeOrListOfFiles(metadata)) { + fileTypeFound = true; + } + + if (metadata.getClass().equals(java.io.File.class) || + metadata.getClass().equals(Integer.class) || + metadata.getClass().equals(String.class) || + metadata.getClass().isEnum()) { + map.put("metadata", metadata); + } else if (isListOfFile(metadata)) { + for(int i = 0; i< getListSize(metadata); i++) { + map.put("metadata[" + i + "]", getFromList(metadata, i)); + } + } + else { + map.put("metadata", JSON.getDefault().getMapper().writeValueAsString(metadata)); + } + } + if (createdAt != null) { + if (isFileTypeOrListOfFiles(createdAt)) { + fileTypeFound = true; + } + + if (createdAt.getClass().equals(java.io.File.class) || + createdAt.getClass().equals(Integer.class) || + createdAt.getClass().equals(String.class) || + createdAt.getClass().isEnum()) { + map.put("created_at", createdAt); + } else if (isListOfFile(createdAt)) { + for(int i = 0; i< getListSize(createdAt); i++) { + map.put("created_at[" + i + "]", getFromList(createdAt, i)); + } + } + else { + map.put("created_at", JSON.getDefault().getMapper().writeValueAsString(createdAt)); + } + } + if (from != null) { + if (isFileTypeOrListOfFiles(from)) { + fileTypeFound = true; + } + + if (from.getClass().equals(java.io.File.class) || + from.getClass().equals(Integer.class) || + from.getClass().equals(String.class) || + from.getClass().isEnum()) { + map.put("from", from); + } else if (isListOfFile(from)) { + for(int i = 0; i< getListSize(from); i++) { + map.put("from[" + i + "]", getFromList(from, i)); + } + } + else { + map.put("from", JSON.getDefault().getMapper().writeValueAsString(from)); + } + } + if (transmissions != null) { + if (isFileTypeOrListOfFiles(transmissions)) { + fileTypeFound = true; + } + + if (transmissions.getClass().equals(java.io.File.class) || + transmissions.getClass().equals(Integer.class) || + transmissions.getClass().equals(String.class) || + transmissions.getClass().isEnum()) { + map.put("transmissions", transmissions); + } else if (isListOfFile(transmissions)) { + for(int i = 0; i< getListSize(transmissions); i++) { + map.put("transmissions[" + i + "]", getFromList(transmissions, i)); + } + } + else { + map.put("transmissions", JSON.getDefault().getMapper().writeValueAsString(transmissions)); + } + } + if (filesUrl != null) { + if (isFileTypeOrListOfFiles(filesUrl)) { + fileTypeFound = true; + } + + if (filesUrl.getClass().equals(java.io.File.class) || + filesUrl.getClass().equals(Integer.class) || + filesUrl.getClass().equals(String.class) || + filesUrl.getClass().isEnum()) { + map.put("files_url", filesUrl); + } else if (isListOfFile(filesUrl)) { + for(int i = 0; i< getListSize(filesUrl); i++) { + map.put("files_url[" + i + "]", getFromList(filesUrl, i)); + } + } + else { + map.put("files_url", JSON.getDefault().getMapper().writeValueAsString(filesUrl)); + } + } + } 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/FaxResponseFaxTransmission.java b/sdks/java-v2/src/main/java/com/dropbox/sign/model/FaxResponseFaxTransmission.java new file mode 100644 index 000000000..09027a786 --- /dev/null +++ b/sdks/java-v2/src/main/java/com/dropbox/sign/model/FaxResponseFaxTransmission.java @@ -0,0 +1,328 @@ +/* + * 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; +/** + * FaxResponseFaxTransmission + */ +@JsonPropertyOrder({ + FaxResponseFaxTransmission.JSON_PROPERTY_RECIPIENT, + FaxResponseFaxTransmission.JSON_PROPERTY_SENDER, + FaxResponseFaxTransmission.JSON_PROPERTY_STATUS_CODE, + FaxResponseFaxTransmission.JSON_PROPERTY_SENT_AT +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") +@JsonIgnoreProperties(ignoreUnknown=true) +public class FaxResponseFaxTransmission { + public static final String JSON_PROPERTY_RECIPIENT = "recipient"; + private String recipient; + + public static final String JSON_PROPERTY_SENDER = "sender"; + private String sender; + + public static final String JSON_PROPERTY_STATUS_CODE = "status_code"; + private String statusCode; + + public static final String JSON_PROPERTY_SENT_AT = "sent_at"; + private Integer sentAt; + + public FaxResponseFaxTransmission() { + } + + /** + * Attempt to instantiate and hydrate a new instance of this class + * @param jsonData String of JSON data representing target object + */ + static public FaxResponseFaxTransmission init(String jsonData) throws Exception { + return new ObjectMapper().readValue(jsonData, FaxResponseFaxTransmission.class); + } + + static public FaxResponseFaxTransmission init(HashMap data) throws Exception { + return new ObjectMapper().readValue( + new ObjectMapper().writeValueAsString(data), + FaxResponseFaxTransmission.class + ); + } + + public FaxResponseFaxTransmission recipient(String recipient) { + this.recipient = recipient; + return this; + } + + /** + * Fax Transmission Recipient + * @return recipient + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_RECIPIENT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getRecipient() { + return recipient; + } + + + @JsonProperty(JSON_PROPERTY_RECIPIENT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setRecipient(String recipient) { + this.recipient = recipient; + } + + + public FaxResponseFaxTransmission sender(String sender) { + this.sender = sender; + return this; + } + + /** + * Fax Transmission Sender + * @return sender + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SENDER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getSender() { + return sender; + } + + + @JsonProperty(JSON_PROPERTY_SENDER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSender(String sender) { + this.sender = sender; + } + + + public FaxResponseFaxTransmission statusCode(String statusCode) { + this.statusCode = statusCode; + return this; + } + + /** + * Fax Transmission Status Code + * @return statusCode + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_STATUS_CODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getStatusCode() { + return statusCode; + } + + + @JsonProperty(JSON_PROPERTY_STATUS_CODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setStatusCode(String statusCode) { + this.statusCode = statusCode; + } + + + public FaxResponseFaxTransmission sentAt(Integer sentAt) { + this.sentAt = sentAt; + return this; + } + + /** + * Fax Transmission Sent Timestamp + * @return sentAt + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SENT_AT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Integer getSentAt() { + return sentAt; + } + + + @JsonProperty(JSON_PROPERTY_SENT_AT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSentAt(Integer sentAt) { + this.sentAt = sentAt; + } + + + /** + * Return true if this FaxResponseFaxTransmission object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + FaxResponseFaxTransmission faxResponseFaxTransmission = (FaxResponseFaxTransmission) o; + return Objects.equals(this.recipient, faxResponseFaxTransmission.recipient) && + Objects.equals(this.sender, faxResponseFaxTransmission.sender) && + Objects.equals(this.statusCode, faxResponseFaxTransmission.statusCode) && + Objects.equals(this.sentAt, faxResponseFaxTransmission.sentAt); + } + + @Override + public int hashCode() { + return Objects.hash(recipient, sender, statusCode, sentAt); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class FaxResponseFaxTransmission {\n"); + sb.append(" recipient: ").append(toIndentedString(recipient)).append("\n"); + sb.append(" sender: ").append(toIndentedString(sender)).append("\n"); + sb.append(" statusCode: ").append(toIndentedString(statusCode)).append("\n"); + sb.append(" sentAt: ").append(toIndentedString(sentAt)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public Map createFormData() throws ApiException { + Map map = new HashMap<>(); + boolean fileTypeFound = false; + try { + if (recipient != null) { + if (isFileTypeOrListOfFiles(recipient)) { + fileTypeFound = true; + } + + if (recipient.getClass().equals(java.io.File.class) || + recipient.getClass().equals(Integer.class) || + recipient.getClass().equals(String.class) || + recipient.getClass().isEnum()) { + map.put("recipient", recipient); + } else if (isListOfFile(recipient)) { + for(int i = 0; i< getListSize(recipient); i++) { + map.put("recipient[" + i + "]", getFromList(recipient, i)); + } + } + else { + map.put("recipient", JSON.getDefault().getMapper().writeValueAsString(recipient)); + } + } + if (sender != null) { + if (isFileTypeOrListOfFiles(sender)) { + fileTypeFound = true; + } + + if (sender.getClass().equals(java.io.File.class) || + sender.getClass().equals(Integer.class) || + sender.getClass().equals(String.class) || + sender.getClass().isEnum()) { + map.put("sender", sender); + } else if (isListOfFile(sender)) { + for(int i = 0; i< getListSize(sender); i++) { + map.put("sender[" + i + "]", getFromList(sender, i)); + } + } + else { + map.put("sender", JSON.getDefault().getMapper().writeValueAsString(sender)); + } + } + if (statusCode != null) { + if (isFileTypeOrListOfFiles(statusCode)) { + fileTypeFound = true; + } + + if (statusCode.getClass().equals(java.io.File.class) || + statusCode.getClass().equals(Integer.class) || + statusCode.getClass().equals(String.class) || + statusCode.getClass().isEnum()) { + map.put("status_code", statusCode); + } else if (isListOfFile(statusCode)) { + for(int i = 0; i< getListSize(statusCode); i++) { + map.put("status_code[" + i + "]", getFromList(statusCode, i)); + } + } + else { + map.put("status_code", JSON.getDefault().getMapper().writeValueAsString(statusCode)); + } + } + if (sentAt != null) { + if (isFileTypeOrListOfFiles(sentAt)) { + fileTypeFound = true; + } + + if (sentAt.getClass().equals(java.io.File.class) || + sentAt.getClass().equals(Integer.class) || + sentAt.getClass().equals(String.class) || + sentAt.getClass().isEnum()) { + map.put("sent_at", sentAt); + } else if (isListOfFile(sentAt)) { + for(int i = 0; i< getListSize(sentAt); i++) { + map.put("sent_at[" + i + "]", getFromList(sentAt, i)); + } + } + else { + map.put("sent_at", JSON.getDefault().getMapper().writeValueAsString(sentAt)); + } + } + } 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/FaxSendRequest.java b/sdks/java-v2/src/main/java/com/dropbox/sign/model/FaxSendRequest.java new file mode 100644 index 000000000..56e58dce7 --- /dev/null +++ b/sdks/java-v2/src/main/java/com/dropbox/sign/model/FaxSendRequest.java @@ -0,0 +1,655 @@ +/* + * 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.SubFile; +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; +/** + * FaxSendRequest + */ +@JsonPropertyOrder({ + FaxSendRequest.JSON_PROPERTY_TO, + FaxSendRequest.JSON_PROPERTY_FROM, + FaxSendRequest.JSON_PROPERTY_FILE, + FaxSendRequest.JSON_PROPERTY_FILE_URL, + FaxSendRequest.JSON_PROPERTY_FILE_URL_NAMES, + FaxSendRequest.JSON_PROPERTY_TEST_MODE, + FaxSendRequest.JSON_PROPERTY_COVER_PAGE_TO, + FaxSendRequest.JSON_PROPERTY_COVER_PAGE_FROM, + FaxSendRequest.JSON_PROPERTY_COVER_PAGE_MESSAGE, + FaxSendRequest.JSON_PROPERTY_TITLE +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") +@JsonIgnoreProperties(ignoreUnknown=true) +public class FaxSendRequest { + public static final String JSON_PROPERTY_TO = "to"; + private String to; + + public static final String JSON_PROPERTY_FROM = "from"; + private String from; + + public static final String JSON_PROPERTY_FILE = "file"; + private List _file = null; + + public static final String JSON_PROPERTY_FILE_URL = "file_url"; + private List fileUrl = null; + + public static final String JSON_PROPERTY_FILE_URL_NAMES = "file_url_names"; + private List fileUrlNames = null; + + public static final String JSON_PROPERTY_TEST_MODE = "test_mode"; + private Boolean testMode; + + public static final String JSON_PROPERTY_COVER_PAGE_TO = "cover_page_to"; + private String coverPageTo; + + public static final String JSON_PROPERTY_COVER_PAGE_FROM = "cover_page_from"; + private String coverPageFrom; + + public static final String JSON_PROPERTY_COVER_PAGE_MESSAGE = "cover_page_message"; + private String coverPageMessage; + + public static final String JSON_PROPERTY_TITLE = "title"; + private String title; + + public FaxSendRequest() { + } + + /** + * Attempt to instantiate and hydrate a new instance of this class + * @param jsonData String of JSON data representing target object + */ + static public FaxSendRequest init(String jsonData) throws Exception { + return new ObjectMapper().readValue(jsonData, FaxSendRequest.class); + } + + static public FaxSendRequest init(HashMap data) throws Exception { + return new ObjectMapper().readValue( + new ObjectMapper().writeValueAsString(data), + FaxSendRequest.class + ); + } + + public FaxSendRequest to(String to) { + this.to = to; + return this; + } + + /** + * Fax Send To Recipient + * @return to + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TO) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getTo() { + return to; + } + + + @JsonProperty(JSON_PROPERTY_TO) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTo(String to) { + this.to = to; + } + + + public FaxSendRequest from(String from) { + this.from = from; + return this; + } + + /** + * Fax Send From Sender (used only with fax number) + * @return from + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_FROM) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getFrom() { + return from; + } + + + @JsonProperty(JSON_PROPERTY_FROM) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setFrom(String from) { + this.from = from; + } + + + public FaxSendRequest _file(List _file) { + this._file = _file; + return this; + } + + public FaxSendRequest addFileItem(SubFile _fileItem) { + if (this._file == null) { + this._file = new ArrayList<>(); + } + this._file.add(_fileItem); + return this; + } + + /** + * Fax File to Send + * @return _file + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_FILE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getFile() { + return _file; + } + + + @JsonProperty(JSON_PROPERTY_FILE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setFile(List _file) { + this._file = _file; + } + + + public FaxSendRequest fileUrl(List fileUrl) { + this.fileUrl = fileUrl; + return this; + } + + public FaxSendRequest addFileUrlItem(String fileUrlItem) { + if (this.fileUrl == null) { + this.fileUrl = new ArrayList<>(); + } + this.fileUrl.add(fileUrlItem); + return this; + } + + /** + * Fax File URL to Send + * @return fileUrl + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_FILE_URL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getFileUrl() { + return fileUrl; + } + + + @JsonProperty(JSON_PROPERTY_FILE_URL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setFileUrl(List fileUrl) { + this.fileUrl = fileUrl; + } + + + public FaxSendRequest fileUrlNames(List fileUrlNames) { + this.fileUrlNames = fileUrlNames; + return this; + } + + public FaxSendRequest addFileUrlNamesItem(String fileUrlNamesItem) { + if (this.fileUrlNames == null) { + this.fileUrlNames = new ArrayList<>(); + } + this.fileUrlNames.add(fileUrlNamesItem); + return this; + } + + /** + * Fax File URL Names + * @return fileUrlNames + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_FILE_URL_NAMES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getFileUrlNames() { + return fileUrlNames; + } + + + @JsonProperty(JSON_PROPERTY_FILE_URL_NAMES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setFileUrlNames(List fileUrlNames) { + this.fileUrlNames = fileUrlNames; + } + + + public FaxSendRequest testMode(Boolean testMode) { + this.testMode = testMode; + return this; + } + + /** + * API Test Mode Setting + * @return testMode + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TEST_MODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Boolean getTestMode() { + return testMode; + } + + + @JsonProperty(JSON_PROPERTY_TEST_MODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTestMode(Boolean testMode) { + this.testMode = testMode; + } + + + public FaxSendRequest coverPageTo(String coverPageTo) { + this.coverPageTo = coverPageTo; + return this; + } + + /** + * Fax Cover Page for Recipient + * @return coverPageTo + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_COVER_PAGE_TO) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getCoverPageTo() { + return coverPageTo; + } + + + @JsonProperty(JSON_PROPERTY_COVER_PAGE_TO) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCoverPageTo(String coverPageTo) { + this.coverPageTo = coverPageTo; + } + + + public FaxSendRequest coverPageFrom(String coverPageFrom) { + this.coverPageFrom = coverPageFrom; + return this; + } + + /** + * Fax Cover Page for Sender + * @return coverPageFrom + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_COVER_PAGE_FROM) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getCoverPageFrom() { + return coverPageFrom; + } + + + @JsonProperty(JSON_PROPERTY_COVER_PAGE_FROM) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCoverPageFrom(String coverPageFrom) { + this.coverPageFrom = coverPageFrom; + } + + + public FaxSendRequest coverPageMessage(String coverPageMessage) { + this.coverPageMessage = coverPageMessage; + return this; + } + + /** + * Fax Cover Page Message + * @return coverPageMessage + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_COVER_PAGE_MESSAGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getCoverPageMessage() { + return coverPageMessage; + } + + + @JsonProperty(JSON_PROPERTY_COVER_PAGE_MESSAGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCoverPageMessage(String coverPageMessage) { + this.coverPageMessage = coverPageMessage; + } + + + public FaxSendRequest title(String title) { + this.title = title; + return this; + } + + /** + * Fax Title + * @return title + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TITLE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getTitle() { + return title; + } + + + @JsonProperty(JSON_PROPERTY_TITLE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTitle(String title) { + this.title = title; + } + + + /** + * Return true if this FaxSendRequest object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + FaxSendRequest faxSendRequest = (FaxSendRequest) o; + return Objects.equals(this.to, faxSendRequest.to) && + Objects.equals(this.from, faxSendRequest.from) && + Objects.equals(this._file, faxSendRequest._file) && + Objects.equals(this.fileUrl, faxSendRequest.fileUrl) && + Objects.equals(this.fileUrlNames, faxSendRequest.fileUrlNames) && + Objects.equals(this.testMode, faxSendRequest.testMode) && + Objects.equals(this.coverPageTo, faxSendRequest.coverPageTo) && + Objects.equals(this.coverPageFrom, faxSendRequest.coverPageFrom) && + Objects.equals(this.coverPageMessage, faxSendRequest.coverPageMessage) && + Objects.equals(this.title, faxSendRequest.title); + } + + @Override + public int hashCode() { + return Objects.hash(to, from, _file, fileUrl, fileUrlNames, testMode, coverPageTo, coverPageFrom, coverPageMessage, title); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class FaxSendRequest {\n"); + sb.append(" to: ").append(toIndentedString(to)).append("\n"); + sb.append(" from: ").append(toIndentedString(from)).append("\n"); + sb.append(" _file: ").append(toIndentedString(_file)).append("\n"); + sb.append(" fileUrl: ").append(toIndentedString(fileUrl)).append("\n"); + sb.append(" fileUrlNames: ").append(toIndentedString(fileUrlNames)).append("\n"); + sb.append(" testMode: ").append(toIndentedString(testMode)).append("\n"); + sb.append(" coverPageTo: ").append(toIndentedString(coverPageTo)).append("\n"); + sb.append(" coverPageFrom: ").append(toIndentedString(coverPageFrom)).append("\n"); + sb.append(" coverPageMessage: ").append(toIndentedString(coverPageMessage)).append("\n"); + sb.append(" title: ").append(toIndentedString(title)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public Map createFormData() throws ApiException { + Map map = new HashMap<>(); + boolean fileTypeFound = false; + try { + if (to != null) { + if (isFileTypeOrListOfFiles(to)) { + fileTypeFound = true; + } + + if (to.getClass().equals(java.io.File.class) || + to.getClass().equals(Integer.class) || + to.getClass().equals(String.class) || + to.getClass().isEnum()) { + map.put("to", to); + } else if (isListOfFile(to)) { + for(int i = 0; i< getListSize(to); i++) { + map.put("to[" + i + "]", getFromList(to, i)); + } + } + else { + map.put("to", JSON.getDefault().getMapper().writeValueAsString(to)); + } + } + if (from != null) { + if (isFileTypeOrListOfFiles(from)) { + fileTypeFound = true; + } + + if (from.getClass().equals(java.io.File.class) || + from.getClass().equals(Integer.class) || + from.getClass().equals(String.class) || + from.getClass().isEnum()) { + map.put("from", from); + } else if (isListOfFile(from)) { + for(int i = 0; i< getListSize(from); i++) { + map.put("from[" + i + "]", getFromList(from, i)); + } + } + else { + map.put("from", JSON.getDefault().getMapper().writeValueAsString(from)); + } + } + if (_file != null) { + if (isFileTypeOrListOfFiles(_file)) { + fileTypeFound = true; + } + + if (_file.getClass().equals(java.io.File.class) || + _file.getClass().equals(Integer.class) || + _file.getClass().equals(String.class) || + _file.getClass().isEnum()) { + map.put("file", _file); + } else if (isListOfFile(_file)) { + for(int i = 0; i< getListSize(_file); i++) { + map.put("file[" + i + "]", getFromList(_file, i)); + } + } + else { + map.put("file", JSON.getDefault().getMapper().writeValueAsString(_file)); + } + } + if (fileUrl != null) { + if (isFileTypeOrListOfFiles(fileUrl)) { + fileTypeFound = true; + } + + if (fileUrl.getClass().equals(java.io.File.class) || + fileUrl.getClass().equals(Integer.class) || + fileUrl.getClass().equals(String.class) || + fileUrl.getClass().isEnum()) { + map.put("file_url", fileUrl); + } else if (isListOfFile(fileUrl)) { + for(int i = 0; i< getListSize(fileUrl); i++) { + map.put("file_url[" + i + "]", getFromList(fileUrl, i)); + } + } + else { + map.put("file_url", JSON.getDefault().getMapper().writeValueAsString(fileUrl)); + } + } + if (fileUrlNames != null) { + if (isFileTypeOrListOfFiles(fileUrlNames)) { + fileTypeFound = true; + } + + if (fileUrlNames.getClass().equals(java.io.File.class) || + fileUrlNames.getClass().equals(Integer.class) || + fileUrlNames.getClass().equals(String.class) || + fileUrlNames.getClass().isEnum()) { + map.put("file_url_names", fileUrlNames); + } else if (isListOfFile(fileUrlNames)) { + for(int i = 0; i< getListSize(fileUrlNames); i++) { + map.put("file_url_names[" + i + "]", getFromList(fileUrlNames, i)); + } + } + else { + map.put("file_url_names", JSON.getDefault().getMapper().writeValueAsString(fileUrlNames)); + } + } + if (testMode != null) { + if (isFileTypeOrListOfFiles(testMode)) { + fileTypeFound = true; + } + + if (testMode.getClass().equals(java.io.File.class) || + testMode.getClass().equals(Integer.class) || + testMode.getClass().equals(String.class) || + testMode.getClass().isEnum()) { + map.put("test_mode", testMode); + } else if (isListOfFile(testMode)) { + for(int i = 0; i< getListSize(testMode); i++) { + map.put("test_mode[" + i + "]", getFromList(testMode, i)); + } + } + else { + map.put("test_mode", JSON.getDefault().getMapper().writeValueAsString(testMode)); + } + } + if (coverPageTo != null) { + if (isFileTypeOrListOfFiles(coverPageTo)) { + fileTypeFound = true; + } + + if (coverPageTo.getClass().equals(java.io.File.class) || + coverPageTo.getClass().equals(Integer.class) || + coverPageTo.getClass().equals(String.class) || + coverPageTo.getClass().isEnum()) { + map.put("cover_page_to", coverPageTo); + } else if (isListOfFile(coverPageTo)) { + for(int i = 0; i< getListSize(coverPageTo); i++) { + map.put("cover_page_to[" + i + "]", getFromList(coverPageTo, i)); + } + } + else { + map.put("cover_page_to", JSON.getDefault().getMapper().writeValueAsString(coverPageTo)); + } + } + if (coverPageFrom != null) { + if (isFileTypeOrListOfFiles(coverPageFrom)) { + fileTypeFound = true; + } + + if (coverPageFrom.getClass().equals(java.io.File.class) || + coverPageFrom.getClass().equals(Integer.class) || + coverPageFrom.getClass().equals(String.class) || + coverPageFrom.getClass().isEnum()) { + map.put("cover_page_from", coverPageFrom); + } else if (isListOfFile(coverPageFrom)) { + for(int i = 0; i< getListSize(coverPageFrom); i++) { + map.put("cover_page_from[" + i + "]", getFromList(coverPageFrom, i)); + } + } + else { + map.put("cover_page_from", JSON.getDefault().getMapper().writeValueAsString(coverPageFrom)); + } + } + if (coverPageMessage != null) { + if (isFileTypeOrListOfFiles(coverPageMessage)) { + fileTypeFound = true; + } + + if (coverPageMessage.getClass().equals(java.io.File.class) || + coverPageMessage.getClass().equals(Integer.class) || + coverPageMessage.getClass().equals(String.class) || + coverPageMessage.getClass().isEnum()) { + map.put("cover_page_message", coverPageMessage); + } else if (isListOfFile(coverPageMessage)) { + for(int i = 0; i< getListSize(coverPageMessage); i++) { + map.put("cover_page_message[" + i + "]", getFromList(coverPageMessage, i)); + } + } + else { + map.put("cover_page_message", JSON.getDefault().getMapper().writeValueAsString(coverPageMessage)); + } + } + if (title != null) { + if (isFileTypeOrListOfFiles(title)) { + fileTypeFound = true; + } + + if (title.getClass().equals(java.io.File.class) || + title.getClass().equals(Integer.class) || + title.getClass().equals(String.class) || + title.getClass().isEnum()) { + map.put("title", title); + } else if (isListOfFile(title)) { + for(int i = 0; i< getListSize(title); i++) { + map.put("title[" + i + "]", getFromList(title, i)); + } + } + else { + map.put("title", JSON.getDefault().getMapper().writeValueAsString(title)); + } + } + } catch (Exception e) { + throw new ApiException(e); + } + + return fileTypeFound ? map : new HashMap<>(); + } + + private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { + return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); + } + + private boolean isListOfFile(Object obj) throws Exception { + return obj instanceof java.util.List && !isListEmpty(obj) && getFromList(obj, 0) instanceof java.io.File; + } + + private boolean isListEmpty(Object obj) throws Exception { + return (boolean) Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); + } + + private Object getFromList(Object obj, int index) throws Exception { + return Class.forName(java.util.List.class.getName()).getMethod("get", int.class).invoke(obj, index); + } + + private int getListSize(Object obj) throws Exception { + return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/sdks/java-v2/src/main/java/com/dropbox/sign/model/SubFile.java b/sdks/java-v2/src/main/java/com/dropbox/sign/model/SubFile.java new file mode 100644 index 000000000..dc654fb2c --- /dev/null +++ b/sdks/java-v2/src/main/java/com/dropbox/sign/model/SubFile.java @@ -0,0 +1,178 @@ +/* + * 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; +/** + * Actual uploaded physical file + */ +@JsonPropertyOrder({ + SubFile.JSON_PROPERTY_NAME +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") +@JsonIgnoreProperties(ignoreUnknown=true) +public class SubFile { + public static final String JSON_PROPERTY_NAME = "name"; + private String name = ""; + + public SubFile() { + } + + /** + * Attempt to instantiate and hydrate a new instance of this class + * @param jsonData String of JSON data representing target object + */ + static public SubFile init(String jsonData) throws Exception { + return new ObjectMapper().readValue(jsonData, SubFile.class); + } + + static public SubFile init(HashMap data) throws Exception { + return new ObjectMapper().readValue( + new ObjectMapper().writeValueAsString(data), + SubFile.class + ); + } + + public SubFile name(String name) { + this.name = name; + return this; + } + + /** + * Actual physical uploaded file name that is derived during upload. Not settable parameter. + * @return name + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getName() { + return name; + } + + + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setName(String name) { + this.name = name; + } + + + /** + * Return true if this SubFile object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SubFile subFile = (SubFile) o; + return Objects.equals(this.name, subFile.name); + } + + @Override + public int hashCode() { + return Objects.hash(name); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SubFile {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public Map createFormData() throws ApiException { + Map map = new HashMap<>(); + boolean fileTypeFound = false; + try { + if (name != null) { + if (isFileTypeOrListOfFiles(name)) { + fileTypeFound = true; + } + + if (name.getClass().equals(java.io.File.class) || + name.getClass().equals(Integer.class) || + name.getClass().equals(String.class) || + name.getClass().isEnum()) { + map.put("name", name); + } else if (isListOfFile(name)) { + for(int i = 0; i< getListSize(name); i++) { + map.put("name[" + i + "]", getFromList(name, i)); + } + } + else { + map.put("name", JSON.getDefault().getMapper().writeValueAsString(name)); + } + } + } 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 4aca5d208..770e86178 100644 --- a/sdks/node/README.md +++ b/sdks/node/README.md @@ -120,6 +120,11 @@ All URIs are relative to *https://api.hellosign.com/v3* | *BulkSendJobApi* | [**bulkSendJobList**](./docs/api/BulkSendJobApi.md#bulksendjoblist) | **GET** /bulk_send_job/list | List Bulk Send Jobs | | *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* | [**deleteFax**](./docs/api/FaxApi.md#deletefax) | **DELETE** /fax/{fax_id} | Delete Fax | +| *FaxApi* | [**getFaxById**](./docs/api/FaxApi.md#getfaxbyid) | **GET** /fax/{fax_id} | Get Fax | +| *FaxApi* | [**getFaxFiles**](./docs/api/FaxApi.md#getfaxfiles) | **GET** /fax/files/{fax_id} | List Fax Files | +| *FaxApi* | [**listFaxes**](./docs/api/FaxApi.md#listfaxes) | **GET** /fax/list | Lists Faxes | +| *FaxApi* | [**sendFax**](./docs/api/FaxApi.md#sendfax) | **POST** /fax/send | Send Fax | | *FaxLineApi* | [**faxLineAddUser**](./docs/api/FaxLineApi.md#faxlineadduser) | **PUT** /fax_line/add_user | Add Fax Line User | | *FaxLineApi* | [**faxLineAreaCodeGet**](./docs/api/FaxLineApi.md#faxlineareacodeget) | **GET** /fax_line/area_codes | Get Available Fax Line Area Codes | | *FaxLineApi* | [**faxLineCreate**](./docs/api/FaxLineApi.md#faxlinecreate) | **POST** /fax_line/create | Purchase Fax Line | @@ -219,6 +224,11 @@ All URIs are relative to *https://api.hellosign.com/v3* - [FaxLineRemoveUserRequest](./docs/model/FaxLineRemoveUserRequest.md) - [FaxLineResponse](./docs/model/FaxLineResponse.md) - [FaxLineResponseFaxLine](./docs/model/FaxLineResponseFaxLine.md) +- [FaxListResponse](./docs/model/FaxListResponse.md) +- [FaxResponse](./docs/model/FaxResponse.md) +- [FaxResponseFax](./docs/model/FaxResponseFax.md) +- [FaxResponseFaxTransmission](./docs/model/FaxResponseFaxTransmission.md) +- [FaxSendRequest](./docs/model/FaxSendRequest.md) - [FileResponse](./docs/model/FileResponse.md) - [FileResponseDataUri](./docs/model/FileResponseDataUri.md) - [ListInfoResponse](./docs/model/ListInfoResponse.md) @@ -263,6 +273,7 @@ All URIs are relative to *https://api.hellosign.com/v3* - [SubCustomField](./docs/model/SubCustomField.md) - [SubEditorOptions](./docs/model/SubEditorOptions.md) - [SubFieldOptions](./docs/model/SubFieldOptions.md) +- [SubFile](./docs/model/SubFile.md) - [SubFormFieldGroup](./docs/model/SubFormFieldGroup.md) - [SubFormFieldRule](./docs/model/SubFormFieldRule.md) - [SubFormFieldRuleAction](./docs/model/SubFormFieldRuleAction.md) diff --git a/sdks/node/api/faxApi.ts b/sdks/node/api/faxApi.ts new file mode 100644 index 000000000..f50d12224 --- /dev/null +++ b/sdks/node/api/faxApi.ts @@ -0,0 +1,777 @@ +/** + * The MIT License (MIT) + * + * Copyright (C) 2023 dropbox.com + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +import axios, { AxiosError, AxiosRequestConfig, AxiosResponse } from "axios"; + +import { + Authentication, + FaxListResponse, + FaxResponse, + FaxSendRequest, + HttpBasicAuth, + HttpBearerAuth, + Interceptor, + ObjectSerializer, + VoidAuth, +} from "../model"; + +import { + generateFormData, + HttpError, + optionsI, + queryParamsSerializer, + returnTypeI, + returnTypeT, + toFormData, + USER_AGENT, +} from "./"; + +let defaultBasePath = "https://api.hellosign.com/v3"; + +// =============================================== +// This file is autogenerated - Please do not edit +// =============================================== + +export enum FaxApiApiKeys {} + +export class FaxApi { + protected _basePath = defaultBasePath; + protected _defaultHeaders: any = { "User-Agent": USER_AGENT }; + protected _useQuerystring: boolean = false; + + protected authentications = { + default: new VoidAuth(), + api_key: new HttpBasicAuth(), + oauth2: new HttpBearerAuth(), + }; + + protected interceptors: Interceptor[] = []; + + constructor(basePath?: string) { + if (basePath) { + this.basePath = basePath; + } + } + + set useQuerystring(value: boolean) { + this._useQuerystring = value; + } + + set basePath(basePath: string) { + this._basePath = basePath; + } + + set defaultHeaders(defaultHeaders: any) { + this._defaultHeaders = { ...defaultHeaders, "User-Agent": USER_AGENT }; + } + + get defaultHeaders() { + return this._defaultHeaders; + } + + get basePath() { + return this._basePath; + } + + public setDefaultAuthentication(auth: Authentication) { + this.authentications.default = auth; + } + + public setApiKey(key: string) { + this.authentications.api_key.username = key; + } + + set username(username: string) { + this.authentications.api_key.username = username; + } + + set password(password: string) { + this.authentications.api_key.password = password; + } + + set accessToken(accessToken: string | (() => string)) { + this.authentications.oauth2.accessToken = accessToken; + } + + public addInterceptor(interceptor: Interceptor) { + this.interceptors.push(interceptor); + } + + /** + * Deletes the specified Fax from the system. + * @summary Delete Fax + * @param faxId Fax ID + * @param options + */ + public async deleteFax( + faxId: string, + options: optionsI = { headers: {} } + ): Promise { + const localVarPath = + this.basePath + + "/fax/{fax_id}".replace( + "{" + "fax_id" + "}", + encodeURIComponent(String(faxId)) + ); + 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 'faxId' is not null or undefined + if (faxId === null || faxId === undefined) { + throw new Error( + "Required parameter faxId was null or undefined when calling deleteFax." + ); + } + + (Object).assign(localVarHeaderParams, options.headers); + + let localVarUseFormData = false; + + let localVarRequestOptions: AxiosRequestConfig = { + method: "DELETE", + params: localVarQueryParameters, + headers: localVarHeaderParams, + url: localVarPath, + paramsSerializer: this._useQuerystring + ? queryParamsSerializer + : undefined, + maxContentLength: Infinity, + maxBodyLength: Infinity, + responseType: "json", + }; + + let authenticationPromise = Promise.resolve(); + if (this.authentications.api_key.username) { + authenticationPromise = authenticationPromise.then(() => + this.authentications.api_key.applyToRequest(localVarRequestOptions) + ); + } + 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); + }, + (error: AxiosError) => { + if (error.response == null) { + reject(error); + return; + } + + if ( + handleErrorRangeResponse( + reject, + error.response, + "4XX", + "ErrorResponse" + ) + ) { + return; + } + + reject(error); + } + ); + }); + }); + } + /** + * Returns information about fax + * @summary Get Fax + * @param faxId Fax ID + * @param options + */ + public async getFaxById( + faxId: string, + options: optionsI = { headers: {} } + ): Promise> { + const localVarPath = + this.basePath + + "/fax/{fax_id}".replace( + "{" + "fax_id" + "}", + encodeURIComponent(String(faxId)) + ); + 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 'faxId' is not null or undefined + if (faxId === null || faxId === undefined) { + throw new Error( + "Required parameter faxId was null or undefined when calling getFaxById." + ); + } + + (Object).assign(localVarHeaderParams, options.headers); + + let localVarUseFormData = false; + + let localVarRequestOptions: AxiosRequestConfig = { + method: "GET", + params: localVarQueryParameters, + headers: localVarHeaderParams, + url: localVarPath, + paramsSerializer: this._useQuerystring + ? queryParamsSerializer + : undefined, + maxContentLength: Infinity, + maxBodyLength: Infinity, + responseType: "json", + }; + + let authenticationPromise = Promise.resolve(); + if (this.authentications.api_key.username) { + authenticationPromise = authenticationPromise.then(() => + this.authentications.api_key.applyToRequest(localVarRequestOptions) + ); + } + 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, + "FaxResponse" + ); + }, + (error: AxiosError) => { + if (error.response == null) { + reject(error); + return; + } + + if ( + handleErrorCodeResponse( + reject, + error.response, + 200, + "FaxResponse" + ) + ) { + return; + } + + if ( + handleErrorRangeResponse( + reject, + error.response, + "4XX", + "ErrorResponse" + ) + ) { + return; + } + + reject(error); + } + ); + }); + }); + } + /** + * Returns list of fax files + * @summary List Fax Files + * @param faxId Fax ID + * @param options + */ + public async getFaxFiles( + faxId: string, + options: optionsI = { headers: {} } + ): Promise { + const localVarPath = + this.basePath + + "/fax/files/{fax_id}".replace( + "{" + "fax_id" + "}", + encodeURIComponent(String(faxId)) + ); + 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 'faxId' is not null or undefined + if (faxId === null || faxId === undefined) { + throw new Error( + "Required parameter faxId was null or undefined when calling getFaxFiles." + ); + } + + (Object).assign(localVarHeaderParams, options.headers); + + let localVarUseFormData = false; + + let localVarRequestOptions: AxiosRequestConfig = { + method: "GET", + params: localVarQueryParameters, + headers: localVarHeaderParams, + url: localVarPath, + paramsSerializer: this._useQuerystring + ? queryParamsSerializer + : undefined, + maxContentLength: Infinity, + maxBodyLength: Infinity, + responseType: "json", + }; + + let authenticationPromise = Promise.resolve(); + if (this.authentications.api_key.username) { + authenticationPromise = authenticationPromise.then(() => + this.authentications.api_key.applyToRequest(localVarRequestOptions) + ); + } + 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); + }, + (error: AxiosError) => { + if (error.response == null) { + reject(error); + return; + } + + if ( + handleErrorRangeResponse( + reject, + error.response, + "4XX", + "ErrorResponse" + ) + ) { + return; + } + + reject(error); + } + ); + }); + }); + } + /** + * Returns properties of multiple faxes + * @summary Lists Faxes + * @param page Page + * @param pageSize Page size + * @param options + */ + public async listFaxes( + page: number, + pageSize: number, + options: optionsI = { headers: {} } + ): Promise> { + const localVarPath = this.basePath + "/fax/list"; + 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 'page' is not null or undefined + if (page === null || page === undefined) { + throw new Error( + "Required parameter page was null or undefined when calling listFaxes." + ); + } + + // verify required parameter 'pageSize' is not null or undefined + if (pageSize === null || pageSize === undefined) { + throw new Error( + "Required parameter pageSize was null or undefined when calling listFaxes." + ); + } + + if (page !== undefined) { + localVarQueryParameters["page"] = ObjectSerializer.serialize( + page, + "number" + ); + } + + if (pageSize !== undefined) { + localVarQueryParameters["page_size"] = ObjectSerializer.serialize( + pageSize, + "number" + ); + } + + (Object).assign(localVarHeaderParams, options.headers); + + let localVarUseFormData = false; + + let localVarRequestOptions: AxiosRequestConfig = { + method: "GET", + params: localVarQueryParameters, + headers: localVarHeaderParams, + url: localVarPath, + paramsSerializer: this._useQuerystring + ? queryParamsSerializer + : undefined, + maxContentLength: Infinity, + maxBodyLength: Infinity, + responseType: "json", + }; + + let authenticationPromise = Promise.resolve(); + if (this.authentications.api_key.username) { + authenticationPromise = authenticationPromise.then(() => + this.authentications.api_key.applyToRequest(localVarRequestOptions) + ); + } + 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, + "FaxListResponse" + ); + }, + (error: AxiosError) => { + if (error.response == null) { + reject(error); + return; + } + + if ( + handleErrorCodeResponse( + reject, + error.response, + 200, + "FaxListResponse" + ) + ) { + return; + } + + if ( + handleErrorRangeResponse( + reject, + error.response, + "4XX", + "ErrorResponse" + ) + ) { + return; + } + + reject(error); + } + ); + }); + }); + } + /** + * Action to prepare and send a fax + * @summary Send Fax + * @param faxSendRequest + * @param options + */ + public async sendFax( + faxSendRequest: FaxSendRequest, + options: optionsI = { headers: {} } + ): Promise> { + faxSendRequest = deserializeIfNeeded(faxSendRequest, "FaxSendRequest"); + const localVarPath = this.basePath + "/fax/send"; + 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 'faxSendRequest' is not null or undefined + if (faxSendRequest === null || faxSendRequest === undefined) { + throw new Error( + "Required parameter faxSendRequest was null or undefined when calling sendFax." + ); + } + + (Object).assign(localVarHeaderParams, options.headers); + + let localVarUseFormData = false; + + const result = generateFormData( + faxSendRequest, + FaxSendRequest.attributeTypeMap + ); + localVarUseFormData = result.localVarUseFormData; + + let data = {}; + if (localVarUseFormData) { + const formData = toFormData(result.data); + data = formData; + localVarHeaderParams = { + ...localVarHeaderParams, + ...formData.getHeaders(), + }; + } else { + data = ObjectSerializer.serialize(faxSendRequest, "FaxSendRequest"); + } + + 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, + "FaxResponse" + ); + }, + (error: AxiosError) => { + if (error.response == null) { + reject(error); + return; + } + + if ( + handleErrorCodeResponse( + reject, + error.response, + 200, + "FaxResponse" + ) + ) { + return; + } + + if ( + handleErrorRangeResponse( + reject, + error.response, + "4XX", + "ErrorResponse" + ) + ) { + return; + } + + reject(error); + } + ); + }); + }); + } +} + +function deserializeIfNeeded(obj: T, classname: string): T { + if (obj !== null && obj !== undefined && obj.constructor.name !== classname) { + return ObjectSerializer.deserialize(obj, classname); + } + + return obj; +} + +type AxiosResolve = ( + value: returnTypeT | PromiseLike> +) => void; + +type AxiosReject = (reason?: any) => void; + +function handleSuccessfulResponse( + resolve: AxiosResolve, + reject: AxiosReject, + response: AxiosResponse, + returnType?: string +) { + let body = response.data; + + if (response.status && response.status >= 200 && response.status <= 299) { + if (returnType) { + body = ObjectSerializer.deserialize(body, returnType); + } + + resolve({ response: response, body: body }); + } else { + reject(new HttpError(response, body, response.status)); + } +} + +function handleErrorCodeResponse( + reject: AxiosReject, + response: AxiosResponse, + code: number, + returnType: string +): boolean { + if (response.status !== code) { + return false; + } + + const body = ObjectSerializer.deserialize(response.data, returnType); + + reject(new HttpError(response, body, response.status)); + + return true; +} + +function handleErrorRangeResponse( + reject: AxiosReject, + response: AxiosResponse, + code: string, + returnType: string +): boolean { + let rangeCodeLeft = Number(code[0] + "00"); + let rangeCodeRight = Number(code[0] + "99"); + + if (response.status >= rangeCodeLeft && response.status <= rangeCodeRight) { + const body = ObjectSerializer.deserialize(response.data, returnType); + + reject(new HttpError(response, body, response.status)); + + return true; + } + + return false; +} diff --git a/sdks/node/api/index.ts b/sdks/node/api/index.ts index 1304b009a..d32b5b1b7 100644 --- a/sdks/node/api/index.ts +++ b/sdks/node/api/index.ts @@ -2,6 +2,7 @@ import { AccountApi } from "./accountApi"; import { ApiAppApi } from "./apiAppApi"; import { BulkSendJobApi } from "./bulkSendJobApi"; import { EmbeddedApi } from "./embeddedApi"; +import { FaxApi } from "./faxApi"; import { FaxLineApi } from "./faxLineApi"; import { OAuthApi } from "./oAuthApi"; import { ReportApi } from "./reportApi"; @@ -15,6 +16,7 @@ export { ApiAppApi, BulkSendJobApi, EmbeddedApi, + FaxApi, FaxLineApi, OAuthApi, ReportApi, @@ -40,6 +42,7 @@ export const APIS = [ ApiAppApi, BulkSendJobApi, EmbeddedApi, + FaxApi, FaxLineApi, OAuthApi, ReportApi, diff --git a/sdks/node/dist/api.js b/sdks/node/dist/api.js index 69fdca0c9..a151ce8b4 100644 --- a/sdks/node/dist/api.js +++ b/sdks/node/dist/api.js @@ -12976,6 +12976,7 @@ __export(api_exports, { EventCallbackRequest: () => EventCallbackRequest, EventCallbackRequestEvent: () => EventCallbackRequestEvent, EventCallbackRequestEventMetadata: () => EventCallbackRequestEventMetadata, + FaxApi: () => FaxApi, FaxLineAddUserRequest: () => FaxLineAddUserRequest, FaxLineApi: () => FaxLineApi, FaxLineAreaCodeGetCountryEnum: () => FaxLineAreaCodeGetCountryEnum, @@ -12988,6 +12989,11 @@ __export(api_exports, { FaxLineRemoveUserRequest: () => FaxLineRemoveUserRequest, FaxLineResponse: () => FaxLineResponse, FaxLineResponseFaxLine: () => FaxLineResponseFaxLine, + FaxListResponse: () => FaxListResponse, + FaxResponse: () => FaxResponse, + FaxResponseFax: () => FaxResponseFax, + FaxResponseFaxTransmission: () => FaxResponseFaxTransmission, + FaxSendRequest: () => FaxSendRequest, FileResponse: () => FileResponse, FileResponseDataUri: () => FileResponseDataUri, HttpBasicAuth: () => HttpBasicAuth, @@ -13040,6 +13046,7 @@ __export(api_exports, { SubCustomField: () => SubCustomField, SubEditorOptions: () => SubEditorOptions, SubFieldOptions: () => SubFieldOptions, + SubFile: () => SubFile, SubFormFieldGroup: () => SubFormFieldGroup, SubFormFieldRule: () => SubFormFieldRule, SubFormFieldRuleAction: () => SubFormFieldRuleAction, @@ -17999,6 +18006,216 @@ FaxLineResponseFaxLine.attributeTypeMap = [ } ]; +// model/faxListResponse.ts +var _FaxListResponse = class { + static getAttributeTypeMap() { + return _FaxListResponse.attributeTypeMap; + } + static init(data) { + return ObjectSerializer.deserialize(data, "FaxListResponse"); + } +}; +var FaxListResponse = _FaxListResponse; +FaxListResponse.discriminator = void 0; +FaxListResponse.attributeTypeMap = [ + { + name: "faxes", + baseName: "faxes", + type: "Array" + }, + { + name: "listInfo", + baseName: "list_info", + type: "ListInfoResponse" + } +]; + +// model/faxResponse.ts +var _FaxResponse = class { + static getAttributeTypeMap() { + return _FaxResponse.attributeTypeMap; + } + static init(data) { + return ObjectSerializer.deserialize(data, "FaxResponse"); + } +}; +var FaxResponse = _FaxResponse; +FaxResponse.discriminator = void 0; +FaxResponse.attributeTypeMap = [ + { + name: "fax", + baseName: "fax", + type: "FaxResponseFax" + }, + { + name: "warnings", + baseName: "warnings", + type: "WarningResponse" + } +]; + +// model/faxResponseFax.ts +var _FaxResponseFax = class { + static getAttributeTypeMap() { + return _FaxResponseFax.attributeTypeMap; + } + static init(data) { + return ObjectSerializer.deserialize(data, "FaxResponseFax"); + } +}; +var FaxResponseFax = _FaxResponseFax; +FaxResponseFax.discriminator = void 0; +FaxResponseFax.attributeTypeMap = [ + { + name: "faxId", + baseName: "fax_id", + type: "string" + }, + { + name: "title", + baseName: "title", + type: "string" + }, + { + name: "originalTitle", + baseName: "original_title", + type: "string" + }, + { + name: "subject", + baseName: "subject", + type: "string" + }, + { + name: "message", + baseName: "message", + type: "string" + }, + { + name: "metadata", + baseName: "metadata", + type: "object" + }, + { + name: "createdAt", + baseName: "created_at", + type: "number" + }, + { + name: "from", + baseName: "from", + type: "string" + }, + { + name: "transmissions", + baseName: "transmissions", + type: "Array" + }, + { + name: "filesUrl", + baseName: "files_url", + type: "string" + } +]; + +// model/faxResponseFaxTransmission.ts +var _FaxResponseFaxTransmission = class { + static getAttributeTypeMap() { + return _FaxResponseFaxTransmission.attributeTypeMap; + } + static init(data) { + return ObjectSerializer.deserialize(data, "FaxResponseFaxTransmission"); + } +}; +var FaxResponseFaxTransmission = _FaxResponseFaxTransmission; +FaxResponseFaxTransmission.discriminator = void 0; +FaxResponseFaxTransmission.attributeTypeMap = [ + { + name: "recipient", + baseName: "recipient", + type: "string" + }, + { + name: "sender", + baseName: "sender", + type: "string" + }, + { + name: "statusCode", + baseName: "status_code", + type: "string" + }, + { + name: "sentAt", + baseName: "sent_at", + type: "number" + } +]; + +// model/faxSendRequest.ts +var _FaxSendRequest = class { + static getAttributeTypeMap() { + return _FaxSendRequest.attributeTypeMap; + } + static init(data) { + return ObjectSerializer.deserialize(data, "FaxSendRequest"); + } +}; +var FaxSendRequest = _FaxSendRequest; +FaxSendRequest.discriminator = void 0; +FaxSendRequest.attributeTypeMap = [ + { + name: "to", + baseName: "to", + type: "string" + }, + { + name: "from", + baseName: "from", + type: "string" + }, + { + name: "file", + baseName: "file", + type: "Array" + }, + { + name: "fileUrl", + baseName: "file_url", + type: "Array" + }, + { + name: "fileUrlNames", + baseName: "file_url_names", + type: "Array" + }, + { + name: "testMode", + baseName: "test_mode", + type: "boolean" + }, + { + name: "coverPageTo", + baseName: "cover_page_to", + type: "string" + }, + { + name: "coverPageFrom", + baseName: "cover_page_from", + type: "string" + }, + { + name: "coverPageMessage", + baseName: "cover_page_message", + type: "string" + }, + { + name: "title", + baseName: "title", + type: "string" + } +]; + // model/fileResponse.ts var _FileResponse = class { static getAttributeTypeMap() { @@ -20244,6 +20461,28 @@ SubFieldOptions.attributeTypeMap = [ })(DateFormatEnum = SubFieldOptions2.DateFormatEnum || (SubFieldOptions2.DateFormatEnum = {})); })(SubFieldOptions || (SubFieldOptions = {})); +// model/subFile.ts +var _SubFile = class { + constructor() { + this["name"] = ""; + } + static getAttributeTypeMap() { + return _SubFile.attributeTypeMap; + } + static init(data) { + return ObjectSerializer.deserialize(data, "SubFile"); + } +}; +var SubFile = _SubFile; +SubFile.discriminator = void 0; +SubFile.attributeTypeMap = [ + { + name: "name", + baseName: "name", + type: "string" + } +]; + // model/subFormFieldGroup.ts var _SubFormFieldGroup = class { static getAttributeTypeMap() { @@ -24482,6 +24721,11 @@ var typeMap = { FaxLineRemoveUserRequest, FaxLineResponse, FaxLineResponseFaxLine, + FaxListResponse, + FaxResponse, + FaxResponseFax, + FaxResponseFaxTransmission, + FaxSendRequest, FileResponse, FileResponseDataUri, ListInfoResponse, @@ -24524,6 +24768,7 @@ var typeMap = { SubCustomField, SubEditorOptions, SubFieldOptions, + SubFile, SubFormFieldGroup, SubFormFieldRule, SubFormFieldRuleAction, @@ -26342,9 +26587,9 @@ function handleErrorRangeResponse4(reject, response, code, returnType) { return false; } -// api/faxLineApi.ts +// api/faxApi.ts var defaultBasePath5 = "https://api.hellosign.com/v3"; -var FaxLineApi = class { +var FaxApi = class { constructor(basePath) { this._basePath = defaultBasePath5; this._defaultHeaders = { "User-Agent": USER_AGENT }; @@ -26392,13 +26637,12 @@ var FaxLineApi = class { addInterceptor(interceptor) { this.interceptors.push(interceptor); } - faxLineAddUser(_0) { - return __async(this, arguments, function* (faxLineAddUserRequest, options = { headers: {} }) { - faxLineAddUserRequest = deserializeIfNeeded4( - faxLineAddUserRequest, - "FaxLineAddUserRequest" + deleteFax(_0) { + return __async(this, arguments, function* (faxId, options = { headers: {} }) { + const localVarPath = this.basePath + "/fax/{fax_id}".replace( + "{fax_id}", + encodeURIComponent(String(faxId)) ); - const localVarPath = this.basePath + "/fax_line/add_user"; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign( {}, @@ -26412,39 +26656,22 @@ var FaxLineApi = class { } let localVarFormParams = {}; let localVarBodyParams = void 0; - if (faxLineAddUserRequest === null || faxLineAddUserRequest === void 0) { + if (faxId === null || faxId === void 0) { throw new Error( - "Required parameter faxLineAddUserRequest was null or undefined when calling faxLineAddUser." + "Required parameter faxId was null or undefined when calling deleteFax." ); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; - const result = generateFormData( - faxLineAddUserRequest, - FaxLineAddUserRequest.attributeTypeMap - ); - localVarUseFormData = result.localVarUseFormData; - let data = {}; - if (localVarUseFormData) { - const formData2 = toFormData3(result.data); - data = formData2; - localVarHeaderParams = __spreadValues(__spreadValues({}, localVarHeaderParams), formData2.getHeaders()); - } else { - data = ObjectSerializer.serialize( - faxLineAddUserRequest, - "FaxLineAddUserRequest" - ); - } let localVarRequestOptions = { - method: "PUT", + method: "DELETE", params: localVarQueryParameters, headers: localVarHeaderParams, url: localVarPath, paramsSerializer: this._useQuerystring ? queryParamsSerializer : void 0, maxContentLength: Infinity, maxBodyLength: Infinity, - responseType: "json", - data + responseType: "json" }; let authenticationPromise = Promise.resolve(); if (this.authentications.api_key.username) { @@ -26465,26 +26692,13 @@ var FaxLineApi = class { return new Promise((resolve, reject) => { axios_default.request(localVarRequestOptions).then( (response) => { - handleSuccessfulResponse5( - resolve, - reject, - response, - "FaxLineResponse" - ); + handleSuccessfulResponse5(resolve, reject, response); }, (error) => { if (error.response == null) { reject(error); return; } - if (handleErrorCodeResponse5( - reject, - error.response, - 200, - "FaxLineResponse" - )) { - return; - } if (handleErrorRangeResponse5( reject, error.response, @@ -26500,9 +26714,12 @@ var FaxLineApi = class { }); }); } - faxLineAreaCodeGet(_0, _1, _2, _3) { - return __async(this, arguments, function* (country, state, province, city, options = { headers: {} }) { - const localVarPath = this.basePath + "/fax_line/area_codes"; + getFaxById(_0) { + return __async(this, arguments, function* (faxId, options = { headers: {} }) { + const localVarPath = this.basePath + "/fax/{fax_id}".replace( + "{fax_id}", + encodeURIComponent(String(faxId)) + ); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign( {}, @@ -26516,33 +26733,9 @@ var FaxLineApi = class { } let localVarFormParams = {}; let localVarBodyParams = void 0; - if (country === null || country === void 0) { + if (faxId === null || faxId === void 0) { throw new Error( - "Required parameter country was null or undefined when calling faxLineAreaCodeGet." - ); - } - if (country !== void 0) { - localVarQueryParameters["country"] = ObjectSerializer.serialize( - country, - "'CA' | 'US' | 'UK'" - ); - } - if (state !== void 0) { - localVarQueryParameters["state"] = ObjectSerializer.serialize( - state, - "'AK' | 'AL' | 'AR' | 'AZ' | 'CA' | 'CO' | 'CT' | 'DC' | 'DE' | 'FL' | 'GA' | 'HI' | 'IA' | 'ID' | 'IL' | 'IN' | 'KS' | 'KY' | 'LA' | 'MA' | 'MD' | 'ME' | 'MI' | 'MN' | 'MO' | 'MS' | 'MT' | 'NC' | 'ND' | 'NE' | 'NH' | 'NJ' | 'NM' | 'NV' | 'NY' | 'OH' | 'OK' | 'OR' | 'PA' | 'RI' | 'SC' | 'SD' | 'TN' | 'TX' | 'UT' | 'VA' | 'VT' | 'WA' | 'WI' | 'WV' | 'WY'" - ); - } - if (province !== void 0) { - localVarQueryParameters["province"] = ObjectSerializer.serialize( - province, - "'AB' | 'BC' | 'MB' | 'NB' | 'NL' | 'NT' | 'NS' | 'NU' | 'ON' | 'PE' | 'QC' | 'SK' | 'YT'" - ); - } - if (city !== void 0) { - localVarQueryParameters["city"] = ObjectSerializer.serialize( - city, - "string" + "Required parameter faxId was null or undefined when calling getFaxById." ); } Object.assign(localVarHeaderParams, options.headers); @@ -26573,33 +26766,622 @@ var FaxLineApi = class { ); } return interceptorPromise.then(() => { - return new Promise( - (resolve, reject) => { - axios_default.request(localVarRequestOptions).then( - (response) => { - handleSuccessfulResponse5( - resolve, - reject, - response, - "FaxLineAreaCodeGetResponse" - ); - }, - (error) => { - if (error.response == null) { - reject(error); - return; - } - if (handleErrorCodeResponse5( - reject, - error.response, - 200, - "FaxLineAreaCodeGetResponse" - )) { - return; - } - if (handleErrorRangeResponse5( - reject, - error.response, + return new Promise((resolve, reject) => { + axios_default.request(localVarRequestOptions).then( + (response) => { + handleSuccessfulResponse5( + resolve, + reject, + response, + "FaxResponse" + ); + }, + (error) => { + if (error.response == null) { + reject(error); + return; + } + if (handleErrorCodeResponse5( + reject, + error.response, + 200, + "FaxResponse" + )) { + return; + } + if (handleErrorRangeResponse5( + reject, + error.response, + "4XX", + "ErrorResponse" + )) { + return; + } + reject(error); + } + ); + }); + }); + }); + } + getFaxFiles(_0) { + return __async(this, arguments, function* (faxId, options = { headers: {} }) { + const localVarPath = this.basePath + "/fax/files/{fax_id}".replace( + "{fax_id}", + encodeURIComponent(String(faxId)) + ); + 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 (faxId === null || faxId === void 0) { + throw new Error( + "Required parameter faxId was null or undefined when calling getFaxFiles." + ); + } + Object.assign(localVarHeaderParams, options.headers); + let localVarUseFormData = false; + let localVarRequestOptions = { + method: "GET", + params: localVarQueryParameters, + headers: localVarHeaderParams, + url: localVarPath, + paramsSerializer: this._useQuerystring ? queryParamsSerializer : void 0, + maxContentLength: Infinity, + maxBodyLength: Infinity, + responseType: "json" + }; + let authenticationPromise = Promise.resolve(); + if (this.authentications.api_key.username) { + authenticationPromise = authenticationPromise.then( + () => this.authentications.api_key.applyToRequest(localVarRequestOptions) + ); + } + 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); + }, + (error) => { + if (error.response == null) { + reject(error); + return; + } + if (handleErrorRangeResponse5( + reject, + error.response, + "4XX", + "ErrorResponse" + )) { + return; + } + reject(error); + } + ); + }); + }); + }); + } + listFaxes(_0, _1) { + return __async(this, arguments, function* (page, pageSize, options = { headers: {} }) { + const localVarPath = this.basePath + "/fax/list"; + 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 (page === null || page === void 0) { + throw new Error( + "Required parameter page was null or undefined when calling listFaxes." + ); + } + if (pageSize === null || pageSize === void 0) { + throw new Error( + "Required parameter pageSize was null or undefined when calling listFaxes." + ); + } + if (page !== void 0) { + localVarQueryParameters["page"] = ObjectSerializer.serialize( + page, + "number" + ); + } + if (pageSize !== void 0) { + localVarQueryParameters["page_size"] = ObjectSerializer.serialize( + pageSize, + "number" + ); + } + Object.assign(localVarHeaderParams, options.headers); + let localVarUseFormData = false; + let localVarRequestOptions = { + method: "GET", + params: localVarQueryParameters, + headers: localVarHeaderParams, + url: localVarPath, + paramsSerializer: this._useQuerystring ? queryParamsSerializer : void 0, + maxContentLength: Infinity, + maxBodyLength: Infinity, + responseType: "json" + }; + let authenticationPromise = Promise.resolve(); + if (this.authentications.api_key.username) { + authenticationPromise = authenticationPromise.then( + () => this.authentications.api_key.applyToRequest(localVarRequestOptions) + ); + } + 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, + "FaxListResponse" + ); + }, + (error) => { + if (error.response == null) { + reject(error); + return; + } + if (handleErrorCodeResponse5( + reject, + error.response, + 200, + "FaxListResponse" + )) { + return; + } + if (handleErrorRangeResponse5( + reject, + error.response, + "4XX", + "ErrorResponse" + )) { + return; + } + reject(error); + } + ); + }); + }); + }); + } + sendFax(_0) { + return __async(this, arguments, function* (faxSendRequest, options = { headers: {} }) { + faxSendRequest = deserializeIfNeeded4(faxSendRequest, "FaxSendRequest"); + const localVarPath = this.basePath + "/fax/send"; + 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 (faxSendRequest === null || faxSendRequest === void 0) { + throw new Error( + "Required parameter faxSendRequest was null or undefined when calling sendFax." + ); + } + Object.assign(localVarHeaderParams, options.headers); + let localVarUseFormData = false; + const result = generateFormData( + faxSendRequest, + FaxSendRequest.attributeTypeMap + ); + localVarUseFormData = result.localVarUseFormData; + let data = {}; + if (localVarUseFormData) { + const formData2 = toFormData3(result.data); + data = formData2; + localVarHeaderParams = __spreadValues(__spreadValues({}, localVarHeaderParams), formData2.getHeaders()); + } else { + data = ObjectSerializer.serialize(faxSendRequest, "FaxSendRequest"); + } + 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, + "FaxResponse" + ); + }, + (error) => { + if (error.response == null) { + reject(error); + return; + } + if (handleErrorCodeResponse5( + reject, + error.response, + 200, + "FaxResponse" + )) { + return; + } + if (handleErrorRangeResponse5( + reject, + error.response, + "4XX", + "ErrorResponse" + )) { + return; + } + reject(error); + } + ); + }); + }); + }); + } +}; +function deserializeIfNeeded4(obj, classname) { + if (obj !== null && obj !== void 0 && obj.constructor.name !== classname) { + return ObjectSerializer.deserialize(obj, classname); + } + return obj; +} +function handleSuccessfulResponse5(resolve, reject, response, returnType) { + let body = response.data; + if (response.status && response.status >= 200 && response.status <= 299) { + if (returnType) { + body = ObjectSerializer.deserialize(body, returnType); + } + resolve({ response, body }); + } else { + reject(new HttpError(response, body, response.status)); + } +} +function handleErrorCodeResponse5(reject, response, code, returnType) { + if (response.status !== code) { + return false; + } + const body = ObjectSerializer.deserialize(response.data, returnType); + reject(new HttpError(response, body, response.status)); + return true; +} +function handleErrorRangeResponse5(reject, response, code, returnType) { + let rangeCodeLeft = Number(code[0] + "00"); + let rangeCodeRight = Number(code[0] + "99"); + if (response.status >= rangeCodeLeft && response.status <= rangeCodeRight) { + const body = ObjectSerializer.deserialize(response.data, returnType); + reject(new HttpError(response, body, response.status)); + return true; + } + return false; +} + +// api/faxLineApi.ts +var defaultBasePath6 = "https://api.hellosign.com/v3"; +var FaxLineApi = class { + constructor(basePath) { + this._basePath = defaultBasePath6; + this._defaultHeaders = { "User-Agent": USER_AGENT }; + this._useQuerystring = false; + this.authentications = { + default: new VoidAuth(), + api_key: new HttpBasicAuth(), + oauth2: new HttpBearerAuth() + }; + this.interceptors = []; + if (basePath) { + this.basePath = basePath; + } + } + set useQuerystring(value) { + this._useQuerystring = value; + } + set basePath(basePath) { + this._basePath = basePath; + } + set defaultHeaders(defaultHeaders) { + this._defaultHeaders = __spreadProps(__spreadValues({}, defaultHeaders), { "User-Agent": USER_AGENT }); + } + get defaultHeaders() { + return this._defaultHeaders; + } + get basePath() { + return this._basePath; + } + setDefaultAuthentication(auth) { + this.authentications.default = auth; + } + setApiKey(key) { + this.authentications.api_key.username = key; + } + set username(username) { + this.authentications.api_key.username = username; + } + set password(password) { + this.authentications.api_key.password = password; + } + set accessToken(accessToken) { + this.authentications.oauth2.accessToken = accessToken; + } + addInterceptor(interceptor) { + this.interceptors.push(interceptor); + } + faxLineAddUser(_0) { + return __async(this, arguments, function* (faxLineAddUserRequest, options = { headers: {} }) { + faxLineAddUserRequest = deserializeIfNeeded5( + faxLineAddUserRequest, + "FaxLineAddUserRequest" + ); + const localVarPath = this.basePath + "/fax_line/add_user"; + 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 (faxLineAddUserRequest === null || faxLineAddUserRequest === void 0) { + throw new Error( + "Required parameter faxLineAddUserRequest was null or undefined when calling faxLineAddUser." + ); + } + Object.assign(localVarHeaderParams, options.headers); + let localVarUseFormData = false; + const result = generateFormData( + faxLineAddUserRequest, + FaxLineAddUserRequest.attributeTypeMap + ); + localVarUseFormData = result.localVarUseFormData; + let data = {}; + if (localVarUseFormData) { + const formData2 = toFormData3(result.data); + data = formData2; + localVarHeaderParams = __spreadValues(__spreadValues({}, localVarHeaderParams), formData2.getHeaders()); + } else { + data = ObjectSerializer.serialize( + faxLineAddUserRequest, + "FaxLineAddUserRequest" + ); + } + let localVarRequestOptions = { + method: "PUT", + 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) => { + handleSuccessfulResponse6( + resolve, + reject, + response, + "FaxLineResponse" + ); + }, + (error) => { + if (error.response == null) { + reject(error); + return; + } + if (handleErrorCodeResponse6( + reject, + error.response, + 200, + "FaxLineResponse" + )) { + return; + } + if (handleErrorRangeResponse6( + reject, + error.response, + "4XX", + "ErrorResponse" + )) { + return; + } + reject(error); + } + ); + }); + }); + }); + } + faxLineAreaCodeGet(_0, _1, _2, _3) { + return __async(this, arguments, function* (country, state, province, city, options = { headers: {} }) { + const localVarPath = this.basePath + "/fax_line/area_codes"; + 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 (country === null || country === void 0) { + throw new Error( + "Required parameter country was null or undefined when calling faxLineAreaCodeGet." + ); + } + if (country !== void 0) { + localVarQueryParameters["country"] = ObjectSerializer.serialize( + country, + "'CA' | 'US' | 'UK'" + ); + } + if (state !== void 0) { + localVarQueryParameters["state"] = ObjectSerializer.serialize( + state, + "'AK' | 'AL' | 'AR' | 'AZ' | 'CA' | 'CO' | 'CT' | 'DC' | 'DE' | 'FL' | 'GA' | 'HI' | 'IA' | 'ID' | 'IL' | 'IN' | 'KS' | 'KY' | 'LA' | 'MA' | 'MD' | 'ME' | 'MI' | 'MN' | 'MO' | 'MS' | 'MT' | 'NC' | 'ND' | 'NE' | 'NH' | 'NJ' | 'NM' | 'NV' | 'NY' | 'OH' | 'OK' | 'OR' | 'PA' | 'RI' | 'SC' | 'SD' | 'TN' | 'TX' | 'UT' | 'VA' | 'VT' | 'WA' | 'WI' | 'WV' | 'WY'" + ); + } + if (province !== void 0) { + localVarQueryParameters["province"] = ObjectSerializer.serialize( + province, + "'AB' | 'BC' | 'MB' | 'NB' | 'NL' | 'NT' | 'NS' | 'NU' | 'ON' | 'PE' | 'QC' | 'SK' | 'YT'" + ); + } + if (city !== void 0) { + localVarQueryParameters["city"] = ObjectSerializer.serialize( + city, + "string" + ); + } + Object.assign(localVarHeaderParams, options.headers); + let localVarUseFormData = false; + let localVarRequestOptions = { + method: "GET", + params: localVarQueryParameters, + headers: localVarHeaderParams, + url: localVarPath, + paramsSerializer: this._useQuerystring ? queryParamsSerializer : void 0, + maxContentLength: Infinity, + maxBodyLength: Infinity, + responseType: "json" + }; + let authenticationPromise = Promise.resolve(); + if (this.authentications.api_key.username) { + authenticationPromise = authenticationPromise.then( + () => this.authentications.api_key.applyToRequest(localVarRequestOptions) + ); + } + 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) => { + handleSuccessfulResponse6( + resolve, + reject, + response, + "FaxLineAreaCodeGetResponse" + ); + }, + (error) => { + if (error.response == null) { + reject(error); + return; + } + if (handleErrorCodeResponse6( + reject, + error.response, + 200, + "FaxLineAreaCodeGetResponse" + )) { + return; + } + if (handleErrorRangeResponse6( + reject, + error.response, "4XX", "ErrorResponse" )) { @@ -26615,7 +27397,7 @@ var FaxLineApi = class { } faxLineCreate(_0) { return __async(this, arguments, function* (faxLineCreateRequest, options = { headers: {} }) { - faxLineCreateRequest = deserializeIfNeeded4( + faxLineCreateRequest = deserializeIfNeeded5( faxLineCreateRequest, "FaxLineCreateRequest" ); @@ -26686,7 +27468,7 @@ var FaxLineApi = class { return new Promise((resolve, reject) => { axios_default.request(localVarRequestOptions).then( (response) => { - handleSuccessfulResponse5( + handleSuccessfulResponse6( resolve, reject, response, @@ -26698,7 +27480,7 @@ var FaxLineApi = class { reject(error); return; } - if (handleErrorCodeResponse5( + if (handleErrorCodeResponse6( reject, error.response, 200, @@ -26706,7 +27488,7 @@ var FaxLineApi = class { )) { return; } - if (handleErrorRangeResponse5( + if (handleErrorRangeResponse6( reject, error.response, "4XX", @@ -26723,7 +27505,7 @@ var FaxLineApi = class { } faxLineDelete(_0) { return __async(this, arguments, function* (faxLineDeleteRequest, options = { headers: {} }) { - faxLineDeleteRequest = deserializeIfNeeded4( + faxLineDeleteRequest = deserializeIfNeeded5( faxLineDeleteRequest, "FaxLineDeleteRequest" ); @@ -26794,14 +27576,14 @@ var FaxLineApi = class { return new Promise((resolve, reject) => { axios_default.request(localVarRequestOptions).then( (response) => { - handleSuccessfulResponse5(resolve, reject, response); + handleSuccessfulResponse6(resolve, reject, response); }, (error) => { if (error.response == null) { reject(error); return; } - if (handleErrorRangeResponse5( + if (handleErrorRangeResponse6( reject, error.response, "4XX", @@ -26874,7 +27656,7 @@ var FaxLineApi = class { return new Promise((resolve, reject) => { axios_default.request(localVarRequestOptions).then( (response) => { - handleSuccessfulResponse5( + handleSuccessfulResponse6( resolve, reject, response, @@ -26886,7 +27668,7 @@ var FaxLineApi = class { reject(error); return; } - if (handleErrorCodeResponse5( + if (handleErrorCodeResponse6( reject, error.response, 200, @@ -26894,7 +27676,7 @@ var FaxLineApi = class { )) { return; } - if (handleErrorRangeResponse5( + if (handleErrorRangeResponse6( reject, error.response, "4XX", @@ -26981,7 +27763,7 @@ var FaxLineApi = class { (resolve, reject) => { axios_default.request(localVarRequestOptions).then( (response) => { - handleSuccessfulResponse5( + handleSuccessfulResponse6( resolve, reject, response, @@ -26993,7 +27775,7 @@ var FaxLineApi = class { reject(error); return; } - if (handleErrorCodeResponse5( + if (handleErrorCodeResponse6( reject, error.response, 200, @@ -27001,7 +27783,7 @@ var FaxLineApi = class { )) { return; } - if (handleErrorRangeResponse5( + if (handleErrorRangeResponse6( reject, error.response, "4XX", @@ -27019,7 +27801,7 @@ var FaxLineApi = class { } faxLineRemoveUser(_0) { return __async(this, arguments, function* (faxLineRemoveUserRequest, options = { headers: {} }) { - faxLineRemoveUserRequest = deserializeIfNeeded4( + faxLineRemoveUserRequest = deserializeIfNeeded5( faxLineRemoveUserRequest, "FaxLineRemoveUserRequest" ); @@ -27090,7 +27872,7 @@ var FaxLineApi = class { return new Promise((resolve, reject) => { axios_default.request(localVarRequestOptions).then( (response) => { - handleSuccessfulResponse5( + handleSuccessfulResponse6( resolve, reject, response, @@ -27102,7 +27884,7 @@ var FaxLineApi = class { reject(error); return; } - if (handleErrorCodeResponse5( + if (handleErrorCodeResponse6( reject, error.response, 200, @@ -27110,7 +27892,7 @@ var FaxLineApi = class { )) { return; } - if (handleErrorRangeResponse5( + if (handleErrorRangeResponse6( reject, error.response, "4XX", @@ -27126,13 +27908,13 @@ var FaxLineApi = class { }); } }; -function deserializeIfNeeded4(obj, classname) { +function deserializeIfNeeded5(obj, classname) { if (obj !== null && obj !== void 0 && obj.constructor.name !== classname) { return ObjectSerializer.deserialize(obj, classname); } return obj; } -function handleSuccessfulResponse5(resolve, reject, response, returnType) { +function handleSuccessfulResponse6(resolve, reject, response, returnType) { let body = response.data; if (response.status && response.status >= 200 && response.status <= 299) { if (returnType) { @@ -27143,7 +27925,7 @@ function handleSuccessfulResponse5(resolve, reject, response, returnType) { reject(new HttpError(response, body, response.status)); } } -function handleErrorCodeResponse5(reject, response, code, returnType) { +function handleErrorCodeResponse6(reject, response, code, returnType) { if (response.status !== code) { return false; } @@ -27151,7 +27933,7 @@ function handleErrorCodeResponse5(reject, response, code, returnType) { reject(new HttpError(response, body, response.status)); return true; } -function handleErrorRangeResponse5(reject, response, code, returnType) { +function handleErrorRangeResponse6(reject, response, code, returnType) { let rangeCodeLeft = Number(code[0] + "00"); let rangeCodeRight = Number(code[0] + "99"); if (response.status >= rangeCodeLeft && response.status <= rangeCodeRight) { @@ -27163,10 +27945,10 @@ function handleErrorRangeResponse5(reject, response, code, returnType) { } // api/oAuthApi.ts -var defaultBasePath6 = "https://app.hellosign.com"; +var defaultBasePath7 = "https://app.hellosign.com"; var OAuthApi = class { constructor(basePath) { - this._basePath = defaultBasePath6; + this._basePath = defaultBasePath7; this._defaultHeaders = { "User-Agent": USER_AGENT }; this._useQuerystring = false; this.authentications = { @@ -27214,7 +27996,7 @@ var OAuthApi = class { } oauthTokenGenerate(_0) { return __async(this, arguments, function* (oAuthTokenGenerateRequest, options = { headers: {} }) { - oAuthTokenGenerateRequest = deserializeIfNeeded5( + oAuthTokenGenerateRequest = deserializeIfNeeded6( oAuthTokenGenerateRequest, "OAuthTokenGenerateRequest" ); @@ -27280,7 +28062,7 @@ var OAuthApi = class { return new Promise((resolve, reject) => { axios_default.request(localVarRequestOptions).then( (response) => { - handleSuccessfulResponse6( + handleSuccessfulResponse7( resolve, reject, response, @@ -27292,7 +28074,7 @@ var OAuthApi = class { reject(error); return; } - if (handleErrorCodeResponse6( + if (handleErrorCodeResponse7( reject, error.response, 200, @@ -27309,7 +28091,7 @@ var OAuthApi = class { } oauthTokenRefresh(_0) { return __async(this, arguments, function* (oAuthTokenRefreshRequest, options = { headers: {} }) { - oAuthTokenRefreshRequest = deserializeIfNeeded5( + oAuthTokenRefreshRequest = deserializeIfNeeded6( oAuthTokenRefreshRequest, "OAuthTokenRefreshRequest" ); @@ -27375,7 +28157,7 @@ var OAuthApi = class { return new Promise((resolve, reject) => { axios_default.request(localVarRequestOptions).then( (response) => { - handleSuccessfulResponse6( + handleSuccessfulResponse7( resolve, reject, response, @@ -27387,7 +28169,7 @@ var OAuthApi = class { reject(error); return; } - if (handleErrorCodeResponse6( + if (handleErrorCodeResponse7( reject, error.response, 200, @@ -27403,13 +28185,13 @@ var OAuthApi = class { }); } }; -function deserializeIfNeeded5(obj, classname) { +function deserializeIfNeeded6(obj, classname) { if (obj !== null && obj !== void 0 && obj.constructor.name !== classname) { return ObjectSerializer.deserialize(obj, classname); } return obj; } -function handleSuccessfulResponse6(resolve, reject, response, returnType) { +function handleSuccessfulResponse7(resolve, reject, response, returnType) { let body = response.data; if (response.status && response.status >= 200 && response.status <= 299) { if (returnType) { @@ -27420,7 +28202,7 @@ function handleSuccessfulResponse6(resolve, reject, response, returnType) { reject(new HttpError(response, body, response.status)); } } -function handleErrorCodeResponse6(reject, response, code, returnType) { +function handleErrorCodeResponse7(reject, response, code, returnType) { if (response.status !== code) { return false; } @@ -27430,10 +28212,10 @@ function handleErrorCodeResponse6(reject, response, code, returnType) { } // api/reportApi.ts -var defaultBasePath7 = "https://api.hellosign.com/v3"; +var defaultBasePath8 = "https://api.hellosign.com/v3"; var ReportApi = class { constructor(basePath) { - this._basePath = defaultBasePath7; + this._basePath = defaultBasePath8; this._defaultHeaders = { "User-Agent": USER_AGENT }; this._useQuerystring = false; this.authentications = { @@ -27481,7 +28263,7 @@ var ReportApi = class { } reportCreate(_0) { return __async(this, arguments, function* (reportCreateRequest, options = { headers: {} }) { - reportCreateRequest = deserializeIfNeeded6( + reportCreateRequest = deserializeIfNeeded7( reportCreateRequest, "ReportCreateRequest" ); @@ -27553,7 +28335,7 @@ var ReportApi = class { (resolve, reject) => { axios_default.request(localVarRequestOptions).then( (response) => { - handleSuccessfulResponse7( + handleSuccessfulResponse8( resolve, reject, response, @@ -27565,7 +28347,7 @@ var ReportApi = class { reject(error); return; } - if (handleErrorCodeResponse7( + if (handleErrorCodeResponse8( reject, error.response, 200, @@ -27573,7 +28355,7 @@ var ReportApi = class { )) { return; } - if (handleErrorRangeResponse6( + if (handleErrorRangeResponse7( reject, error.response, "4XX", @@ -27590,13 +28372,13 @@ var ReportApi = class { }); } }; -function deserializeIfNeeded6(obj, classname) { +function deserializeIfNeeded7(obj, classname) { if (obj !== null && obj !== void 0 && obj.constructor.name !== classname) { return ObjectSerializer.deserialize(obj, classname); } return obj; } -function handleSuccessfulResponse7(resolve, reject, response, returnType) { +function handleSuccessfulResponse8(resolve, reject, response, returnType) { let body = response.data; if (response.status && response.status >= 200 && response.status <= 299) { if (returnType) { @@ -27607,7 +28389,7 @@ function handleSuccessfulResponse7(resolve, reject, response, returnType) { reject(new HttpError(response, body, response.status)); } } -function handleErrorCodeResponse7(reject, response, code, returnType) { +function handleErrorCodeResponse8(reject, response, code, returnType) { if (response.status !== code) { return false; } @@ -27615,7 +28397,7 @@ function handleErrorCodeResponse7(reject, response, code, returnType) { reject(new HttpError(response, body, response.status)); return true; } -function handleErrorRangeResponse6(reject, response, code, returnType) { +function handleErrorRangeResponse7(reject, response, code, returnType) { let rangeCodeLeft = Number(code[0] + "00"); let rangeCodeRight = Number(code[0] + "99"); if (response.status >= rangeCodeLeft && response.status <= rangeCodeRight) { @@ -27627,10 +28409,10 @@ function handleErrorRangeResponse6(reject, response, code, returnType) { } // api/signatureRequestApi.ts -var defaultBasePath8 = "https://api.hellosign.com/v3"; +var defaultBasePath9 = "https://api.hellosign.com/v3"; var SignatureRequestApi = class { constructor(basePath) { - this._basePath = defaultBasePath8; + this._basePath = defaultBasePath9; this._defaultHeaders = { "User-Agent": USER_AGENT }; this._useQuerystring = false; this.authentications = { @@ -27678,7 +28460,7 @@ var SignatureRequestApi = class { } signatureRequestBulkCreateEmbeddedWithTemplate(_0) { return __async(this, arguments, function* (signatureRequestBulkCreateEmbeddedWithTemplateRequest, options = { headers: {} }) { - signatureRequestBulkCreateEmbeddedWithTemplateRequest = deserializeIfNeeded7( + signatureRequestBulkCreateEmbeddedWithTemplateRequest = deserializeIfNeeded8( signatureRequestBulkCreateEmbeddedWithTemplateRequest, "SignatureRequestBulkCreateEmbeddedWithTemplateRequest" ); @@ -27750,7 +28532,7 @@ var SignatureRequestApi = class { (resolve, reject) => { axios_default.request(localVarRequestOptions).then( (response) => { - handleSuccessfulResponse8( + handleSuccessfulResponse9( resolve, reject, response, @@ -27762,7 +28544,7 @@ var SignatureRequestApi = class { reject(error); return; } - if (handleErrorCodeResponse8( + if (handleErrorCodeResponse9( reject, error.response, 200, @@ -27770,7 +28552,7 @@ var SignatureRequestApi = class { )) { return; } - if (handleErrorRangeResponse7( + if (handleErrorRangeResponse8( reject, error.response, "4XX", @@ -27788,7 +28570,7 @@ var SignatureRequestApi = class { } signatureRequestBulkSendWithTemplate(_0) { return __async(this, arguments, function* (signatureRequestBulkSendWithTemplateRequest, options = { headers: {} }) { - signatureRequestBulkSendWithTemplateRequest = deserializeIfNeeded7( + signatureRequestBulkSendWithTemplateRequest = deserializeIfNeeded8( signatureRequestBulkSendWithTemplateRequest, "SignatureRequestBulkSendWithTemplateRequest" ); @@ -27865,7 +28647,7 @@ var SignatureRequestApi = class { (resolve, reject) => { axios_default.request(localVarRequestOptions).then( (response) => { - handleSuccessfulResponse8( + handleSuccessfulResponse9( resolve, reject, response, @@ -27877,7 +28659,7 @@ var SignatureRequestApi = class { reject(error); return; } - if (handleErrorCodeResponse8( + if (handleErrorCodeResponse9( reject, error.response, 200, @@ -27885,7 +28667,7 @@ var SignatureRequestApi = class { )) { return; } - if (handleErrorRangeResponse7( + if (handleErrorRangeResponse8( reject, error.response, "4XX", @@ -27961,14 +28743,14 @@ var SignatureRequestApi = class { return new Promise((resolve, reject) => { axios_default.request(localVarRequestOptions).then( (response) => { - handleSuccessfulResponse8(resolve, reject, response); + handleSuccessfulResponse9(resolve, reject, response); }, (error) => { if (error.response == null) { reject(error); return; } - if (handleErrorRangeResponse7( + if (handleErrorRangeResponse8( reject, error.response, "4XX", @@ -27985,7 +28767,7 @@ var SignatureRequestApi = class { } signatureRequestCreateEmbedded(_0) { return __async(this, arguments, function* (signatureRequestCreateEmbeddedRequest, options = { headers: {} }) { - signatureRequestCreateEmbeddedRequest = deserializeIfNeeded7( + signatureRequestCreateEmbeddedRequest = deserializeIfNeeded8( signatureRequestCreateEmbeddedRequest, "SignatureRequestCreateEmbeddedRequest" ); @@ -28062,7 +28844,7 @@ var SignatureRequestApi = class { (resolve, reject) => { axios_default.request(localVarRequestOptions).then( (response) => { - handleSuccessfulResponse8( + handleSuccessfulResponse9( resolve, reject, response, @@ -28074,7 +28856,7 @@ var SignatureRequestApi = class { reject(error); return; } - if (handleErrorCodeResponse8( + if (handleErrorCodeResponse9( reject, error.response, 200, @@ -28082,7 +28864,7 @@ var SignatureRequestApi = class { )) { return; } - if (handleErrorRangeResponse7( + if (handleErrorRangeResponse8( reject, error.response, "4XX", @@ -28100,7 +28882,7 @@ var SignatureRequestApi = class { } signatureRequestCreateEmbeddedWithTemplate(_0) { return __async(this, arguments, function* (signatureRequestCreateEmbeddedWithTemplateRequest, options = { headers: {} }) { - signatureRequestCreateEmbeddedWithTemplateRequest = deserializeIfNeeded7( + signatureRequestCreateEmbeddedWithTemplateRequest = deserializeIfNeeded8( signatureRequestCreateEmbeddedWithTemplateRequest, "SignatureRequestCreateEmbeddedWithTemplateRequest" ); @@ -28177,7 +28959,7 @@ var SignatureRequestApi = class { (resolve, reject) => { axios_default.request(localVarRequestOptions).then( (response) => { - handleSuccessfulResponse8( + handleSuccessfulResponse9( resolve, reject, response, @@ -28189,7 +28971,7 @@ var SignatureRequestApi = class { reject(error); return; } - if (handleErrorCodeResponse8( + if (handleErrorCodeResponse9( reject, error.response, 200, @@ -28197,7 +28979,7 @@ var SignatureRequestApi = class { )) { return; } - if (handleErrorRangeResponse7( + if (handleErrorRangeResponse8( reject, error.response, "4XX", @@ -28279,7 +29061,7 @@ var SignatureRequestApi = class { return new Promise((resolve, reject) => { axios_default.request(localVarRequestOptions).then( (response) => { - handleSuccessfulResponse8( + handleSuccessfulResponse9( resolve, reject, response, @@ -28291,7 +29073,7 @@ var SignatureRequestApi = class { reject(error); return; } - if (handleErrorCodeResponse8( + if (handleErrorCodeResponse9( reject, error.response, 200, @@ -28299,7 +29081,7 @@ var SignatureRequestApi = class { )) { return; } - if (handleErrorRangeResponse7( + if (handleErrorRangeResponse8( reject, error.response, "4XX", @@ -28375,7 +29157,7 @@ var SignatureRequestApi = class { (resolve, reject) => { axios_default.request(localVarRequestOptions).then( (response) => { - handleSuccessfulResponse8( + handleSuccessfulResponse9( resolve, reject, response, @@ -28387,7 +29169,7 @@ var SignatureRequestApi = class { reject(error); return; } - if (handleErrorCodeResponse8( + if (handleErrorCodeResponse9( reject, error.response, 200, @@ -28395,7 +29177,7 @@ var SignatureRequestApi = class { )) { return; } - if (handleErrorRangeResponse7( + if (handleErrorRangeResponse8( reject, error.response, "4XX", @@ -28477,7 +29259,7 @@ var SignatureRequestApi = class { return new Promise((resolve, reject) => { axios_default.request(localVarRequestOptions).then( (response) => { - handleSuccessfulResponse8( + handleSuccessfulResponse9( resolve, reject, response, @@ -28489,7 +29271,7 @@ var SignatureRequestApi = class { reject(error); return; } - if (handleErrorCodeResponse8( + if (handleErrorCodeResponse9( reject, error.response, 200, @@ -28497,7 +29279,7 @@ var SignatureRequestApi = class { )) { return; } - if (handleErrorRangeResponse7( + if (handleErrorRangeResponse8( reject, error.response, "4XX", @@ -28573,7 +29355,7 @@ var SignatureRequestApi = class { (resolve, reject) => { axios_default.request(localVarRequestOptions).then( (response) => { - handleSuccessfulResponse8( + handleSuccessfulResponse9( resolve, reject, response, @@ -28585,7 +29367,7 @@ var SignatureRequestApi = class { reject(error); return; } - if (handleErrorCodeResponse8( + if (handleErrorCodeResponse9( reject, error.response, 200, @@ -28593,7 +29375,7 @@ var SignatureRequestApi = class { )) { return; } - if (handleErrorRangeResponse7( + if (handleErrorRangeResponse8( reject, error.response, "4XX", @@ -28686,7 +29468,7 @@ var SignatureRequestApi = class { (resolve, reject) => { axios_default.request(localVarRequestOptions).then( (response) => { - handleSuccessfulResponse8( + handleSuccessfulResponse9( resolve, reject, response, @@ -28698,7 +29480,7 @@ var SignatureRequestApi = class { reject(error); return; } - if (handleErrorCodeResponse8( + if (handleErrorCodeResponse9( reject, error.response, 200, @@ -28706,7 +29488,7 @@ var SignatureRequestApi = class { )) { return; } - if (handleErrorRangeResponse7( + if (handleErrorRangeResponse8( reject, error.response, "4XX", @@ -28783,7 +29565,7 @@ var SignatureRequestApi = class { (resolve, reject) => { axios_default.request(localVarRequestOptions).then( (response) => { - handleSuccessfulResponse8( + handleSuccessfulResponse9( resolve, reject, response, @@ -28795,7 +29577,7 @@ var SignatureRequestApi = class { reject(error); return; } - if (handleErrorCodeResponse8( + if (handleErrorCodeResponse9( reject, error.response, 200, @@ -28803,7 +29585,7 @@ var SignatureRequestApi = class { )) { return; } - if (handleErrorRangeResponse7( + if (handleErrorRangeResponse8( reject, error.response, "4XX", @@ -28821,7 +29603,7 @@ var SignatureRequestApi = class { } signatureRequestRemind(_0, _1) { return __async(this, arguments, function* (signatureRequestId, signatureRequestRemindRequest, options = { headers: {} }) { - signatureRequestRemindRequest = deserializeIfNeeded7( + signatureRequestRemindRequest = deserializeIfNeeded8( signatureRequestRemindRequest, "SignatureRequestRemindRequest" ); @@ -28906,7 +29688,7 @@ var SignatureRequestApi = class { (resolve, reject) => { axios_default.request(localVarRequestOptions).then( (response) => { - handleSuccessfulResponse8( + handleSuccessfulResponse9( resolve, reject, response, @@ -28918,7 +29700,7 @@ var SignatureRequestApi = class { reject(error); return; } - if (handleErrorCodeResponse8( + if (handleErrorCodeResponse9( reject, error.response, 200, @@ -28926,7 +29708,7 @@ var SignatureRequestApi = class { )) { return; } - if (handleErrorRangeResponse7( + if (handleErrorRangeResponse8( reject, error.response, "4XX", @@ -28997,14 +29779,14 @@ var SignatureRequestApi = class { return new Promise((resolve, reject) => { axios_default.request(localVarRequestOptions).then( (response) => { - handleSuccessfulResponse8(resolve, reject, response); + handleSuccessfulResponse9(resolve, reject, response); }, (error) => { if (error.response == null) { reject(error); return; } - if (handleErrorRangeResponse7( + if (handleErrorRangeResponse8( reject, error.response, "4XX", @@ -29021,7 +29803,7 @@ var SignatureRequestApi = class { } signatureRequestSend(_0) { return __async(this, arguments, function* (signatureRequestSendRequest, options = { headers: {} }) { - signatureRequestSendRequest = deserializeIfNeeded7( + signatureRequestSendRequest = deserializeIfNeeded8( signatureRequestSendRequest, "SignatureRequestSendRequest" ); @@ -29098,7 +29880,7 @@ var SignatureRequestApi = class { (resolve, reject) => { axios_default.request(localVarRequestOptions).then( (response) => { - handleSuccessfulResponse8( + handleSuccessfulResponse9( resolve, reject, response, @@ -29110,7 +29892,7 @@ var SignatureRequestApi = class { reject(error); return; } - if (handleErrorCodeResponse8( + if (handleErrorCodeResponse9( reject, error.response, 200, @@ -29118,7 +29900,7 @@ var SignatureRequestApi = class { )) { return; } - if (handleErrorRangeResponse7( + if (handleErrorRangeResponse8( reject, error.response, "4XX", @@ -29136,7 +29918,7 @@ var SignatureRequestApi = class { } signatureRequestSendWithTemplate(_0) { return __async(this, arguments, function* (signatureRequestSendWithTemplateRequest, options = { headers: {} }) { - signatureRequestSendWithTemplateRequest = deserializeIfNeeded7( + signatureRequestSendWithTemplateRequest = deserializeIfNeeded8( signatureRequestSendWithTemplateRequest, "SignatureRequestSendWithTemplateRequest" ); @@ -29213,7 +29995,7 @@ var SignatureRequestApi = class { (resolve, reject) => { axios_default.request(localVarRequestOptions).then( (response) => { - handleSuccessfulResponse8( + handleSuccessfulResponse9( resolve, reject, response, @@ -29225,7 +30007,7 @@ var SignatureRequestApi = class { reject(error); return; } - if (handleErrorCodeResponse8( + if (handleErrorCodeResponse9( reject, error.response, 200, @@ -29233,7 +30015,7 @@ var SignatureRequestApi = class { )) { return; } - if (handleErrorRangeResponse7( + if (handleErrorRangeResponse8( reject, error.response, "4XX", @@ -29251,7 +30033,7 @@ var SignatureRequestApi = class { } signatureRequestUpdate(_0, _1) { return __async(this, arguments, function* (signatureRequestId, signatureRequestUpdateRequest, options = { headers: {} }) { - signatureRequestUpdateRequest = deserializeIfNeeded7( + signatureRequestUpdateRequest = deserializeIfNeeded8( signatureRequestUpdateRequest, "SignatureRequestUpdateRequest" ); @@ -29336,7 +30118,7 @@ var SignatureRequestApi = class { (resolve, reject) => { axios_default.request(localVarRequestOptions).then( (response) => { - handleSuccessfulResponse8( + handleSuccessfulResponse9( resolve, reject, response, @@ -29348,7 +30130,7 @@ var SignatureRequestApi = class { reject(error); return; } - if (handleErrorCodeResponse8( + if (handleErrorCodeResponse9( reject, error.response, 200, @@ -29356,7 +30138,7 @@ var SignatureRequestApi = class { )) { return; } - if (handleErrorRangeResponse7( + if (handleErrorRangeResponse8( reject, error.response, "4XX", @@ -29373,13 +30155,13 @@ var SignatureRequestApi = class { }); } }; -function deserializeIfNeeded7(obj, classname) { +function deserializeIfNeeded8(obj, classname) { if (obj !== null && obj !== void 0 && obj.constructor.name !== classname) { return ObjectSerializer.deserialize(obj, classname); } return obj; } -function handleSuccessfulResponse8(resolve, reject, response, returnType) { +function handleSuccessfulResponse9(resolve, reject, response, returnType) { let body = response.data; if (response.status && response.status >= 200 && response.status <= 299) { if (returnType) { @@ -29390,7 +30172,7 @@ function handleSuccessfulResponse8(resolve, reject, response, returnType) { reject(new HttpError(response, body, response.status)); } } -function handleErrorCodeResponse8(reject, response, code, returnType) { +function handleErrorCodeResponse9(reject, response, code, returnType) { if (response.status !== code) { return false; } @@ -29398,7 +30180,7 @@ function handleErrorCodeResponse8(reject, response, code, returnType) { reject(new HttpError(response, body, response.status)); return true; } -function handleErrorRangeResponse7(reject, response, code, returnType) { +function handleErrorRangeResponse8(reject, response, code, returnType) { let rangeCodeLeft = Number(code[0] + "00"); let rangeCodeRight = Number(code[0] + "99"); if (response.status >= rangeCodeLeft && response.status <= rangeCodeRight) { @@ -29410,10 +30192,10 @@ function handleErrorRangeResponse7(reject, response, code, returnType) { } // api/teamApi.ts -var defaultBasePath9 = "https://api.hellosign.com/v3"; +var defaultBasePath10 = "https://api.hellosign.com/v3"; var TeamApi = class { constructor(basePath) { - this._basePath = defaultBasePath9; + this._basePath = defaultBasePath10; this._defaultHeaders = { "User-Agent": USER_AGENT }; this._useQuerystring = false; this.authentications = { @@ -29461,7 +30243,7 @@ var TeamApi = class { } teamAddMember(_0, _1) { return __async(this, arguments, function* (teamAddMemberRequest, teamId, options = { headers: {} }) { - teamAddMemberRequest = deserializeIfNeeded8( + teamAddMemberRequest = deserializeIfNeeded9( teamAddMemberRequest, "TeamAddMemberRequest" ); @@ -29543,7 +30325,7 @@ var TeamApi = class { return new Promise((resolve, reject) => { axios_default.request(localVarRequestOptions).then( (response) => { - handleSuccessfulResponse9( + handleSuccessfulResponse10( resolve, reject, response, @@ -29555,7 +30337,7 @@ var TeamApi = class { reject(error); return; } - if (handleErrorCodeResponse9( + if (handleErrorCodeResponse10( reject, error.response, 200, @@ -29563,7 +30345,7 @@ var TeamApi = class { )) { return; } - if (handleErrorRangeResponse8( + if (handleErrorRangeResponse9( reject, error.response, "4XX", @@ -29580,7 +30362,7 @@ var TeamApi = class { } teamCreate(_0) { return __async(this, arguments, function* (teamCreateRequest, options = { headers: {} }) { - teamCreateRequest = deserializeIfNeeded8( + teamCreateRequest = deserializeIfNeeded9( teamCreateRequest, "TeamCreateRequest" ); @@ -29653,7 +30435,7 @@ var TeamApi = class { return new Promise((resolve, reject) => { axios_default.request(localVarRequestOptions).then( (response) => { - handleSuccessfulResponse9( + handleSuccessfulResponse10( resolve, reject, response, @@ -29665,7 +30447,7 @@ var TeamApi = class { reject(error); return; } - if (handleErrorCodeResponse9( + if (handleErrorCodeResponse10( reject, error.response, 200, @@ -29673,7 +30455,7 @@ var TeamApi = class { )) { return; } - if (handleErrorRangeResponse8( + if (handleErrorRangeResponse9( reject, error.response, "4XX", @@ -29740,14 +30522,14 @@ var TeamApi = class { return new Promise((resolve, reject) => { axios_default.request(localVarRequestOptions).then( (response) => { - handleSuccessfulResponse9(resolve, reject, response); + handleSuccessfulResponse10(resolve, reject, response); }, (error) => { if (error.response == null) { reject(error); return; } - if (handleErrorRangeResponse8( + if (handleErrorRangeResponse9( reject, error.response, "4XX", @@ -29814,7 +30596,7 @@ var TeamApi = class { return new Promise((resolve, reject) => { axios_default.request(localVarRequestOptions).then( (response) => { - handleSuccessfulResponse9( + handleSuccessfulResponse10( resolve, reject, response, @@ -29826,7 +30608,7 @@ var TeamApi = class { reject(error); return; } - if (handleErrorCodeResponse9( + if (handleErrorCodeResponse10( reject, error.response, 200, @@ -29834,7 +30616,7 @@ var TeamApi = class { )) { return; } - if (handleErrorRangeResponse8( + if (handleErrorRangeResponse9( reject, error.response, "4XX", @@ -29908,7 +30690,7 @@ var TeamApi = class { (resolve, reject) => { axios_default.request(localVarRequestOptions).then( (response) => { - handleSuccessfulResponse9( + handleSuccessfulResponse10( resolve, reject, response, @@ -29920,7 +30702,7 @@ var TeamApi = class { reject(error); return; } - if (handleErrorCodeResponse9( + if (handleErrorCodeResponse10( reject, error.response, 200, @@ -29928,7 +30710,7 @@ var TeamApi = class { )) { return; } - if (handleErrorRangeResponse8( + if (handleErrorRangeResponse9( reject, error.response, "4XX", @@ -30003,7 +30785,7 @@ var TeamApi = class { (resolve, reject) => { axios_default.request(localVarRequestOptions).then( (response) => { - handleSuccessfulResponse9( + handleSuccessfulResponse10( resolve, reject, response, @@ -30015,7 +30797,7 @@ var TeamApi = class { reject(error); return; } - if (handleErrorCodeResponse9( + if (handleErrorCodeResponse10( reject, error.response, 200, @@ -30023,7 +30805,7 @@ var TeamApi = class { )) { return; } - if (handleErrorRangeResponse8( + if (handleErrorRangeResponse9( reject, error.response, "4XX", @@ -30112,7 +30894,7 @@ var TeamApi = class { (resolve, reject) => { axios_default.request(localVarRequestOptions).then( (response) => { - handleSuccessfulResponse9( + handleSuccessfulResponse10( resolve, reject, response, @@ -30124,7 +30906,7 @@ var TeamApi = class { reject(error); return; } - if (handleErrorCodeResponse9( + if (handleErrorCodeResponse10( reject, error.response, 200, @@ -30132,7 +30914,7 @@ var TeamApi = class { )) { return; } - if (handleErrorRangeResponse8( + if (handleErrorRangeResponse9( reject, error.response, "4XX", @@ -30150,7 +30932,7 @@ var TeamApi = class { } teamRemoveMember(_0) { return __async(this, arguments, function* (teamRemoveMemberRequest, options = { headers: {} }) { - teamRemoveMemberRequest = deserializeIfNeeded8( + teamRemoveMemberRequest = deserializeIfNeeded9( teamRemoveMemberRequest, "TeamRemoveMemberRequest" ); @@ -30226,7 +31008,7 @@ var TeamApi = class { return new Promise((resolve, reject) => { axios_default.request(localVarRequestOptions).then( (response) => { - handleSuccessfulResponse9( + handleSuccessfulResponse10( resolve, reject, response, @@ -30238,7 +31020,7 @@ var TeamApi = class { reject(error); return; } - if (handleErrorCodeResponse9( + if (handleErrorCodeResponse10( reject, error.response, 201, @@ -30246,7 +31028,7 @@ var TeamApi = class { )) { return; } - if (handleErrorRangeResponse8( + if (handleErrorRangeResponse9( reject, error.response, "4XX", @@ -30334,7 +31116,7 @@ var TeamApi = class { (resolve, reject) => { axios_default.request(localVarRequestOptions).then( (response) => { - handleSuccessfulResponse9( + handleSuccessfulResponse10( resolve, reject, response, @@ -30346,7 +31128,7 @@ var TeamApi = class { reject(error); return; } - if (handleErrorCodeResponse9( + if (handleErrorCodeResponse10( reject, error.response, 200, @@ -30354,7 +31136,7 @@ var TeamApi = class { )) { return; } - if (handleErrorRangeResponse8( + if (handleErrorRangeResponse9( reject, error.response, "4XX", @@ -30372,7 +31154,7 @@ var TeamApi = class { } teamUpdate(_0) { return __async(this, arguments, function* (teamUpdateRequest, options = { headers: {} }) { - teamUpdateRequest = deserializeIfNeeded8( + teamUpdateRequest = deserializeIfNeeded9( teamUpdateRequest, "TeamUpdateRequest" ); @@ -30445,7 +31227,7 @@ var TeamApi = class { return new Promise((resolve, reject) => { axios_default.request(localVarRequestOptions).then( (response) => { - handleSuccessfulResponse9( + handleSuccessfulResponse10( resolve, reject, response, @@ -30457,7 +31239,7 @@ var TeamApi = class { reject(error); return; } - if (handleErrorCodeResponse9( + if (handleErrorCodeResponse10( reject, error.response, 200, @@ -30465,7 +31247,7 @@ var TeamApi = class { )) { return; } - if (handleErrorRangeResponse8( + if (handleErrorRangeResponse9( reject, error.response, "4XX", @@ -30481,13 +31263,13 @@ var TeamApi = class { }); } }; -function deserializeIfNeeded8(obj, classname) { +function deserializeIfNeeded9(obj, classname) { if (obj !== null && obj !== void 0 && obj.constructor.name !== classname) { return ObjectSerializer.deserialize(obj, classname); } return obj; } -function handleSuccessfulResponse9(resolve, reject, response, returnType) { +function handleSuccessfulResponse10(resolve, reject, response, returnType) { let body = response.data; if (response.status && response.status >= 200 && response.status <= 299) { if (returnType) { @@ -30498,7 +31280,7 @@ function handleSuccessfulResponse9(resolve, reject, response, returnType) { reject(new HttpError(response, body, response.status)); } } -function handleErrorCodeResponse9(reject, response, code, returnType) { +function handleErrorCodeResponse10(reject, response, code, returnType) { if (response.status !== code) { return false; } @@ -30506,7 +31288,7 @@ function handleErrorCodeResponse9(reject, response, code, returnType) { reject(new HttpError(response, body, response.status)); return true; } -function handleErrorRangeResponse8(reject, response, code, returnType) { +function handleErrorRangeResponse9(reject, response, code, returnType) { let rangeCodeLeft = Number(code[0] + "00"); let rangeCodeRight = Number(code[0] + "99"); if (response.status >= rangeCodeLeft && response.status <= rangeCodeRight) { @@ -30518,10 +31300,10 @@ function handleErrorRangeResponse8(reject, response, code, returnType) { } // api/templateApi.ts -var defaultBasePath10 = "https://api.hellosign.com/v3"; +var defaultBasePath11 = "https://api.hellosign.com/v3"; var TemplateApi = class { constructor(basePath) { - this._basePath = defaultBasePath10; + this._basePath = defaultBasePath11; this._defaultHeaders = { "User-Agent": USER_AGENT }; this._useQuerystring = false; this.authentications = { @@ -30569,7 +31351,7 @@ var TemplateApi = class { } templateAddUser(_0, _1) { return __async(this, arguments, function* (templateId, templateAddUserRequest, options = { headers: {} }) { - templateAddUserRequest = deserializeIfNeeded9( + templateAddUserRequest = deserializeIfNeeded10( templateAddUserRequest, "TemplateAddUserRequest" ); @@ -30654,7 +31436,7 @@ var TemplateApi = class { (resolve, reject) => { axios_default.request(localVarRequestOptions).then( (response) => { - handleSuccessfulResponse10( + handleSuccessfulResponse11( resolve, reject, response, @@ -30666,7 +31448,7 @@ var TemplateApi = class { reject(error); return; } - if (handleErrorCodeResponse10( + if (handleErrorCodeResponse11( reject, error.response, 200, @@ -30674,7 +31456,7 @@ var TemplateApi = class { )) { return; } - if (handleErrorRangeResponse9( + if (handleErrorRangeResponse10( reject, error.response, "4XX", @@ -30692,7 +31474,7 @@ var TemplateApi = class { } templateCreate(_0) { return __async(this, arguments, function* (templateCreateRequest, options = { headers: {} }) { - templateCreateRequest = deserializeIfNeeded9( + templateCreateRequest = deserializeIfNeeded10( templateCreateRequest, "TemplateCreateRequest" ); @@ -30769,7 +31551,7 @@ var TemplateApi = class { (resolve, reject) => { axios_default.request(localVarRequestOptions).then( (response) => { - handleSuccessfulResponse10( + handleSuccessfulResponse11( resolve, reject, response, @@ -30781,7 +31563,7 @@ var TemplateApi = class { reject(error); return; } - if (handleErrorCodeResponse10( + if (handleErrorCodeResponse11( reject, error.response, 200, @@ -30789,7 +31571,7 @@ var TemplateApi = class { )) { return; } - if (handleErrorRangeResponse9( + if (handleErrorRangeResponse10( reject, error.response, "4XX", @@ -30807,7 +31589,7 @@ var TemplateApi = class { } templateCreateEmbeddedDraft(_0) { return __async(this, arguments, function* (templateCreateEmbeddedDraftRequest, options = { headers: {} }) { - templateCreateEmbeddedDraftRequest = deserializeIfNeeded9( + templateCreateEmbeddedDraftRequest = deserializeIfNeeded10( templateCreateEmbeddedDraftRequest, "TemplateCreateEmbeddedDraftRequest" ); @@ -30884,7 +31666,7 @@ var TemplateApi = class { (resolve, reject) => { axios_default.request(localVarRequestOptions).then( (response) => { - handleSuccessfulResponse10( + handleSuccessfulResponse11( resolve, reject, response, @@ -30896,7 +31678,7 @@ var TemplateApi = class { reject(error); return; } - if (handleErrorCodeResponse10( + if (handleErrorCodeResponse11( reject, error.response, 200, @@ -30904,7 +31686,7 @@ var TemplateApi = class { )) { return; } - if (handleErrorRangeResponse9( + if (handleErrorRangeResponse10( reject, error.response, "4XX", @@ -30980,14 +31762,14 @@ var TemplateApi = class { return new Promise((resolve, reject) => { axios_default.request(localVarRequestOptions).then( (response) => { - handleSuccessfulResponse10(resolve, reject, response); + handleSuccessfulResponse11(resolve, reject, response); }, (error) => { if (error.response == null) { reject(error); return; } - if (handleErrorRangeResponse9( + if (handleErrorRangeResponse10( reject, error.response, "4XX", @@ -31068,7 +31850,7 @@ var TemplateApi = class { return new Promise((resolve, reject) => { axios_default.request(localVarRequestOptions).then( (response) => { - handleSuccessfulResponse10( + handleSuccessfulResponse11( resolve, reject, response, @@ -31080,7 +31862,7 @@ var TemplateApi = class { reject(error); return; } - if (handleErrorCodeResponse10( + if (handleErrorCodeResponse11( reject, error.response, 200, @@ -31088,7 +31870,7 @@ var TemplateApi = class { )) { return; } - if (handleErrorRangeResponse9( + if (handleErrorRangeResponse10( reject, error.response, "4XX", @@ -31164,7 +31946,7 @@ var TemplateApi = class { (resolve, reject) => { axios_default.request(localVarRequestOptions).then( (response) => { - handleSuccessfulResponse10( + handleSuccessfulResponse11( resolve, reject, response, @@ -31176,7 +31958,7 @@ var TemplateApi = class { reject(error); return; } - if (handleErrorCodeResponse10( + if (handleErrorCodeResponse11( reject, error.response, 200, @@ -31184,7 +31966,7 @@ var TemplateApi = class { )) { return; } - if (handleErrorRangeResponse9( + if (handleErrorRangeResponse10( reject, error.response, "4XX", @@ -31266,7 +32048,7 @@ var TemplateApi = class { return new Promise((resolve, reject) => { axios_default.request(localVarRequestOptions).then( (response) => { - handleSuccessfulResponse10( + handleSuccessfulResponse11( resolve, reject, response, @@ -31278,7 +32060,7 @@ var TemplateApi = class { reject(error); return; } - if (handleErrorCodeResponse10( + if (handleErrorCodeResponse11( reject, error.response, 200, @@ -31286,7 +32068,7 @@ var TemplateApi = class { )) { return; } - if (handleErrorRangeResponse9( + if (handleErrorRangeResponse10( reject, error.response, "4XX", @@ -31362,7 +32144,7 @@ var TemplateApi = class { (resolve, reject) => { axios_default.request(localVarRequestOptions).then( (response) => { - handleSuccessfulResponse10( + handleSuccessfulResponse11( resolve, reject, response, @@ -31374,7 +32156,7 @@ var TemplateApi = class { reject(error); return; } - if (handleErrorCodeResponse10( + if (handleErrorCodeResponse11( reject, error.response, 200, @@ -31382,7 +32164,7 @@ var TemplateApi = class { )) { return; } - if (handleErrorRangeResponse9( + if (handleErrorRangeResponse10( reject, error.response, "4XX", @@ -31475,7 +32257,7 @@ var TemplateApi = class { (resolve, reject) => { axios_default.request(localVarRequestOptions).then( (response) => { - handleSuccessfulResponse10( + handleSuccessfulResponse11( resolve, reject, response, @@ -31487,7 +32269,7 @@ var TemplateApi = class { reject(error); return; } - if (handleErrorCodeResponse10( + if (handleErrorCodeResponse11( reject, error.response, 200, @@ -31495,7 +32277,7 @@ var TemplateApi = class { )) { return; } - if (handleErrorRangeResponse9( + if (handleErrorRangeResponse10( reject, error.response, "4XX", @@ -31513,7 +32295,7 @@ var TemplateApi = class { } templateRemoveUser(_0, _1) { return __async(this, arguments, function* (templateId, templateRemoveUserRequest, options = { headers: {} }) { - templateRemoveUserRequest = deserializeIfNeeded9( + templateRemoveUserRequest = deserializeIfNeeded10( templateRemoveUserRequest, "TemplateRemoveUserRequest" ); @@ -31598,7 +32380,7 @@ var TemplateApi = class { (resolve, reject) => { axios_default.request(localVarRequestOptions).then( (response) => { - handleSuccessfulResponse10( + handleSuccessfulResponse11( resolve, reject, response, @@ -31610,7 +32392,7 @@ var TemplateApi = class { reject(error); return; } - if (handleErrorCodeResponse10( + if (handleErrorCodeResponse11( reject, error.response, 200, @@ -31618,7 +32400,7 @@ var TemplateApi = class { )) { return; } - if (handleErrorRangeResponse9( + if (handleErrorRangeResponse10( reject, error.response, "4XX", @@ -31636,7 +32418,7 @@ var TemplateApi = class { } templateUpdateFiles(_0, _1) { return __async(this, arguments, function* (templateId, templateUpdateFilesRequest, options = { headers: {} }) { - templateUpdateFilesRequest = deserializeIfNeeded9( + templateUpdateFilesRequest = deserializeIfNeeded10( templateUpdateFilesRequest, "TemplateUpdateFilesRequest" ); @@ -31721,7 +32503,7 @@ var TemplateApi = class { (resolve, reject) => { axios_default.request(localVarRequestOptions).then( (response) => { - handleSuccessfulResponse10( + handleSuccessfulResponse11( resolve, reject, response, @@ -31733,7 +32515,7 @@ var TemplateApi = class { reject(error); return; } - if (handleErrorCodeResponse10( + if (handleErrorCodeResponse11( reject, error.response, 200, @@ -31741,7 +32523,7 @@ var TemplateApi = class { )) { return; } - if (handleErrorRangeResponse9( + if (handleErrorRangeResponse10( reject, error.response, "4XX", @@ -31758,13 +32540,13 @@ var TemplateApi = class { }); } }; -function deserializeIfNeeded9(obj, classname) { +function deserializeIfNeeded10(obj, classname) { if (obj !== null && obj !== void 0 && obj.constructor.name !== classname) { return ObjectSerializer.deserialize(obj, classname); } return obj; } -function handleSuccessfulResponse10(resolve, reject, response, returnType) { +function handleSuccessfulResponse11(resolve, reject, response, returnType) { let body = response.data; if (response.status && response.status >= 200 && response.status <= 299) { if (returnType) { @@ -31775,7 +32557,7 @@ function handleSuccessfulResponse10(resolve, reject, response, returnType) { reject(new HttpError(response, body, response.status)); } } -function handleErrorCodeResponse10(reject, response, code, returnType) { +function handleErrorCodeResponse11(reject, response, code, returnType) { if (response.status !== code) { return false; } @@ -31783,7 +32565,7 @@ function handleErrorCodeResponse10(reject, response, code, returnType) { reject(new HttpError(response, body, response.status)); return true; } -function handleErrorRangeResponse9(reject, response, code, returnType) { +function handleErrorRangeResponse10(reject, response, code, returnType) { let rangeCodeLeft = Number(code[0] + "00"); let rangeCodeRight = Number(code[0] + "99"); if (response.status >= rangeCodeLeft && response.status <= rangeCodeRight) { @@ -31795,10 +32577,10 @@ function handleErrorRangeResponse9(reject, response, code, returnType) { } // api/unclaimedDraftApi.ts -var defaultBasePath11 = "https://api.hellosign.com/v3"; +var defaultBasePath12 = "https://api.hellosign.com/v3"; var UnclaimedDraftApi = class { constructor(basePath) { - this._basePath = defaultBasePath11; + this._basePath = defaultBasePath12; this._defaultHeaders = { "User-Agent": USER_AGENT }; this._useQuerystring = false; this.authentications = { @@ -31846,7 +32628,7 @@ var UnclaimedDraftApi = class { } unclaimedDraftCreate(_0) { return __async(this, arguments, function* (unclaimedDraftCreateRequest, options = { headers: {} }) { - unclaimedDraftCreateRequest = deserializeIfNeeded10( + unclaimedDraftCreateRequest = deserializeIfNeeded11( unclaimedDraftCreateRequest, "UnclaimedDraftCreateRequest" ); @@ -31923,7 +32705,7 @@ var UnclaimedDraftApi = class { (resolve, reject) => { axios_default.request(localVarRequestOptions).then( (response) => { - handleSuccessfulResponse11( + handleSuccessfulResponse12( resolve, reject, response, @@ -31935,7 +32717,7 @@ var UnclaimedDraftApi = class { reject(error); return; } - if (handleErrorCodeResponse11( + if (handleErrorCodeResponse12( reject, error.response, 200, @@ -31943,7 +32725,7 @@ var UnclaimedDraftApi = class { )) { return; } - if (handleErrorRangeResponse10( + if (handleErrorRangeResponse11( reject, error.response, "4XX", @@ -31961,7 +32743,7 @@ var UnclaimedDraftApi = class { } unclaimedDraftCreateEmbedded(_0) { return __async(this, arguments, function* (unclaimedDraftCreateEmbeddedRequest, options = { headers: {} }) { - unclaimedDraftCreateEmbeddedRequest = deserializeIfNeeded10( + unclaimedDraftCreateEmbeddedRequest = deserializeIfNeeded11( unclaimedDraftCreateEmbeddedRequest, "UnclaimedDraftCreateEmbeddedRequest" ); @@ -32038,7 +32820,7 @@ var UnclaimedDraftApi = class { (resolve, reject) => { axios_default.request(localVarRequestOptions).then( (response) => { - handleSuccessfulResponse11( + handleSuccessfulResponse12( resolve, reject, response, @@ -32050,7 +32832,7 @@ var UnclaimedDraftApi = class { reject(error); return; } - if (handleErrorCodeResponse11( + if (handleErrorCodeResponse12( reject, error.response, 200, @@ -32058,7 +32840,7 @@ var UnclaimedDraftApi = class { )) { return; } - if (handleErrorRangeResponse10( + if (handleErrorRangeResponse11( reject, error.response, "4XX", @@ -32076,7 +32858,7 @@ var UnclaimedDraftApi = class { } unclaimedDraftCreateEmbeddedWithTemplate(_0) { return __async(this, arguments, function* (unclaimedDraftCreateEmbeddedWithTemplateRequest, options = { headers: {} }) { - unclaimedDraftCreateEmbeddedWithTemplateRequest = deserializeIfNeeded10( + unclaimedDraftCreateEmbeddedWithTemplateRequest = deserializeIfNeeded11( unclaimedDraftCreateEmbeddedWithTemplateRequest, "UnclaimedDraftCreateEmbeddedWithTemplateRequest" ); @@ -32153,7 +32935,7 @@ var UnclaimedDraftApi = class { (resolve, reject) => { axios_default.request(localVarRequestOptions).then( (response) => { - handleSuccessfulResponse11( + handleSuccessfulResponse12( resolve, reject, response, @@ -32165,7 +32947,7 @@ var UnclaimedDraftApi = class { reject(error); return; } - if (handleErrorCodeResponse11( + if (handleErrorCodeResponse12( reject, error.response, 200, @@ -32173,7 +32955,7 @@ var UnclaimedDraftApi = class { )) { return; } - if (handleErrorRangeResponse10( + if (handleErrorRangeResponse11( reject, error.response, "4XX", @@ -32191,7 +32973,7 @@ var UnclaimedDraftApi = class { } unclaimedDraftEditAndResend(_0, _1) { return __async(this, arguments, function* (signatureRequestId, unclaimedDraftEditAndResendRequest, options = { headers: {} }) { - unclaimedDraftEditAndResendRequest = deserializeIfNeeded10( + unclaimedDraftEditAndResendRequest = deserializeIfNeeded11( unclaimedDraftEditAndResendRequest, "UnclaimedDraftEditAndResendRequest" ); @@ -32276,7 +33058,7 @@ var UnclaimedDraftApi = class { (resolve, reject) => { axios_default.request(localVarRequestOptions).then( (response) => { - handleSuccessfulResponse11( + handleSuccessfulResponse12( resolve, reject, response, @@ -32288,7 +33070,7 @@ var UnclaimedDraftApi = class { reject(error); return; } - if (handleErrorCodeResponse11( + if (handleErrorCodeResponse12( reject, error.response, 200, @@ -32296,7 +33078,7 @@ var UnclaimedDraftApi = class { )) { return; } - if (handleErrorRangeResponse10( + if (handleErrorRangeResponse11( reject, error.response, "4XX", @@ -32313,13 +33095,13 @@ var UnclaimedDraftApi = class { }); } }; -function deserializeIfNeeded10(obj, classname) { +function deserializeIfNeeded11(obj, classname) { if (obj !== null && obj !== void 0 && obj.constructor.name !== classname) { return ObjectSerializer.deserialize(obj, classname); } return obj; } -function handleSuccessfulResponse11(resolve, reject, response, returnType) { +function handleSuccessfulResponse12(resolve, reject, response, returnType) { let body = response.data; if (response.status && response.status >= 200 && response.status <= 299) { if (returnType) { @@ -32330,7 +33112,7 @@ function handleSuccessfulResponse11(resolve, reject, response, returnType) { reject(new HttpError(response, body, response.status)); } } -function handleErrorCodeResponse11(reject, response, code, returnType) { +function handleErrorCodeResponse12(reject, response, code, returnType) { if (response.status !== code) { return false; } @@ -32338,7 +33120,7 @@ function handleErrorCodeResponse11(reject, response, code, returnType) { reject(new HttpError(response, body, response.status)); return true; } -function handleErrorRangeResponse10(reject, response, code, returnType) { +function handleErrorRangeResponse11(reject, response, code, returnType) { let rangeCodeLeft = Number(code[0] + "00"); let rangeCodeRight = Number(code[0] + "99"); if (response.status >= rangeCodeLeft && response.status <= rangeCodeRight) { @@ -32428,6 +33210,7 @@ var APIS = [ ApiAppApi, BulkSendJobApi, EmbeddedApi, + FaxApi, FaxLineApi, OAuthApi, ReportApi, @@ -32479,6 +33262,7 @@ var APIS = [ EventCallbackRequest, EventCallbackRequestEvent, EventCallbackRequestEventMetadata, + FaxApi, FaxLineAddUserRequest, FaxLineApi, FaxLineAreaCodeGetCountryEnum, @@ -32491,6 +33275,11 @@ var APIS = [ FaxLineRemoveUserRequest, FaxLineResponse, FaxLineResponseFaxLine, + FaxListResponse, + FaxResponse, + FaxResponseFax, + FaxResponseFaxTransmission, + FaxSendRequest, FileResponse, FileResponseDataUri, HttpBasicAuth, @@ -32543,6 +33332,7 @@ var APIS = [ SubCustomField, SubEditorOptions, SubFieldOptions, + SubFile, SubFormFieldGroup, SubFormFieldRule, SubFormFieldRuleAction, diff --git a/sdks/node/docs/api/FaxApi.md b/sdks/node/docs/api/FaxApi.md new file mode 100644 index 000000000..aeeee7989 --- /dev/null +++ b/sdks/node/docs/api/FaxApi.md @@ -0,0 +1,401 @@ +# FaxApi + +All URIs are relative to https://api.hellosign.com/v3. + +| Method | HTTP request | Description | +| ------------- | ------------- | ------------- | +| [**deleteFax()**](FaxApi.md#deleteFax) | **DELETE** /fax/{fax_id} | Delete Fax | +| [**getFaxById()**](FaxApi.md#getFaxById) | **GET** /fax/{fax_id} | Get Fax | +| [**getFaxFiles()**](FaxApi.md#getFaxFiles) | **GET** /fax/files/{fax_id} | List Fax Files | +| [**listFaxes()**](FaxApi.md#listFaxes) | **GET** /fax/list | Lists Faxes | +| [**sendFax()**](FaxApi.md#sendFax) | **POST** /fax/send | Send Fax | + + +## `deleteFax()` + +```typescript +deleteFax(faxId: string) +``` + +Delete Fax + +Deletes the specified Fax from the system. + +### TypeScript Example + +```typescript +import * as DropboxSign from "@dropbox/sign"; + +const faxApi = new DropboxSign.FaxApi(); + +// Configure HTTP basic authorization: api_key +faxApi.username = "YOUR_API_KEY"; + +const result = faxApi.deleteFax("[FAX_NUMBER]"); + +result.catch(error => { + console.log("Exception when calling Dropbox Sign API:"); + console.log(error.body); +}); + +``` + +### JavaScript Example + +```javascript +import * as DropboxSign from "@dropbox/sign"; + +const faxApi = new DropboxSign.FaxApi(); + +// Configure HTTP basic authorization: api_key +faxApi.username = "YOUR_API_KEY"; + + +const result = faxApi.deleteFax("[FAX_NUMBER]"); + +result.catch(error => { + console.log("Exception when calling Dropbox Sign API:"); + console.log(error.body); +}); + +``` + +### Parameters + +|Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **faxId** | **string**| Fax ID | | + +### Return type + +void (empty response body) + +### Authorization + +[api_key](../../README.md#api_key) + +### HTTP request headers + +- **Content-Type**: Not defined +- **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) + +## `getFaxById()` + +```typescript +getFaxById(faxId: string): FaxResponse +``` + +Get Fax + +Returns information about fax + +### TypeScript Example + +```typescript +import * as DropboxSign from "@dropbox/sign"; + +const faxApi = new DropboxSign.ApiAppApi(); + +// Configure HTTP basic authorization: api_key +faxApi.username = "YOUR_API_KEY"; + +const faxId = "fa5c8a0b0f492d768749333ad6fcc214c111e967" + +const result = faxApi.getFaxById(faxId); +result.then(response => { + console.log(response.body); +}).catch(error => { + console.log("Exception when calling Dropbox Sign API:"); + console.log(error.body); +}); + +``` + +### JavaScript Example + +```javascript +import * as DropboxSign from "@dropbox/sign"; + +const faxApi = new DropboxSign.FaxApi(); + +// Configure HTTP basic authorization: api_key +faxApi.username = "YOUR_API_KEY"; + +const faxId = "fa5c8a0b0f492d768749333ad6fcc214c111e967" + +const result = faxApi.getFaxById(faxId); +result.then(response => { + console.log(response.body); +}).catch(error => { + console.log("Exception when calling Dropbox Sign API:"); + console.log(error.body); +}); + +``` + +### Parameters + +|Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **faxId** | **string**| Fax ID | | + +### Return type + +[**FaxResponse**](../model/FaxResponse.md) + +### Authorization + +[api_key](../../README.md#api_key) + +### HTTP request headers + +- **Content-Type**: Not defined +- **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) + +## `getFaxFiles()` + +```typescript +getFaxFiles(faxId: string) +``` + +List Fax Files + +Returns list of fax files + +### TypeScript Example + +```typescript +import * as DropboxSign from "@dropbox/sign"; + +const faxApi = new DropboxSign.FaxApi(); + +// Configure HTTP basic authorization: api_key +faxApi.username = "YOUR_API_KEY"; + +const faxId = "fa5c8a0b0f492d768749333ad6fcc214c111e967"; + +const result = faxApi.getFaxFiles(faxId); +result.then(response => { + console.log(response.body); +}).catch(error => { + console.log("Exception when calling Dropbox Sign API:"); + console.log(error.body); +}); + +``` + +### JavaScript Example + +```javascript +import * as DropboxSign from "@dropbox/sign"; + +const faxApi = new DropboxSign.FaxApi(); + +// Configure HTTP basic authorization: api_key +faxApi.username = "YOUR_API_KEY"; + +const faxId = "fa5c8a0b0f492d768749333ad6fcc214c111e967"; + +const result = faxApi.getFaxFiles(faxId); +result.then(response => { + console.log(response.body); +}).catch(error => { + console.log("Exception when calling Dropbox Sign API:"); + console.log(error.body); +}); + +``` + +### Parameters + +|Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **faxId** | **string**| Fax ID | | + +### Return type + +void (empty response body) + +### Authorization + +[api_key](../../README.md#api_key) + +### HTTP request headers + +- **Content-Type**: Not defined +- **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) + +## `listFaxes()` + +```typescript +listFaxes(page: number, pageSize: number): FaxListResponse +``` + +Lists Faxes + +Returns properties of multiple faxes + +### TypeScript Example + +```typescript +import * as DropboxSign from "@dropbox/sign"; + +const faxApi = new DropboxSign.FaxApi(); + +// Configure HTTP basic authorization: api_key +faxApi.username = "YOUR_API_KEY"; + +const page = 1; +const pageSize = 2; + +const result = faxApi.listFaxes(page, pageSize); +result.then(response => { + console.log(response.body); +}).catch(error => { + console.log("Exception when calling Dropbox Sign API:"); + console.log(error.body); +}); + +``` + +### JavaScript Example + +```javascript +import * as DropboxSign from "@dropbox/sign"; + +const faxApi = new DropboxSign.FaxApi(); + +// Configure HTTP basic authorization: api_key +faxApi.username = "YOUR_API_KEY"; + +const page = 1; +const pageSize = 2; + +const result = faxApi.listFaxes(page, pageSize); +result.then(response => { + console.log(response.body); +}).catch(error => { + console.log("Exception when calling Dropbox Sign API:"); + console.log(error.body); +}); + +``` + +### Parameters + +|Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **page** | **number**| Page | | +| **pageSize** | **number**| Page size | | + +### Return type + +[**FaxListResponse**](../model/FaxListResponse.md) + +### Authorization + +[api_key](../../README.md#api_key) + +### HTTP request headers + +- **Content-Type**: Not defined +- **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) + +## `sendFax()` + +```typescript +sendFax(faxSendRequest: FaxSendRequest): FaxResponse +``` + +Send Fax + +Action to prepare and send a fax + +### TypeScript Example + +```typescript +import * as DropboxSign from "@dropbox/sign"; + +const faxApi = new DropboxSign.FaxApi(); + +// Configure HTTP basic authorization: api_key +faxApi.username = "YOUR_API_KEY"; + +const data: DropboxSign.FaxCreateRequest = { + areaCode: 209, + country: "US", +}; + +const result = faxApi.faxCreate(data); +result.then(response => { + console.log(response.body); +}).catch(error => { + console.log("Exception when calling Dropbox Sign API:"); + console.log(error.body); +}); + +``` + +### JavaScript Example + +```javascript +import * as DropboxSign from "@dropbox/sign"; + +const faxApi = new DropboxSign.FaxApi(); + +// Configure HTTP basic authorization: api_key +faxApi.username = "YOUR_API_KEY"; + +const data = { + areaCode: 209, + country: "US", +}; + +const result = faxApi.faxCreate(data); +result.then(response => { + console.log(response.body); +}).catch(error => { + console.log("Exception when calling Dropbox Sign API:"); + console.log(error.body); +}); + +``` + +### Parameters + +|Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **faxSendRequest** | [**FaxSendRequest**](../model/FaxSendRequest.md)| | | + +### Return type + +[**FaxResponse**](../model/FaxResponse.md) + +### Authorization + +[api_key](../../README.md#api_key) + +### HTTP request headers + +- **Content-Type**: `application/json` +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) diff --git a/sdks/node/docs/model/FaxListResponse.md b/sdks/node/docs/model/FaxListResponse.md new file mode 100644 index 000000000..e5bf8adb6 --- /dev/null +++ b/sdks/node/docs/model/FaxListResponse.md @@ -0,0 +1,12 @@ +# # FaxListResponse + + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +| `faxes`*_required_ | [```Array```](FaxResponseFax.md) | | | +| `listInfo`*_required_ | [```ListInfoResponse```](ListInfoResponse.md) | | | + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/sdks/node/docs/model/FaxResponse.md b/sdks/node/docs/model/FaxResponse.md new file mode 100644 index 000000000..0ec18fe14 --- /dev/null +++ b/sdks/node/docs/model/FaxResponse.md @@ -0,0 +1,12 @@ +# # FaxResponse + + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +| `fax`*_required_ | [```FaxResponseFax```](FaxResponseFax.md) | | | +| `warnings` | [```WarningResponse```](WarningResponse.md) | | | + +[[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/FaxResponseFax.md b/sdks/node/docs/model/FaxResponseFax.md new file mode 100644 index 000000000..fdeab50f4 --- /dev/null +++ b/sdks/node/docs/model/FaxResponseFax.md @@ -0,0 +1,20 @@ +# # FaxResponseFax + + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +| `faxId` | ```string``` | Fax ID | | +| `title` | ```string``` | Fax Title | | +| `originalTitle` | ```string``` | Fax Original Title | | +| `subject` | ```string``` | Fax Subject | | +| `message` | ```string``` | Fax Message | | +| `metadata` | ```object``` | Fax Metadata | | +| `createdAt` | ```number``` | Fax Created At Timestamp | | +| `from` | ```string``` | Fax Sender Email | | +| `transmissions` | [```Array```](FaxResponseFaxTransmission.md) | Fax Transmissions List | | +| `filesUrl` | ```string``` | Fax Files URL | | + +[[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/FaxResponseFaxTransmission.md b/sdks/node/docs/model/FaxResponseFaxTransmission.md new file mode 100644 index 000000000..ef86d2c9f --- /dev/null +++ b/sdks/node/docs/model/FaxResponseFaxTransmission.md @@ -0,0 +1,14 @@ +# # FaxResponseFaxTransmission + + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +| `recipient` | ```string``` | Fax Transmission Recipient | | +| `sender` | ```string``` | Fax Transmission Sender | | +| `statusCode` | ```string``` | Fax Transmission Status Code | | +| `sentAt` | ```number``` | Fax Transmission Sent Timestamp | | + +[[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/FaxSendRequest.md b/sdks/node/docs/model/FaxSendRequest.md new file mode 100644 index 000000000..16496eaba --- /dev/null +++ b/sdks/node/docs/model/FaxSendRequest.md @@ -0,0 +1,20 @@ +# # FaxSendRequest + + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +| `to` | ```string``` | Fax Send To Recipient | | +| `from` | ```string``` | Fax Send From Sender (used only with fax number) | | +| `file` | [```Array```](SubFile.md) | Fax File to Send | | +| `fileUrl` | ```Array``` | Fax File URL to Send | | +| `fileUrlNames` | ```Array``` | Fax File URL Names | | +| `testMode` | ```boolean``` | API Test Mode Setting | | +| `coverPageTo` | ```string``` | Fax Cover Page for Recipient | | +| `coverPageFrom` | ```string``` | Fax Cover Page for Sender | | +| `coverPageMessage` | ```string``` | Fax Cover Page Message | | +| `title` | ```string``` | Fax Title | | + +[[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/SubFile.md b/sdks/node/docs/model/SubFile.md new file mode 100644 index 000000000..b08f3ed5d --- /dev/null +++ b/sdks/node/docs/model/SubFile.md @@ -0,0 +1,11 @@ +# # SubFile + +Actual uploaded physical file + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +| `name` | ```string``` | Actual physical uploaded file name that is derived during upload. Not settable parameter. | [default to ''] | + +[[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/faxListResponse.ts b/sdks/node/model/faxListResponse.ts new file mode 100644 index 000000000..09c10a399 --- /dev/null +++ b/sdks/node/model/faxListResponse.ts @@ -0,0 +1,56 @@ +/** + * 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 { FaxResponseFax } from "./faxResponseFax"; +import { ListInfoResponse } from "./listInfoResponse"; + +export class FaxListResponse { + "faxes": Array; + "listInfo": ListInfoResponse; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: AttributeTypeMap = [ + { + name: "faxes", + baseName: "faxes", + type: "Array", + }, + { + name: "listInfo", + baseName: "list_info", + type: "ListInfoResponse", + }, + ]; + + static getAttributeTypeMap(): AttributeTypeMap { + return FaxListResponse.attributeTypeMap; + } + + /** Attempt to instantiate and hydrate a new instance of this class */ + static init(data: any): FaxListResponse { + return ObjectSerializer.deserialize(data, "FaxListResponse"); + } +} diff --git a/sdks/node/model/faxResponse.ts b/sdks/node/model/faxResponse.ts new file mode 100644 index 000000000..d2c2989e9 --- /dev/null +++ b/sdks/node/model/faxResponse.ts @@ -0,0 +1,56 @@ +/** + * 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 { FaxResponseFax } from "./faxResponseFax"; +import { WarningResponse } from "./warningResponse"; + +export class FaxResponse { + "fax": FaxResponseFax; + "warnings"?: WarningResponse; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: AttributeTypeMap = [ + { + name: "fax", + baseName: "fax", + type: "FaxResponseFax", + }, + { + name: "warnings", + baseName: "warnings", + type: "WarningResponse", + }, + ]; + + static getAttributeTypeMap(): AttributeTypeMap { + return FaxResponse.attributeTypeMap; + } + + /** Attempt to instantiate and hydrate a new instance of this class */ + static init(data: any): FaxResponse { + return ObjectSerializer.deserialize(data, "FaxResponse"); + } +} diff --git a/sdks/node/model/faxResponseFax.ts b/sdks/node/model/faxResponseFax.ts new file mode 100644 index 000000000..079bdc1bf --- /dev/null +++ b/sdks/node/model/faxResponseFax.ts @@ -0,0 +1,133 @@ +/** + * 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 { FaxResponseFaxTransmission } from "./faxResponseFaxTransmission"; + +export class FaxResponseFax { + /** + * Fax ID + */ + "faxId"?: string; + /** + * Fax Title + */ + "title"?: string; + /** + * Fax Original Title + */ + "originalTitle"?: string; + /** + * Fax Subject + */ + "subject"?: string; + /** + * Fax Message + */ + "message"?: string; + /** + * Fax Metadata + */ + "metadata"?: object; + /** + * Fax Created At Timestamp + */ + "createdAt"?: number; + /** + * Fax Sender Email + */ + "from"?: string; + /** + * Fax Transmissions List + */ + "transmissions"?: Array; + /** + * Fax Files URL + */ + "filesUrl"?: string; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: AttributeTypeMap = [ + { + name: "faxId", + baseName: "fax_id", + type: "string", + }, + { + name: "title", + baseName: "title", + type: "string", + }, + { + name: "originalTitle", + baseName: "original_title", + type: "string", + }, + { + name: "subject", + baseName: "subject", + type: "string", + }, + { + name: "message", + baseName: "message", + type: "string", + }, + { + name: "metadata", + baseName: "metadata", + type: "object", + }, + { + name: "createdAt", + baseName: "created_at", + type: "number", + }, + { + name: "from", + baseName: "from", + type: "string", + }, + { + name: "transmissions", + baseName: "transmissions", + type: "Array", + }, + { + name: "filesUrl", + baseName: "files_url", + type: "string", + }, + ]; + + static getAttributeTypeMap(): AttributeTypeMap { + return FaxResponseFax.attributeTypeMap; + } + + /** Attempt to instantiate and hydrate a new instance of this class */ + static init(data: any): FaxResponseFax { + return ObjectSerializer.deserialize(data, "FaxResponseFax"); + } +} diff --git a/sdks/node/model/faxResponseFaxTransmission.ts b/sdks/node/model/faxResponseFaxTransmission.ts new file mode 100644 index 000000000..5f650f6ef --- /dev/null +++ b/sdks/node/model/faxResponseFaxTransmission.ts @@ -0,0 +1,78 @@ +/** + * The MIT License (MIT) + * + * Copyright (C) 2023 dropbox.com + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +import { AttributeTypeMap, ObjectSerializer } from "./"; + +export class FaxResponseFaxTransmission { + /** + * Fax Transmission Recipient + */ + "recipient"?: string; + /** + * Fax Transmission Sender + */ + "sender"?: string; + /** + * Fax Transmission Status Code + */ + "statusCode"?: string; + /** + * Fax Transmission Sent Timestamp + */ + "sentAt"?: number; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: AttributeTypeMap = [ + { + name: "recipient", + baseName: "recipient", + type: "string", + }, + { + name: "sender", + baseName: "sender", + type: "string", + }, + { + name: "statusCode", + baseName: "status_code", + type: "string", + }, + { + name: "sentAt", + baseName: "sent_at", + type: "number", + }, + ]; + + static getAttributeTypeMap(): AttributeTypeMap { + return FaxResponseFaxTransmission.attributeTypeMap; + } + + /** Attempt to instantiate and hydrate a new instance of this class */ + static init(data: any): FaxResponseFaxTransmission { + return ObjectSerializer.deserialize(data, "FaxResponseFaxTransmission"); + } +} diff --git a/sdks/node/model/faxSendRequest.ts b/sdks/node/model/faxSendRequest.ts new file mode 100644 index 000000000..4480e3bb3 --- /dev/null +++ b/sdks/node/model/faxSendRequest.ts @@ -0,0 +1,133 @@ +/** + * 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 { SubFile } from "./subFile"; + +export class FaxSendRequest { + /** + * Fax Send To Recipient + */ + "to"?: string; + /** + * Fax Send From Sender (used only with fax number) + */ + "from"?: string | null; + /** + * Fax File to Send + */ + "file"?: Array; + /** + * Fax File URL to Send + */ + "fileUrl"?: Array; + /** + * Fax File URL Names + */ + "fileUrlNames"?: Array; + /** + * API Test Mode Setting + */ + "testMode"?: boolean; + /** + * Fax Cover Page for Recipient + */ + "coverPageTo"?: string | null; + /** + * Fax Cover Page for Sender + */ + "coverPageFrom"?: string | null; + /** + * Fax Cover Page Message + */ + "coverPageMessage"?: string | null; + /** + * Fax Title + */ + "title"?: string | null; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: AttributeTypeMap = [ + { + name: "to", + baseName: "to", + type: "string", + }, + { + name: "from", + baseName: "from", + type: "string", + }, + { + name: "file", + baseName: "file", + type: "Array", + }, + { + name: "fileUrl", + baseName: "file_url", + type: "Array", + }, + { + name: "fileUrlNames", + baseName: "file_url_names", + type: "Array", + }, + { + name: "testMode", + baseName: "test_mode", + type: "boolean", + }, + { + name: "coverPageTo", + baseName: "cover_page_to", + type: "string", + }, + { + name: "coverPageFrom", + baseName: "cover_page_from", + type: "string", + }, + { + name: "coverPageMessage", + baseName: "cover_page_message", + type: "string", + }, + { + name: "title", + baseName: "title", + type: "string", + }, + ]; + + static getAttributeTypeMap(): AttributeTypeMap { + return FaxSendRequest.attributeTypeMap; + } + + /** Attempt to instantiate and hydrate a new instance of this class */ + static init(data: any): FaxSendRequest { + return ObjectSerializer.deserialize(data, "FaxSendRequest"); + } +} diff --git a/sdks/node/model/index.ts b/sdks/node/model/index.ts index c59b28024..a0991d6c3 100644 --- a/sdks/node/model/index.ts +++ b/sdks/node/model/index.ts @@ -44,6 +44,11 @@ import { FaxLineListResponse } from "./faxLineListResponse"; import { FaxLineRemoveUserRequest } from "./faxLineRemoveUserRequest"; import { FaxLineResponse } from "./faxLineResponse"; import { FaxLineResponseFaxLine } from "./faxLineResponseFaxLine"; +import { FaxListResponse } from "./faxListResponse"; +import { FaxResponse } from "./faxResponse"; +import { FaxResponseFax } from "./faxResponseFax"; +import { FaxResponseFaxTransmission } from "./faxResponseFaxTransmission"; +import { FaxSendRequest } from "./faxSendRequest"; import { FileResponse } from "./fileResponse"; import { FileResponseDataUri } from "./fileResponseDataUri"; import { ListInfoResponse } from "./listInfoResponse"; @@ -101,6 +106,7 @@ import { SubCC } from "./subCC"; import { SubCustomField } from "./subCustomField"; import { SubEditorOptions } from "./subEditorOptions"; import { SubFieldOptions } from "./subFieldOptions"; +import { SubFile } from "./subFile"; import { SubFormFieldGroup } from "./subFormFieldGroup"; import { SubFormFieldRule } from "./subFormFieldRule"; import { SubFormFieldRuleAction } from "./subFormFieldRuleAction"; @@ -287,6 +293,11 @@ export let typeMap: { [index: string]: any } = { FaxLineRemoveUserRequest: FaxLineRemoveUserRequest, FaxLineResponse: FaxLineResponse, FaxLineResponseFaxLine: FaxLineResponseFaxLine, + FaxListResponse: FaxListResponse, + FaxResponse: FaxResponse, + FaxResponseFax: FaxResponseFax, + FaxResponseFaxTransmission: FaxResponseFaxTransmission, + FaxSendRequest: FaxSendRequest, FileResponse: FileResponse, FileResponseDataUri: FileResponseDataUri, ListInfoResponse: ListInfoResponse, @@ -344,6 +355,7 @@ export let typeMap: { [index: string]: any } = { SubCustomField: SubCustomField, SubEditorOptions: SubEditorOptions, SubFieldOptions: SubFieldOptions, + SubFile: SubFile, SubFormFieldGroup: SubFormFieldGroup, SubFormFieldRule: SubFormFieldRule, SubFormFieldRuleAction: SubFormFieldRuleAction, @@ -510,6 +522,11 @@ export { FaxLineRemoveUserRequest, FaxLineResponse, FaxLineResponseFaxLine, + FaxListResponse, + FaxResponse, + FaxResponseFax, + FaxResponseFaxTransmission, + FaxSendRequest, FileResponse, FileResponseDataUri, HttpBasicAuth, @@ -561,6 +578,7 @@ export { SubCustomField, SubEditorOptions, SubFieldOptions, + SubFile, SubFormFieldGroup, SubFormFieldRule, SubFormFieldRuleAction, diff --git a/sdks/node/model/subFile.ts b/sdks/node/model/subFile.ts new file mode 100644 index 000000000..4c434908c --- /dev/null +++ b/sdks/node/model/subFile.ts @@ -0,0 +1,54 @@ +/** + * 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 "./"; + +/** + * Actual uploaded physical file + */ +export class SubFile { + /** + * Actual physical uploaded file name that is derived during upload. Not settable parameter. + */ + "name"?: string = ""; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: AttributeTypeMap = [ + { + name: "name", + baseName: "name", + type: "string", + }, + ]; + + static getAttributeTypeMap(): AttributeTypeMap { + return SubFile.attributeTypeMap; + } + + /** Attempt to instantiate and hydrate a new instance of this class */ + static init(data: any): SubFile { + return ObjectSerializer.deserialize(data, "SubFile"); + } +} diff --git a/sdks/node/types/api/faxApi.d.ts b/sdks/node/types/api/faxApi.d.ts new file mode 100644 index 000000000..9c0cdf4b8 --- /dev/null +++ b/sdks/node/types/api/faxApi.d.ts @@ -0,0 +1,32 @@ +import { Authentication, FaxListResponse, FaxResponse, FaxSendRequest, HttpBasicAuth, HttpBearerAuth, Interceptor } from "../model"; +import { optionsI, returnTypeI, returnTypeT } from "./"; +export declare enum FaxApiApiKeys { +} +export declare class FaxApi { + protected _basePath: string; + protected _defaultHeaders: any; + protected _useQuerystring: boolean; + protected authentications: { + default: Authentication; + api_key: HttpBasicAuth; + oauth2: HttpBearerAuth; + }; + protected interceptors: Interceptor[]; + constructor(basePath?: string); + set useQuerystring(value: boolean); + set basePath(basePath: string); + set defaultHeaders(defaultHeaders: any); + get defaultHeaders(): any; + get basePath(): string; + setDefaultAuthentication(auth: Authentication): void; + setApiKey(key: string): void; + set username(username: string); + set password(password: string); + set accessToken(accessToken: string | (() => string)); + addInterceptor(interceptor: Interceptor): void; + deleteFax(faxId: string, options?: optionsI): Promise; + getFaxById(faxId: string, options?: optionsI): Promise>; + getFaxFiles(faxId: string, options?: optionsI): Promise; + listFaxes(page: number, pageSize: number, options?: optionsI): Promise>; + sendFax(faxSendRequest: FaxSendRequest, options?: optionsI): Promise>; +} diff --git a/sdks/node/types/api/index.d.ts b/sdks/node/types/api/index.d.ts index 567248c08..4fb28dcef 100644 --- a/sdks/node/types/api/index.d.ts +++ b/sdks/node/types/api/index.d.ts @@ -2,6 +2,7 @@ import { AccountApi } from "./accountApi"; import { ApiAppApi } from "./apiAppApi"; import { BulkSendJobApi } from "./bulkSendJobApi"; import { EmbeddedApi } from "./embeddedApi"; +import { FaxApi } from "./faxApi"; import { FaxLineApi } from "./faxLineApi"; import { OAuthApi } from "./oAuthApi"; import { ReportApi } from "./reportApi"; @@ -9,6 +10,6 @@ import { SignatureRequestApi } from "./signatureRequestApi"; import { TeamApi } from "./teamApi"; import { TemplateApi } from "./templateApi"; import { UnclaimedDraftApi } from "./unclaimedDraftApi"; -export { AccountApi, ApiAppApi, BulkSendJobApi, EmbeddedApi, FaxLineApi, OAuthApi, ReportApi, SignatureRequestApi, TeamApi, TemplateApi, UnclaimedDraftApi, }; +export { AccountApi, ApiAppApi, BulkSendJobApi, EmbeddedApi, FaxApi, FaxLineApi, OAuthApi, ReportApi, SignatureRequestApi, TeamApi, TemplateApi, UnclaimedDraftApi, }; export { generateFormData, HttpError, optionsI, queryParamsSerializer, returnTypeI, returnTypeT, toFormData, USER_AGENT, } from "./apis"; -export declare const APIS: (typeof AccountApi | typeof ApiAppApi | typeof BulkSendJobApi | typeof EmbeddedApi | typeof FaxLineApi | typeof OAuthApi | typeof ReportApi | typeof SignatureRequestApi | typeof TeamApi | typeof TemplateApi | typeof UnclaimedDraftApi)[]; +export declare const APIS: (typeof AccountApi | typeof ApiAppApi | typeof BulkSendJobApi | typeof EmbeddedApi | typeof FaxApi | typeof FaxLineApi | typeof OAuthApi | typeof ReportApi | typeof SignatureRequestApi | typeof TeamApi | typeof TemplateApi | typeof UnclaimedDraftApi)[]; diff --git a/sdks/node/types/model/faxListResponse.d.ts b/sdks/node/types/model/faxListResponse.d.ts new file mode 100644 index 000000000..843240400 --- /dev/null +++ b/sdks/node/types/model/faxListResponse.d.ts @@ -0,0 +1,11 @@ +import { AttributeTypeMap } from "./"; +import { FaxResponseFax } from "./faxResponseFax"; +import { ListInfoResponse } from "./listInfoResponse"; +export declare class FaxListResponse { + "faxes": Array; + "listInfo": ListInfoResponse; + static discriminator: string | undefined; + static attributeTypeMap: AttributeTypeMap; + static getAttributeTypeMap(): AttributeTypeMap; + static init(data: any): FaxListResponse; +} diff --git a/sdks/node/types/model/faxResponse.d.ts b/sdks/node/types/model/faxResponse.d.ts new file mode 100644 index 000000000..2b564e2fd --- /dev/null +++ b/sdks/node/types/model/faxResponse.d.ts @@ -0,0 +1,11 @@ +import { AttributeTypeMap } from "./"; +import { FaxResponseFax } from "./faxResponseFax"; +import { WarningResponse } from "./warningResponse"; +export declare class FaxResponse { + "fax": FaxResponseFax; + "warnings"?: WarningResponse; + static discriminator: string | undefined; + static attributeTypeMap: AttributeTypeMap; + static getAttributeTypeMap(): AttributeTypeMap; + static init(data: any): FaxResponse; +} diff --git a/sdks/node/types/model/faxResponseFax.d.ts b/sdks/node/types/model/faxResponseFax.d.ts new file mode 100644 index 000000000..628c3fe9f --- /dev/null +++ b/sdks/node/types/model/faxResponseFax.d.ts @@ -0,0 +1,18 @@ +import { AttributeTypeMap } from "./"; +import { FaxResponseFaxTransmission } from "./faxResponseFaxTransmission"; +export declare class FaxResponseFax { + "faxId"?: string; + "title"?: string; + "originalTitle"?: string; + "subject"?: string; + "message"?: string; + "metadata"?: object; + "createdAt"?: number; + "from"?: string; + "transmissions"?: Array; + "filesUrl"?: string; + static discriminator: string | undefined; + static attributeTypeMap: AttributeTypeMap; + static getAttributeTypeMap(): AttributeTypeMap; + static init(data: any): FaxResponseFax; +} diff --git a/sdks/node/types/model/faxResponseFaxTransmission.d.ts b/sdks/node/types/model/faxResponseFaxTransmission.d.ts new file mode 100644 index 000000000..4bbafb752 --- /dev/null +++ b/sdks/node/types/model/faxResponseFaxTransmission.d.ts @@ -0,0 +1,11 @@ +import { AttributeTypeMap } from "./"; +export declare class FaxResponseFaxTransmission { + "recipient"?: string; + "sender"?: string; + "statusCode"?: string; + "sentAt"?: number; + static discriminator: string | undefined; + static attributeTypeMap: AttributeTypeMap; + static getAttributeTypeMap(): AttributeTypeMap; + static init(data: any): FaxResponseFaxTransmission; +} diff --git a/sdks/node/types/model/faxSendRequest.d.ts b/sdks/node/types/model/faxSendRequest.d.ts new file mode 100644 index 000000000..e7e609d30 --- /dev/null +++ b/sdks/node/types/model/faxSendRequest.d.ts @@ -0,0 +1,18 @@ +import { AttributeTypeMap } from "./"; +import { SubFile } from "./subFile"; +export declare class FaxSendRequest { + "to"?: string; + "from"?: string | null; + "file"?: Array; + "fileUrl"?: Array; + "fileUrlNames"?: Array; + "testMode"?: boolean; + "coverPageTo"?: string | null; + "coverPageFrom"?: string | null; + "coverPageMessage"?: string | null; + "title"?: string | null; + static discriminator: string | undefined; + static attributeTypeMap: AttributeTypeMap; + static getAttributeTypeMap(): AttributeTypeMap; + static init(data: any): FaxSendRequest; +} diff --git a/sdks/node/types/model/index.d.ts b/sdks/node/types/model/index.d.ts index ad7859941..77b570a4f 100644 --- a/sdks/node/types/model/index.d.ts +++ b/sdks/node/types/model/index.d.ts @@ -44,6 +44,11 @@ import { FaxLineListResponse } from "./faxLineListResponse"; import { FaxLineRemoveUserRequest } from "./faxLineRemoveUserRequest"; import { FaxLineResponse } from "./faxLineResponse"; import { FaxLineResponseFaxLine } from "./faxLineResponseFaxLine"; +import { FaxListResponse } from "./faxListResponse"; +import { FaxResponse } from "./faxResponse"; +import { FaxResponseFax } from "./faxResponseFax"; +import { FaxResponseFaxTransmission } from "./faxResponseFaxTransmission"; +import { FaxSendRequest } from "./faxSendRequest"; import { FileResponse } from "./fileResponse"; import { FileResponseDataUri } from "./fileResponseDataUri"; import { ListInfoResponse } from "./listInfoResponse"; @@ -89,6 +94,7 @@ import { SubCC } from "./subCC"; import { SubCustomField } from "./subCustomField"; import { SubEditorOptions } from "./subEditorOptions"; import { SubFieldOptions } from "./subFieldOptions"; +import { SubFile } from "./subFile"; import { SubFormFieldGroup } from "./subFormFieldGroup"; import { SubFormFieldRule } from "./subFormFieldRule"; import { SubFormFieldRuleAction } from "./subFormFieldRuleAction"; @@ -189,4 +195,4 @@ export declare let enumsMap: { export declare let typeMap: { [index: string]: any; }; -export { AccountCreateRequest, AccountCreateResponse, AccountGetResponse, AccountResponse, AccountResponseQuotas, AccountResponseUsage, AccountUpdateRequest, AccountVerifyRequest, AccountVerifyResponse, AccountVerifyResponseAccount, ApiAppCreateRequest, ApiAppGetResponse, ApiAppListResponse, ApiAppResponse, ApiAppResponseOAuth, ApiAppResponseOptions, ApiAppResponseOwnerAccount, ApiAppResponseWhiteLabelingOptions, ApiAppUpdateRequest, ApiKeyAuth, AttributeTypeMap, Authentication, BulkSendJobGetResponse, BulkSendJobGetResponseSignatureRequests, BulkSendJobListResponse, BulkSendJobResponse, BulkSendJobSendResponse, EmbeddedEditUrlRequest, EmbeddedEditUrlResponse, EmbeddedEditUrlResponseEmbedded, EmbeddedSignUrlResponse, EmbeddedSignUrlResponseEmbedded, ErrorResponse, ErrorResponseError, EventCallbackHelper, EventCallbackRequest, EventCallbackRequestEvent, EventCallbackRequestEventMetadata, FaxLineAddUserRequest, FaxLineAreaCodeGetCountryEnum, FaxLineAreaCodeGetProvinceEnum, FaxLineAreaCodeGetResponse, FaxLineAreaCodeGetStateEnum, FaxLineCreateRequest, FaxLineDeleteRequest, FaxLineListResponse, FaxLineRemoveUserRequest, FaxLineResponse, FaxLineResponseFaxLine, FileResponse, FileResponseDataUri, HttpBasicAuth, HttpBearerAuth, Interceptor, ListInfoResponse, OAuth, OAuthTokenGenerateRequest, OAuthTokenRefreshRequest, OAuthTokenResponse, ObjectSerializer, ReportCreateRequest, ReportCreateResponse, ReportResponse, RequestDetailedFile, RequestFile, SignatureRequestBulkCreateEmbeddedWithTemplateRequest, SignatureRequestBulkSendWithTemplateRequest, SignatureRequestCreateEmbeddedRequest, SignatureRequestCreateEmbeddedWithTemplateRequest, SignatureRequestGetResponse, SignatureRequestListResponse, SignatureRequestRemindRequest, SignatureRequestResponse, SignatureRequestResponseAttachment, SignatureRequestResponseCustomFieldBase, SignatureRequestResponseCustomFieldCheckbox, SignatureRequestResponseCustomFieldText, SignatureRequestResponseCustomFieldTypeEnum, SignatureRequestResponseDataBase, SignatureRequestResponseDataTypeEnum, SignatureRequestResponseDataValueCheckbox, SignatureRequestResponseDataValueCheckboxMerge, SignatureRequestResponseDataValueDateSigned, SignatureRequestResponseDataValueDropdown, SignatureRequestResponseDataValueInitials, SignatureRequestResponseDataValueRadio, SignatureRequestResponseDataValueSignature, SignatureRequestResponseDataValueText, SignatureRequestResponseDataValueTextMerge, SignatureRequestResponseSignatures, SignatureRequestSendRequest, SignatureRequestSendWithTemplateRequest, SignatureRequestUpdateRequest, SubAttachment, SubBulkSignerList, SubBulkSignerListCustomField, SubCC, SubCustomField, SubEditorOptions, SubFieldOptions, SubFormFieldGroup, SubFormFieldRule, SubFormFieldRuleAction, SubFormFieldRuleTrigger, SubFormFieldsPerDocumentBase, SubFormFieldsPerDocumentCheckbox, SubFormFieldsPerDocumentCheckboxMerge, SubFormFieldsPerDocumentDateSigned, SubFormFieldsPerDocumentDropdown, SubFormFieldsPerDocumentFontEnum, SubFormFieldsPerDocumentHyperlink, SubFormFieldsPerDocumentInitials, SubFormFieldsPerDocumentRadio, SubFormFieldsPerDocumentSignature, SubFormFieldsPerDocumentText, SubFormFieldsPerDocumentTextMerge, SubFormFieldsPerDocumentTypeEnum, SubMergeField, SubOAuth, SubOptions, SubSignatureRequestGroupedSigners, SubSignatureRequestSigner, SubSignatureRequestTemplateSigner, SubSigningOptions, SubTeamResponse, SubTemplateRole, SubUnclaimedDraftSigner, SubUnclaimedDraftTemplateSigner, SubWhiteLabelingOptions, TeamAddMemberRequest, TeamCreateRequest, TeamGetInfoResponse, TeamGetResponse, TeamInfoResponse, TeamInviteResponse, TeamInvitesResponse, TeamMemberResponse, TeamMembersResponse, TeamParentResponse, TeamRemoveMemberRequest, TeamResponse, TeamSubTeamsResponse, TeamUpdateRequest, TemplateAddUserRequest, TemplateCreateEmbeddedDraftRequest, TemplateCreateEmbeddedDraftResponse, TemplateCreateEmbeddedDraftResponseTemplate, TemplateCreateRequest, TemplateCreateResponse, TemplateCreateResponseTemplate, TemplateEditResponse, TemplateGetResponse, TemplateListResponse, TemplateRemoveUserRequest, TemplateResponse, TemplateResponseAccount, TemplateResponseAccountQuota, TemplateResponseCCRole, TemplateResponseDocument, TemplateResponseDocumentCustomFieldBase, TemplateResponseDocumentCustomFieldCheckbox, TemplateResponseDocumentCustomFieldText, TemplateResponseDocumentFieldGroup, TemplateResponseDocumentFieldGroupRule, TemplateResponseDocumentFormFieldBase, TemplateResponseDocumentFormFieldCheckbox, TemplateResponseDocumentFormFieldDateSigned, TemplateResponseDocumentFormFieldDropdown, TemplateResponseDocumentFormFieldHyperlink, TemplateResponseDocumentFormFieldInitials, TemplateResponseDocumentFormFieldRadio, TemplateResponseDocumentFormFieldSignature, TemplateResponseDocumentFormFieldText, TemplateResponseDocumentStaticFieldBase, TemplateResponseDocumentStaticFieldCheckbox, TemplateResponseDocumentStaticFieldDateSigned, TemplateResponseDocumentStaticFieldDropdown, TemplateResponseDocumentStaticFieldHyperlink, TemplateResponseDocumentStaticFieldInitials, TemplateResponseDocumentStaticFieldRadio, TemplateResponseDocumentStaticFieldSignature, TemplateResponseDocumentStaticFieldText, TemplateResponseFieldAvgTextLength, TemplateResponseSignerRole, TemplateUpdateFilesRequest, TemplateUpdateFilesResponse, TemplateUpdateFilesResponseTemplate, UnclaimedDraftCreateEmbeddedRequest, UnclaimedDraftCreateEmbeddedWithTemplateRequest, UnclaimedDraftCreateRequest, UnclaimedDraftCreateResponse, UnclaimedDraftEditAndResendRequest, UnclaimedDraftResponse, VoidAuth, WarningResponse, }; +export { AccountCreateRequest, AccountCreateResponse, AccountGetResponse, AccountResponse, AccountResponseQuotas, AccountResponseUsage, AccountUpdateRequest, AccountVerifyRequest, AccountVerifyResponse, AccountVerifyResponseAccount, ApiAppCreateRequest, ApiAppGetResponse, ApiAppListResponse, ApiAppResponse, ApiAppResponseOAuth, ApiAppResponseOptions, ApiAppResponseOwnerAccount, ApiAppResponseWhiteLabelingOptions, ApiAppUpdateRequest, ApiKeyAuth, AttributeTypeMap, Authentication, BulkSendJobGetResponse, BulkSendJobGetResponseSignatureRequests, BulkSendJobListResponse, BulkSendJobResponse, BulkSendJobSendResponse, EmbeddedEditUrlRequest, EmbeddedEditUrlResponse, EmbeddedEditUrlResponseEmbedded, EmbeddedSignUrlResponse, EmbeddedSignUrlResponseEmbedded, ErrorResponse, ErrorResponseError, EventCallbackHelper, EventCallbackRequest, EventCallbackRequestEvent, EventCallbackRequestEventMetadata, FaxLineAddUserRequest, FaxLineAreaCodeGetCountryEnum, FaxLineAreaCodeGetProvinceEnum, FaxLineAreaCodeGetResponse, FaxLineAreaCodeGetStateEnum, FaxLineCreateRequest, FaxLineDeleteRequest, FaxLineListResponse, FaxLineRemoveUserRequest, FaxLineResponse, FaxLineResponseFaxLine, FaxListResponse, FaxResponse, FaxResponseFax, FaxResponseFaxTransmission, FaxSendRequest, FileResponse, FileResponseDataUri, HttpBasicAuth, HttpBearerAuth, Interceptor, ListInfoResponse, OAuth, OAuthTokenGenerateRequest, OAuthTokenRefreshRequest, OAuthTokenResponse, ObjectSerializer, ReportCreateRequest, ReportCreateResponse, ReportResponse, RequestDetailedFile, RequestFile, SignatureRequestBulkCreateEmbeddedWithTemplateRequest, SignatureRequestBulkSendWithTemplateRequest, SignatureRequestCreateEmbeddedRequest, SignatureRequestCreateEmbeddedWithTemplateRequest, SignatureRequestGetResponse, SignatureRequestListResponse, SignatureRequestRemindRequest, SignatureRequestResponse, SignatureRequestResponseAttachment, SignatureRequestResponseCustomFieldBase, SignatureRequestResponseCustomFieldCheckbox, SignatureRequestResponseCustomFieldText, SignatureRequestResponseCustomFieldTypeEnum, SignatureRequestResponseDataBase, SignatureRequestResponseDataTypeEnum, SignatureRequestResponseDataValueCheckbox, SignatureRequestResponseDataValueCheckboxMerge, SignatureRequestResponseDataValueDateSigned, SignatureRequestResponseDataValueDropdown, SignatureRequestResponseDataValueInitials, SignatureRequestResponseDataValueRadio, SignatureRequestResponseDataValueSignature, SignatureRequestResponseDataValueText, SignatureRequestResponseDataValueTextMerge, SignatureRequestResponseSignatures, SignatureRequestSendRequest, SignatureRequestSendWithTemplateRequest, SignatureRequestUpdateRequest, SubAttachment, SubBulkSignerList, SubBulkSignerListCustomField, SubCC, SubCustomField, SubEditorOptions, SubFieldOptions, SubFile, SubFormFieldGroup, SubFormFieldRule, SubFormFieldRuleAction, SubFormFieldRuleTrigger, SubFormFieldsPerDocumentBase, SubFormFieldsPerDocumentCheckbox, SubFormFieldsPerDocumentCheckboxMerge, SubFormFieldsPerDocumentDateSigned, SubFormFieldsPerDocumentDropdown, SubFormFieldsPerDocumentFontEnum, SubFormFieldsPerDocumentHyperlink, SubFormFieldsPerDocumentInitials, SubFormFieldsPerDocumentRadio, SubFormFieldsPerDocumentSignature, SubFormFieldsPerDocumentText, SubFormFieldsPerDocumentTextMerge, SubFormFieldsPerDocumentTypeEnum, SubMergeField, SubOAuth, SubOptions, SubSignatureRequestGroupedSigners, SubSignatureRequestSigner, SubSignatureRequestTemplateSigner, SubSigningOptions, SubTeamResponse, SubTemplateRole, SubUnclaimedDraftSigner, SubUnclaimedDraftTemplateSigner, SubWhiteLabelingOptions, TeamAddMemberRequest, TeamCreateRequest, TeamGetInfoResponse, TeamGetResponse, TeamInfoResponse, TeamInviteResponse, TeamInvitesResponse, TeamMemberResponse, TeamMembersResponse, TeamParentResponse, TeamRemoveMemberRequest, TeamResponse, TeamSubTeamsResponse, TeamUpdateRequest, TemplateAddUserRequest, TemplateCreateEmbeddedDraftRequest, TemplateCreateEmbeddedDraftResponse, TemplateCreateEmbeddedDraftResponseTemplate, TemplateCreateRequest, TemplateCreateResponse, TemplateCreateResponseTemplate, TemplateEditResponse, TemplateGetResponse, TemplateListResponse, TemplateRemoveUserRequest, TemplateResponse, TemplateResponseAccount, TemplateResponseAccountQuota, TemplateResponseCCRole, TemplateResponseDocument, TemplateResponseDocumentCustomFieldBase, TemplateResponseDocumentCustomFieldCheckbox, TemplateResponseDocumentCustomFieldText, TemplateResponseDocumentFieldGroup, TemplateResponseDocumentFieldGroupRule, TemplateResponseDocumentFormFieldBase, TemplateResponseDocumentFormFieldCheckbox, TemplateResponseDocumentFormFieldDateSigned, TemplateResponseDocumentFormFieldDropdown, TemplateResponseDocumentFormFieldHyperlink, TemplateResponseDocumentFormFieldInitials, TemplateResponseDocumentFormFieldRadio, TemplateResponseDocumentFormFieldSignature, TemplateResponseDocumentFormFieldText, TemplateResponseDocumentStaticFieldBase, TemplateResponseDocumentStaticFieldCheckbox, TemplateResponseDocumentStaticFieldDateSigned, TemplateResponseDocumentStaticFieldDropdown, TemplateResponseDocumentStaticFieldHyperlink, TemplateResponseDocumentStaticFieldInitials, TemplateResponseDocumentStaticFieldRadio, TemplateResponseDocumentStaticFieldSignature, TemplateResponseDocumentStaticFieldText, TemplateResponseFieldAvgTextLength, TemplateResponseSignerRole, TemplateUpdateFilesRequest, TemplateUpdateFilesResponse, TemplateUpdateFilesResponseTemplate, UnclaimedDraftCreateEmbeddedRequest, UnclaimedDraftCreateEmbeddedWithTemplateRequest, UnclaimedDraftCreateRequest, UnclaimedDraftCreateResponse, UnclaimedDraftEditAndResendRequest, UnclaimedDraftResponse, VoidAuth, WarningResponse, }; diff --git a/sdks/node/types/model/subFile.d.ts b/sdks/node/types/model/subFile.d.ts new file mode 100644 index 000000000..56706fc54 --- /dev/null +++ b/sdks/node/types/model/subFile.d.ts @@ -0,0 +1,8 @@ +import { AttributeTypeMap } from "./"; +export declare class SubFile { + "name"?: string; + static discriminator: string | undefined; + static attributeTypeMap: AttributeTypeMap; + static getAttributeTypeMap(): AttributeTypeMap; + static init(data: any): SubFile; +} diff --git a/sdks/php/README.md b/sdks/php/README.md index b68ace90a..47a9091a0 100644 --- a/sdks/php/README.md +++ b/sdks/php/README.md @@ -160,6 +160,11 @@ All URIs are relative to *https://api.hellosign.com/v3* | *BulkSendJobApi* | [**bulkSendJobList**](docs/Api/BulkSendJobApi.md#bulksendjoblist) | **GET** /bulk_send_job/list | List Bulk Send Jobs | | *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* | [**deleteFax**](docs/Api/FaxApi.md#deletefax) | **DELETE** /fax/{fax_id} | Delete Fax | +| *FaxApi* | [**getFaxById**](docs/Api/FaxApi.md#getfaxbyid) | **GET** /fax/{fax_id} | Get Fax | +| *FaxApi* | [**getFaxFiles**](docs/Api/FaxApi.md#getfaxfiles) | **GET** /fax/files/{fax_id} | List Fax Files | +| *FaxApi* | [**listFaxes**](docs/Api/FaxApi.md#listfaxes) | **GET** /fax/list | Lists Faxes | +| *FaxApi* | [**sendFax**](docs/Api/FaxApi.md#sendfax) | **POST** /fax/send | Send Fax | | *FaxLineApi* | [**faxLineAddUser**](docs/Api/FaxLineApi.md#faxlineadduser) | **PUT** /fax_line/add_user | Add Fax Line User | | *FaxLineApi* | [**faxLineAreaCodeGet**](docs/Api/FaxLineApi.md#faxlineareacodeget) | **GET** /fax_line/area_codes | Get Available Fax Line Area Codes | | *FaxLineApi* | [**faxLineCreate**](docs/Api/FaxLineApi.md#faxlinecreate) | **POST** /fax_line/create | Purchase Fax Line | @@ -260,6 +265,11 @@ All URIs are relative to *https://api.hellosign.com/v3* - [FaxLineRemoveUserRequest](docs/Model/FaxLineRemoveUserRequest.md) - [FaxLineResponse](docs/Model/FaxLineResponse.md) - [FaxLineResponseFaxLine](docs/Model/FaxLineResponseFaxLine.md) +- [FaxListResponse](docs/Model/FaxListResponse.md) +- [FaxResponse](docs/Model/FaxResponse.md) +- [FaxResponseFax](docs/Model/FaxResponseFax.md) +- [FaxResponseFaxTransmission](docs/Model/FaxResponseFaxTransmission.md) +- [FaxSendRequest](docs/Model/FaxSendRequest.md) - [FileResponse](docs/Model/FileResponse.md) - [FileResponseDataUri](docs/Model/FileResponseDataUri.md) - [ListInfoResponse](docs/Model/ListInfoResponse.md) @@ -304,6 +314,7 @@ All URIs are relative to *https://api.hellosign.com/v3* - [SubCustomField](docs/Model/SubCustomField.md) - [SubEditorOptions](docs/Model/SubEditorOptions.md) - [SubFieldOptions](docs/Model/SubFieldOptions.md) +- [SubFile](docs/Model/SubFile.md) - [SubFormFieldGroup](docs/Model/SubFormFieldGroup.md) - [SubFormFieldRule](docs/Model/SubFormFieldRule.md) - [SubFormFieldRuleAction](docs/Model/SubFormFieldRuleAction.md) diff --git a/sdks/php/docs/Api/FaxApi.md b/sdks/php/docs/Api/FaxApi.md new file mode 100644 index 000000000..cbf0d02d0 --- /dev/null +++ b/sdks/php/docs/Api/FaxApi.md @@ -0,0 +1,307 @@ +# Dropbox\Sign\FaxApi + +All URIs are relative to https://api.hellosign.com/v3. + +| Method | HTTP request | Description | +| ------------- | ------------- | ------------- | +| [**deleteFax()**](FaxApi.md#deleteFax) | **DELETE** /fax/{fax_id} | Delete Fax | +| [**getFaxById()**](FaxApi.md#getFaxById) | **GET** /fax/{fax_id} | Get Fax | +| [**getFaxFiles()**](FaxApi.md#getFaxFiles) | **GET** /fax/files/{fax_id} | List Fax Files | +| [**listFaxes()**](FaxApi.md#listFaxes) | **GET** /fax/list | Lists Faxes | +| [**sendFax()**](FaxApi.md#sendFax) | **POST** /fax/send | Send Fax | + + +## `deleteFax()` + +```php +deleteFax($fax_id) +``` +Delete Fax + +Deletes the specified Fax from the system. + +### Example + +```php +setUsername("YOUR_API_KEY"); + +$faxDelete = new Dropbox\Sign\Api\FaxApi($config); + +try { + $faxDelete->deleteFax("[FAX_NUMBER]"); +} catch (Dropbox\Sign\ApiException $e) { + $error = $e->getResponseObject(); + echo "Exception when calling Dropbox Sign API: " + . print_r($error->getError()); +} + +``` + +### Parameters + +|Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **fax_id** | **string**| Fax ID | | + +### Return type + +void (empty response body) + +### Authorization + +[api_key](../../README.md#api_key) + +### HTTP request headers + +- **Content-Type**: Not defined +- **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) + +## `getFaxById()` + +```php +getFaxById($fax_id): \Dropbox\Sign\Model\FaxResponse +``` +Get Fax + +Returns information about fax + +### Example + +```php +setUsername("YOUR_API_KEY"); + +$faxApi = new Dropbox\Sign\Api\FaxApi($config); + +$faxId = "fa5c8a0b0f492d768749333ad6fcc214c111e967"; + +try { + $result = $faxApi->getFaxById($faxId); + print_r($result); +} catch (Dropbox\Sign\ApiException $e) { + $error = $e->getResponseObject(); + echo "Exception when calling Dropbox Sign API: " + . print_r($error->getError()); +} + +``` + +### Parameters + +|Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **fax_id** | **string**| Fax ID | | + +### Return type + +[**\Dropbox\Sign\Model\FaxResponse**](../Model/FaxResponse.md) + +### Authorization + +[api_key](../../README.md#api_key) + +### HTTP request headers + +- **Content-Type**: Not defined +- **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) + +## `getFaxFiles()` + +```php +getFaxFiles($fax_id) +``` +List Fax Files + +Returns list of fax files + +### Example + +```php +setUsername("YOUR_API_KEY"); + +$faxApi = new Dropbox\Sign\Api\FaxApi($config); + +$faxId = "fa5c8a0b0f492d768749333ad6fcc214c111e967"; + +try { + $faxApi->getFaxFiles($faxId); +} catch (Dropbox\Sign\ApiException $e) { + $error = $e->getResponseObject(); + echo "Exception when calling Dropbox Sign API: " + . print_r($error->getError()); +} + +``` + +### Parameters + +|Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **fax_id** | **string**| Fax ID | | + +### Return type + +void (empty response body) + +### Authorization + +[api_key](../../README.md#api_key) + +### HTTP request headers + +- **Content-Type**: Not defined +- **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) + +## `listFaxes()` + +```php +listFaxes($page, $page_size): \Dropbox\Sign\Model\FaxListResponse +``` +Lists Faxes + +Returns properties of multiple faxes + +### Example + +```php +setUsername("YOUR_API_KEY"); + +$faxApi = new Dropbox\Sign\Api\FaxApi($config); + +$page = 1; +$pageSize = 2; + +try { + $result = $faxApi->listFaxes($page, $pageSize); + print_r($result); +} catch (Dropbox\Sign\ApiException $e) { + $error = $e->getResponseObject(); + echo "Exception when calling Dropbox Sign API: " + . print_r($error->getError()); +} + +``` + +### Parameters + +|Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **page** | **int**| Page | | +| **page_size** | **int**| Page size | | + +### Return type + +[**\Dropbox\Sign\Model\FaxListResponse**](../Model/FaxListResponse.md) + +### Authorization + +[api_key](../../README.md#api_key) + +### HTTP request headers + +- **Content-Type**: Not defined +- **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) + +## `sendFax()` + +```php +sendFax($fax_send_request): \Dropbox\Sign\Model\FaxResponse +``` +Send Fax + +Action to prepare and send a fax + +### Example + +```php +setUsername("YOUR_API_KEY"); + +$faxApi = new Dropbox\Sign\Api\FaxApi($config); + +$data = new Dropbox\Sign\Model\FaxCreateRequest(); +$data->setAreaCode(209) + ->setCountry("US"); + +try { + $result = $faxApi->faxCreate($data); + print_r($result); +} catch (Dropbox\Sign\ApiException $e) { + $error = $e->getResponseObject(); + echo "Exception when calling Dropbox Sign API: " + . print_r($error->getError()); +} + +``` + +### Parameters + +|Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **fax_send_request** | [**\Dropbox\Sign\Model\FaxSendRequest**](../Model/FaxSendRequest.md)| | | + +### Return type + +[**\Dropbox\Sign\Model\FaxResponse**](../Model/FaxResponse.md) + +### Authorization + +[api_key](../../README.md#api_key) + +### HTTP request headers + +- **Content-Type**: `application/json` +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) diff --git a/sdks/php/docs/Model/FaxListResponse.md b/sdks/php/docs/Model/FaxListResponse.md new file mode 100644 index 000000000..b5ddd64cc --- /dev/null +++ b/sdks/php/docs/Model/FaxListResponse.md @@ -0,0 +1,12 @@ +# # FaxListResponse + + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +| `faxes`*_required_ | [```\Dropbox\Sign\Model\FaxResponseFax[]```](FaxResponseFax.md) | | | +| `list_info`*_required_ | [```\Dropbox\Sign\Model\ListInfoResponse```](ListInfoResponse.md) | | | + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/sdks/php/docs/Model/FaxResponse.md b/sdks/php/docs/Model/FaxResponse.md new file mode 100644 index 000000000..ba763d245 --- /dev/null +++ b/sdks/php/docs/Model/FaxResponse.md @@ -0,0 +1,12 @@ +# # FaxResponse + + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +| `fax`*_required_ | [```\Dropbox\Sign\Model\FaxResponseFax```](FaxResponseFax.md) | | | +| `warnings` | [```\Dropbox\Sign\Model\WarningResponse```](WarningResponse.md) | | | + +[[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/FaxResponseFax.md b/sdks/php/docs/Model/FaxResponseFax.md new file mode 100644 index 000000000..8bfbaf7a6 --- /dev/null +++ b/sdks/php/docs/Model/FaxResponseFax.md @@ -0,0 +1,20 @@ +# # FaxResponseFax + + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +| `fax_id` | ```string``` | Fax ID | | +| `title` | ```string``` | Fax Title | | +| `original_title` | ```string``` | Fax Original Title | | +| `subject` | ```string``` | Fax Subject | | +| `message` | ```string``` | Fax Message | | +| `metadata` | ```array``` | Fax Metadata | | +| `created_at` | ```int``` | Fax Created At Timestamp | | +| `from` | ```string``` | Fax Sender Email | | +| `transmissions` | [```\Dropbox\Sign\Model\FaxResponseFaxTransmission[]```](FaxResponseFaxTransmission.md) | Fax Transmissions List | | +| `files_url` | ```string``` | Fax Files URL | | + +[[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/FaxResponseFaxTransmission.md b/sdks/php/docs/Model/FaxResponseFaxTransmission.md new file mode 100644 index 000000000..03e592c48 --- /dev/null +++ b/sdks/php/docs/Model/FaxResponseFaxTransmission.md @@ -0,0 +1,14 @@ +# # FaxResponseFaxTransmission + + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +| `recipient` | ```string``` | Fax Transmission Recipient | | +| `sender` | ```string``` | Fax Transmission Sender | | +| `status_code` | ```string``` | Fax Transmission Status Code | | +| `sent_at` | ```int``` | Fax Transmission Sent Timestamp | | + +[[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/FaxSendRequest.md b/sdks/php/docs/Model/FaxSendRequest.md new file mode 100644 index 000000000..b23542ea8 --- /dev/null +++ b/sdks/php/docs/Model/FaxSendRequest.md @@ -0,0 +1,20 @@ +# # FaxSendRequest + + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +| `to` | ```string``` | Fax Send To Recipient | | +| `from` | ```string``` | Fax Send From Sender (used only with fax number) | | +| `file` | [```\Dropbox\Sign\Model\SubFile[]```](SubFile.md) | Fax File to Send | | +| `file_url` | ```string[]``` | Fax File URL to Send | | +| `file_url_names` | ```string[]``` | Fax File URL Names | | +| `test_mode` | ```bool``` | API Test Mode Setting | | +| `cover_page_to` | ```string``` | Fax Cover Page for Recipient | | +| `cover_page_from` | ```string``` | Fax Cover Page for Sender | | +| `cover_page_message` | ```string``` | Fax Cover Page Message | | +| `title` | ```string``` | Fax Title | | + +[[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/SubFile.md b/sdks/php/docs/Model/SubFile.md new file mode 100644 index 000000000..b08f3ed5d --- /dev/null +++ b/sdks/php/docs/Model/SubFile.md @@ -0,0 +1,11 @@ +# # SubFile + +Actual uploaded physical file + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +| `name` | ```string``` | Actual physical uploaded file name that is derived during upload. Not settable parameter. | [default to ''] | + +[[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 new file mode 100644 index 000000000..8db1dcdb8 --- /dev/null +++ b/sdks/php/src/Api/FaxApi.php @@ -0,0 +1,1725 @@ + [ + 'application/json', + ], + 'getFaxById' => [ + 'application/json', + ], + 'getFaxFiles' => [ + 'application/json', + ], + 'listFaxes' => [ + 'application/json', + ], + 'sendFax' => [ + 'application/json', + ], + ]; + + /** @var ResponseInterface|null */ + protected $response; + + /** + * @param int $hostIndex (Optional) host index to select the list of hosts if defined in the OpenAPI spec + */ + public function __construct( + Configuration $config = null, + ClientInterface $client = null, + HeaderSelector $selector = null, + int $hostIndex = 0 + ) { + $this->client = $client ?: new Client(); + $this->config = $config ?: new Configuration(); + $this->headerSelector = $selector ?: new HeaderSelector(); + $this->hostIndex = $hostIndex; + } + + /** + * Set the host index + * + * @param int $hostIndex Host index (required) + * @deprecated To be made private in the future + */ + public function setHostIndex(int $hostIndex): void + { + $this->hostIndex = $hostIndex; + } + + /** + * Get the host index + * + * @return int Host index + * @deprecated To be made private in the future + */ + public function getHostIndex() + { + return $this->hostIndex; + } + + /** + * @return Configuration + */ + public function getConfig() + { + return $this->config; + } + + /** + * @return ResponseInterface|null + */ + public function getResponse() + { + return $this->response; + } + + /** + * Operation deleteFax + * + * Delete Fax + * + * @param string $fax_id Fax ID (required) + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + */ + public function deleteFax(string $fax_id) + { + $this->deleteFaxWithHttpInfo($fax_id); + } + + /** + * Operation deleteFaxWithHttpInfo + * + * Delete Fax + * + * @param string $fax_id Fax ID (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteFax'] to see the possible values for this operation + * + * @return array of null, 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 ::deleteFax. This method will eventually become unavailable + */ + public function deleteFaxWithHttpInfo(string $fax_id, string $contentType = self::contentTypes['deleteFax'][0]) + { + $request = $this->deleteFaxRequest($fax_id, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + $this->response = $response; + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int)$e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string)$e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int)$e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string)$request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string)$response->getBody() + ); + } + + return [null, $statusCode, $response->getHeaders()]; + } catch (ApiException $e) { + if ($this->handleRangeCodeException($e, '4XX', '\Dropbox\Sign\Model\ErrorResponse')) { + throw $e; + } + switch ($e->getCode()) { + } + throw $e; + } + } + + /** + * Operation deleteFaxAsync + * + * Delete Fax + * + * @param string $fax_id Fax ID (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteFax'] to see the possible values for this operation + * + * @return \GuzzleHttp\Promise\PromiseInterface + * @throws InvalidArgumentException + * @deprecated Prefer to use ::deleteFax. This method will eventually become unavailable + */ + public function deleteFaxAsync(string $fax_id, string $contentType = self::contentTypes['deleteFax'][0]) + { + return $this->deleteFaxAsyncWithHttpInfo($fax_id, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation deleteFaxAsyncWithHttpInfo + * + * Delete Fax + * + * @param string $fax_id Fax ID (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteFax'] to see the possible values for this operation + * + * @return \GuzzleHttp\Promise\PromiseInterface + * @throws InvalidArgumentException + * @deprecated Prefer to use ::deleteFax. This method will eventually become unavailable + */ + public function deleteFaxAsyncWithHttpInfo(string $fax_id, string $contentType = self::contentTypes['deleteFax'][0]) + { + $returnType = ''; + $request = $this->deleteFaxRequest($fax_id, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) { + return [null, $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 'deleteFax' + * + * @param string $fax_id Fax ID (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteFax'] to see the possible values for this operation + * + * @return Request + * @throws InvalidArgumentException + * @deprecated Prefer to use ::deleteFax. This method will eventually become unavailable + */ + public function deleteFaxRequest(string $fax_id, string $contentType = self::contentTypes['deleteFax'][0]) + { + // verify the required parameter 'fax_id' is set + if ($fax_id === null || (is_array($fax_id) && count($fax_id) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $fax_id when calling deleteFax' + ); + } + + $resourcePath = '/fax/{fax_id}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // path params + if ($fax_id !== null) { + $resourcePath = str_replace( + '{fax_id}', + ObjectSerializer::toPathValue($fax_id), + $resourcePath + ); + } + + $headers = $this->headerSelector->selectHeaders( + $multipart ? ['multipart/form-data'] : ['application/json'], + $contentType, + $multipart + ); + + // for model (json/xml) + if (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'], + ]; + } + + $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( + 'DELETE', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getFaxById + * + * Get Fax + * + * @param string $fax_id Fax ID (required) + * + * @return Model\FaxResponse + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + */ + public function getFaxById(string $fax_id) + { + list($response) = $this->getFaxByIdWithHttpInfo($fax_id); + return $response; + } + + /** + * Operation getFaxByIdWithHttpInfo + * + * Get Fax + * + * @param string $fax_id Fax ID (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getFaxById'] to see the possible values for this operation + * + * @return array of Model\FaxResponse, 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 ::getFaxById. This method will eventually become unavailable + */ + public function getFaxByIdWithHttpInfo(string $fax_id, string $contentType = self::contentTypes['getFaxById'][0]) + { + $request = $this->getFaxByIdRequest($fax_id, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + $this->response = $response; + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int)$e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string)$e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int)$e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string)$request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string)$response->getBody() + ); + } + + $result = $this->handleRangeCodeResponse( + $response, + '4XX', + '\Dropbox\Sign\Model\ErrorResponse' + ); + if ($result) { + return $result; + } + + switch ($statusCode) { + case 200: + if ('\Dropbox\Sign\Model\FaxResponse' === '\SplFileObject') { + $content = $response->getBody(); // stream goes to serializer + } else { + $content = (string)$response->getBody(); + if ('\Dropbox\Sign\Model\FaxResponse' !== '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\FaxResponse', []), + $response->getStatusCode(), + $response->getHeaders(), + ]; + } + + $returnType = '\Dropbox\Sign\Model\FaxResponse'; + 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\FaxResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getFaxByIdAsync + * + * Get Fax + * + * @param string $fax_id Fax ID (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getFaxById'] to see the possible values for this operation + * + * @return \GuzzleHttp\Promise\PromiseInterface + * @throws InvalidArgumentException + * @deprecated Prefer to use ::getFaxById. This method will eventually become unavailable + */ + public function getFaxByIdAsync(string $fax_id, string $contentType = self::contentTypes['getFaxById'][0]) + { + return $this->getFaxByIdAsyncWithHttpInfo($fax_id, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getFaxByIdAsyncWithHttpInfo + * + * Get Fax + * + * @param string $fax_id Fax ID (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getFaxById'] to see the possible values for this operation + * + * @return \GuzzleHttp\Promise\PromiseInterface + * @throws InvalidArgumentException + * @deprecated Prefer to use ::getFaxById. This method will eventually become unavailable + */ + public function getFaxByIdAsyncWithHttpInfo(string $fax_id, string $contentType = self::contentTypes['getFaxById'][0]) + { + $returnType = '\Dropbox\Sign\Model\FaxResponse'; + $request = $this->getFaxByIdRequest($fax_id, $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 'getFaxById' + * + * @param string $fax_id Fax ID (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getFaxById'] to see the possible values for this operation + * + * @return Request + * @throws InvalidArgumentException + * @deprecated Prefer to use ::getFaxById. This method will eventually become unavailable + */ + public function getFaxByIdRequest(string $fax_id, string $contentType = self::contentTypes['getFaxById'][0]) + { + // verify the required parameter 'fax_id' is set + if ($fax_id === null || (is_array($fax_id) && count($fax_id) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $fax_id when calling getFaxById' + ); + } + + $resourcePath = '/fax/{fax_id}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // path params + if ($fax_id !== null) { + $resourcePath = str_replace( + '{fax_id}', + ObjectSerializer::toPathValue($fax_id), + $resourcePath + ); + } + + $headers = $this->headerSelector->selectHeaders( + $multipart ? ['multipart/form-data'] : ['application/json'], + $contentType, + $multipart + ); + + // for model (json/xml) + if (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'], + ]; + } + + $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( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getFaxFiles + * + * List Fax Files + * + * @param string $fax_id Fax ID (required) + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + */ + public function getFaxFiles(string $fax_id) + { + $this->getFaxFilesWithHttpInfo($fax_id); + } + + /** + * Operation getFaxFilesWithHttpInfo + * + * List Fax Files + * + * @param string $fax_id Fax ID (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getFaxFiles'] to see the possible values for this operation + * + * @return array of null, 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 ::getFaxFiles. This method will eventually become unavailable + */ + public function getFaxFilesWithHttpInfo(string $fax_id, string $contentType = self::contentTypes['getFaxFiles'][0]) + { + $request = $this->getFaxFilesRequest($fax_id, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + $this->response = $response; + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int)$e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string)$e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int)$e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string)$request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string)$response->getBody() + ); + } + + return [null, $statusCode, $response->getHeaders()]; + } catch (ApiException $e) { + if ($this->handleRangeCodeException($e, '4XX', '\Dropbox\Sign\Model\ErrorResponse')) { + throw $e; + } + switch ($e->getCode()) { + } + throw $e; + } + } + + /** + * Operation getFaxFilesAsync + * + * List Fax Files + * + * @param string $fax_id Fax ID (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getFaxFiles'] to see the possible values for this operation + * + * @return \GuzzleHttp\Promise\PromiseInterface + * @throws InvalidArgumentException + * @deprecated Prefer to use ::getFaxFiles. This method will eventually become unavailable + */ + public function getFaxFilesAsync(string $fax_id, string $contentType = self::contentTypes['getFaxFiles'][0]) + { + return $this->getFaxFilesAsyncWithHttpInfo($fax_id, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getFaxFilesAsyncWithHttpInfo + * + * List Fax Files + * + * @param string $fax_id Fax ID (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getFaxFiles'] to see the possible values for this operation + * + * @return \GuzzleHttp\Promise\PromiseInterface + * @throws InvalidArgumentException + * @deprecated Prefer to use ::getFaxFiles. This method will eventually become unavailable + */ + public function getFaxFilesAsyncWithHttpInfo(string $fax_id, string $contentType = self::contentTypes['getFaxFiles'][0]) + { + $returnType = ''; + $request = $this->getFaxFilesRequest($fax_id, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) { + return [null, $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 'getFaxFiles' + * + * @param string $fax_id Fax ID (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getFaxFiles'] to see the possible values for this operation + * + * @return Request + * @throws InvalidArgumentException + * @deprecated Prefer to use ::getFaxFiles. This method will eventually become unavailable + */ + public function getFaxFilesRequest(string $fax_id, string $contentType = self::contentTypes['getFaxFiles'][0]) + { + // verify the required parameter 'fax_id' is set + if ($fax_id === null || (is_array($fax_id) && count($fax_id) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $fax_id when calling getFaxFiles' + ); + } + + $resourcePath = '/fax/files/{fax_id}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // path params + if ($fax_id !== null) { + $resourcePath = str_replace( + '{fax_id}', + ObjectSerializer::toPathValue($fax_id), + $resourcePath + ); + } + + $headers = $this->headerSelector->selectHeaders( + $multipart ? ['multipart/form-data'] : ['application/json'], + $contentType, + $multipart + ); + + // for model (json/xml) + if (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'], + ]; + } + + $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( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation listFaxes + * + * Lists Faxes + * + * @param int $page Page (required) + * @param int $page_size Page size (required) + * + * @return Model\FaxListResponse + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + */ + public function listFaxes(int $page, int $page_size) + { + list($response) = $this->listFaxesWithHttpInfo($page, $page_size); + return $response; + } + + /** + * Operation listFaxesWithHttpInfo + * + * Lists Faxes + * + * @param int $page Page (required) + * @param int $page_size Page size (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['listFaxes'] to see the possible values for this operation + * + * @return array of Model\FaxListResponse, 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 ::listFaxes. This method will eventually become unavailable + */ + public function listFaxesWithHttpInfo(int $page, int $page_size, string $contentType = self::contentTypes['listFaxes'][0]) + { + $request = $this->listFaxesRequest($page, $page_size, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + $this->response = $response; + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int)$e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string)$e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int)$e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string)$request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string)$response->getBody() + ); + } + + $result = $this->handleRangeCodeResponse( + $response, + '4XX', + '\Dropbox\Sign\Model\ErrorResponse' + ); + if ($result) { + return $result; + } + + switch ($statusCode) { + case 200: + if ('\Dropbox\Sign\Model\FaxListResponse' === '\SplFileObject') { + $content = $response->getBody(); // stream goes to serializer + } else { + $content = (string)$response->getBody(); + if ('\Dropbox\Sign\Model\FaxListResponse' !== '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\FaxListResponse', []), + $response->getStatusCode(), + $response->getHeaders(), + ]; + } + + $returnType = '\Dropbox\Sign\Model\FaxListResponse'; + 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\FaxListResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation listFaxesAsync + * + * Lists Faxes + * + * @param int $page Page (required) + * @param int $page_size Page size (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['listFaxes'] to see the possible values for this operation + * + * @return \GuzzleHttp\Promise\PromiseInterface + * @throws InvalidArgumentException + * @deprecated Prefer to use ::listFaxes. This method will eventually become unavailable + */ + public function listFaxesAsync(int $page, int $page_size, string $contentType = self::contentTypes['listFaxes'][0]) + { + return $this->listFaxesAsyncWithHttpInfo($page, $page_size, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation listFaxesAsyncWithHttpInfo + * + * Lists Faxes + * + * @param int $page Page (required) + * @param int $page_size Page size (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['listFaxes'] to see the possible values for this operation + * + * @return \GuzzleHttp\Promise\PromiseInterface + * @throws InvalidArgumentException + * @deprecated Prefer to use ::listFaxes. This method will eventually become unavailable + */ + public function listFaxesAsyncWithHttpInfo(int $page, int $page_size, string $contentType = self::contentTypes['listFaxes'][0]) + { + $returnType = '\Dropbox\Sign\Model\FaxListResponse'; + $request = $this->listFaxesRequest($page, $page_size, $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 'listFaxes' + * + * @param int $page Page (required) + * @param int $page_size Page size (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['listFaxes'] to see the possible values for this operation + * + * @return Request + * @throws InvalidArgumentException + * @deprecated Prefer to use ::listFaxes. This method will eventually become unavailable + */ + public function listFaxesRequest(int $page, int $page_size, string $contentType = self::contentTypes['listFaxes'][0]) + { + // verify the required parameter 'page' is set + if ($page === null || (is_array($page) && count($page) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $page when calling listFaxes' + ); + } + if ($page < 1) { + throw new InvalidArgumentException('invalid value for "$page" when calling FaxApi.listFaxes, must be bigger than or equal to 1.'); + } + + // verify the required parameter 'page_size' is set + if ($page_size === null || (is_array($page_size) && count($page_size) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $page_size when calling listFaxes' + ); + } + if ($page_size > 100) { + throw new InvalidArgumentException('invalid value for "$page_size" when calling FaxApi.listFaxes, must be smaller than or equal to 100.'); + } + if ($page_size < 1) { + throw new InvalidArgumentException('invalid value for "$page_size" when calling FaxApi.listFaxes, must be bigger than or equal to 1.'); + } + + $resourcePath = '/fax/list'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $page, + 'page', // param base name + 'integer', // openApiType + 'form', // style + true, // explode + true // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $page_size, + 'page_size', // param base name + 'integer', // openApiType + 'form', // style + true, // explode + true // required + ) ?? []); + + $headers = $this->headerSelector->selectHeaders( + $multipart ? ['multipart/form-data'] : ['application/json'], + $contentType, + $multipart + ); + + // for model (json/xml) + if (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'], + ]; + } + + $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( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation sendFax + * + * Send Fax + * + * @param Model\FaxSendRequest $fax_send_request fax_send_request (required) + * + * @return Model\FaxResponse + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + */ + public function sendFax(Model\FaxSendRequest $fax_send_request) + { + list($response) = $this->sendFaxWithHttpInfo($fax_send_request); + return $response; + } + + /** + * Operation sendFaxWithHttpInfo + * + * Send Fax + * + * @param Model\FaxSendRequest $fax_send_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['sendFax'] to see the possible values for this operation + * + * @return array of Model\FaxResponse, 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 ::sendFax. This method will eventually become unavailable + */ + public function sendFaxWithHttpInfo(Model\FaxSendRequest $fax_send_request, string $contentType = self::contentTypes['sendFax'][0]) + { + $request = $this->sendFaxRequest($fax_send_request, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + $this->response = $response; + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int)$e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string)$e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int)$e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string)$request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string)$response->getBody() + ); + } + + $result = $this->handleRangeCodeResponse( + $response, + '4XX', + '\Dropbox\Sign\Model\ErrorResponse' + ); + if ($result) { + return $result; + } + + switch ($statusCode) { + case 200: + if ('\Dropbox\Sign\Model\FaxResponse' === '\SplFileObject') { + $content = $response->getBody(); // stream goes to serializer + } else { + $content = (string)$response->getBody(); + if ('\Dropbox\Sign\Model\FaxResponse' !== '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\FaxResponse', []), + $response->getStatusCode(), + $response->getHeaders(), + ]; + } + + $returnType = '\Dropbox\Sign\Model\FaxResponse'; + 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\FaxResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation sendFaxAsync + * + * Send Fax + * + * @param Model\FaxSendRequest $fax_send_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['sendFax'] to see the possible values for this operation + * + * @return \GuzzleHttp\Promise\PromiseInterface + * @throws InvalidArgumentException + * @deprecated Prefer to use ::sendFax. This method will eventually become unavailable + */ + public function sendFaxAsync(Model\FaxSendRequest $fax_send_request, string $contentType = self::contentTypes['sendFax'][0]) + { + return $this->sendFaxAsyncWithHttpInfo($fax_send_request, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation sendFaxAsyncWithHttpInfo + * + * Send Fax + * + * @param Model\FaxSendRequest $fax_send_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['sendFax'] to see the possible values for this operation + * + * @return \GuzzleHttp\Promise\PromiseInterface + * @throws InvalidArgumentException + * @deprecated Prefer to use ::sendFax. This method will eventually become unavailable + */ + public function sendFaxAsyncWithHttpInfo(Model\FaxSendRequest $fax_send_request, string $contentType = self::contentTypes['sendFax'][0]) + { + $returnType = '\Dropbox\Sign\Model\FaxResponse'; + $request = $this->sendFaxRequest($fax_send_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 'sendFax' + * + * @param Model\FaxSendRequest $fax_send_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['sendFax'] to see the possible values for this operation + * + * @return Request + * @throws InvalidArgumentException + * @deprecated Prefer to use ::sendFax. This method will eventually become unavailable + */ + public function sendFaxRequest(Model\FaxSendRequest $fax_send_request, string $contentType = self::contentTypes['sendFax'][0]) + { + // verify the required parameter 'fax_send_request' is set + if ($fax_send_request === null || (is_array($fax_send_request) && count($fax_send_request) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $fax_send_request when calling sendFax' + ); + } + + $resourcePath = '/fax/send'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + $formParams = ObjectSerializer::getFormParams( + $fax_send_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_send_request)); + } else { + $httpBody = $fax_send_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_send_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 + ); + } + + /** + * Create http client option + * + * @return array of http client options + * @throws RuntimeException on file opening failure + */ + protected function createHttpClientOption() + { + $options = $this->config->getOptions(); + if ($this->config->getDebug()) { + $options[RequestOptions::DEBUG] = fopen($this->config->getDebugFile(), 'a'); + if (!$options[RequestOptions::DEBUG]) { + throw new RuntimeException('Failed to open the debug file: ' . $this->config->getDebugFile()); + } + } + + return $options; + } + + /** + * @return object|array|null + */ + private function handleRangeCodeResponse( + ResponseInterface $response, + string $rangeCode, + string $returnDataType + ) { + $statusCode = $response->getStatusCode(); + $rangeCodeLeft = (int)(substr($rangeCode, 0, 1) . '00'); + $rangeCodeRight = (int)(substr($rangeCode, 0, 1) . '99'); + + if ( + $statusCode < $rangeCodeLeft + || $statusCode > $rangeCodeRight + ) { + return null; + } + + if ($returnDataType === '\SplFileObject') { + $content = $response->getBody(); // stream goes to serializer + } else { + $content = (string)$response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, $returnDataType, []), + $statusCode, + $response->getHeaders(), + ]; + } + + /** + * @return object|array|null + */ + private function handleRangeCodeException( + ApiException $e, + string $rangeCode, + string $exceptionDataType + ): bool { + $statusCode = $e->getCode(); + $rangeCodeLeft = (int)(substr($rangeCode, 0, 1) . '00'); + $rangeCodeRight = (int)(substr($rangeCode, 0, 1) . '99'); + + if ( + $statusCode < $rangeCodeLeft + || $statusCode > $rangeCodeRight + ) { + return false; + } + + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + $exceptionDataType, + $e->getResponseHeaders() + ); + + $e->setResponseObject($data); + + return true; + } +} diff --git a/sdks/php/src/Model/FaxListResponse.php b/sdks/php/src/Model/FaxListResponse.php new file mode 100644 index 000000000..ae3b71be4 --- /dev/null +++ b/sdks/php/src/Model/FaxListResponse.php @@ -0,0 +1,453 @@ + + */ +class FaxListResponse implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'FaxListResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'faxes' => '\Dropbox\Sign\Model\FaxResponseFax[]', + 'list_info' => '\Dropbox\Sign\Model\ListInfoResponse', + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'faxes' => null, + 'list_info' => null, + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var bool[] + */ + protected static array $openAPINullables = [ + 'faxes' => false, + 'list_info' => 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 = [ + 'faxes' => 'faxes', + 'list_info' => 'list_info', + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'faxes' => 'setFaxes', + 'list_info' => 'setListInfo', + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'faxes' => 'getFaxes', + 'list_info' => 'getListInfo', + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('faxes', $data ?? [], null); + $this->setIfExists('list_info', $data ?? [], null); + } + + /** + * @deprecated use ::init() + */ + public static function fromArray(array $data): FaxListResponse + { + return self::init($data); + } + + /** + * Attempt to instantiate and hydrate a new instance of this class + */ + public static function init(array $data): FaxListResponse + { + /** @var FaxListResponse */ + return ObjectSerializer::deserialize( + $data, + FaxListResponse::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['faxes'] === null) { + $invalidProperties[] = "'faxes' can't be null"; + } + if ($this->container['list_info'] === null) { + $invalidProperties[] = "'list_info' 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 faxes + * + * @return FaxResponseFax[] + */ + public function getFaxes() + { + return $this->container['faxes']; + } + + /** + * Sets faxes + * + * @param FaxResponseFax[] $faxes faxes + * + * @return self + */ + public function setFaxes(array $faxes) + { + if (is_null($faxes)) { + throw new InvalidArgumentException('non-nullable faxes cannot be null'); + } + $this->container['faxes'] = $faxes; + + return $this; + } + + /** + * Gets list_info + * + * @return ListInfoResponse + */ + public function getListInfo() + { + return $this->container['list_info']; + } + + /** + * Sets list_info + * + * @param ListInfoResponse $list_info list_info + * + * @return self + */ + public function setListInfo(ListInfoResponse $list_info) + { + if (is_null($list_info)) { + throw new InvalidArgumentException('non-nullable list_info cannot be null'); + } + $this->container['list_info'] = $list_info; + + return $this; + } + + /** + * Returns true if offset exists. False otherwise. + * + * @param int $offset Offset + */ + #[ReturnTypeWillChange] + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param int $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + */ + #[ReturnTypeWillChange] + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param int $offset Offset + */ + #[ReturnTypeWillChange] + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @see https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource + */ + #[ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_UNESCAPED_SLASHES + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} diff --git a/sdks/php/src/Model/FaxResponse.php b/sdks/php/src/Model/FaxResponse.php new file mode 100644 index 000000000..26f16ca97 --- /dev/null +++ b/sdks/php/src/Model/FaxResponse.php @@ -0,0 +1,450 @@ + + */ +class FaxResponse implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'FaxResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'fax' => '\Dropbox\Sign\Model\FaxResponseFax', + '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' => null, + 'warnings' => null, + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var bool[] + */ + protected static array $openAPINullables = [ + 'fax' => 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' => 'fax', + 'warnings' => 'warnings', + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'fax' => 'setFax', + 'warnings' => 'setWarnings', + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'fax' => 'getFax', + '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[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('fax', $data ?? [], null); + $this->setIfExists('warnings', $data ?? [], null); + } + + /** + * @deprecated use ::init() + */ + public static function fromArray(array $data): FaxResponse + { + return self::init($data); + } + + /** + * Attempt to instantiate and hydrate a new instance of this class + */ + public static function init(array $data): FaxResponse + { + /** @var FaxResponse */ + return ObjectSerializer::deserialize( + $data, + FaxResponse::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'] === null) { + $invalidProperties[] = "'fax' 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 + * + * @return FaxResponseFax + */ + public function getFax() + { + return $this->container['fax']; + } + + /** + * Sets fax + * + * @param FaxResponseFax $fax fax + * + * @return self + */ + public function setFax(FaxResponseFax $fax) + { + if (is_null($fax)) { + throw new InvalidArgumentException('non-nullable fax cannot be null'); + } + $this->container['fax'] = $fax; + + return $this; + } + + /** + * Gets warnings + * + * @return WarningResponse|null + */ + public function getWarnings() + { + return $this->container['warnings']; + } + + /** + * Sets warnings + * + * @param WarningResponse|null $warnings warnings + * + * @return self + */ + public function setWarnings(?WarningResponse $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/FaxResponseFax.php b/sdks/php/src/Model/FaxResponseFax.php new file mode 100644 index 000000000..d5acfb2e9 --- /dev/null +++ b/sdks/php/src/Model/FaxResponseFax.php @@ -0,0 +1,717 @@ + + */ +class FaxResponseFax implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'FaxResponseFax'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'fax_id' => 'string', + 'title' => 'string', + 'original_title' => 'string', + 'subject' => 'string', + 'message' => 'string', + 'metadata' => 'array', + 'created_at' => 'int', + 'from' => 'string', + 'transmissions' => '\Dropbox\Sign\Model\FaxResponseFaxTransmission[]', + 'files_url' => 'string', + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'fax_id' => null, + 'title' => null, + 'original_title' => null, + 'subject' => null, + 'message' => null, + 'metadata' => null, + 'created_at' => null, + 'from' => null, + 'transmissions' => null, + 'files_url' => null, + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var bool[] + */ + protected static array $openAPINullables = [ + 'fax_id' => false, + 'title' => false, + 'original_title' => false, + 'subject' => false, + 'message' => false, + 'metadata' => false, + 'created_at' => false, + 'from' => false, + 'transmissions' => false, + 'files_url' => 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', + 'title' => 'title', + 'original_title' => 'original_title', + 'subject' => 'subject', + 'message' => 'message', + 'metadata' => 'metadata', + 'created_at' => 'created_at', + 'from' => 'from', + 'transmissions' => 'transmissions', + 'files_url' => 'files_url', + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'fax_id' => 'setFaxId', + 'title' => 'setTitle', + 'original_title' => 'setOriginalTitle', + 'subject' => 'setSubject', + 'message' => 'setMessage', + 'metadata' => 'setMetadata', + 'created_at' => 'setCreatedAt', + 'from' => 'setFrom', + 'transmissions' => 'setTransmissions', + 'files_url' => 'setFilesUrl', + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'fax_id' => 'getFaxId', + 'title' => 'getTitle', + 'original_title' => 'getOriginalTitle', + 'subject' => 'getSubject', + 'message' => 'getMessage', + 'metadata' => 'getMetadata', + 'created_at' => 'getCreatedAt', + 'from' => 'getFrom', + 'transmissions' => 'getTransmissions', + 'files_url' => 'getFilesUrl', + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('fax_id', $data ?? [], null); + $this->setIfExists('title', $data ?? [], null); + $this->setIfExists('original_title', $data ?? [], null); + $this->setIfExists('subject', $data ?? [], null); + $this->setIfExists('message', $data ?? [], null); + $this->setIfExists('metadata', $data ?? [], null); + $this->setIfExists('created_at', $data ?? [], null); + $this->setIfExists('from', $data ?? [], null); + $this->setIfExists('transmissions', $data ?? [], null); + $this->setIfExists('files_url', $data ?? [], null); + } + + /** + * @deprecated use ::init() + */ + public static function fromArray(array $data): FaxResponseFax + { + return self::init($data); + } + + /** + * Attempt to instantiate and hydrate a new instance of this class + */ + public static function init(array $data): FaxResponseFax + { + /** @var FaxResponseFax */ + return ObjectSerializer::deserialize( + $data, + FaxResponseFax::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 fax_id + * + * @return string|null + */ + public function getFaxId() + { + return $this->container['fax_id']; + } + + /** + * Sets fax_id + * + * @param string|null $fax_id Fax ID + * + * @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 title + * + * @return string|null + */ + public function getTitle() + { + return $this->container['title']; + } + + /** + * Sets title + * + * @param string|null $title Fax Title + * + * @return self + */ + public function setTitle(?string $title) + { + if (is_null($title)) { + throw new InvalidArgumentException('non-nullable title cannot be null'); + } + $this->container['title'] = $title; + + return $this; + } + + /** + * Gets original_title + * + * @return string|null + */ + public function getOriginalTitle() + { + return $this->container['original_title']; + } + + /** + * Sets original_title + * + * @param string|null $original_title Fax Original Title + * + * @return self + */ + public function setOriginalTitle(?string $original_title) + { + if (is_null($original_title)) { + throw new InvalidArgumentException('non-nullable original_title cannot be null'); + } + $this->container['original_title'] = $original_title; + + return $this; + } + + /** + * Gets subject + * + * @return string|null + */ + public function getSubject() + { + return $this->container['subject']; + } + + /** + * Sets subject + * + * @param string|null $subject Fax Subject + * + * @return self + */ + public function setSubject(?string $subject) + { + if (is_null($subject)) { + throw new InvalidArgumentException('non-nullable subject cannot be null'); + } + $this->container['subject'] = $subject; + + return $this; + } + + /** + * Gets message + * + * @return string|null + */ + public function getMessage() + { + return $this->container['message']; + } + + /** + * Sets message + * + * @param string|null $message Fax Message + * + * @return self + */ + public function setMessage(?string $message) + { + if (is_null($message)) { + throw new InvalidArgumentException('non-nullable message cannot be null'); + } + $this->container['message'] = $message; + + return $this; + } + + /** + * Gets metadata + * + * @return array|null + */ + public function getMetadata() + { + return $this->container['metadata']; + } + + /** + * Sets metadata + * + * @param array|null $metadata Fax Metadata + * + * @return self + */ + public function setMetadata(?array $metadata) + { + if (is_null($metadata)) { + throw new InvalidArgumentException('non-nullable metadata cannot be null'); + } + $this->container['metadata'] = $metadata; + + return $this; + } + + /** + * Gets created_at + * + * @return int|null + */ + public function getCreatedAt() + { + return $this->container['created_at']; + } + + /** + * Sets created_at + * + * @param int|null $created_at Fax Created At Timestamp + * + * @return self + */ + public function setCreatedAt(?int $created_at) + { + if (is_null($created_at)) { + throw new InvalidArgumentException('non-nullable created_at cannot be null'); + } + $this->container['created_at'] = $created_at; + + return $this; + } + + /** + * Gets from + * + * @return string|null + */ + public function getFrom() + { + return $this->container['from']; + } + + /** + * Sets from + * + * @param string|null $from Fax Sender Email + * + * @return self + */ + public function setFrom(?string $from) + { + if (is_null($from)) { + throw new InvalidArgumentException('non-nullable from cannot be null'); + } + $this->container['from'] = $from; + + return $this; + } + + /** + * Gets transmissions + * + * @return FaxResponseFaxTransmission[]|null + */ + public function getTransmissions() + { + return $this->container['transmissions']; + } + + /** + * Sets transmissions + * + * @param FaxResponseFaxTransmission[]|null $transmissions Fax Transmissions List + * + * @return self + */ + public function setTransmissions(?array $transmissions) + { + if (is_null($transmissions)) { + throw new InvalidArgumentException('non-nullable transmissions cannot be null'); + } + $this->container['transmissions'] = $transmissions; + + return $this; + } + + /** + * Gets files_url + * + * @return string|null + */ + public function getFilesUrl() + { + return $this->container['files_url']; + } + + /** + * Sets files_url + * + * @param string|null $files_url Fax Files URL + * + * @return self + */ + public function setFilesUrl(?string $files_url) + { + if (is_null($files_url)) { + throw new InvalidArgumentException('non-nullable files_url cannot be null'); + } + $this->container['files_url'] = $files_url; + + 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/FaxResponseFaxTransmission.php b/sdks/php/src/Model/FaxResponseFaxTransmission.php new file mode 100644 index 000000000..a7b00e08b --- /dev/null +++ b/sdks/php/src/Model/FaxResponseFaxTransmission.php @@ -0,0 +1,513 @@ + + */ +class FaxResponseFaxTransmission implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'FaxResponseFaxTransmission'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'recipient' => 'string', + 'sender' => 'string', + 'status_code' => 'string', + 'sent_at' => 'int', + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'recipient' => null, + 'sender' => null, + 'status_code' => null, + 'sent_at' => null, + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var bool[] + */ + protected static array $openAPINullables = [ + 'recipient' => false, + 'sender' => false, + 'status_code' => false, + 'sent_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 = [ + 'recipient' => 'recipient', + 'sender' => 'sender', + 'status_code' => 'status_code', + 'sent_at' => 'sent_at', + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'recipient' => 'setRecipient', + 'sender' => 'setSender', + 'status_code' => 'setStatusCode', + 'sent_at' => 'setSentAt', + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'recipient' => 'getRecipient', + 'sender' => 'getSender', + 'status_code' => 'getStatusCode', + 'sent_at' => 'getSentAt', + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('recipient', $data ?? [], null); + $this->setIfExists('sender', $data ?? [], null); + $this->setIfExists('status_code', $data ?? [], null); + $this->setIfExists('sent_at', $data ?? [], null); + } + + /** + * @deprecated use ::init() + */ + public static function fromArray(array $data): FaxResponseFaxTransmission + { + return self::init($data); + } + + /** + * Attempt to instantiate and hydrate a new instance of this class + */ + public static function init(array $data): FaxResponseFaxTransmission + { + /** @var FaxResponseFaxTransmission */ + return ObjectSerializer::deserialize( + $data, + FaxResponseFaxTransmission::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 recipient + * + * @return string|null + */ + public function getRecipient() + { + return $this->container['recipient']; + } + + /** + * Sets recipient + * + * @param string|null $recipient Fax Transmission Recipient + * + * @return self + */ + public function setRecipient(?string $recipient) + { + if (is_null($recipient)) { + throw new InvalidArgumentException('non-nullable recipient cannot be null'); + } + $this->container['recipient'] = $recipient; + + return $this; + } + + /** + * Gets sender + * + * @return string|null + */ + public function getSender() + { + return $this->container['sender']; + } + + /** + * Sets sender + * + * @param string|null $sender Fax Transmission Sender + * + * @return self + */ + public function setSender(?string $sender) + { + if (is_null($sender)) { + throw new InvalidArgumentException('non-nullable sender cannot be null'); + } + $this->container['sender'] = $sender; + + return $this; + } + + /** + * Gets status_code + * + * @return string|null + */ + public function getStatusCode() + { + return $this->container['status_code']; + } + + /** + * Sets status_code + * + * @param string|null $status_code Fax Transmission Status Code + * + * @return self + */ + public function setStatusCode(?string $status_code) + { + if (is_null($status_code)) { + throw new InvalidArgumentException('non-nullable status_code cannot be null'); + } + $this->container['status_code'] = $status_code; + + return $this; + } + + /** + * Gets sent_at + * + * @return int|null + */ + public function getSentAt() + { + return $this->container['sent_at']; + } + + /** + * Sets sent_at + * + * @param int|null $sent_at Fax Transmission Sent Timestamp + * + * @return self + */ + public function setSentAt(?int $sent_at) + { + if (is_null($sent_at)) { + throw new InvalidArgumentException('non-nullable sent_at cannot be null'); + } + $this->container['sent_at'] = $sent_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/FaxSendRequest.php b/sdks/php/src/Model/FaxSendRequest.php new file mode 100644 index 000000000..c11c2fc6a --- /dev/null +++ b/sdks/php/src/Model/FaxSendRequest.php @@ -0,0 +1,752 @@ + + */ +class FaxSendRequest implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'FaxSendRequest'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'to' => 'string', + 'from' => 'string', + 'file' => '\Dropbox\Sign\Model\SubFile[]', + 'file_url' => 'string[]', + 'file_url_names' => 'string[]', + 'test_mode' => 'bool', + 'cover_page_to' => 'string', + 'cover_page_from' => 'string', + 'cover_page_message' => 'string', + 'title' => 'string', + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'to' => null, + 'from' => null, + 'file' => null, + 'file_url' => null, + 'file_url_names' => null, + 'test_mode' => null, + 'cover_page_to' => null, + 'cover_page_from' => null, + 'cover_page_message' => null, + 'title' => null, + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var bool[] + */ + protected static array $openAPINullables = [ + 'to' => false, + 'from' => true, + 'file' => false, + 'file_url' => false, + 'file_url_names' => false, + 'test_mode' => false, + 'cover_page_to' => true, + 'cover_page_from' => true, + 'cover_page_message' => true, + 'title' => true, + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var bool[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return bool[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param bool[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'to' => 'to', + 'from' => 'from', + 'file' => 'file', + 'file_url' => 'file_url', + 'file_url_names' => 'file_url_names', + 'test_mode' => 'test_mode', + 'cover_page_to' => 'cover_page_to', + 'cover_page_from' => 'cover_page_from', + 'cover_page_message' => 'cover_page_message', + 'title' => 'title', + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'to' => 'setTo', + 'from' => 'setFrom', + 'file' => 'setFile', + 'file_url' => 'setFileUrl', + 'file_url_names' => 'setFileUrlNames', + 'test_mode' => 'setTestMode', + 'cover_page_to' => 'setCoverPageTo', + 'cover_page_from' => 'setCoverPageFrom', + 'cover_page_message' => 'setCoverPageMessage', + 'title' => 'setTitle', + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'to' => 'getTo', + 'from' => 'getFrom', + 'file' => 'getFile', + 'file_url' => 'getFileUrl', + 'file_url_names' => 'getFileUrlNames', + 'test_mode' => 'getTestMode', + 'cover_page_to' => 'getCoverPageTo', + 'cover_page_from' => 'getCoverPageFrom', + 'cover_page_message' => 'getCoverPageMessage', + 'title' => 'getTitle', + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('to', $data ?? [], null); + $this->setIfExists('from', $data ?? [], null); + $this->setIfExists('file', $data ?? [], null); + $this->setIfExists('file_url', $data ?? [], null); + $this->setIfExists('file_url_names', $data ?? [], null); + $this->setIfExists('test_mode', $data ?? [], null); + $this->setIfExists('cover_page_to', $data ?? [], null); + $this->setIfExists('cover_page_from', $data ?? [], null); + $this->setIfExists('cover_page_message', $data ?? [], null); + $this->setIfExists('title', $data ?? [], null); + } + + /** + * @deprecated use ::init() + */ + public static function fromArray(array $data): FaxSendRequest + { + return self::init($data); + } + + /** + * Attempt to instantiate and hydrate a new instance of this class + */ + public static function init(array $data): FaxSendRequest + { + /** @var FaxSendRequest */ + return ObjectSerializer::deserialize( + $data, + FaxSendRequest::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 to + * + * @return string|null + */ + public function getTo() + { + return $this->container['to']; + } + + /** + * Sets to + * + * @param string|null $to Fax Send To Recipient + * + * @return self + */ + public function setTo(?string $to) + { + if (is_null($to)) { + throw new InvalidArgumentException('non-nullable to cannot be null'); + } + $this->container['to'] = $to; + + return $this; + } + + /** + * Gets from + * + * @return string|null + */ + public function getFrom() + { + return $this->container['from']; + } + + /** + * Sets from + * + * @param string|null $from Fax Send From Sender (used only with fax number) + * + * @return self + */ + public function setFrom(?string $from) + { + if (is_null($from)) { + array_push($this->openAPINullablesSetToNull, 'from'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('from', $nullablesSetToNull); + if ($index !== false) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['from'] = $from; + + return $this; + } + + /** + * Gets file + * + * @return SubFile[]|null + */ + public function getFile() + { + return $this->container['file']; + } + + /** + * Sets file + * + * @param SubFile[]|null $file Fax File to Send + * + * @return self + */ + public function setFile(?array $file) + { + if (is_null($file)) { + throw new InvalidArgumentException('non-nullable file cannot be null'); + } + $this->container['file'] = $file; + + return $this; + } + + /** + * Gets file_url + * + * @return string[]|null + */ + public function getFileUrl() + { + return $this->container['file_url']; + } + + /** + * Sets file_url + * + * @param string[]|null $file_url Fax File URL to Send + * + * @return self + */ + public function setFileUrl(?array $file_url) + { + if (is_null($file_url)) { + throw new InvalidArgumentException('non-nullable file_url cannot be null'); + } + $this->container['file_url'] = $file_url; + + return $this; + } + + /** + * Gets file_url_names + * + * @return string[]|null + */ + public function getFileUrlNames() + { + return $this->container['file_url_names']; + } + + /** + * Sets file_url_names + * + * @param string[]|null $file_url_names Fax File URL Names + * + * @return self + */ + public function setFileUrlNames(?array $file_url_names) + { + if (is_null($file_url_names)) { + throw new InvalidArgumentException('non-nullable file_url_names cannot be null'); + } + $this->container['file_url_names'] = $file_url_names; + + return $this; + } + + /** + * Gets test_mode + * + * @return bool|null + */ + public function getTestMode() + { + return $this->container['test_mode']; + } + + /** + * Sets test_mode + * + * @param bool|null $test_mode API Test Mode Setting + * + * @return self + */ + public function setTestMode(?bool $test_mode) + { + if (is_null($test_mode)) { + throw new InvalidArgumentException('non-nullable test_mode cannot be null'); + } + $this->container['test_mode'] = $test_mode; + + return $this; + } + + /** + * Gets cover_page_to + * + * @return string|null + */ + public function getCoverPageTo() + { + return $this->container['cover_page_to']; + } + + /** + * Sets cover_page_to + * + * @param string|null $cover_page_to Fax Cover Page for Recipient + * + * @return self + */ + public function setCoverPageTo(?string $cover_page_to) + { + if (is_null($cover_page_to)) { + array_push($this->openAPINullablesSetToNull, 'cover_page_to'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('cover_page_to', $nullablesSetToNull); + if ($index !== false) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['cover_page_to'] = $cover_page_to; + + return $this; + } + + /** + * Gets cover_page_from + * + * @return string|null + */ + public function getCoverPageFrom() + { + return $this->container['cover_page_from']; + } + + /** + * Sets cover_page_from + * + * @param string|null $cover_page_from Fax Cover Page for Sender + * + * @return self + */ + public function setCoverPageFrom(?string $cover_page_from) + { + if (is_null($cover_page_from)) { + array_push($this->openAPINullablesSetToNull, 'cover_page_from'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('cover_page_from', $nullablesSetToNull); + if ($index !== false) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['cover_page_from'] = $cover_page_from; + + return $this; + } + + /** + * Gets cover_page_message + * + * @return string|null + */ + public function getCoverPageMessage() + { + return $this->container['cover_page_message']; + } + + /** + * Sets cover_page_message + * + * @param string|null $cover_page_message Fax Cover Page Message + * + * @return self + */ + public function setCoverPageMessage(?string $cover_page_message) + { + if (is_null($cover_page_message)) { + array_push($this->openAPINullablesSetToNull, 'cover_page_message'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('cover_page_message', $nullablesSetToNull); + if ($index !== false) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['cover_page_message'] = $cover_page_message; + + return $this; + } + + /** + * Gets title + * + * @return string|null + */ + public function getTitle() + { + return $this->container['title']; + } + + /** + * Sets title + * + * @param string|null $title Fax Title + * + * @return self + */ + public function setTitle(?string $title) + { + if (is_null($title)) { + array_push($this->openAPINullablesSetToNull, 'title'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('title', $nullablesSetToNull); + if ($index !== false) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['title'] = $title; + + return $this; + } + + /** + * Returns true if offset exists. False otherwise. + * + * @param int $offset Offset + */ + #[ReturnTypeWillChange] + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param int $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + */ + #[ReturnTypeWillChange] + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param int $offset Offset + */ + #[ReturnTypeWillChange] + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @see https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource + */ + #[ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_UNESCAPED_SLASHES + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} diff --git a/sdks/php/src/Model/SubFile.php b/sdks/php/src/Model/SubFile.php new file mode 100644 index 000000000..82ed726b6 --- /dev/null +++ b/sdks/php/src/Model/SubFile.php @@ -0,0 +1,412 @@ + + */ +class SubFile implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'SubFile'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'name' => 'string', + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'name' => null, + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var bool[] + */ + protected static array $openAPINullables = [ + 'name' => 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 = [ + 'name' => 'name', + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'name' => 'setName', + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'name' => 'getName', + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('name', $data ?? [], ''); + } + + /** + * @deprecated use ::init() + */ + public static function fromArray(array $data): SubFile + { + return self::init($data); + } + + /** + * Attempt to instantiate and hydrate a new instance of this class + */ + public static function init(array $data): SubFile + { + /** @var SubFile */ + return ObjectSerializer::deserialize( + $data, + SubFile::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 name + * + * @return string|null + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string|null $name Actual physical uploaded file name that is derived during upload. Not settable parameter. + * + * @return self + */ + public function setName(?string $name) + { + if (is_null($name)) { + throw new InvalidArgumentException('non-nullable name cannot be null'); + } + $this->container['name'] = $name; + + 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 15be18ce8..f6a2d1adb 100644 --- a/sdks/python/README.md +++ b/sdks/python/README.md @@ -115,6 +115,11 @@ Class | Method | HTTP request | Description ```BulkSendJobApi``` | [```bulk_send_job_list```](docs/BulkSendJobApi.md#bulk_send_job_list) | ```GET /bulk_send_job/list``` | List Bulk Send Jobs| |```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``` | [```delete_fax```](docs/FaxApi.md#delete_fax) | ```DELETE /fax/{fax_id}``` | Delete Fax| +```FaxApi``` | [```get_fax_by_id```](docs/FaxApi.md#get_fax_by_id) | ```GET /fax/{fax_id}``` | Get Fax| +```FaxApi``` | [```get_fax_files```](docs/FaxApi.md#get_fax_files) | ```GET /fax/files/{fax_id}``` | List Fax Files| +```FaxApi``` | [```list_faxes```](docs/FaxApi.md#list_faxes) | ```GET /fax/list``` | Lists Faxes| +```FaxApi``` | [```send_fax```](docs/FaxApi.md#send_fax) | ```POST /fax/send``` | Send Fax| |```FaxLineApi``` | [```fax_line_add_user```](docs/FaxLineApi.md#fax_line_add_user) | ```PUT /fax_line/add_user``` | Add Fax Line User| ```FaxLineApi``` | [```fax_line_area_code_get```](docs/FaxLineApi.md#fax_line_area_code_get) | ```GET /fax_line/area_codes``` | Get Available Fax Line Area Codes| ```FaxLineApi``` | [```fax_line_create```](docs/FaxLineApi.md#fax_line_create) | ```POST /fax_line/create``` | Purchase Fax Line| @@ -215,6 +220,11 @@ Class | Method | HTTP request | Description - [FaxLineRemoveUserRequest](docs/FaxLineRemoveUserRequest.md) - [FaxLineResponse](docs/FaxLineResponse.md) - [FaxLineResponseFaxLine](docs/FaxLineResponseFaxLine.md) + - [FaxListResponse](docs/FaxListResponse.md) + - [FaxResponse](docs/FaxResponse.md) + - [FaxResponseFax](docs/FaxResponseFax.md) + - [FaxResponseFaxTransmission](docs/FaxResponseFaxTransmission.md) + - [FaxSendRequest](docs/FaxSendRequest.md) - [FileResponse](docs/FileResponse.md) - [FileResponseDataUri](docs/FileResponseDataUri.md) - [ListInfoResponse](docs/ListInfoResponse.md) @@ -259,6 +269,7 @@ Class | Method | HTTP request | Description - [SubCustomField](docs/SubCustomField.md) - [SubEditorOptions](docs/SubEditorOptions.md) - [SubFieldOptions](docs/SubFieldOptions.md) + - [SubFile](docs/SubFile.md) - [SubFormFieldGroup](docs/SubFormFieldGroup.md) - [SubFormFieldRule](docs/SubFormFieldRule.md) - [SubFormFieldRuleAction](docs/SubFormFieldRuleAction.md) diff --git a/sdks/python/docs/FaxApi.md b/sdks/python/docs/FaxApi.md new file mode 100644 index 000000000..bbe37c94b --- /dev/null +++ b/sdks/python/docs/FaxApi.md @@ -0,0 +1,326 @@ +# ```dropbox_sign.FaxApi``` + +All URIs are relative to *https://api.hellosign.com/v3* + +Method | HTTP request | Description +------------- | ------------- | ------------- +|[```delete_fax```](FaxApi.md#delete_fax) | ```DELETE /fax/{fax_id}``` | Delete Fax| +|[```get_fax_by_id```](FaxApi.md#get_fax_by_id) | ```GET /fax/{fax_id}``` | Get Fax| +|[```get_fax_files```](FaxApi.md#get_fax_files) | ```GET /fax/files/{fax_id}``` | List Fax Files| +|[```list_faxes```](FaxApi.md#list_faxes) | ```GET /fax/list``` | Lists Faxes| +|[```send_fax```](FaxApi.md#send_fax) | ```POST /fax/send``` | Send Fax| + + +# ```delete_fax``` +> ```delete_fax(fax_id)``` + +Delete Fax + +Deletes the specified Fax from the system. + +### Example + +* Basic Authentication (api_key): + +```python +from pprint import pprint + +from dropbox_sign import ApiClient, ApiException, Configuration, apis, models + +configuration = Configuration( + # Configure HTTP basic authorization: api_key + username="YOUR_API_KEY", +) + +with ApiClient(configuration) as api_client: + fax_api = apis.FaxApi(api_client) + + try: + fax_api.delete_fax("[FAX_NUMBER]") + except ApiException as e: + print("Exception when calling Dropbox Sign API: %s\n" % e) + +``` +``` + +### Parameters +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| `fax_id` | **str** | Fax ID | | + +### Return type + +void (empty response body) + +### Authorization + +[api_key](../README.md#api_key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **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) + +# ```get_fax_by_id``` +> ```FaxResponse get_fax_by_id(fax_id)``` + +Get Fax + +Returns information about fax + +### Example + +* Basic Authentication (api_key): + +```python +from pprint import pprint + +from dropbox_sign import ApiClient, ApiException, Configuration, apis + +configuration = Configuration( + # Configure HTTP basic authorization: api_key + username="YOUR_API_KEY", +) + +with ApiClient(configuration) as api_client: + fax_api = apis.FaxApi(api_client) + + faxId = "fa5c8a0b0f492d768749333ad6fcc214c111e967" + + try: + response = fax_api.get_fax_by_id(client_id) + pprint(response) + except ApiException as e: + print("Exception when calling Dropbox Sign API: %s\n" % e) + +``` +``` + +### Parameters +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| `fax_id` | **str** | Fax ID | | + +### Return type + +[**FaxResponse**](FaxResponse.md) + +### Authorization + +[api_key](../README.md#api_key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **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) + +# ```get_fax_files``` +> ```get_fax_files(fax_id)``` + +List Fax Files + +Returns list of fax files + +### Example + +* Basic Authentication (api_key): + +```python +from pprint import pprint + +from dropbox_sign import ApiClient, ApiException, Configuration, apis, models + +configuration = Configuration( + # Configure HTTP basic authorization: api_key + username="YOUR_API_KEY", +) + +with ApiClient(configuration) as api_client: + fax_api = apis.FaxApi(api_client) + + fax_id = "fa5c8a0b0f492d768749333ad6fcc214c111e967" + + try: + fax_api.get_fax_files(fax_id) + except ApiException as e: + print("Exception when calling Dropbox Sign API: %s\n" % e) + +``` +``` + +### Parameters +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| `fax_id` | **str** | Fax ID | | + +### Return type + +void (empty response body) + +### Authorization + +[api_key](../README.md#api_key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**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) + +# ```list_faxes``` +> ```FaxListResponse list_faxes(page, page_size)``` + +Lists Faxes + +Returns properties of multiple faxes + +### Example + +* Basic Authentication (api_key): + +```python +from pprint import pprint + +from dropbox_sign import ApiClient, ApiException, Configuration, apis + +configuration = Configuration( + # Configure HTTP basic authorization: api_key + username="YOUR_API_KEY", +) + +with ApiClient(configuration) as api_client: + fax_api = apis.FaxApi(api_client) + + page = 1 + page_size = 2 + + try: + response = fax_api.list_faxes( + page=page, + page_size=page_size, + ) + pprint(response) + except ApiException as e: + print("Exception when calling Dropbox Sign API: %s\n" % e) + +``` +``` + +### Parameters +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| `page` | **int** | Page | | +| `page_size` | **int** | Page size | | + +### Return type + +[**FaxListResponse**](FaxListResponse.md) + +### Authorization + +[api_key](../README.md#api_key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **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) + +# ```send_fax``` +> ```FaxResponse send_fax(fax_send_request)``` + +Send Fax + +Action to prepare and send a fax + +### Example + +* Basic Authentication (api_key): + +```python +from pprint import pprint + +from dropbox_sign import ApiClient, ApiException, Configuration, apis, models + +configuration = Configuration( + # Configure HTTP basic authorization: api_key + username="YOUR_API_KEY", +) + +with ApiClient(configuration) as api_client: + fax_api = apis.FaxApi(api_client) + + data = models.FaxCreateRequest( + area_code=209, + country="US", + ) + + try: + response = fax_api.fax_create(data) + pprint(response) + except ApiException as e: + print("Exception when calling Dropbox Sign API: %s\n" % e) + +``` +``` + +### Parameters +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| `fax_send_request` | [**FaxSendRequest**](FaxSendRequest.md) | | | + +### Return type + +[**FaxResponse**](FaxResponse.md) + +### Authorization + +[api_key](../README.md#api_key) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | successful operation | * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
| +**4XX** | failed_operation | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/sdks/python/docs/FaxListResponse.md b/sdks/python/docs/FaxListResponse.md new file mode 100644 index 000000000..20fc27fcf --- /dev/null +++ b/sdks/python/docs/FaxListResponse.md @@ -0,0 +1,12 @@ +# FaxListResponse + + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +| `faxes`*_required_ | [```List[FaxResponseFax]```](FaxResponseFax.md) | | | +| `list_info`*_required_ | [```ListInfoResponse```](ListInfoResponse.md) | | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/sdks/python/docs/FaxResponse.md b/sdks/python/docs/FaxResponse.md new file mode 100644 index 000000000..79aa4d7c6 --- /dev/null +++ b/sdks/python/docs/FaxResponse.md @@ -0,0 +1,12 @@ +# FaxResponse + + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +| `fax`*_required_ | [```FaxResponseFax```](FaxResponseFax.md) | | | +| `warnings` | [```WarningResponse```](WarningResponse.md) | | | + +[[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/FaxResponseFax.md b/sdks/python/docs/FaxResponseFax.md new file mode 100644 index 000000000..ead4553a9 --- /dev/null +++ b/sdks/python/docs/FaxResponseFax.md @@ -0,0 +1,20 @@ +# FaxResponseFax + + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +| `fax_id` | ```str``` | Fax ID | | +| `title` | ```str``` | Fax Title | | +| `original_title` | ```str``` | Fax Original Title | | +| `subject` | ```str``` | Fax Subject | | +| `message` | ```str``` | Fax Message | | +| `metadata` | ```object``` | Fax Metadata | | +| `created_at` | ```int``` | Fax Created At Timestamp | | +| `var_from` | ```str``` | Fax Sender Email | | +| `transmissions` | [```List[FaxResponseFaxTransmission]```](FaxResponseFaxTransmission.md) | Fax Transmissions List | | +| `files_url` | ```str``` | Fax Files URL | | + +[[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/FaxResponseFaxTransmission.md b/sdks/python/docs/FaxResponseFaxTransmission.md new file mode 100644 index 000000000..ce8f0c4e7 --- /dev/null +++ b/sdks/python/docs/FaxResponseFaxTransmission.md @@ -0,0 +1,14 @@ +# FaxResponseFaxTransmission + + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +| `recipient` | ```str``` | Fax Transmission Recipient | | +| `sender` | ```str``` | Fax Transmission Sender | | +| `status_code` | ```str``` | Fax Transmission Status Code | | +| `sent_at` | ```int``` | Fax Transmission Sent Timestamp | | + +[[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/FaxSendRequest.md b/sdks/python/docs/FaxSendRequest.md new file mode 100644 index 000000000..a991978bc --- /dev/null +++ b/sdks/python/docs/FaxSendRequest.md @@ -0,0 +1,20 @@ +# FaxSendRequest + + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +| `to` | ```str``` | Fax Send To Recipient | | +| `var_from` | ```str``` | Fax Send From Sender (used only with fax number) | | +| `file` | [```List[SubFile]```](SubFile.md) | Fax File to Send | | +| `file_url` | ```List[str]``` | Fax File URL to Send | | +| `file_url_names` | ```List[str]``` | Fax File URL Names | | +| `test_mode` | ```bool``` | API Test Mode Setting | | +| `cover_page_to` | ```str``` | Fax Cover Page for Recipient | | +| `cover_page_from` | ```str``` | Fax Cover Page for Sender | | +| `cover_page_message` | ```str``` | Fax Cover Page Message | | +| `title` | ```str``` | Fax Title | | + +[[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/SubFile.md b/sdks/python/docs/SubFile.md new file mode 100644 index 000000000..dee439a9e --- /dev/null +++ b/sdks/python/docs/SubFile.md @@ -0,0 +1,11 @@ +# SubFile + +Actual uploaded physical file + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +| `name` | ```str``` | Actual physical uploaded file name that is derived during upload. Not settable parameter. | [default to ''] | + +[[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 15adf1c8d..26736b94b 100644 --- a/sdks/python/dropbox_sign/__init__.py +++ b/sdks/python/dropbox_sign/__init__.py @@ -99,6 +99,11 @@ from dropbox_sign.models.fax_line_remove_user_request import FaxLineRemoveUserRequest from dropbox_sign.models.fax_line_response import FaxLineResponse from dropbox_sign.models.fax_line_response_fax_line import FaxLineResponseFaxLine +from dropbox_sign.models.fax_list_response import FaxListResponse +from dropbox_sign.models.fax_response import FaxResponse +from dropbox_sign.models.fax_response_fax import FaxResponseFax +from dropbox_sign.models.fax_response_fax_transmission import FaxResponseFaxTransmission +from dropbox_sign.models.fax_send_request import FaxSendRequest from dropbox_sign.models.file_response import FileResponse from dropbox_sign.models.file_response_data_uri import FileResponseDataUri from dropbox_sign.models.list_info_response import ListInfoResponse @@ -199,6 +204,7 @@ from dropbox_sign.models.sub_custom_field import SubCustomField from dropbox_sign.models.sub_editor_options import SubEditorOptions from dropbox_sign.models.sub_field_options import SubFieldOptions +from dropbox_sign.models.sub_file import SubFile from dropbox_sign.models.sub_form_field_group import SubFormFieldGroup from dropbox_sign.models.sub_form_field_rule import SubFormFieldRule from dropbox_sign.models.sub_form_field_rule_action import SubFormFieldRuleAction diff --git a/sdks/python/dropbox_sign/api/__init__.py b/sdks/python/dropbox_sign/api/__init__.py index c861b688e..f4000e522 100644 --- a/sdks/python/dropbox_sign/api/__init__.py +++ b/sdks/python/dropbox_sign/api/__init__.py @@ -5,6 +5,7 @@ from dropbox_sign.api.api_app_api import ApiAppApi from dropbox_sign.api.bulk_send_job_api import BulkSendJobApi from dropbox_sign.api.embedded_api import EmbeddedApi +from dropbox_sign.api.fax_api import FaxApi from dropbox_sign.api.fax_line_api import FaxLineApi from dropbox_sign.api.o_auth_api import OAuthApi from dropbox_sign.api.report_api import ReportApi diff --git a/sdks/python/dropbox_sign/api/fax_api.py b/sdks/python/dropbox_sign/api/fax_api.py new file mode 100644 index 000000000..d4c0d3764 --- /dev/null +++ b/sdks/python/dropbox_sign/api/fax_api.py @@ -0,0 +1,1311 @@ +# coding: utf-8 + +""" + Dropbox Sign API + + Dropbox Sign v3 API + + The version of the OpenAPI document: 3.0.0 + Contact: apisupport@hellosign.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + +import warnings +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union +from typing_extensions import Annotated + +from pydantic import Field, StrictStr +from typing_extensions import Annotated +from dropbox_sign.models.fax_list_response import FaxListResponse +from dropbox_sign.models.fax_response import FaxResponse +from dropbox_sign.models.fax_send_request import FaxSendRequest + +from dropbox_sign.api_client import ApiClient, RequestSerialized +from dropbox_sign.api_response import ApiResponse +from dropbox_sign.rest import RESTResponseType +import io + + +class FaxApi: + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None) -> None: + if api_client is None: + api_client = ApiClient.get_default() + self.api_client = api_client + + @validate_call + def delete_fax( + self, + fax_id: Annotated[StrictStr, Field(description="Fax ID")], + _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, + ) -> None: + """Delete Fax + + Deletes the specified Fax from the system. + + :param fax_id: Fax ID (required) + :type fax_id: str + :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._delete_fax_serialize( + fax_id=fax_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": None, + "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 delete_fax_with_http_info( + self, + fax_id: Annotated[StrictStr, Field(description="Fax ID")], + _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[None]: + """Delete Fax + + Deletes the specified Fax from the system. + + :param fax_id: Fax ID (required) + :type fax_id: str + :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._delete_fax_serialize( + fax_id=fax_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": None, + "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 delete_fax_without_preload_content( + self, + fax_id: Annotated[StrictStr, Field(description="Fax ID")], + _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: + """Delete Fax + + Deletes the specified Fax from the system. + + :param fax_id: Fax ID (required) + :type fax_id: str + :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._delete_fax_serialize( + fax_id=fax_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": None, + "4XX": "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + return response_data.response + + def _delete_fax_serialize( + self, + fax_id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = {} + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if fax_id is not None: + _path_params["fax_id"] = fax_id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + # set the HTTP header `Accept` + if "Accept" not in _header_params: + _header_params["Accept"] = self.api_client.select_header_accept( + ["application/json"] + ) + + # authentication setting + _auth_settings: List[str] = ["api_key"] + + return self.api_client.param_serialize( + method="DELETE", + resource_path="/fax/{fax_id}", + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth, + ) + + @validate_call + def get_fax_by_id( + self, + fax_id: Annotated[StrictStr, Field(description="Fax ID")], + _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, + ) -> FaxResponse: + """Get Fax + + Returns information about fax + + :param fax_id: Fax ID (required) + :type fax_id: str + :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._get_fax_by_id_serialize( + fax_id=fax_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "FaxResponse", + "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 get_fax_by_id_with_http_info( + self, + fax_id: Annotated[StrictStr, Field(description="Fax ID")], + _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[FaxResponse]: + """Get Fax + + Returns information about fax + + :param fax_id: Fax ID (required) + :type fax_id: str + :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._get_fax_by_id_serialize( + fax_id=fax_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "FaxResponse", + "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 get_fax_by_id_without_preload_content( + self, + fax_id: Annotated[StrictStr, Field(description="Fax ID")], + _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: + """Get Fax + + Returns information about fax + + :param fax_id: Fax ID (required) + :type fax_id: str + :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._get_fax_by_id_serialize( + fax_id=fax_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "FaxResponse", + "4XX": "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + return response_data.response + + def _get_fax_by_id_serialize( + self, + fax_id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = {} + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if fax_id is not None: + _path_params["fax_id"] = fax_id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + # set the HTTP header `Accept` + if "Accept" not in _header_params: + _header_params["Accept"] = self.api_client.select_header_accept( + ["application/json"] + ) + + # authentication setting + _auth_settings: List[str] = ["api_key"] + + return self.api_client.param_serialize( + method="GET", + resource_path="/fax/{fax_id}", + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth, + ) + + @validate_call + def get_fax_files( + self, + fax_id: Annotated[StrictStr, Field(description="Fax ID")], + _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, + ) -> None: + """List Fax Files + + Returns list of fax files + + :param fax_id: Fax ID (required) + :type fax_id: str + :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._get_fax_files_serialize( + fax_id=fax_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "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 get_fax_files_with_http_info( + self, + fax_id: Annotated[StrictStr, Field(description="Fax ID")], + _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[None]: + """List Fax Files + + Returns list of fax files + + :param fax_id: Fax ID (required) + :type fax_id: str + :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._get_fax_files_serialize( + fax_id=fax_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "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 get_fax_files_without_preload_content( + self, + fax_id: Annotated[StrictStr, Field(description="Fax ID")], + _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: + """List Fax Files + + Returns list of fax files + + :param fax_id: Fax ID (required) + :type fax_id: str + :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._get_fax_files_serialize( + fax_id=fax_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "4XX": "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + return response_data.response + + def _get_fax_files_serialize( + self, + fax_id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = {} + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if fax_id is not None: + _path_params["fax_id"] = fax_id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + # set the HTTP header `Accept` + if "Accept" not in _header_params: + _header_params["Accept"] = self.api_client.select_header_accept( + ["application/json"] + ) + + # authentication setting + _auth_settings: List[str] = ["api_key"] + + return self.api_client.param_serialize( + method="GET", + resource_path="/fax/files/{fax_id}", + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth, + ) + + @validate_call + def list_faxes( + self, + page: Annotated[int, Field(strict=True, ge=1, description="Page")], + page_size: Annotated[ + int, Field(le=100, strict=True, ge=1, description="Page size") + ], + _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, + ) -> FaxListResponse: + """Lists Faxes + + Returns properties of multiple faxes + + :param page: Page (required) + :type page: int + :param page_size: Page size (required) + :type page_size: int + :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._list_faxes_serialize( + page=page, + page_size=page_size, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "FaxListResponse", + "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 list_faxes_with_http_info( + self, + page: Annotated[int, Field(strict=True, ge=1, description="Page")], + page_size: Annotated[ + int, Field(le=100, strict=True, ge=1, description="Page size") + ], + _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[FaxListResponse]: + """Lists Faxes + + Returns properties of multiple faxes + + :param page: Page (required) + :type page: int + :param page_size: Page size (required) + :type page_size: int + :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._list_faxes_serialize( + page=page, + page_size=page_size, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "FaxListResponse", + "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 list_faxes_without_preload_content( + self, + page: Annotated[int, Field(strict=True, ge=1, description="Page")], + page_size: Annotated[ + int, Field(le=100, strict=True, ge=1, description="Page size") + ], + _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: + """Lists Faxes + + Returns properties of multiple faxes + + :param page: Page (required) + :type page: int + :param page_size: Page size (required) + :type page_size: int + :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._list_faxes_serialize( + page=page, + page_size=page_size, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "FaxListResponse", + "4XX": "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + return response_data.response + + def _list_faxes_serialize( + self, + page, + page_size, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = {} + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + if page is not None: + + _query_params.append(("page", page)) + + if page_size is not None: + + _query_params.append(("page_size", page_size)) + + # process the header parameters + # process the form parameters + # process the body parameter + + # set the HTTP header `Accept` + if "Accept" not in _header_params: + _header_params["Accept"] = self.api_client.select_header_accept( + ["application/json"] + ) + + # authentication setting + _auth_settings: List[str] = ["api_key"] + + return self.api_client.param_serialize( + method="GET", + resource_path="/fax/list", + 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 send_fax( + self, + fax_send_request: FaxSendRequest, + _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, + ) -> FaxResponse: + """Send Fax + + Action to prepare and send a fax + + :param fax_send_request: (required) + :type fax_send_request: FaxSendRequest + :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._send_fax_serialize( + fax_send_request=fax_send_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "FaxResponse", + "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 send_fax_with_http_info( + self, + fax_send_request: FaxSendRequest, + _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[FaxResponse]: + """Send Fax + + Action to prepare and send a fax + + :param fax_send_request: (required) + :type fax_send_request: FaxSendRequest + :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._send_fax_serialize( + fax_send_request=fax_send_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "FaxResponse", + "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 send_fax_without_preload_content( + self, + fax_send_request: FaxSendRequest, + _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: + """Send Fax + + Action to prepare and send a fax + + :param fax_send_request: (required) + :type fax_send_request: FaxSendRequest + :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._send_fax_serialize( + fax_send_request=fax_send_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "FaxResponse", + "4XX": "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + return response_data.response + + def _send_fax_serialize( + self, + fax_send_request, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = {} + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + has_files = False + body_param = fax_send_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_send_request is not None and has_files is False: + _body_params = fax_send_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"] + ) + 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/send", + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth, + ) diff --git a/sdks/python/dropbox_sign/apis/__init__.py b/sdks/python/dropbox_sign/apis/__init__.py index 16344f32d..0df638089 100644 --- a/sdks/python/dropbox_sign/apis/__init__.py +++ b/sdks/python/dropbox_sign/apis/__init__.py @@ -5,6 +5,7 @@ from dropbox_sign.api.api_app_api import ApiAppApi from dropbox_sign.api.bulk_send_job_api import BulkSendJobApi from dropbox_sign.api.embedded_api import EmbeddedApi +from dropbox_sign.api.fax_api import FaxApi from dropbox_sign.api.fax_line_api import FaxLineApi from dropbox_sign.api.o_auth_api import OAuthApi from dropbox_sign.api.report_api import ReportApi diff --git a/sdks/python/dropbox_sign/models/__init__.py b/sdks/python/dropbox_sign/models/__init__.py index 919a66d9c..7143671f8 100644 --- a/sdks/python/dropbox_sign/models/__init__.py +++ b/sdks/python/dropbox_sign/models/__init__.py @@ -82,6 +82,11 @@ from dropbox_sign.models.fax_line_remove_user_request import FaxLineRemoveUserRequest from dropbox_sign.models.fax_line_response import FaxLineResponse from dropbox_sign.models.fax_line_response_fax_line import FaxLineResponseFaxLine +from dropbox_sign.models.fax_list_response import FaxListResponse +from dropbox_sign.models.fax_response import FaxResponse +from dropbox_sign.models.fax_response_fax import FaxResponseFax +from dropbox_sign.models.fax_response_fax_transmission import FaxResponseFaxTransmission +from dropbox_sign.models.fax_send_request import FaxSendRequest from dropbox_sign.models.file_response import FileResponse from dropbox_sign.models.file_response_data_uri import FileResponseDataUri from dropbox_sign.models.list_info_response import ListInfoResponse @@ -182,6 +187,7 @@ from dropbox_sign.models.sub_custom_field import SubCustomField from dropbox_sign.models.sub_editor_options import SubEditorOptions from dropbox_sign.models.sub_field_options import SubFieldOptions +from dropbox_sign.models.sub_file import SubFile from dropbox_sign.models.sub_form_field_group import SubFormFieldGroup from dropbox_sign.models.sub_form_field_rule import SubFormFieldRule from dropbox_sign.models.sub_form_field_rule_action import SubFormFieldRuleAction diff --git a/sdks/python/dropbox_sign/models/fax_list_response.py b/sdks/python/dropbox_sign/models/fax_list_response.py new file mode 100644 index 000000000..d4a02d369 --- /dev/null +++ b/sdks/python/dropbox_sign/models/fax_list_response.py @@ -0,0 +1,149 @@ +# 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 +from typing import Any, ClassVar, Dict, List +from dropbox_sign.models.fax_response_fax import FaxResponseFax +from dropbox_sign.models.list_info_response import ListInfoResponse +from typing import Optional, Set, Tuple +from typing_extensions import Self +import io +from pydantic import StrictBool +from typing import Union + + +class FaxListResponse(BaseModel): + """ + FaxListResponse + """ # noqa: E501 + + faxes: List[FaxResponseFax] + list_info: ListInfoResponse + __properties: ClassVar[List[str]] = ["faxes", "list_info"] + + 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 FaxListResponse from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self, excluded_fields: Set[str] = None) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in faxes (list) + _items = [] + if self.faxes: + for _item_faxes in self.faxes: + if _item_faxes: + _items.append(_item_faxes.to_dict()) + _dict["faxes"] = _items + # override the default output from pydantic by calling `to_dict()` of list_info + if self.list_info: + _dict["list_info"] = self.list_info.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of FaxListResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate( + { + "faxes": ( + [FaxResponseFax.from_dict(_item) for _item in obj["faxes"]] + if obj.get("faxes") is not None + else None + ), + "list_info": ( + ListInfoResponse.from_dict(obj["list_info"]) + if obj.get("list_info") 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 { + "faxes": "(List[FaxResponseFax],)", + "list_info": "(ListInfoResponse,)", + } + + @classmethod + def openapi_type_is_array(cls, property_name: str) -> bool: + return property_name in [ + "faxes", + ] diff --git a/sdks/python/dropbox_sign/models/fax_response.py b/sdks/python/dropbox_sign/models/fax_response.py new file mode 100644 index 000000000..37819c56e --- /dev/null +++ b/sdks/python/dropbox_sign/models/fax_response.py @@ -0,0 +1,143 @@ +# 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 +from typing import Any, ClassVar, Dict, List, Optional +from dropbox_sign.models.fax_response_fax import FaxResponseFax +from dropbox_sign.models.warning_response import WarningResponse +from typing import Optional, Set, Tuple +from typing_extensions import Self +import io +from pydantic import StrictBool +from typing import Union + + +class FaxResponse(BaseModel): + """ + FaxResponse + """ # noqa: E501 + + fax: FaxResponseFax + warnings: Optional[WarningResponse] = None + __properties: ClassVar[List[str]] = ["fax", "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 FaxResponse 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 + if self.fax: + _dict["fax"] = self.fax.to_dict() + # override the default output from pydantic by calling `to_dict()` of warnings + if self.warnings: + _dict["warnings"] = self.warnings.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of FaxResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate( + { + "fax": ( + FaxResponseFax.from_dict(obj["fax"]) + if obj.get("fax") is not None + else None + ), + "warnings": ( + WarningResponse.from_dict(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": "(FaxResponseFax,)", + "warnings": "(WarningResponse,)", + } + + @classmethod + def openapi_type_is_array(cls, property_name: str) -> bool: + return property_name in [] diff --git a/sdks/python/dropbox_sign/models/fax_response_fax.py b/sdks/python/dropbox_sign/models/fax_response_fax.py new file mode 100644 index 000000000..e66df9880 --- /dev/null +++ b/sdks/python/dropbox_sign/models/fax_response_fax.py @@ -0,0 +1,187 @@ +# 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, Optional +from dropbox_sign.models.fax_response_fax_transmission import FaxResponseFaxTransmission +from typing import Optional, Set, Tuple +from typing_extensions import Self +import io +from pydantic import StrictBool +from typing import Union + + +class FaxResponseFax(BaseModel): + """ + FaxResponseFax + """ # noqa: E501 + + fax_id: Optional[StrictStr] = Field(default=None, description="Fax ID") + title: Optional[StrictStr] = Field(default=None, description="Fax Title") + original_title: Optional[StrictStr] = Field( + default=None, description="Fax Original Title" + ) + subject: Optional[StrictStr] = Field(default=None, description="Fax Subject") + message: Optional[StrictStr] = Field(default=None, description="Fax Message") + metadata: Optional[Dict[str, Any]] = Field(default=None, description="Fax Metadata") + created_at: Optional[StrictInt] = Field( + default=None, description="Fax Created At Timestamp" + ) + var_from: Optional[StrictStr] = Field( + default=None, description="Fax Sender Email", alias="from" + ) + transmissions: Optional[List[FaxResponseFaxTransmission]] = Field( + default=None, description="Fax Transmissions List" + ) + files_url: Optional[StrictStr] = Field(default=None, description="Fax Files URL") + __properties: ClassVar[List[str]] = [ + "fax_id", + "title", + "original_title", + "subject", + "message", + "metadata", + "created_at", + "from", + "transmissions", + "files_url", + ] + + 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 FaxResponseFax from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self, excluded_fields: Set[str] = None) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in transmissions (list) + _items = [] + if self.transmissions: + for _item_transmissions in self.transmissions: + if _item_transmissions: + _items.append(_item_transmissions.to_dict()) + _dict["transmissions"] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of FaxResponseFax 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"), + "title": obj.get("title"), + "original_title": obj.get("original_title"), + "subject": obj.get("subject"), + "message": obj.get("message"), + "metadata": obj.get("metadata"), + "created_at": obj.get("created_at"), + "from": obj.get("from"), + "transmissions": ( + [ + FaxResponseFaxTransmission.from_dict(_item) + for _item in obj["transmissions"] + ] + if obj.get("transmissions") is not None + else None + ), + "files_url": obj.get("files_url"), + } + ) + 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,)", + "title": "(str,)", + "original_title": "(str,)", + "subject": "(str,)", + "message": "(str,)", + "metadata": "(object,)", + "created_at": "(int,)", + "var_from": "(str,)", + "transmissions": "(List[FaxResponseFaxTransmission],)", + "files_url": "(str,)", + } + + @classmethod + def openapi_type_is_array(cls, property_name: str) -> bool: + return property_name in [ + "transmissions", + ] diff --git a/sdks/python/dropbox_sign/models/fax_response_fax_transmission.py b/sdks/python/dropbox_sign/models/fax_response_fax_transmission.py new file mode 100644 index 000000000..0c47a93f0 --- /dev/null +++ b/sdks/python/dropbox_sign/models/fax_response_fax_transmission.py @@ -0,0 +1,146 @@ +# 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, Optional +from typing import Optional, Set, Tuple +from typing_extensions import Self +import io +from pydantic import StrictBool +from typing import Union + + +class FaxResponseFaxTransmission(BaseModel): + """ + FaxResponseFaxTransmission + """ # noqa: E501 + + recipient: Optional[StrictStr] = Field( + default=None, description="Fax Transmission Recipient" + ) + sender: Optional[StrictStr] = Field( + default=None, description="Fax Transmission Sender" + ) + status_code: Optional[StrictStr] = Field( + default=None, description="Fax Transmission Status Code" + ) + sent_at: Optional[StrictInt] = Field( + default=None, description="Fax Transmission Sent Timestamp" + ) + __properties: ClassVar[List[str]] = [ + "recipient", + "sender", + "status_code", + "sent_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 FaxResponseFaxTransmission 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 FaxResponseFaxTransmission from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate( + { + "recipient": obj.get("recipient"), + "sender": obj.get("sender"), + "status_code": obj.get("status_code"), + "sent_at": obj.get("sent_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 { + "recipient": "(str,)", + "sender": "(str,)", + "status_code": "(str,)", + "sent_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/fax_send_request.py b/sdks/python/dropbox_sign/models/fax_send_request.py new file mode 100644 index 000000000..c4c9e7b6f --- /dev/null +++ b/sdks/python/dropbox_sign/models/fax_send_request.py @@ -0,0 +1,194 @@ +# 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, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from dropbox_sign.models.sub_file import SubFile +from typing import Optional, Set, Tuple +from typing_extensions import Self +import io +from pydantic import StrictBool +from typing import Union + + +class FaxSendRequest(BaseModel): + """ + FaxSendRequest + """ # noqa: E501 + + to: Optional[StrictStr] = Field(default=None, description="Fax Send To Recipient") + var_from: Optional[StrictStr] = Field( + default=None, + description="Fax Send From Sender (used only with fax number)", + alias="from", + ) + file: Optional[List[SubFile]] = Field(default=None, description="Fax File to Send") + file_url: Optional[List[StrictStr]] = Field( + default=None, description="Fax File URL to Send" + ) + file_url_names: Optional[List[StrictStr]] = Field( + default=None, description="Fax File URL Names" + ) + test_mode: Optional[StrictBool] = Field( + default=None, description="API Test Mode Setting" + ) + cover_page_to: Optional[StrictStr] = Field( + default=None, description="Fax Cover Page for Recipient" + ) + cover_page_from: Optional[StrictStr] = Field( + default=None, description="Fax Cover Page for Sender" + ) + cover_page_message: Optional[StrictStr] = Field( + default=None, description="Fax Cover Page Message" + ) + title: Optional[StrictStr] = Field(default=None, description="Fax Title") + __properties: ClassVar[List[str]] = [ + "to", + "from", + "file", + "file_url", + "file_url_names", + "test_mode", + "cover_page_to", + "cover_page_from", + "cover_page_message", + "title", + ] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + arbitrary_types_allowed=True, + ) + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + def to_json_form_params( + self, excluded_fields: Set[str] = None + ) -> List[Tuple[str, str]]: + data: List[Tuple[str, str]] = [] + + for key, value in self.to_dict(excluded_fields).items(): + if isinstance(value, (int, str, bool)): + data.append((key, value)) + else: + data.append((key, json.dumps(value, ensure_ascii=False))) + + return data + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of FaxSendRequest from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self, excluded_fields: Set[str] = None) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in file (list) + _items = [] + if self.file: + for _item_file in self.file: + if _item_file: + _items.append(_item_file.to_dict()) + _dict["file"] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of FaxSendRequest from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate( + { + "to": obj.get("to"), + "from": obj.get("from"), + "file": ( + [SubFile.from_dict(_item) for _item in obj["file"]] + if obj.get("file") is not None + else None + ), + "file_url": obj.get("file_url"), + "file_url_names": obj.get("file_url_names"), + "test_mode": obj.get("test_mode"), + "cover_page_to": obj.get("cover_page_to"), + "cover_page_from": obj.get("cover_page_from"), + "cover_page_message": obj.get("cover_page_message"), + "title": obj.get("title"), + } + ) + return _obj + + @classmethod + def init(cls, data: Any) -> Self: + """ + Attempt to instantiate and hydrate a new instance of this class + """ + if isinstance(data, str): + data = json.loads(data) + + return cls.from_dict(data) + + @classmethod + def openapi_types(cls) -> Dict[str, str]: + return { + "to": "(str,)", + "var_from": "(str,)", + "file": "(List[SubFile],)", + "file_url": "(List[str],)", + "file_url_names": "(List[str],)", + "test_mode": "(bool,)", + "cover_page_to": "(str,)", + "cover_page_from": "(str,)", + "cover_page_message": "(str,)", + "title": "(str,)", + } + + @classmethod + def openapi_type_is_array(cls, property_name: str) -> bool: + return property_name in [ + "file", + "file_url", + "file_url_names", + ] diff --git a/sdks/python/dropbox_sign/models/sub_file.py b/sdks/python/dropbox_sign/models/sub_file.py new file mode 100644 index 000000000..a3c21e4f7 --- /dev/null +++ b/sdks/python/dropbox_sign/models/sub_file.py @@ -0,0 +1,125 @@ +# coding: utf-8 + +""" + Dropbox Sign API + + Dropbox Sign v3 API + + The version of the OpenAPI document: 3.0.0 + Contact: apisupport@hellosign.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set, Tuple +from typing_extensions import Self +import io +from pydantic import StrictBool +from typing import Union + + +class SubFile(BaseModel): + """ + Actual uploaded physical file + """ # noqa: E501 + + name: Optional[StrictStr] = Field( + default="", + description="Actual physical uploaded file name that is derived during upload. Not settable parameter.", + ) + __properties: ClassVar[List[str]] = ["name"] + + 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 SubFile 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 SubFile from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate( + {"name": obj.get("name") if obj.get("name") is not None else ""} + ) + 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 { + "name": "(str,)", + } + + @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 1dd16ae20..8d301c752 100644 --- a/sdks/ruby/README.md +++ b/sdks/ruby/README.md @@ -121,6 +121,11 @@ All URIs are relative to *https://api.hellosign.com/v3* |*Dropbox::Sign::BulkSendJobApi* | [**bulk_send_job_list**](docs/BulkSendJobApi.md#bulk_send_job_list) | **GET** /bulk_send_job/list | List Bulk Send Jobs | |*Dropbox::Sign::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* | [**delete_fax**](docs/FaxApi.md#delete_fax) | **DELETE** /fax/{fax_id} | Delete Fax | +|*Dropbox::Sign::FaxApi* | [**get_fax_by_id**](docs/FaxApi.md#get_fax_by_id) | **GET** /fax/{fax_id} | Get Fax | +|*Dropbox::Sign::FaxApi* | [**get_fax_files**](docs/FaxApi.md#get_fax_files) | **GET** /fax/files/{fax_id} | List Fax Files | +|*Dropbox::Sign::FaxApi* | [**list_faxes**](docs/FaxApi.md#list_faxes) | **GET** /fax/list | Lists Faxes | +|*Dropbox::Sign::FaxApi* | [**send_fax**](docs/FaxApi.md#send_fax) | **POST** /fax/send | Send Fax | |*Dropbox::Sign::FaxLineApi* | [**fax_line_add_user**](docs/FaxLineApi.md#fax_line_add_user) | **PUT** /fax_line/add_user | Add Fax Line User | |*Dropbox::Sign::FaxLineApi* | [**fax_line_area_code_get**](docs/FaxLineApi.md#fax_line_area_code_get) | **GET** /fax_line/area_codes | Get Available Fax Line Area Codes | |*Dropbox::Sign::FaxLineApi* | [**fax_line_create**](docs/FaxLineApi.md#fax_line_create) | **POST** /fax_line/create | Purchase Fax Line | @@ -221,6 +226,11 @@ All URIs are relative to *https://api.hellosign.com/v3* - [Dropbox::Sign::FaxLineRemoveUserRequest](docs/FaxLineRemoveUserRequest.md) - [Dropbox::Sign::FaxLineResponse](docs/FaxLineResponse.md) - [Dropbox::Sign::FaxLineResponseFaxLine](docs/FaxLineResponseFaxLine.md) + - [Dropbox::Sign::FaxListResponse](docs/FaxListResponse.md) + - [Dropbox::Sign::FaxResponse](docs/FaxResponse.md) + - [Dropbox::Sign::FaxResponseFax](docs/FaxResponseFax.md) + - [Dropbox::Sign::FaxResponseFaxTransmission](docs/FaxResponseFaxTransmission.md) + - [Dropbox::Sign::FaxSendRequest](docs/FaxSendRequest.md) - [Dropbox::Sign::FileResponse](docs/FileResponse.md) - [Dropbox::Sign::FileResponseDataUri](docs/FileResponseDataUri.md) - [Dropbox::Sign::ListInfoResponse](docs/ListInfoResponse.md) @@ -265,6 +275,7 @@ All URIs are relative to *https://api.hellosign.com/v3* - [Dropbox::Sign::SubCustomField](docs/SubCustomField.md) - [Dropbox::Sign::SubEditorOptions](docs/SubEditorOptions.md) - [Dropbox::Sign::SubFieldOptions](docs/SubFieldOptions.md) + - [Dropbox::Sign::SubFile](docs/SubFile.md) - [Dropbox::Sign::SubFormFieldGroup](docs/SubFormFieldGroup.md) - [Dropbox::Sign::SubFormFieldRule](docs/SubFormFieldRule.md) - [Dropbox::Sign::SubFormFieldRuleAction](docs/SubFormFieldRuleAction.md) diff --git a/sdks/ruby/docs/FaxApi.md b/sdks/ruby/docs/FaxApi.md new file mode 100644 index 000000000..34ef17df2 --- /dev/null +++ b/sdks/ruby/docs/FaxApi.md @@ -0,0 +1,358 @@ +# Dropbox::Sign::FaxApi + +All URIs are relative to *https://api.hellosign.com/v3* + +| Method | HTTP request | Description | +| ------ | ------------ | ----------- | +| [`delete_fax`](FaxApi.md#delete_fax) | **DELETE** `/fax/{fax_id}` | Delete Fax | +| [`get_fax_by_id`](FaxApi.md#get_fax_by_id) | **GET** `/fax/{fax_id}` | Get Fax | +| [`get_fax_files`](FaxApi.md#get_fax_files) | **GET** `/fax/files/{fax_id}` | List Fax Files | +| [`list_faxes`](FaxApi.md#list_faxes) | **GET** `/fax/list` | Lists Faxes | +| [`send_fax`](FaxApi.md#send_fax) | **POST** `/fax/send` | Send Fax | + + +## `delete_fax` + +> `delete_fax(fax_id)` + +Delete Fax + +Deletes the specified Fax from the system. + +### Examples + +```ruby +require "dropbox-sign" + +Dropbox::Sign.configure do |config| + # Configure HTTP basic authorization: api_key + config.username = "YOUR_API_KEY" +end + +fax_api = Dropbox::Sign::FaxApi.new + +begin + fax_api.delete_fax("[FAX_NUMBER]") +rescue Dropbox::Sign::ApiError => e + puts "Exception when calling Dropbox Sign API: #{e}" +end + +``` + +#### Using the `delete_fax_with_http_info` variant + +This returns an Array which contains the response data (`nil` in this case), status code and headers. + +> ` delete_fax_with_http_info(fax_id)` + +```ruby +begin + # Delete Fax + data, status_code, headers = api_instance.delete_fax_with_http_info(fax_id) + p status_code # => 2xx + p headers # => { ... } + p data # => nil +rescue Dropbox::Sign::ApiError => e + puts "Error when calling FaxApi->delete_fax_with_http_info: #{e}" +end +``` + +### Parameters + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| `fax_id` | **String** | Fax ID | | + +### Return type + +nil (empty response body) + +### Authorization + +[api_key](../README.md#api_key) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +## `get_fax_by_id` + +> ` get_fax_by_id(fax_id)` + +Get Fax + +Returns information about fax + +### Examples + +```ruby +require "dropbox-sign" + +Dropbox::Sign.configure do |config| + # Configure HTTP basic authorization: api_key + config.username = "YOUR_API_KEY" +end + +fax_api = Dropbox::Sign::FaxApi.new + +fax_id = "fa5c8a0b0f492d768749333ad6fcc214c111e967" + +begin + result = fax_api.get_fax_by_id(fax_id) + p result +rescue Dropbox::Sign::ApiError => e + puts "Exception when calling Dropbox Sign API: #{e}" +end + +``` + +#### Using the `get_fax_by_id_with_http_info` variant + +This returns an Array which contains the response data, status code and headers. + +> `, Integer, Hash)> get_fax_by_id_with_http_info(fax_id)` + +```ruby +begin + # Get Fax + data, status_code, headers = api_instance.get_fax_by_id_with_http_info(fax_id) + p status_code # => 2xx + p headers # => { ... } + p data # => +rescue Dropbox::Sign::ApiError => e + puts "Error when calling FaxApi->get_fax_by_id_with_http_info: #{e}" +end +``` + +### Parameters + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| `fax_id` | **String** | Fax ID | | + +### Return type + +[**FaxResponse**](FaxResponse.md) + +### Authorization + +[api_key](../README.md#api_key) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +## `get_fax_files` + +> `get_fax_files(fax_id)` + +List Fax Files + +Returns list of fax files + +### Examples + +```ruby +require "dropbox-sign" + +Dropbox::Sign.configure do |config| + # Configure HTTP basic authorization: api_key + config.username = "YOUR_API_KEY" +end + +fax_api = Dropbox::Sign::FaxApi.new + +faxId = "fa5c8a0b0f492d768749333ad6fcc214c111e967" + +begin + result = fax_api.get_fax_files(data) + p result +rescue Dropbox::Sign::ApiError => e + puts "Exception when calling Dropbox Sign API: #{e}" +end + +``` + +#### Using the `get_fax_files_with_http_info` variant + +This returns an Array which contains the response data (`nil` in this case), status code and headers. + +> ` get_fax_files_with_http_info(fax_id)` + +```ruby +begin + # List Fax Files + data, status_code, headers = api_instance.get_fax_files_with_http_info(fax_id) + p status_code # => 2xx + p headers # => { ... } + p data # => nil +rescue Dropbox::Sign::ApiError => e + puts "Error when calling FaxApi->get_fax_files_with_http_info: #{e}" +end +``` + +### Parameters + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| `fax_id` | **String** | Fax ID | | + +### Return type + +nil (empty response body) + +### Authorization + +[api_key](../README.md#api_key) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +## `list_faxes` + +> ` list_faxes(page, page_size)` + +Lists Faxes + +Returns properties of multiple faxes + +### Examples + +```ruby +require "dropbox-sign" + +Dropbox::Sign.configure do |config| + # Configure HTTP basic authorization: api_key + config.username = "YOUR_API_KEY" +end + +fax_api = Dropbox::Sign::FaxApi.new + +page = 1 +page_size = 2 + +begin + result = fax_api.list_faxes({ page: page, page_size: page_size }) + p result +rescue Dropbox::Sign::ApiError => e + puts "Exception when calling Dropbox Sign API: #{e}" +end + +``` + +#### Using the `list_faxes_with_http_info` variant + +This returns an Array which contains the response data, status code and headers. + +> `, Integer, Hash)> list_faxes_with_http_info(page, page_size)` + +```ruby +begin + # Lists Faxes + data, status_code, headers = api_instance.list_faxes_with_http_info(page, page_size) + p status_code # => 2xx + p headers # => { ... } + p data # => +rescue Dropbox::Sign::ApiError => e + puts "Error when calling FaxApi->list_faxes_with_http_info: #{e}" +end +``` + +### Parameters + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| `page` | **Integer** | Page | | +| `page_size` | **Integer** | Page size | | + +### Return type + +[**FaxListResponse**](FaxListResponse.md) + +### Authorization + +[api_key](../README.md#api_key) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +## `send_fax` + +> ` send_fax(fax_send_request)` + +Send Fax + +Action to prepare and send a fax + +### Examples + +```ruby +require "dropbox-sign" + +Dropbox::Sign.configure do |config| + # Configure HTTP basic authorization: api_key + config.username = "YOUR_API_KEY" +end + +fax_api = Dropbox::Sign::FaxApi.new + +data = Dropbox::Sign::FaxCreateRequest.new +data.area_code = 209 +data.country = "US" + +begin + result = fax_api.fax_create(data) + p result +rescue Dropbox::Sign::ApiError => e + puts "Exception when calling Dropbox Sign API: #{e}" +end + +``` + +#### Using the `send_fax_with_http_info` variant + +This returns an Array which contains the response data, status code and headers. + +> `, Integer, Hash)> send_fax_with_http_info(fax_send_request)` + +```ruby +begin + # Send Fax + data, status_code, headers = api_instance.send_fax_with_http_info(fax_send_request) + p status_code # => 2xx + p headers # => { ... } + p data # => +rescue Dropbox::Sign::ApiError => e + puts "Error when calling FaxApi->send_fax_with_http_info: #{e}" +end +``` + +### Parameters + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| `fax_send_request` | [**FaxSendRequest**](FaxSendRequest.md) | | | + +### Return type + +[**FaxResponse**](FaxResponse.md) + +### Authorization + +[api_key](../README.md#api_key) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + diff --git a/sdks/ruby/docs/FaxListResponse.md b/sdks/ruby/docs/FaxListResponse.md new file mode 100644 index 000000000..4bf183a3b --- /dev/null +++ b/sdks/ruby/docs/FaxListResponse.md @@ -0,0 +1,11 @@ +# Dropbox::Sign::FaxListResponse + + + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| `faxes`*_required_ | [```Array```](FaxResponseFax.md) | | | +| `list_info`*_required_ | [```ListInfoResponse```](ListInfoResponse.md) | | | + diff --git a/sdks/ruby/docs/FaxResponse.md b/sdks/ruby/docs/FaxResponse.md new file mode 100644 index 000000000..9f2c89944 --- /dev/null +++ b/sdks/ruby/docs/FaxResponse.md @@ -0,0 +1,11 @@ +# Dropbox::Sign::FaxResponse + + + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| `fax`*_required_ | [```FaxResponseFax```](FaxResponseFax.md) | | | +| `warnings` | [```WarningResponse```](WarningResponse.md) | | | + diff --git a/sdks/ruby/docs/FaxResponseFax.md b/sdks/ruby/docs/FaxResponseFax.md new file mode 100644 index 000000000..08ec38b8a --- /dev/null +++ b/sdks/ruby/docs/FaxResponseFax.md @@ -0,0 +1,19 @@ +# Dropbox::Sign::FaxResponseFax + + + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| `fax_id` | ```String``` | Fax ID | | +| `title` | ```String``` | Fax Title | | +| `original_title` | ```String``` | Fax Original Title | | +| `subject` | ```String``` | Fax Subject | | +| `message` | ```String``` | Fax Message | | +| `metadata` | ```Object``` | Fax Metadata | | +| `created_at` | ```Integer``` | Fax Created At Timestamp | | +| `from` | ```String``` | Fax Sender Email | | +| `transmissions` | [```Array```](FaxResponseFaxTransmission.md) | Fax Transmissions List | | +| `files_url` | ```String``` | Fax Files URL | | + diff --git a/sdks/ruby/docs/FaxResponseFaxTransmission.md b/sdks/ruby/docs/FaxResponseFaxTransmission.md new file mode 100644 index 000000000..f721eeda7 --- /dev/null +++ b/sdks/ruby/docs/FaxResponseFaxTransmission.md @@ -0,0 +1,13 @@ +# Dropbox::Sign::FaxResponseFaxTransmission + + + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| `recipient` | ```String``` | Fax Transmission Recipient | | +| `sender` | ```String``` | Fax Transmission Sender | | +| `status_code` | ```String``` | Fax Transmission Status Code | | +| `sent_at` | ```Integer``` | Fax Transmission Sent Timestamp | | + diff --git a/sdks/ruby/docs/FaxSendRequest.md b/sdks/ruby/docs/FaxSendRequest.md new file mode 100644 index 000000000..f85def315 --- /dev/null +++ b/sdks/ruby/docs/FaxSendRequest.md @@ -0,0 +1,19 @@ +# Dropbox::Sign::FaxSendRequest + + + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| `to` | ```String``` | Fax Send To Recipient | | +| `from` | ```String``` | Fax Send From Sender (used only with fax number) | | +| `file` | [```Array```](SubFile.md) | Fax File to Send | | +| `file_url` | ```Array``` | Fax File URL to Send | | +| `file_url_names` | ```Array``` | Fax File URL Names | | +| `test_mode` | ```Boolean``` | API Test Mode Setting | | +| `cover_page_to` | ```String``` | Fax Cover Page for Recipient | | +| `cover_page_from` | ```String``` | Fax Cover Page for Sender | | +| `cover_page_message` | ```String``` | Fax Cover Page Message | | +| `title` | ```String``` | Fax Title | | + diff --git a/sdks/ruby/docs/SubFile.md b/sdks/ruby/docs/SubFile.md new file mode 100644 index 000000000..58478622e --- /dev/null +++ b/sdks/ruby/docs/SubFile.md @@ -0,0 +1,10 @@ +# Dropbox::Sign::SubFile + +Actual uploaded physical file + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| `name` | ```String``` | Actual physical uploaded file name that is derived during upload. Not settable parameter. | [default to ''] | + diff --git a/sdks/ruby/lib/dropbox-sign.rb b/sdks/ruby/lib/dropbox-sign.rb index 147b296a5..e3d924cb0 100644 --- a/sdks/ruby/lib/dropbox-sign.rb +++ b/sdks/ruby/lib/dropbox-sign.rb @@ -62,6 +62,11 @@ require 'dropbox-sign/models/fax_line_remove_user_request' require 'dropbox-sign/models/fax_line_response' require 'dropbox-sign/models/fax_line_response_fax_line' +require 'dropbox-sign/models/fax_list_response' +require 'dropbox-sign/models/fax_response' +require 'dropbox-sign/models/fax_response_fax' +require 'dropbox-sign/models/fax_response_fax_transmission' +require 'dropbox-sign/models/fax_send_request' require 'dropbox-sign/models/file_response' require 'dropbox-sign/models/file_response_data_uri' require 'dropbox-sign/models/list_info_response' @@ -95,6 +100,7 @@ require 'dropbox-sign/models/sub_custom_field' require 'dropbox-sign/models/sub_editor_options' require 'dropbox-sign/models/sub_field_options' +require 'dropbox-sign/models/sub_file' require 'dropbox-sign/models/sub_form_field_group' require 'dropbox-sign/models/sub_form_field_rule' require 'dropbox-sign/models/sub_form_field_rule_action' @@ -206,6 +212,7 @@ require 'dropbox-sign/api/api_app_api' require 'dropbox-sign/api/bulk_send_job_api' require 'dropbox-sign/api/embedded_api' +require 'dropbox-sign/api/fax_api' require 'dropbox-sign/api/fax_line_api' require 'dropbox-sign/api/o_auth_api' require 'dropbox-sign/api/report_api' diff --git a/sdks/ruby/lib/dropbox-sign/api/fax_api.rb b/sdks/ruby/lib/dropbox-sign/api/fax_api.rb new file mode 100644 index 000000000..80e7c5d64 --- /dev/null +++ b/sdks/ruby/lib/dropbox-sign/api/fax_api.rb @@ -0,0 +1,476 @@ +=begin +#Dropbox Sign API + +#Dropbox Sign v3 API + +The version of the OpenAPI document: 3.0.0 +Contact: apisupport@hellosign.com +Generated by: https://openapi-generator.tech +Generator version: 7.8.0 + +=end + +require 'cgi' + +module Dropbox +end + +module Dropbox::Sign + class FaxApi + attr_accessor :api_client + + def initialize(api_client = ApiClient.default) + @api_client = api_client + end + # Delete Fax + # Deletes the specified Fax from the system. + # @param fax_id [String] Fax ID + # @param [Hash] opts the optional parameters + # @return [nil] + def delete_fax(fax_id, opts = {}) + delete_fax_with_http_info(fax_id, opts) + nil + end + + # Delete Fax + # Deletes the specified Fax from the system. + # @param fax_id [String] Fax ID + # @param [Hash] opts the optional parameters + # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers + def delete_fax_with_http_info(fax_id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: FaxApi.delete_fax ...' + end + # verify the required parameter 'fax_id' is set + if @api_client.config.client_side_validation && fax_id.nil? + fail ArgumentError, "Missing the required parameter 'fax_id' when calling FaxApi.delete_fax" + end + # resource path + local_var_path = '/fax/{fax_id}'.sub('{' + 'fax_id' + '}', CGI.escape(fax_id.to_s)) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] + + post_body = {} + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] + + # auth_names + auth_names = opts[:debug_auth_names] || ['api_key'] + + new_options = opts.merge( + :operation => :"FaxApi.delete_fax", + :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(:DELETE, local_var_path, new_options) + rescue Dropbox::Sign::ApiError => e + end + + if @api_client.config.debugging + @api_client.config.logger.debug "API called: FaxApi#delete_fax\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Get Fax + # Returns information about fax + # @param fax_id [String] Fax ID + # @param [Hash] opts the optional parameters + # @return [FaxResponse] + def get_fax_by_id(fax_id, opts = {}) + data, _status_code, _headers = get_fax_by_id_with_http_info(fax_id, opts) + data + end + + # Get Fax + # Returns information about fax + # @param fax_id [String] Fax ID + # @param [Hash] opts the optional parameters + # @return [Array<(FaxResponse, Integer, Hash)>] FaxResponse data, response status code and response headers + def get_fax_by_id_with_http_info(fax_id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: FaxApi.get_fax_by_id ...' + end + # verify the required parameter 'fax_id' is set + if @api_client.config.client_side_validation && fax_id.nil? + fail ArgumentError, "Missing the required parameter 'fax_id' when calling FaxApi.get_fax_by_id" + end + # resource path + local_var_path = '/fax/{fax_id}'.sub('{' + 'fax_id' + '}', CGI.escape(fax_id.to_s)) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] + + post_body = {} + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] || 'FaxResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || ['api_key'] + + new_options = opts.merge( + :operation => :"FaxApi.get_fax_by_id", + :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(:GET, 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::FaxResponse" + ) + + fail ApiError.new(:code => e.code, + :response_headers => e.response_headers, + :response_body => body), + e.message + end + + range_code = "4XX".split('').first + range_code_left = "#{range_code}00".to_i + range_code_right = "#{range_code}99".to_i + if e.code >= range_code_left && e.code <= range_code_right + body = @api_client.convert_to_type( + JSON.parse("[#{e.response_body}]", :symbolize_names => true)[0], + "Dropbox::Sign::ErrorResponse" + ) + + fail ApiError.new(:code => e.code, + :response_headers => e.response_headers, + :response_body => body), + e.message + end + + end + + if @api_client.config.debugging + @api_client.config.logger.debug "API called: FaxApi#get_fax_by_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # List Fax Files + # Returns list of fax files + # @param fax_id [String] Fax ID + # @param [Hash] opts the optional parameters + # @return [nil] + def get_fax_files(fax_id, opts = {}) + get_fax_files_with_http_info(fax_id, opts) + nil + end + + # List Fax Files + # Returns list of fax files + # @param fax_id [String] Fax ID + # @param [Hash] opts the optional parameters + # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers + def get_fax_files_with_http_info(fax_id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: FaxApi.get_fax_files ...' + end + # verify the required parameter 'fax_id' is set + if @api_client.config.client_side_validation && fax_id.nil? + fail ArgumentError, "Missing the required parameter 'fax_id' when calling FaxApi.get_fax_files" + end + # resource path + local_var_path = '/fax/files/{fax_id}'.sub('{' + 'fax_id' + '}', CGI.escape(fax_id.to_s)) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] + + post_body = {} + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] + + # auth_names + auth_names = opts[:debug_auth_names] || ['api_key'] + + new_options = opts.merge( + :operation => :"FaxApi.get_fax_files", + :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(:GET, local_var_path, new_options) + rescue Dropbox::Sign::ApiError => e + end + + if @api_client.config.debugging + @api_client.config.logger.debug "API called: FaxApi#get_fax_files\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Lists Faxes + # Returns properties of multiple faxes + # @param page [Integer] Page + # @param page_size [Integer] Page size + # @param [Hash] opts the optional parameters + # @return [FaxListResponse] + def list_faxes(page, page_size, opts = {}) + data, _status_code, _headers = list_faxes_with_http_info(page, page_size, opts) + data + end + + # Lists Faxes + # Returns properties of multiple faxes + # @param page [Integer] Page + # @param page_size [Integer] Page size + # @param [Hash] opts the optional parameters + # @return [Array<(FaxListResponse, Integer, Hash)>] FaxListResponse data, response status code and response headers + def list_faxes_with_http_info(page, page_size, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: FaxApi.list_faxes ...' + end + # verify the required parameter 'page' is set + if @api_client.config.client_side_validation && page.nil? + fail ArgumentError, "Missing the required parameter 'page' when calling FaxApi.list_faxes" + end + if @api_client.config.client_side_validation && page < 1 + fail ArgumentError, 'invalid value for "page" when calling FaxApi.list_faxes, must be greater than or equal to 1.' + end + + # verify the required parameter 'page_size' is set + if @api_client.config.client_side_validation && page_size.nil? + fail ArgumentError, "Missing the required parameter 'page_size' when calling FaxApi.list_faxes" + end + if @api_client.config.client_side_validation && page_size > 100 + fail ArgumentError, 'invalid value for "page_size" when calling FaxApi.list_faxes, must be smaller than or equal to 100.' + end + + if @api_client.config.client_side_validation && page_size < 1 + fail ArgumentError, 'invalid value for "page_size" when calling FaxApi.list_faxes, must be greater than or equal to 1.' + end + + # resource path + local_var_path = '/fax/list' + + # query parameters + query_params = opts[:query_params] || {} + query_params[:'page'] = page + query_params[:'page_size'] = page_size + + # 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'] + + post_body = {} + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] || 'FaxListResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || ['api_key'] + + new_options = opts.merge( + :operation => :"FaxApi.list_faxes", + :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(:GET, 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::FaxListResponse" + ) + + fail ApiError.new(:code => e.code, + :response_headers => e.response_headers, + :response_body => body), + e.message + end + + range_code = "4XX".split('').first + range_code_left = "#{range_code}00".to_i + range_code_right = "#{range_code}99".to_i + if e.code >= range_code_left && e.code <= range_code_right + body = @api_client.convert_to_type( + JSON.parse("[#{e.response_body}]", :symbolize_names => true)[0], + "Dropbox::Sign::ErrorResponse" + ) + + fail ApiError.new(:code => e.code, + :response_headers => e.response_headers, + :response_body => body), + e.message + end + + end + + if @api_client.config.debugging + @api_client.config.logger.debug "API called: FaxApi#list_faxes\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Send Fax + # Action to prepare and send a fax + # @param fax_send_request [FaxSendRequest] + # @param [Hash] opts the optional parameters + # @return [FaxResponse] + def send_fax(fax_send_request, opts = {}) + data, _status_code, _headers = send_fax_with_http_info(fax_send_request, opts) + data + end + + # Send Fax + # Action to prepare and send a fax + # @param fax_send_request [FaxSendRequest] + # @param [Hash] opts the optional parameters + # @return [Array<(FaxResponse, Integer, Hash)>] FaxResponse data, response status code and response headers + def send_fax_with_http_info(fax_send_request, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: FaxApi.send_fax ...' + end + # verify the required parameter 'fax_send_request' is set + if @api_client.config.client_side_validation && fax_send_request.nil? + fail ArgumentError, "Missing the required parameter 'fax_send_request' when calling FaxApi.send_fax" + end + # resource path + local_var_path = '/fax/send' + + # 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']) + 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_send_request, + Dropbox::Sign::FaxSendRequest.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] || 'FaxResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || ['api_key'] + + new_options = opts.merge( + :operation => :"FaxApi.send_fax", + :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::FaxResponse" + ) + + fail ApiError.new(:code => e.code, + :response_headers => e.response_headers, + :response_body => body), + e.message + end + + range_code = "4XX".split('').first + range_code_left = "#{range_code}00".to_i + range_code_right = "#{range_code}99".to_i + if e.code >= range_code_left && e.code <= range_code_right + body = @api_client.convert_to_type( + JSON.parse("[#{e.response_body}]", :symbolize_names => true)[0], + "Dropbox::Sign::ErrorResponse" + ) + + fail ApiError.new(:code => e.code, + :response_headers => e.response_headers, + :response_body => body), + e.message + end + + end + + if @api_client.config.debugging + @api_client.config.logger.debug "API called: FaxApi#send_fax\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + end +end diff --git a/sdks/ruby/lib/dropbox-sign/models/fax_list_response.rb b/sdks/ruby/lib/dropbox-sign/models/fax_list_response.rb new file mode 100644 index 000000000..0d6ffcf86 --- /dev/null +++ b/sdks/ruby/lib/dropbox-sign/models/fax_list_response.rb @@ -0,0 +1,267 @@ +=begin +#Dropbox Sign API + +#Dropbox Sign v3 API + +The version of the OpenAPI document: 3.0.0 +Contact: apisupport@hellosign.com +Generated by: https://openapi-generator.tech +Generator version: 7.8.0 + +=end + +require 'date' +require 'time' + +module Dropbox +end + +module Dropbox::Sign + class FaxListResponse + # @return [Array] + attr_accessor :faxes + + # @return [ListInfoResponse] + attr_accessor :list_info + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'faxes' => :'faxes', + :'list_info' => :'list_info' + } + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'faxes' => :'Array', + :'list_info' => :'ListInfoResponse' + } + 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 [FaxListResponse] + def self.init(data) + ApiClient.default.convert_to_type( + data, + "FaxListResponse" + ) || FaxListResponse.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::FaxListResponse` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.merged_attributes.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `Dropbox::Sign::FaxListResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'faxes') + if (value = attributes[:'faxes']).is_a?(Array) + self.faxes = value + end + end + + if attributes.key?(:'list_info') + self.list_info = attributes[:'list_info'] + 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 @faxes.nil? + invalid_properties.push('invalid value for "faxes", faxes cannot be nil.') + end + + if @list_info.nil? + invalid_properties.push('invalid value for "list_info", list_info 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 @faxes.nil? + return false if @list_info.nil? + 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 && + faxes == o.faxes && + list_info == o.list_info + 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 + [faxes, list_info].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attribute_map = self.class.merged_attributes + + self.class.merged_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[attribute_map[key]])) + end + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + klass = Dropbox::Sign.const_get(type) + klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash(include_nil = true) + hash = {} + self.class.merged_attributes.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + next unless include_nil + is_nullable = self.class.merged_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value, include_nil) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value, include_nil = true) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v, include_nil) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v, include_nil) } + end + elsif value.respond_to? :to_hash + value.to_hash(include_nil) + else + value + end + end + end +end diff --git a/sdks/ruby/lib/dropbox-sign/models/fax_response.rb b/sdks/ruby/lib/dropbox-sign/models/fax_response.rb new file mode 100644 index 000000000..01f44eba5 --- /dev/null +++ b/sdks/ruby/lib/dropbox-sign/models/fax_response.rb @@ -0,0 +1,260 @@ +=begin +#Dropbox Sign API + +#Dropbox Sign v3 API + +The version of the OpenAPI document: 3.0.0 +Contact: apisupport@hellosign.com +Generated by: https://openapi-generator.tech +Generator version: 7.8.0 + +=end + +require 'date' +require 'time' + +module Dropbox +end + +module Dropbox::Sign + class FaxResponse + # @return [FaxResponseFax] + attr_accessor :fax + + # @return [WarningResponse] + attr_accessor :warnings + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'fax' => :'fax', + :'warnings' => :'warnings' + } + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'fax' => :'FaxResponseFax', + :'warnings' => :'WarningResponse' + } + 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 [FaxResponse] + def self.init(data) + ApiClient.default.convert_to_type( + data, + "FaxResponse" + ) || FaxResponse.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::FaxResponse` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.merged_attributes.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `Dropbox::Sign::FaxResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'fax') + self.fax = attributes[:'fax'] + end + + if attributes.key?(:'warnings') + self.warnings = attributes[:'warnings'] + 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.nil? + invalid_properties.push('invalid value for "fax", fax 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.nil? + 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 && + fax == o.fax && + 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, 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_response_fax.rb b/sdks/ruby/lib/dropbox-sign/models/fax_response_fax.rb new file mode 100644 index 000000000..565d0203e --- /dev/null +++ b/sdks/ruby/lib/dropbox-sign/models/fax_response_fax.rb @@ -0,0 +1,347 @@ +=begin +#Dropbox Sign API + +#Dropbox Sign v3 API + +The version of the OpenAPI document: 3.0.0 +Contact: apisupport@hellosign.com +Generated by: https://openapi-generator.tech +Generator version: 7.8.0 + +=end + +require 'date' +require 'time' + +module Dropbox +end + +module Dropbox::Sign + class FaxResponseFax + # Fax ID + # @return [String] + attr_accessor :fax_id + + # Fax Title + # @return [String] + attr_accessor :title + + # Fax Original Title + # @return [String] + attr_accessor :original_title + + # Fax Subject + # @return [String] + attr_accessor :subject + + # Fax Message + # @return [String] + attr_accessor :message + + # Fax Metadata + # @return [Object] + attr_accessor :metadata + + # Fax Created At Timestamp + # @return [Integer] + attr_accessor :created_at + + # Fax Sender Email + # @return [String] + attr_accessor :from + + # Fax Transmissions List + # @return [Array] + attr_accessor :transmissions + + # Fax Files URL + # @return [String] + attr_accessor :files_url + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'fax_id' => :'fax_id', + :'title' => :'title', + :'original_title' => :'original_title', + :'subject' => :'subject', + :'message' => :'message', + :'metadata' => :'metadata', + :'created_at' => :'created_at', + :'from' => :'from', + :'transmissions' => :'transmissions', + :'files_url' => :'files_url' + } + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'fax_id' => :'String', + :'title' => :'String', + :'original_title' => :'String', + :'subject' => :'String', + :'message' => :'String', + :'metadata' => :'Object', + :'created_at' => :'Integer', + :'from' => :'String', + :'transmissions' => :'Array', + :'files_url' => :'String' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Returns attribute map of this model + parent + def self.merged_attributes + self.attribute_map + end + + # Attribute type mapping of this model + parent + def self.merged_types + self.openapi_types + end + + # Returns list of attributes with nullable: true of this model + parent + def self.merged_nullable + self.openapi_nullable + end + + # Attempt to instantiate and hydrate a new instance of this class + # @param [Object] data Data to be converted + # @return [FaxResponseFax] + def self.init(data) + ApiClient.default.convert_to_type( + data, + "FaxResponseFax" + ) || FaxResponseFax.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::FaxResponseFax` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.merged_attributes.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `Dropbox::Sign::FaxResponseFax`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'fax_id') + self.fax_id = attributes[:'fax_id'] + end + + if attributes.key?(:'title') + self.title = attributes[:'title'] + end + + if attributes.key?(:'original_title') + self.original_title = attributes[:'original_title'] + end + + if attributes.key?(:'subject') + self.subject = attributes[:'subject'] + end + + if attributes.key?(:'message') + self.message = attributes[:'message'] + end + + if attributes.key?(:'metadata') + self.metadata = attributes[:'metadata'] + end + + if attributes.key?(:'created_at') + self.created_at = attributes[:'created_at'] + end + + if attributes.key?(:'from') + self.from = attributes[:'from'] + end + + if attributes.key?(:'transmissions') + if (value = attributes[:'transmissions']).is_a?(Array) + self.transmissions = value + end + end + + if attributes.key?(:'files_url') + self.files_url = attributes[:'files_url'] + 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 && + fax_id == o.fax_id && + title == o.title && + original_title == o.original_title && + subject == o.subject && + message == o.message && + metadata == o.metadata && + created_at == o.created_at && + from == o.from && + transmissions == o.transmissions && + files_url == o.files_url + 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, title, original_title, subject, message, metadata, created_at, from, transmissions, files_url].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attribute_map = self.class.merged_attributes + + self.class.merged_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[attribute_map[key]])) + end + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + klass = Dropbox::Sign.const_get(type) + klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash(include_nil = true) + hash = {} + self.class.merged_attributes.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + next unless include_nil + is_nullable = self.class.merged_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value, include_nil) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value, include_nil = true) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v, include_nil) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v, include_nil) } + end + elsif value.respond_to? :to_hash + value.to_hash(include_nil) + else + value + end + end + end +end diff --git a/sdks/ruby/lib/dropbox-sign/models/fax_response_fax_transmission.rb b/sdks/ruby/lib/dropbox-sign/models/fax_response_fax_transmission.rb new file mode 100644 index 000000000..a02278699 --- /dev/null +++ b/sdks/ruby/lib/dropbox-sign/models/fax_response_fax_transmission.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.8.0 + +=end + +require 'date' +require 'time' + +module Dropbox +end + +module Dropbox::Sign + class FaxResponseFaxTransmission + # Fax Transmission Recipient + # @return [String] + attr_accessor :recipient + + # Fax Transmission Sender + # @return [String] + attr_accessor :sender + + # Fax Transmission Status Code + # @return [String] + attr_accessor :status_code + + # Fax Transmission Sent Timestamp + # @return [Integer] + attr_accessor :sent_at + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'recipient' => :'recipient', + :'sender' => :'sender', + :'status_code' => :'status_code', + :'sent_at' => :'sent_at' + } + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'recipient' => :'String', + :'sender' => :'String', + :'status_code' => :'String', + :'sent_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 [FaxResponseFaxTransmission] + def self.init(data) + ApiClient.default.convert_to_type( + data, + "FaxResponseFaxTransmission" + ) || FaxResponseFaxTransmission.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::FaxResponseFaxTransmission` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.merged_attributes.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `Dropbox::Sign::FaxResponseFaxTransmission`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'recipient') + self.recipient = attributes[:'recipient'] + end + + if attributes.key?(:'sender') + self.sender = attributes[:'sender'] + end + + if attributes.key?(:'status_code') + self.status_code = attributes[:'status_code'] + end + + if attributes.key?(:'sent_at') + self.sent_at = attributes[:'sent_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 + 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 && + recipient == o.recipient && + sender == o.sender && + status_code == o.status_code && + sent_at == o.sent_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 + [recipient, sender, status_code, sent_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/fax_send_request.rb b/sdks/ruby/lib/dropbox-sign/models/fax_send_request.rb new file mode 100644 index 000000000..c3256c744 --- /dev/null +++ b/sdks/ruby/lib/dropbox-sign/models/fax_send_request.rb @@ -0,0 +1,356 @@ +=begin +#Dropbox Sign API + +#Dropbox Sign v3 API + +The version of the OpenAPI document: 3.0.0 +Contact: apisupport@hellosign.com +Generated by: https://openapi-generator.tech +Generator version: 7.8.0 + +=end + +require 'date' +require 'time' + +module Dropbox +end + +module Dropbox::Sign + class FaxSendRequest + # Fax Send To Recipient + # @return [String] + attr_accessor :to + + # Fax Send From Sender (used only with fax number) + # @return [String, nil] + attr_accessor :from + + # Fax File to Send + # @return [Array] + attr_accessor :file + + # Fax File URL to Send + # @return [Array] + attr_accessor :file_url + + # Fax File URL Names + # @return [Array] + attr_accessor :file_url_names + + # API Test Mode Setting + # @return [Boolean] + attr_accessor :test_mode + + # Fax Cover Page for Recipient + # @return [String, nil] + attr_accessor :cover_page_to + + # Fax Cover Page for Sender + # @return [String, nil] + attr_accessor :cover_page_from + + # Fax Cover Page Message + # @return [String, nil] + attr_accessor :cover_page_message + + # Fax Title + # @return [String, nil] + attr_accessor :title + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'to' => :'to', + :'from' => :'from', + :'file' => :'file', + :'file_url' => :'file_url', + :'file_url_names' => :'file_url_names', + :'test_mode' => :'test_mode', + :'cover_page_to' => :'cover_page_to', + :'cover_page_from' => :'cover_page_from', + :'cover_page_message' => :'cover_page_message', + :'title' => :'title' + } + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'to' => :'String', + :'from' => :'String', + :'file' => :'Array', + :'file_url' => :'Array', + :'file_url_names' => :'Array', + :'test_mode' => :'Boolean', + :'cover_page_to' => :'String', + :'cover_page_from' => :'String', + :'cover_page_message' => :'String', + :'title' => :'String' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + :'from', + :'cover_page_to', + :'cover_page_from', + :'cover_page_message', + :'title' + ]) + 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 [FaxSendRequest] + def self.init(data) + ApiClient.default.convert_to_type( + data, + "FaxSendRequest" + ) || FaxSendRequest.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::FaxSendRequest` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.merged_attributes.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `Dropbox::Sign::FaxSendRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'to') + self.to = attributes[:'to'] + end + + if attributes.key?(:'from') + self.from = attributes[:'from'] + end + + if attributes.key?(:'file') + if (value = attributes[:'file']).is_a?(Array) + self.file = value + end + end + + if attributes.key?(:'file_url') + if (value = attributes[:'file_url']).is_a?(Array) + self.file_url = value + end + end + + if attributes.key?(:'file_url_names') + if (value = attributes[:'file_url_names']).is_a?(Array) + self.file_url_names = value + end + end + + if attributes.key?(:'test_mode') + self.test_mode = attributes[:'test_mode'] + end + + if attributes.key?(:'cover_page_to') + self.cover_page_to = attributes[:'cover_page_to'] + end + + if attributes.key?(:'cover_page_from') + self.cover_page_from = attributes[:'cover_page_from'] + end + + if attributes.key?(:'cover_page_message') + self.cover_page_message = attributes[:'cover_page_message'] + end + + if attributes.key?(:'title') + self.title = attributes[:'title'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + 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 && + to == o.to && + from == o.from && + file == o.file && + file_url == o.file_url && + file_url_names == o.file_url_names && + test_mode == o.test_mode && + cover_page_to == o.cover_page_to && + cover_page_from == o.cover_page_from && + cover_page_message == o.cover_page_message && + title == o.title + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [to, from, file, file_url, file_url_names, test_mode, cover_page_to, cover_page_from, cover_page_message, title].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attribute_map = self.class.merged_attributes + + self.class.merged_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[attribute_map[key]])) + end + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + klass = Dropbox::Sign.const_get(type) + klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash(include_nil = true) + hash = {} + self.class.merged_attributes.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + next unless include_nil + is_nullable = self.class.merged_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value, include_nil) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value, include_nil = true) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v, include_nil) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v, include_nil) } + end + elsif value.respond_to? :to_hash + value.to_hash(include_nil) + else + value + end + end + end +end diff --git a/sdks/ruby/lib/dropbox-sign/models/sub_file.rb b/sdks/ruby/lib/dropbox-sign/models/sub_file.rb new file mode 100644 index 000000000..fc3fff631 --- /dev/null +++ b/sdks/ruby/lib/dropbox-sign/models/sub_file.rb @@ -0,0 +1,249 @@ +=begin +#Dropbox Sign API + +#Dropbox Sign v3 API + +The version of the OpenAPI document: 3.0.0 +Contact: apisupport@hellosign.com +Generated by: https://openapi-generator.tech +Generator version: 7.8.0 + +=end + +require 'date' +require 'time' + +module Dropbox +end + +module Dropbox::Sign + # Actual uploaded physical file + class SubFile + # Actual physical uploaded file name that is derived during upload. Not settable parameter. + # @return [String] + attr_accessor :name + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'name' => :'name' + } + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'name' => :'String' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Returns attribute map of this model + parent + def self.merged_attributes + self.attribute_map + end + + # Attribute type mapping of this model + parent + def self.merged_types + self.openapi_types + end + + # Returns list of attributes with nullable: true of this model + parent + def self.merged_nullable + self.openapi_nullable + end + + # Attempt to instantiate and hydrate a new instance of this class + # @param [Object] data Data to be converted + # @return [SubFile] + def self.init(data) + ApiClient.default.convert_to_type( + data, + "SubFile" + ) || SubFile.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::SubFile` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.merged_attributes.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `Dropbox::Sign::SubFile`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'name') + self.name = attributes[:'name'] + else + self.name = '' + 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 && + name == o.name + 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 + [name].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 6925e38a4..0a45d831d 100644 --- a/translations/en.yaml +++ b/translations/en.yaml @@ -130,6 +130,45 @@ "EmbeddedSignUrl::DESCRIPTION": Retrieves an embedded object containing a signature url that can be opened in an iFrame. Note that templates created via the embedded template process will only be accessible through the API. "EmbeddedSignUrl::SIGNATURE_ID": The id of the signature to get a signature url for. +"FaxGet::SUMMARY": Get Fax +"FaxGet::DESCRIPTION": Returns information about fax +"FaxParam::FAX_ID": Fax ID +"FaxDelete::SUMMARY": Delete Fax +"FaxDelete::DESCRIPTION": Deletes the specified Fax from the system. +"FaxFiles::SUMMARY": List Fax Files +"FaxFiles::DESCRIPTION": Returns list of fax files +"FaxList::SUMMARY": Lists Faxes +"FaxList::DESCRIPTION": Returns properties of multiple faxes +"FaxList::PAGE": Page +"FaxList::PAGE_SIZE": Page size +"FaxSend::SUMMARY": Send Fax +"FaxSend::DESCRIPTION": Action to prepare and send a fax +"FaxSend::TO": Fax Send To Recipient +"FaxSend::FROM": Fax Send From Sender (used only with fax number) +"FaxSend::FILE": Fax File to Send +"FaxSend::FILE_URL": Fax File URL to Send +"FaxSend::FILE_URL_NAMES": Fax File URL Names +"FaxSend::TEST_MODE": API Test Mode Setting +"FaxSend::COVER_PAGE_TO": Fax Cover Page for Recipient +"FaxSend::COVER_PAGE_FROM": Fax Cover Page for Sender +"FaxSend::COVER_PAGE_MESSAGE": Fax Cover Page Message +"FaxSend::TITLE": Fax Title +"FaxResponseExample::SUMMARY": Fax Response +"FaxResponseFax::FAX_ID": Fax ID +"FaxResponseFax::TITLE": Fax Title +"FaxResponseFax::ORIGINAL_TITLE": Fax Original Title +"FaxResponseFax::SUBJECT": Fax Subject +"FaxResponseFax::MESSAGE": Fax Message +"FaxResponseFax::METADATA": Fax Metadata +"FaxResponseFax::CREATED_AT": Fax Created At Timestamp +"FaxResponseFax::FROM": Fax Sender Email +"FaxResponseFax::TRANSMISSIONS": Fax Transmissions List +"FaxResponseFax::FILES_URL": Fax Files URL +"FaxResponseFaxTransmission::RECIPIENT": Fax Transmission Recipient +"FaxResponseFaxTransmission::SENDER": Fax Transmission Sender +"FaxResponseFaxTransmission::STATUS_CODE": Fax Transmission Status Code +"FaxResponseFaxTransmission::SENT_AT": Fax Transmission Sent Timestamp +"FaxListResponseExample::SUMMARY": Returns the properties and settings of multiple Faxes. "FaxLineAddUser::SUMMARY": Add Fax Line User "FaxLineAddUser::DESCRIPTION": Grants a user access to the specified Fax Line. "FaxLineAddUser::NUMBER": The Fax Line number. @@ -930,6 +969,10 @@ **NOTE:** Only available for Premium and higher. +"Sub::File::DESCRIPTION": Actual uploaded physical file +"Sub::File::NAME": Actual physical uploaded file name that is derived during upload. Not settable parameter. + + "Sub::FormFieldGroup::DESCRIPTION": Group information for fields defined in `form_fields_per_document`. String-indexed JSON array with `group_label` and `requirement` keys. `form_fields_per_document` must contain fields referencing a group defined in `form_field_groups`. "Sub::FormFieldGroup::GROUP_ID_LABEL": ID of group. Use this to reference a specific group from the `group` value in `form_fields_per_document`. "Sub::FormFieldGroup::GROUP_LABEL": Name of the group @@ -1659,6 +1702,16 @@ "EmbeddedEditUrl::SEO::DESCRIPTION": "The Dropbox Sign API allows you to build custom integrations. To find out how to retrieve an embedded iFrame object containing a template url, click here." "EmbeddedSignUrl::SEO::TITLE": "Get Embedded Sign URL | iFrame | Dropbox Sign for Developers" "EmbeddedSignUrl::SEO::DESCRIPTION": "The Dropbox Sign API allows you to build custom integrations. To find out how to retrieve an embedded iFrame object containing a signature url, click here." +"FaxGet::SEO::TITLE": "Get Fax | API Documentation | Dropbox Fax for Developers" +"FaxGet::SEO::DESCRIPTION": "The Dropbox Fax API allows you to build custom integrations. To find out how to retrieve a fax, click here." +"FaxDelete::SEO::TITLE": "Delete Fax | API Documentation | Dropbox Fax for Developers" +"FaxDelete::SEO::DESCRIPTION": "The Dropbox Fax API allows you to build custom integrations. To find out how to delete a fax, click here." +"FaxFiles::SEO::TITLE": "Fax Files | API Documentation | Dropbox Fax for Developers" +"FaxFiles::SEO::DESCRIPTION": "The Dropbox Fax API allows you to build custom integrations. To find out how to list fax files, click here." +"FaxList::SEO::TITLE": "List Faxes | API Documentation | Dropbox Fax for Developers" +"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." "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"