From 1beee8ca81f1f9af52ea03021a897a3db94a5cbe Mon Sep 17 00:00:00 2001 From: Maksud Aghayev Date: Thu, 19 Sep 2024 14:48:31 -0700 Subject: [PATCH 01/11] 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 | 652 ++++++ openapi-sdk.yaml | 652 ++++++ openapi.yaml | 652 ++++++ sdks/dotnet/README.md | 11 + sdks/dotnet/docs/FaxApi.md | 476 +++++ 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 | 1194 +++++++++++ .../src/Dropbox.Sign/Model/FaxListResponse.cs | 201 ++ .../src/Dropbox.Sign/Model/FaxResponse.cs | 197 ++ .../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 | 356 ++++ 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 | 386 ++++ .../dropbox/sign/model/FaxListResponse.java | 224 ++ .../com/dropbox/sign/model/FaxResponse.java | 221 ++ .../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 | 356 ++++ 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 | 379 ++++ .../dropbox/sign/model/FaxListResponse.java | 240 +++ .../com/dropbox/sign/model/FaxResponse.java | 240 +++ .../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 | 793 +++++++ sdks/node/api/index.ts | 3 + sdks/node/dist/api.js | 1413 ++++++++++--- 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 | 59 + 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 | 1814 +++++++++++++++++ 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 | 327 +++ 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 | 1315 ++++++++++++ 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 | 151 ++ .../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 | 503 +++++ .../dropbox-sign/models/fax_list_response.rb | 267 +++ .../lib/dropbox-sign/models/fax_response.rb | 263 +++ .../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, 26335 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..f53d38a4d 100644 --- a/openapi-raw.yaml +++ b/openapi-raw.yaml @@ -1403,6 +1403,298 @@ 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: + '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/pdf: + schema: + type: string + format: binary + 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 +2492,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 +7754,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 +8507,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 +10165,19 @@ components: error: $ref: '#/components/schemas/ErrorResponseError' type: object + FaxResponse: + required: + - fax + properties: + fax: + $ref: '#/components/schemas/FaxResponseFax' + warnings: + description: '_t__WarningResponse::LIST_DESCRIPTION' + type: array + items: + $ref: '#/components/schemas/WarningResponse' + type: object + x-internal-class: true FaxLineResponse: required: - fax_line @@ -9638,6 +10213,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 +10569,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 +10622,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 +12266,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 +12514,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 +12530,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..b64e1e696 100644 --- a/openapi-sdk.yaml +++ b/openapi-sdk.yaml @@ -1409,6 +1409,298 @@ 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: + 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/pdf: + schema: + type: string + format: binary + 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 +2498,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 +7848,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 +8806,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 +10773,19 @@ components: error: $ref: '#/components/schemas/ErrorResponseError' type: object + FaxResponse: + required: + - fax + properties: + fax: + $ref: '#/components/schemas/FaxResponseFax' + warnings: + description: 'A list of warnings.' + type: array + items: + $ref: '#/components/schemas/WarningResponse' + type: object + x-internal-class: true FaxLineResponse: required: - fax_line @@ -10246,6 +10821,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 +11177,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 +11230,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 +13058,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 +13306,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 +13322,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..d803bcc07 100644 --- a/openapi.yaml +++ b/openapi.yaml @@ -1409,6 +1409,298 @@ 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: + 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/pdf: + schema: + type: string + format: binary + 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 +2498,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 +7848,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 +8784,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 +10751,19 @@ components: error: $ref: '#/components/schemas/ErrorResponseError' type: object + FaxResponse: + required: + - fax + properties: + fax: + $ref: '#/components/schemas/FaxResponseFax' + warnings: + description: 'A list of warnings.' + type: array + items: + $ref: '#/components/schemas/WarningResponse' + type: object + x-internal-class: true FaxLineResponse: required: - fax_line @@ -10224,6 +10799,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 +11155,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 +11208,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 +13036,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 +13284,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 +13300,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..52d2ddbcf --- /dev/null +++ b/sdks/dotnet/docs/FaxApi.md @@ -0,0 +1,476 @@ +# 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** +> System.IO.Stream 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 + ApiResponse response = apiInstance.GetFaxFilesWithHttpInfo(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.GetFaxFilesWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **faxId** | **string** | Fax ID | | + +### Return type + +**System.IO.Stream** + +### Authorization + +[api_key](../README.md#api_key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/pdf, 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) + + +# **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..44b7cef62 --- /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** | [**List<WarningResponse>**](WarningResponse.md) | A list of warnings. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/sdks/dotnet/docs/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..f655ee7bf --- /dev/null +++ b/sdks/dotnet/src/Dropbox.Sign/Api/FaxApi.cs @@ -0,0 +1,1194 @@ +/* + * 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. + /// System.IO.Stream + System.IO.Stream 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 System.IO.Stream + 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 System.IO.Stream + 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.IO.Stream) + 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. + /// System.IO.Stream + public System.IO.Stream GetFaxFiles(string faxId, int operationIndex = 0) + { + Dropbox.Sign.Client.ApiResponse localVarResponse = GetFaxFilesWithHttpInfo(faxId); + return localVarResponse.Data; + } + + /// + /// List Fax Files Returns list of fax files + /// + /// Thrown when fails to make API call + /// Fax ID + /// Index associated with the operation. + /// ApiResponse of System.IO.Stream + 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/pdf", + "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 System.IO.Stream + public async System.Threading.Tasks.Task GetFaxFilesAsync(string faxId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + { + Dropbox.Sign.Client.ApiResponse localVarResponse = await GetFaxFilesWithHttpInfoAsync(faxId, operationIndex, cancellationToken).ConfigureAwait(false); + return localVarResponse.Data; + } + + /// + /// 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.IO.Stream) + 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/pdf", + "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..de5879774 --- /dev/null +++ b/sdks/dotnet/src/Dropbox.Sign/Model/FaxResponse.cs @@ -0,0 +1,197 @@ +/* + * Dropbox Sign API + * + * Dropbox Sign v3 API + * + * The version of the OpenAPI document: 3.0.0 + * Contact: apisupport@hellosign.com + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using System.ComponentModel.DataAnnotations; +using OpenAPIDateConverter = Dropbox.Sign.Client.OpenAPIDateConverter; + +namespace Dropbox.Sign.Model +{ + /// + /// 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). + /// A list of warnings.. + public FaxResponse(FaxResponseFax fax = default(FaxResponseFax), List warnings = default(List)) + { + + // 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; } + + /// + /// A list of warnings. + /// + /// A list of warnings. + [DataMember(Name = "warnings", EmitDefaultValue = true)] + public List Warnings { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class 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 && + input.Warnings != null && + this.Warnings.SequenceEqual(input.Warnings) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.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 = "List", + 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..f917f4c3e --- /dev/null +++ b/sdks/java-v1/docs/FaxApi.md @@ -0,0 +1,356 @@ +# 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 + +> File 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 + +[**File**](File.md) + +### Authorization + +[api_key](../README.md#api_key) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/pdf, 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 | - | + + +## 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..76e4a451f --- /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` | [```List```](WarningResponse.md) | A list of warnings. | | + + + 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..33c0bd28c --- /dev/null +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/api/FaxApi.java @@ -0,0 +1,386 @@ +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.io.File; +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) + * @return File + * @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 File getFaxFiles(String faxId) throws ApiException { + return getFaxFilesWithHttpInfo(faxId).getData(); + } + + /** + * List Fax Files. Returns list of fax files + * + * @param faxId Fax ID (required) + * @return ApiResponse<File> + * @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 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/pdf", "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.getFaxFiles", + localVarPath, + "GET", + new ArrayList<>(), + null, + new LinkedHashMap<>(), + new LinkedHashMap<>(), + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType, + 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..5ccf3f755 --- /dev/null +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/model/FaxResponse.java @@ -0,0 +1,221 @@ +/* + * 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; + +/** 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 List warnings = null; + + 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(List warnings) { + this.warnings = warnings; + return this; + } + + public FaxResponse addWarningsItem(WarningResponse warningsItem) { + if (this.warnings == null) { + this.warnings = new ArrayList<>(); + } + this.warnings.add(warningsItem); + return this; + } + + /** + * A list of warnings. + * + * @return warnings + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_WARNINGS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getWarnings() { + return warnings; + } + + @JsonProperty(JSON_PROPERTY_WARNINGS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setWarnings(List 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..f917f4c3e --- /dev/null +++ b/sdks/java-v2/docs/FaxApi.md @@ -0,0 +1,356 @@ +# 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 + +> File 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 + +[**File**](File.md) + +### Authorization + +[api_key](../README.md#api_key) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/pdf, 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 | - | + + +## 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..76e4a451f --- /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` | [```List```](WarningResponse.md) | A list of warnings. | | + + + 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..20435dd12 --- /dev/null +++ b/sdks/java-v2/src/main/java/com/dropbox/sign/api/FaxApi.java @@ -0,0 +1,379 @@ +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.io.File; + +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) + * @return File + * @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 File getFaxFiles(String faxId) throws ApiException { + return getFaxFilesWithHttpInfo(faxId).getData(); + } + + + /** + * List Fax Files. + * Returns list of fax files + * @param faxId Fax ID (required) + * @return ApiResponse<File> + * @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 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/pdf", "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.getFaxFiles", + localVarPath, + "GET", + new ArrayList<>(), + null, + new LinkedHashMap<>(), + new LinkedHashMap<>(), + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType, + 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..22b995ecc --- /dev/null +++ b/sdks/java-v2/src/main/java/com/dropbox/sign/model/FaxResponse.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.WarningResponse; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.dropbox.sign.JSON; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.databind.ObjectMapper; + + +import com.dropbox.sign.ApiException; +/** + * 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 List warnings = null; + + 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(List warnings) { + this.warnings = warnings; + return this; + } + + public FaxResponse addWarningsItem(WarningResponse warningsItem) { + if (this.warnings == null) { + this.warnings = new ArrayList<>(); + } + this.warnings.add(warningsItem); + return this; + } + + /** + * A list of warnings. + * @return warnings + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_WARNINGS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getWarnings() { + return warnings; + } + + + @JsonProperty(JSON_PROPERTY_WARNINGS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setWarnings(List 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..3b8a6b0ae --- /dev/null +++ b/sdks/node/api/faxApi.ts @@ -0,0 +1,793 @@ +/** + * 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/pdf", "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: "arraybuffer", + }; + + 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, + "Buffer" + ); + }, + (error: AxiosError) => { + if (error.response == null) { + reject(error); + return; + } + + if ( + handleErrorCodeResponse( + reject, + error.response, + 200, + "RequestFile" + ) + ) { + 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..92b7c1433 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: "Array" + } +]; + +// 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,635 @@ 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/pdf", "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: "arraybuffer" + }; + 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, + "Buffer" + ); + }, + (error) => { + if (error.response == null) { + reject(error); + return; + } + if (handleErrorCodeResponse5( + reject, + error.response, + 200, + "RequestFile" + )) { + 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 +27410,7 @@ var FaxLineApi = class { } faxLineCreate(_0) { return __async(this, arguments, function* (faxLineCreateRequest, options = { headers: {} }) { - faxLineCreateRequest = deserializeIfNeeded4( + faxLineCreateRequest = deserializeIfNeeded5( faxLineCreateRequest, "FaxLineCreateRequest" ); @@ -26686,7 +27481,7 @@ var FaxLineApi = class { return new Promise((resolve, reject) => { axios_default.request(localVarRequestOptions).then( (response) => { - handleSuccessfulResponse5( + handleSuccessfulResponse6( resolve, reject, response, @@ -26698,7 +27493,7 @@ var FaxLineApi = class { reject(error); return; } - if (handleErrorCodeResponse5( + if (handleErrorCodeResponse6( reject, error.response, 200, @@ -26706,7 +27501,7 @@ var FaxLineApi = class { )) { return; } - if (handleErrorRangeResponse5( + if (handleErrorRangeResponse6( reject, error.response, "4XX", @@ -26723,7 +27518,7 @@ var FaxLineApi = class { } faxLineDelete(_0) { return __async(this, arguments, function* (faxLineDeleteRequest, options = { headers: {} }) { - faxLineDeleteRequest = deserializeIfNeeded4( + faxLineDeleteRequest = deserializeIfNeeded5( faxLineDeleteRequest, "FaxLineDeleteRequest" ); @@ -26794,14 +27589,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 +27669,7 @@ var FaxLineApi = class { return new Promise((resolve, reject) => { axios_default.request(localVarRequestOptions).then( (response) => { - handleSuccessfulResponse5( + handleSuccessfulResponse6( resolve, reject, response, @@ -26886,7 +27681,7 @@ var FaxLineApi = class { reject(error); return; } - if (handleErrorCodeResponse5( + if (handleErrorCodeResponse6( reject, error.response, 200, @@ -26894,7 +27689,7 @@ var FaxLineApi = class { )) { return; } - if (handleErrorRangeResponse5( + if (handleErrorRangeResponse6( reject, error.response, "4XX", @@ -26981,7 +27776,7 @@ var FaxLineApi = class { (resolve, reject) => { axios_default.request(localVarRequestOptions).then( (response) => { - handleSuccessfulResponse5( + handleSuccessfulResponse6( resolve, reject, response, @@ -26993,7 +27788,7 @@ var FaxLineApi = class { reject(error); return; } - if (handleErrorCodeResponse5( + if (handleErrorCodeResponse6( reject, error.response, 200, @@ -27001,7 +27796,7 @@ var FaxLineApi = class { )) { return; } - if (handleErrorRangeResponse5( + if (handleErrorRangeResponse6( reject, error.response, "4XX", @@ -27019,7 +27814,7 @@ var FaxLineApi = class { } faxLineRemoveUser(_0) { return __async(this, arguments, function* (faxLineRemoveUserRequest, options = { headers: {} }) { - faxLineRemoveUserRequest = deserializeIfNeeded4( + faxLineRemoveUserRequest = deserializeIfNeeded5( faxLineRemoveUserRequest, "FaxLineRemoveUserRequest" ); @@ -27090,7 +27885,7 @@ var FaxLineApi = class { return new Promise((resolve, reject) => { axios_default.request(localVarRequestOptions).then( (response) => { - handleSuccessfulResponse5( + handleSuccessfulResponse6( resolve, reject, response, @@ -27102,7 +27897,7 @@ var FaxLineApi = class { reject(error); return; } - if (handleErrorCodeResponse5( + if (handleErrorCodeResponse6( reject, error.response, 200, @@ -27110,7 +27905,7 @@ var FaxLineApi = class { )) { return; } - if (handleErrorRangeResponse5( + if (handleErrorRangeResponse6( reject, error.response, "4XX", @@ -27126,13 +27921,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 +27938,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 +27946,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 +27958,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 +28009,7 @@ var OAuthApi = class { } oauthTokenGenerate(_0) { return __async(this, arguments, function* (oAuthTokenGenerateRequest, options = { headers: {} }) { - oAuthTokenGenerateRequest = deserializeIfNeeded5( + oAuthTokenGenerateRequest = deserializeIfNeeded6( oAuthTokenGenerateRequest, "OAuthTokenGenerateRequest" ); @@ -27280,7 +28075,7 @@ var OAuthApi = class { return new Promise((resolve, reject) => { axios_default.request(localVarRequestOptions).then( (response) => { - handleSuccessfulResponse6( + handleSuccessfulResponse7( resolve, reject, response, @@ -27292,7 +28087,7 @@ var OAuthApi = class { reject(error); return; } - if (handleErrorCodeResponse6( + if (handleErrorCodeResponse7( reject, error.response, 200, @@ -27309,7 +28104,7 @@ var OAuthApi = class { } oauthTokenRefresh(_0) { return __async(this, arguments, function* (oAuthTokenRefreshRequest, options = { headers: {} }) { - oAuthTokenRefreshRequest = deserializeIfNeeded5( + oAuthTokenRefreshRequest = deserializeIfNeeded6( oAuthTokenRefreshRequest, "OAuthTokenRefreshRequest" ); @@ -27375,7 +28170,7 @@ var OAuthApi = class { return new Promise((resolve, reject) => { axios_default.request(localVarRequestOptions).then( (response) => { - handleSuccessfulResponse6( + handleSuccessfulResponse7( resolve, reject, response, @@ -27387,7 +28182,7 @@ var OAuthApi = class { reject(error); return; } - if (handleErrorCodeResponse6( + if (handleErrorCodeResponse7( reject, error.response, 200, @@ -27403,13 +28198,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 +28215,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 +28225,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 +28276,7 @@ var ReportApi = class { } reportCreate(_0) { return __async(this, arguments, function* (reportCreateRequest, options = { headers: {} }) { - reportCreateRequest = deserializeIfNeeded6( + reportCreateRequest = deserializeIfNeeded7( reportCreateRequest, "ReportCreateRequest" ); @@ -27553,7 +28348,7 @@ var ReportApi = class { (resolve, reject) => { axios_default.request(localVarRequestOptions).then( (response) => { - handleSuccessfulResponse7( + handleSuccessfulResponse8( resolve, reject, response, @@ -27565,7 +28360,7 @@ var ReportApi = class { reject(error); return; } - if (handleErrorCodeResponse7( + if (handleErrorCodeResponse8( reject, error.response, 200, @@ -27573,7 +28368,7 @@ var ReportApi = class { )) { return; } - if (handleErrorRangeResponse6( + if (handleErrorRangeResponse7( reject, error.response, "4XX", @@ -27590,13 +28385,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 +28402,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 +28410,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 +28422,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 +28473,7 @@ var SignatureRequestApi = class { } signatureRequestBulkCreateEmbeddedWithTemplate(_0) { return __async(this, arguments, function* (signatureRequestBulkCreateEmbeddedWithTemplateRequest, options = { headers: {} }) { - signatureRequestBulkCreateEmbeddedWithTemplateRequest = deserializeIfNeeded7( + signatureRequestBulkCreateEmbeddedWithTemplateRequest = deserializeIfNeeded8( signatureRequestBulkCreateEmbeddedWithTemplateRequest, "SignatureRequestBulkCreateEmbeddedWithTemplateRequest" ); @@ -27750,7 +28545,7 @@ var SignatureRequestApi = class { (resolve, reject) => { axios_default.request(localVarRequestOptions).then( (response) => { - handleSuccessfulResponse8( + handleSuccessfulResponse9( resolve, reject, response, @@ -27762,7 +28557,7 @@ var SignatureRequestApi = class { reject(error); return; } - if (handleErrorCodeResponse8( + if (handleErrorCodeResponse9( reject, error.response, 200, @@ -27770,7 +28565,7 @@ var SignatureRequestApi = class { )) { return; } - if (handleErrorRangeResponse7( + if (handleErrorRangeResponse8( reject, error.response, "4XX", @@ -27788,7 +28583,7 @@ var SignatureRequestApi = class { } signatureRequestBulkSendWithTemplate(_0) { return __async(this, arguments, function* (signatureRequestBulkSendWithTemplateRequest, options = { headers: {} }) { - signatureRequestBulkSendWithTemplateRequest = deserializeIfNeeded7( + signatureRequestBulkSendWithTemplateRequest = deserializeIfNeeded8( signatureRequestBulkSendWithTemplateRequest, "SignatureRequestBulkSendWithTemplateRequest" ); @@ -27865,7 +28660,7 @@ var SignatureRequestApi = class { (resolve, reject) => { axios_default.request(localVarRequestOptions).then( (response) => { - handleSuccessfulResponse8( + handleSuccessfulResponse9( resolve, reject, response, @@ -27877,7 +28672,7 @@ var SignatureRequestApi = class { reject(error); return; } - if (handleErrorCodeResponse8( + if (handleErrorCodeResponse9( reject, error.response, 200, @@ -27885,7 +28680,7 @@ var SignatureRequestApi = class { )) { return; } - if (handleErrorRangeResponse7( + if (handleErrorRangeResponse8( reject, error.response, "4XX", @@ -27961,14 +28756,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 +28780,7 @@ var SignatureRequestApi = class { } signatureRequestCreateEmbedded(_0) { return __async(this, arguments, function* (signatureRequestCreateEmbeddedRequest, options = { headers: {} }) { - signatureRequestCreateEmbeddedRequest = deserializeIfNeeded7( + signatureRequestCreateEmbeddedRequest = deserializeIfNeeded8( signatureRequestCreateEmbeddedRequest, "SignatureRequestCreateEmbeddedRequest" ); @@ -28062,7 +28857,7 @@ var SignatureRequestApi = class { (resolve, reject) => { axios_default.request(localVarRequestOptions).then( (response) => { - handleSuccessfulResponse8( + handleSuccessfulResponse9( resolve, reject, response, @@ -28074,7 +28869,7 @@ var SignatureRequestApi = class { reject(error); return; } - if (handleErrorCodeResponse8( + if (handleErrorCodeResponse9( reject, error.response, 200, @@ -28082,7 +28877,7 @@ var SignatureRequestApi = class { )) { return; } - if (handleErrorRangeResponse7( + if (handleErrorRangeResponse8( reject, error.response, "4XX", @@ -28100,7 +28895,7 @@ var SignatureRequestApi = class { } signatureRequestCreateEmbeddedWithTemplate(_0) { return __async(this, arguments, function* (signatureRequestCreateEmbeddedWithTemplateRequest, options = { headers: {} }) { - signatureRequestCreateEmbeddedWithTemplateRequest = deserializeIfNeeded7( + signatureRequestCreateEmbeddedWithTemplateRequest = deserializeIfNeeded8( signatureRequestCreateEmbeddedWithTemplateRequest, "SignatureRequestCreateEmbeddedWithTemplateRequest" ); @@ -28177,7 +28972,7 @@ var SignatureRequestApi = class { (resolve, reject) => { axios_default.request(localVarRequestOptions).then( (response) => { - handleSuccessfulResponse8( + handleSuccessfulResponse9( resolve, reject, response, @@ -28189,7 +28984,7 @@ var SignatureRequestApi = class { reject(error); return; } - if (handleErrorCodeResponse8( + if (handleErrorCodeResponse9( reject, error.response, 200, @@ -28197,7 +28992,7 @@ var SignatureRequestApi = class { )) { return; } - if (handleErrorRangeResponse7( + if (handleErrorRangeResponse8( reject, error.response, "4XX", @@ -28279,7 +29074,7 @@ var SignatureRequestApi = class { return new Promise((resolve, reject) => { axios_default.request(localVarRequestOptions).then( (response) => { - handleSuccessfulResponse8( + handleSuccessfulResponse9( resolve, reject, response, @@ -28291,7 +29086,7 @@ var SignatureRequestApi = class { reject(error); return; } - if (handleErrorCodeResponse8( + if (handleErrorCodeResponse9( reject, error.response, 200, @@ -28299,7 +29094,7 @@ var SignatureRequestApi = class { )) { return; } - if (handleErrorRangeResponse7( + if (handleErrorRangeResponse8( reject, error.response, "4XX", @@ -28375,7 +29170,7 @@ var SignatureRequestApi = class { (resolve, reject) => { axios_default.request(localVarRequestOptions).then( (response) => { - handleSuccessfulResponse8( + handleSuccessfulResponse9( resolve, reject, response, @@ -28387,7 +29182,7 @@ var SignatureRequestApi = class { reject(error); return; } - if (handleErrorCodeResponse8( + if (handleErrorCodeResponse9( reject, error.response, 200, @@ -28395,7 +29190,7 @@ var SignatureRequestApi = class { )) { return; } - if (handleErrorRangeResponse7( + if (handleErrorRangeResponse8( reject, error.response, "4XX", @@ -28477,7 +29272,7 @@ var SignatureRequestApi = class { return new Promise((resolve, reject) => { axios_default.request(localVarRequestOptions).then( (response) => { - handleSuccessfulResponse8( + handleSuccessfulResponse9( resolve, reject, response, @@ -28489,7 +29284,7 @@ var SignatureRequestApi = class { reject(error); return; } - if (handleErrorCodeResponse8( + if (handleErrorCodeResponse9( reject, error.response, 200, @@ -28497,7 +29292,7 @@ var SignatureRequestApi = class { )) { return; } - if (handleErrorRangeResponse7( + if (handleErrorRangeResponse8( reject, error.response, "4XX", @@ -28573,7 +29368,7 @@ var SignatureRequestApi = class { (resolve, reject) => { axios_default.request(localVarRequestOptions).then( (response) => { - handleSuccessfulResponse8( + handleSuccessfulResponse9( resolve, reject, response, @@ -28585,7 +29380,7 @@ var SignatureRequestApi = class { reject(error); return; } - if (handleErrorCodeResponse8( + if (handleErrorCodeResponse9( reject, error.response, 200, @@ -28593,7 +29388,7 @@ var SignatureRequestApi = class { )) { return; } - if (handleErrorRangeResponse7( + if (handleErrorRangeResponse8( reject, error.response, "4XX", @@ -28686,7 +29481,7 @@ var SignatureRequestApi = class { (resolve, reject) => { axios_default.request(localVarRequestOptions).then( (response) => { - handleSuccessfulResponse8( + handleSuccessfulResponse9( resolve, reject, response, @@ -28698,7 +29493,7 @@ var SignatureRequestApi = class { reject(error); return; } - if (handleErrorCodeResponse8( + if (handleErrorCodeResponse9( reject, error.response, 200, @@ -28706,7 +29501,7 @@ var SignatureRequestApi = class { )) { return; } - if (handleErrorRangeResponse7( + if (handleErrorRangeResponse8( reject, error.response, "4XX", @@ -28783,7 +29578,7 @@ var SignatureRequestApi = class { (resolve, reject) => { axios_default.request(localVarRequestOptions).then( (response) => { - handleSuccessfulResponse8( + handleSuccessfulResponse9( resolve, reject, response, @@ -28795,7 +29590,7 @@ var SignatureRequestApi = class { reject(error); return; } - if (handleErrorCodeResponse8( + if (handleErrorCodeResponse9( reject, error.response, 200, @@ -28803,7 +29598,7 @@ var SignatureRequestApi = class { )) { return; } - if (handleErrorRangeResponse7( + if (handleErrorRangeResponse8( reject, error.response, "4XX", @@ -28821,7 +29616,7 @@ var SignatureRequestApi = class { } signatureRequestRemind(_0, _1) { return __async(this, arguments, function* (signatureRequestId, signatureRequestRemindRequest, options = { headers: {} }) { - signatureRequestRemindRequest = deserializeIfNeeded7( + signatureRequestRemindRequest = deserializeIfNeeded8( signatureRequestRemindRequest, "SignatureRequestRemindRequest" ); @@ -28906,7 +29701,7 @@ var SignatureRequestApi = class { (resolve, reject) => { axios_default.request(localVarRequestOptions).then( (response) => { - handleSuccessfulResponse8( + handleSuccessfulResponse9( resolve, reject, response, @@ -28918,7 +29713,7 @@ var SignatureRequestApi = class { reject(error); return; } - if (handleErrorCodeResponse8( + if (handleErrorCodeResponse9( reject, error.response, 200, @@ -28926,7 +29721,7 @@ var SignatureRequestApi = class { )) { return; } - if (handleErrorRangeResponse7( + if (handleErrorRangeResponse8( reject, error.response, "4XX", @@ -28997,14 +29792,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 +29816,7 @@ var SignatureRequestApi = class { } signatureRequestSend(_0) { return __async(this, arguments, function* (signatureRequestSendRequest, options = { headers: {} }) { - signatureRequestSendRequest = deserializeIfNeeded7( + signatureRequestSendRequest = deserializeIfNeeded8( signatureRequestSendRequest, "SignatureRequestSendRequest" ); @@ -29098,7 +29893,7 @@ var SignatureRequestApi = class { (resolve, reject) => { axios_default.request(localVarRequestOptions).then( (response) => { - handleSuccessfulResponse8( + handleSuccessfulResponse9( resolve, reject, response, @@ -29110,7 +29905,7 @@ var SignatureRequestApi = class { reject(error); return; } - if (handleErrorCodeResponse8( + if (handleErrorCodeResponse9( reject, error.response, 200, @@ -29118,7 +29913,7 @@ var SignatureRequestApi = class { )) { return; } - if (handleErrorRangeResponse7( + if (handleErrorRangeResponse8( reject, error.response, "4XX", @@ -29136,7 +29931,7 @@ var SignatureRequestApi = class { } signatureRequestSendWithTemplate(_0) { return __async(this, arguments, function* (signatureRequestSendWithTemplateRequest, options = { headers: {} }) { - signatureRequestSendWithTemplateRequest = deserializeIfNeeded7( + signatureRequestSendWithTemplateRequest = deserializeIfNeeded8( signatureRequestSendWithTemplateRequest, "SignatureRequestSendWithTemplateRequest" ); @@ -29213,7 +30008,7 @@ var SignatureRequestApi = class { (resolve, reject) => { axios_default.request(localVarRequestOptions).then( (response) => { - handleSuccessfulResponse8( + handleSuccessfulResponse9( resolve, reject, response, @@ -29225,7 +30020,7 @@ var SignatureRequestApi = class { reject(error); return; } - if (handleErrorCodeResponse8( + if (handleErrorCodeResponse9( reject, error.response, 200, @@ -29233,7 +30028,7 @@ var SignatureRequestApi = class { )) { return; } - if (handleErrorRangeResponse7( + if (handleErrorRangeResponse8( reject, error.response, "4XX", @@ -29251,7 +30046,7 @@ var SignatureRequestApi = class { } signatureRequestUpdate(_0, _1) { return __async(this, arguments, function* (signatureRequestId, signatureRequestUpdateRequest, options = { headers: {} }) { - signatureRequestUpdateRequest = deserializeIfNeeded7( + signatureRequestUpdateRequest = deserializeIfNeeded8( signatureRequestUpdateRequest, "SignatureRequestUpdateRequest" ); @@ -29336,7 +30131,7 @@ var SignatureRequestApi = class { (resolve, reject) => { axios_default.request(localVarRequestOptions).then( (response) => { - handleSuccessfulResponse8( + handleSuccessfulResponse9( resolve, reject, response, @@ -29348,7 +30143,7 @@ var SignatureRequestApi = class { reject(error); return; } - if (handleErrorCodeResponse8( + if (handleErrorCodeResponse9( reject, error.response, 200, @@ -29356,7 +30151,7 @@ var SignatureRequestApi = class { )) { return; } - if (handleErrorRangeResponse7( + if (handleErrorRangeResponse8( reject, error.response, "4XX", @@ -29373,13 +30168,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 +30185,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 +30193,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 +30205,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 +30256,7 @@ var TeamApi = class { } teamAddMember(_0, _1) { return __async(this, arguments, function* (teamAddMemberRequest, teamId, options = { headers: {} }) { - teamAddMemberRequest = deserializeIfNeeded8( + teamAddMemberRequest = deserializeIfNeeded9( teamAddMemberRequest, "TeamAddMemberRequest" ); @@ -29543,7 +30338,7 @@ var TeamApi = class { return new Promise((resolve, reject) => { axios_default.request(localVarRequestOptions).then( (response) => { - handleSuccessfulResponse9( + handleSuccessfulResponse10( resolve, reject, response, @@ -29555,7 +30350,7 @@ var TeamApi = class { reject(error); return; } - if (handleErrorCodeResponse9( + if (handleErrorCodeResponse10( reject, error.response, 200, @@ -29563,7 +30358,7 @@ var TeamApi = class { )) { return; } - if (handleErrorRangeResponse8( + if (handleErrorRangeResponse9( reject, error.response, "4XX", @@ -29580,7 +30375,7 @@ var TeamApi = class { } teamCreate(_0) { return __async(this, arguments, function* (teamCreateRequest, options = { headers: {} }) { - teamCreateRequest = deserializeIfNeeded8( + teamCreateRequest = deserializeIfNeeded9( teamCreateRequest, "TeamCreateRequest" ); @@ -29653,7 +30448,7 @@ var TeamApi = class { return new Promise((resolve, reject) => { axios_default.request(localVarRequestOptions).then( (response) => { - handleSuccessfulResponse9( + handleSuccessfulResponse10( resolve, reject, response, @@ -29665,7 +30460,7 @@ var TeamApi = class { reject(error); return; } - if (handleErrorCodeResponse9( + if (handleErrorCodeResponse10( reject, error.response, 200, @@ -29673,7 +30468,7 @@ var TeamApi = class { )) { return; } - if (handleErrorRangeResponse8( + if (handleErrorRangeResponse9( reject, error.response, "4XX", @@ -29740,14 +30535,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 +30609,7 @@ var TeamApi = class { return new Promise((resolve, reject) => { axios_default.request(localVarRequestOptions).then( (response) => { - handleSuccessfulResponse9( + handleSuccessfulResponse10( resolve, reject, response, @@ -29826,7 +30621,7 @@ var TeamApi = class { reject(error); return; } - if (handleErrorCodeResponse9( + if (handleErrorCodeResponse10( reject, error.response, 200, @@ -29834,7 +30629,7 @@ var TeamApi = class { )) { return; } - if (handleErrorRangeResponse8( + if (handleErrorRangeResponse9( reject, error.response, "4XX", @@ -29908,7 +30703,7 @@ var TeamApi = class { (resolve, reject) => { axios_default.request(localVarRequestOptions).then( (response) => { - handleSuccessfulResponse9( + handleSuccessfulResponse10( resolve, reject, response, @@ -29920,7 +30715,7 @@ var TeamApi = class { reject(error); return; } - if (handleErrorCodeResponse9( + if (handleErrorCodeResponse10( reject, error.response, 200, @@ -29928,7 +30723,7 @@ var TeamApi = class { )) { return; } - if (handleErrorRangeResponse8( + if (handleErrorRangeResponse9( reject, error.response, "4XX", @@ -30003,7 +30798,7 @@ var TeamApi = class { (resolve, reject) => { axios_default.request(localVarRequestOptions).then( (response) => { - handleSuccessfulResponse9( + handleSuccessfulResponse10( resolve, reject, response, @@ -30015,7 +30810,7 @@ var TeamApi = class { reject(error); return; } - if (handleErrorCodeResponse9( + if (handleErrorCodeResponse10( reject, error.response, 200, @@ -30023,7 +30818,7 @@ var TeamApi = class { )) { return; } - if (handleErrorRangeResponse8( + if (handleErrorRangeResponse9( reject, error.response, "4XX", @@ -30112,7 +30907,7 @@ var TeamApi = class { (resolve, reject) => { axios_default.request(localVarRequestOptions).then( (response) => { - handleSuccessfulResponse9( + handleSuccessfulResponse10( resolve, reject, response, @@ -30124,7 +30919,7 @@ var TeamApi = class { reject(error); return; } - if (handleErrorCodeResponse9( + if (handleErrorCodeResponse10( reject, error.response, 200, @@ -30132,7 +30927,7 @@ var TeamApi = class { )) { return; } - if (handleErrorRangeResponse8( + if (handleErrorRangeResponse9( reject, error.response, "4XX", @@ -30150,7 +30945,7 @@ var TeamApi = class { } teamRemoveMember(_0) { return __async(this, arguments, function* (teamRemoveMemberRequest, options = { headers: {} }) { - teamRemoveMemberRequest = deserializeIfNeeded8( + teamRemoveMemberRequest = deserializeIfNeeded9( teamRemoveMemberRequest, "TeamRemoveMemberRequest" ); @@ -30226,7 +31021,7 @@ var TeamApi = class { return new Promise((resolve, reject) => { axios_default.request(localVarRequestOptions).then( (response) => { - handleSuccessfulResponse9( + handleSuccessfulResponse10( resolve, reject, response, @@ -30238,7 +31033,7 @@ var TeamApi = class { reject(error); return; } - if (handleErrorCodeResponse9( + if (handleErrorCodeResponse10( reject, error.response, 201, @@ -30246,7 +31041,7 @@ var TeamApi = class { )) { return; } - if (handleErrorRangeResponse8( + if (handleErrorRangeResponse9( reject, error.response, "4XX", @@ -30334,7 +31129,7 @@ var TeamApi = class { (resolve, reject) => { axios_default.request(localVarRequestOptions).then( (response) => { - handleSuccessfulResponse9( + handleSuccessfulResponse10( resolve, reject, response, @@ -30346,7 +31141,7 @@ var TeamApi = class { reject(error); return; } - if (handleErrorCodeResponse9( + if (handleErrorCodeResponse10( reject, error.response, 200, @@ -30354,7 +31149,7 @@ var TeamApi = class { )) { return; } - if (handleErrorRangeResponse8( + if (handleErrorRangeResponse9( reject, error.response, "4XX", @@ -30372,7 +31167,7 @@ var TeamApi = class { } teamUpdate(_0) { return __async(this, arguments, function* (teamUpdateRequest, options = { headers: {} }) { - teamUpdateRequest = deserializeIfNeeded8( + teamUpdateRequest = deserializeIfNeeded9( teamUpdateRequest, "TeamUpdateRequest" ); @@ -30445,7 +31240,7 @@ var TeamApi = class { return new Promise((resolve, reject) => { axios_default.request(localVarRequestOptions).then( (response) => { - handleSuccessfulResponse9( + handleSuccessfulResponse10( resolve, reject, response, @@ -30457,7 +31252,7 @@ var TeamApi = class { reject(error); return; } - if (handleErrorCodeResponse9( + if (handleErrorCodeResponse10( reject, error.response, 200, @@ -30465,7 +31260,7 @@ var TeamApi = class { )) { return; } - if (handleErrorRangeResponse8( + if (handleErrorRangeResponse9( reject, error.response, "4XX", @@ -30481,13 +31276,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 +31293,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 +31301,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 +31313,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 +31364,7 @@ var TemplateApi = class { } templateAddUser(_0, _1) { return __async(this, arguments, function* (templateId, templateAddUserRequest, options = { headers: {} }) { - templateAddUserRequest = deserializeIfNeeded9( + templateAddUserRequest = deserializeIfNeeded10( templateAddUserRequest, "TemplateAddUserRequest" ); @@ -30654,7 +31449,7 @@ var TemplateApi = class { (resolve, reject) => { axios_default.request(localVarRequestOptions).then( (response) => { - handleSuccessfulResponse10( + handleSuccessfulResponse11( resolve, reject, response, @@ -30666,7 +31461,7 @@ var TemplateApi = class { reject(error); return; } - if (handleErrorCodeResponse10( + if (handleErrorCodeResponse11( reject, error.response, 200, @@ -30674,7 +31469,7 @@ var TemplateApi = class { )) { return; } - if (handleErrorRangeResponse9( + if (handleErrorRangeResponse10( reject, error.response, "4XX", @@ -30692,7 +31487,7 @@ var TemplateApi = class { } templateCreate(_0) { return __async(this, arguments, function* (templateCreateRequest, options = { headers: {} }) { - templateCreateRequest = deserializeIfNeeded9( + templateCreateRequest = deserializeIfNeeded10( templateCreateRequest, "TemplateCreateRequest" ); @@ -30769,7 +31564,7 @@ var TemplateApi = class { (resolve, reject) => { axios_default.request(localVarRequestOptions).then( (response) => { - handleSuccessfulResponse10( + handleSuccessfulResponse11( resolve, reject, response, @@ -30781,7 +31576,7 @@ var TemplateApi = class { reject(error); return; } - if (handleErrorCodeResponse10( + if (handleErrorCodeResponse11( reject, error.response, 200, @@ -30789,7 +31584,7 @@ var TemplateApi = class { )) { return; } - if (handleErrorRangeResponse9( + if (handleErrorRangeResponse10( reject, error.response, "4XX", @@ -30807,7 +31602,7 @@ var TemplateApi = class { } templateCreateEmbeddedDraft(_0) { return __async(this, arguments, function* (templateCreateEmbeddedDraftRequest, options = { headers: {} }) { - templateCreateEmbeddedDraftRequest = deserializeIfNeeded9( + templateCreateEmbeddedDraftRequest = deserializeIfNeeded10( templateCreateEmbeddedDraftRequest, "TemplateCreateEmbeddedDraftRequest" ); @@ -30884,7 +31679,7 @@ var TemplateApi = class { (resolve, reject) => { axios_default.request(localVarRequestOptions).then( (response) => { - handleSuccessfulResponse10( + handleSuccessfulResponse11( resolve, reject, response, @@ -30896,7 +31691,7 @@ var TemplateApi = class { reject(error); return; } - if (handleErrorCodeResponse10( + if (handleErrorCodeResponse11( reject, error.response, 200, @@ -30904,7 +31699,7 @@ var TemplateApi = class { )) { return; } - if (handleErrorRangeResponse9( + if (handleErrorRangeResponse10( reject, error.response, "4XX", @@ -30980,14 +31775,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 +31863,7 @@ var TemplateApi = class { return new Promise((resolve, reject) => { axios_default.request(localVarRequestOptions).then( (response) => { - handleSuccessfulResponse10( + handleSuccessfulResponse11( resolve, reject, response, @@ -31080,7 +31875,7 @@ var TemplateApi = class { reject(error); return; } - if (handleErrorCodeResponse10( + if (handleErrorCodeResponse11( reject, error.response, 200, @@ -31088,7 +31883,7 @@ var TemplateApi = class { )) { return; } - if (handleErrorRangeResponse9( + if (handleErrorRangeResponse10( reject, error.response, "4XX", @@ -31164,7 +31959,7 @@ var TemplateApi = class { (resolve, reject) => { axios_default.request(localVarRequestOptions).then( (response) => { - handleSuccessfulResponse10( + handleSuccessfulResponse11( resolve, reject, response, @@ -31176,7 +31971,7 @@ var TemplateApi = class { reject(error); return; } - if (handleErrorCodeResponse10( + if (handleErrorCodeResponse11( reject, error.response, 200, @@ -31184,7 +31979,7 @@ var TemplateApi = class { )) { return; } - if (handleErrorRangeResponse9( + if (handleErrorRangeResponse10( reject, error.response, "4XX", @@ -31266,7 +32061,7 @@ var TemplateApi = class { return new Promise((resolve, reject) => { axios_default.request(localVarRequestOptions).then( (response) => { - handleSuccessfulResponse10( + handleSuccessfulResponse11( resolve, reject, response, @@ -31278,7 +32073,7 @@ var TemplateApi = class { reject(error); return; } - if (handleErrorCodeResponse10( + if (handleErrorCodeResponse11( reject, error.response, 200, @@ -31286,7 +32081,7 @@ var TemplateApi = class { )) { return; } - if (handleErrorRangeResponse9( + if (handleErrorRangeResponse10( reject, error.response, "4XX", @@ -31362,7 +32157,7 @@ var TemplateApi = class { (resolve, reject) => { axios_default.request(localVarRequestOptions).then( (response) => { - handleSuccessfulResponse10( + handleSuccessfulResponse11( resolve, reject, response, @@ -31374,7 +32169,7 @@ var TemplateApi = class { reject(error); return; } - if (handleErrorCodeResponse10( + if (handleErrorCodeResponse11( reject, error.response, 200, @@ -31382,7 +32177,7 @@ var TemplateApi = class { )) { return; } - if (handleErrorRangeResponse9( + if (handleErrorRangeResponse10( reject, error.response, "4XX", @@ -31475,7 +32270,7 @@ var TemplateApi = class { (resolve, reject) => { axios_default.request(localVarRequestOptions).then( (response) => { - handleSuccessfulResponse10( + handleSuccessfulResponse11( resolve, reject, response, @@ -31487,7 +32282,7 @@ var TemplateApi = class { reject(error); return; } - if (handleErrorCodeResponse10( + if (handleErrorCodeResponse11( reject, error.response, 200, @@ -31495,7 +32290,7 @@ var TemplateApi = class { )) { return; } - if (handleErrorRangeResponse9( + if (handleErrorRangeResponse10( reject, error.response, "4XX", @@ -31513,7 +32308,7 @@ var TemplateApi = class { } templateRemoveUser(_0, _1) { return __async(this, arguments, function* (templateId, templateRemoveUserRequest, options = { headers: {} }) { - templateRemoveUserRequest = deserializeIfNeeded9( + templateRemoveUserRequest = deserializeIfNeeded10( templateRemoveUserRequest, "TemplateRemoveUserRequest" ); @@ -31598,7 +32393,7 @@ var TemplateApi = class { (resolve, reject) => { axios_default.request(localVarRequestOptions).then( (response) => { - handleSuccessfulResponse10( + handleSuccessfulResponse11( resolve, reject, response, @@ -31610,7 +32405,7 @@ var TemplateApi = class { reject(error); return; } - if (handleErrorCodeResponse10( + if (handleErrorCodeResponse11( reject, error.response, 200, @@ -31618,7 +32413,7 @@ var TemplateApi = class { )) { return; } - if (handleErrorRangeResponse9( + if (handleErrorRangeResponse10( reject, error.response, "4XX", @@ -31636,7 +32431,7 @@ var TemplateApi = class { } templateUpdateFiles(_0, _1) { return __async(this, arguments, function* (templateId, templateUpdateFilesRequest, options = { headers: {} }) { - templateUpdateFilesRequest = deserializeIfNeeded9( + templateUpdateFilesRequest = deserializeIfNeeded10( templateUpdateFilesRequest, "TemplateUpdateFilesRequest" ); @@ -31721,7 +32516,7 @@ var TemplateApi = class { (resolve, reject) => { axios_default.request(localVarRequestOptions).then( (response) => { - handleSuccessfulResponse10( + handleSuccessfulResponse11( resolve, reject, response, @@ -31733,7 +32528,7 @@ var TemplateApi = class { reject(error); return; } - if (handleErrorCodeResponse10( + if (handleErrorCodeResponse11( reject, error.response, 200, @@ -31741,7 +32536,7 @@ var TemplateApi = class { )) { return; } - if (handleErrorRangeResponse9( + if (handleErrorRangeResponse10( reject, error.response, "4XX", @@ -31758,13 +32553,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 +32570,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 +32578,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 +32590,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 +32641,7 @@ var UnclaimedDraftApi = class { } unclaimedDraftCreate(_0) { return __async(this, arguments, function* (unclaimedDraftCreateRequest, options = { headers: {} }) { - unclaimedDraftCreateRequest = deserializeIfNeeded10( + unclaimedDraftCreateRequest = deserializeIfNeeded11( unclaimedDraftCreateRequest, "UnclaimedDraftCreateRequest" ); @@ -31923,7 +32718,7 @@ var UnclaimedDraftApi = class { (resolve, reject) => { axios_default.request(localVarRequestOptions).then( (response) => { - handleSuccessfulResponse11( + handleSuccessfulResponse12( resolve, reject, response, @@ -31935,7 +32730,7 @@ var UnclaimedDraftApi = class { reject(error); return; } - if (handleErrorCodeResponse11( + if (handleErrorCodeResponse12( reject, error.response, 200, @@ -31943,7 +32738,7 @@ var UnclaimedDraftApi = class { )) { return; } - if (handleErrorRangeResponse10( + if (handleErrorRangeResponse11( reject, error.response, "4XX", @@ -31961,7 +32756,7 @@ var UnclaimedDraftApi = class { } unclaimedDraftCreateEmbedded(_0) { return __async(this, arguments, function* (unclaimedDraftCreateEmbeddedRequest, options = { headers: {} }) { - unclaimedDraftCreateEmbeddedRequest = deserializeIfNeeded10( + unclaimedDraftCreateEmbeddedRequest = deserializeIfNeeded11( unclaimedDraftCreateEmbeddedRequest, "UnclaimedDraftCreateEmbeddedRequest" ); @@ -32038,7 +32833,7 @@ var UnclaimedDraftApi = class { (resolve, reject) => { axios_default.request(localVarRequestOptions).then( (response) => { - handleSuccessfulResponse11( + handleSuccessfulResponse12( resolve, reject, response, @@ -32050,7 +32845,7 @@ var UnclaimedDraftApi = class { reject(error); return; } - if (handleErrorCodeResponse11( + if (handleErrorCodeResponse12( reject, error.response, 200, @@ -32058,7 +32853,7 @@ var UnclaimedDraftApi = class { )) { return; } - if (handleErrorRangeResponse10( + if (handleErrorRangeResponse11( reject, error.response, "4XX", @@ -32076,7 +32871,7 @@ var UnclaimedDraftApi = class { } unclaimedDraftCreateEmbeddedWithTemplate(_0) { return __async(this, arguments, function* (unclaimedDraftCreateEmbeddedWithTemplateRequest, options = { headers: {} }) { - unclaimedDraftCreateEmbeddedWithTemplateRequest = deserializeIfNeeded10( + unclaimedDraftCreateEmbeddedWithTemplateRequest = deserializeIfNeeded11( unclaimedDraftCreateEmbeddedWithTemplateRequest, "UnclaimedDraftCreateEmbeddedWithTemplateRequest" ); @@ -32153,7 +32948,7 @@ var UnclaimedDraftApi = class { (resolve, reject) => { axios_default.request(localVarRequestOptions).then( (response) => { - handleSuccessfulResponse11( + handleSuccessfulResponse12( resolve, reject, response, @@ -32165,7 +32960,7 @@ var UnclaimedDraftApi = class { reject(error); return; } - if (handleErrorCodeResponse11( + if (handleErrorCodeResponse12( reject, error.response, 200, @@ -32173,7 +32968,7 @@ var UnclaimedDraftApi = class { )) { return; } - if (handleErrorRangeResponse10( + if (handleErrorRangeResponse11( reject, error.response, "4XX", @@ -32191,7 +32986,7 @@ var UnclaimedDraftApi = class { } unclaimedDraftEditAndResend(_0, _1) { return __async(this, arguments, function* (signatureRequestId, unclaimedDraftEditAndResendRequest, options = { headers: {} }) { - unclaimedDraftEditAndResendRequest = deserializeIfNeeded10( + unclaimedDraftEditAndResendRequest = deserializeIfNeeded11( unclaimedDraftEditAndResendRequest, "UnclaimedDraftEditAndResendRequest" ); @@ -32276,7 +33071,7 @@ var UnclaimedDraftApi = class { (resolve, reject) => { axios_default.request(localVarRequestOptions).then( (response) => { - handleSuccessfulResponse11( + handleSuccessfulResponse12( resolve, reject, response, @@ -32288,7 +33083,7 @@ var UnclaimedDraftApi = class { reject(error); return; } - if (handleErrorCodeResponse11( + if (handleErrorCodeResponse12( reject, error.response, 200, @@ -32296,7 +33091,7 @@ var UnclaimedDraftApi = class { )) { return; } - if (handleErrorRangeResponse10( + if (handleErrorRangeResponse11( reject, error.response, "4XX", @@ -32313,13 +33108,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 +33125,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 +33133,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 +33223,7 @@ var APIS = [ ApiAppApi, BulkSendJobApi, EmbeddedApi, + FaxApi, FaxLineApi, OAuthApi, ReportApi, @@ -32479,6 +33275,7 @@ var APIS = [ EventCallbackRequest, EventCallbackRequestEvent, EventCallbackRequestEventMetadata, + FaxApi, FaxLineAddUserRequest, FaxLineApi, FaxLineAreaCodeGetCountryEnum, @@ -32491,6 +33288,11 @@ var APIS = [ FaxLineRemoveUserRequest, FaxLineResponse, FaxLineResponseFaxLine, + FaxListResponse, + FaxResponse, + FaxResponseFax, + FaxResponseFaxTransmission, + FaxSendRequest, FileResponse, FileResponseDataUri, HttpBasicAuth, @@ -32543,6 +33345,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..6fb7355c1 --- /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): Buffer +``` + +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 + +**Buffer** + +### Authorization + +[api_key](../../README.md#api_key) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/pdf`, `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..bab270da1 --- /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` | [```Array```](WarningResponse.md) | A list of warnings. | | + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/sdks/node/docs/model/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..5c8ec7778 --- /dev/null +++ b/sdks/node/model/faxResponse.ts @@ -0,0 +1,59 @@ +/** + * The MIT License (MIT) + * + * Copyright (C) 2023 dropbox.com + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +import { AttributeTypeMap, ObjectSerializer } from "./"; +import { FaxResponseFax } from "./faxResponseFax"; +import { WarningResponse } from "./warningResponse"; + +export class FaxResponse { + "fax": FaxResponseFax; + /** + * A list of warnings. + */ + "warnings"?: Array; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: AttributeTypeMap = [ + { + name: "fax", + baseName: "fax", + type: "FaxResponseFax", + }, + { + name: "warnings", + baseName: "warnings", + type: "Array", + }, + ]; + + 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..6ed6ee189 --- /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..495b09679 --- /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"?: Array; + 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..564802cd9 --- /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): \SplFileObject +``` +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 + +**\SplFileObject** + +### Authorization + +[api_key](../../README.md#api_key) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/pdf`, `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..d3d209603 --- /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) | A list of warnings. | | + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/sdks/php/docs/Model/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..bcd4ad6a4 --- /dev/null +++ b/sdks/php/src/Api/FaxApi.php @@ -0,0 +1,1814 @@ + [ + '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) + * + * @return SplFileObject + * @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) + { + list($response) = $this->getFaxFilesWithHttpInfo($fax_id); + return $response; + } + + /** + * 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 \SplFileObject|\Dropbox\Sign\Model\ErrorResponse, 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() + ); + } + + $result = $this->handleRangeCodeResponse( + $response, + '4XX', + '\Dropbox\Sign\Model\ErrorResponse' + ); + if ($result) { + return $result; + } + + switch ($statusCode) { + case 200: + if ('\SplFileObject' === '\SplFileObject') { + $content = $response->getBody(); // stream goes to serializer + } else { + $content = (string)$response->getBody(); + if ('\SplFileObject' !== '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, '\SplFileObject', []), + $response->getStatusCode(), + $response->getHeaders(), + ]; + } + + $returnType = '\SplFileObject'; + 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(), + '\SplFileObject', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + 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 = '\SplFileObject'; + $request = $this->getFaxFilesRequest($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 '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/pdf', '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..a74e6e363 --- /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 a list of warnings + * + * @return self + */ + public function setWarnings(?array $warnings) + { + if (is_null($warnings)) { + throw new InvalidArgumentException('non-nullable warnings cannot be null'); + } + $this->container['warnings'] = $warnings; + + return $this; + } + + /** + * Returns true if offset exists. False otherwise. + * + * @param int $offset Offset + */ + #[ReturnTypeWillChange] + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param int $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + */ + #[ReturnTypeWillChange] + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param int $offset Offset + */ + #[ReturnTypeWillChange] + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @see https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource + */ + #[ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_UNESCAPED_SLASHES + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} diff --git a/sdks/php/src/Model/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..c241ea626 --- /dev/null +++ b/sdks/python/docs/FaxApi.md @@ -0,0 +1,327 @@ +# ```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``` +> ```io.IOBase 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 + +**io.IOBase** + +### Authorization + +[api_key](../README.md#api_key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/pdf, 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) + +# ```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..c7427201d --- /dev/null +++ b/sdks/python/docs/FaxResponse.md @@ -0,0 +1,12 @@ +# FaxResponse + + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +| `fax`*_required_ | [```FaxResponseFax```](FaxResponseFax.md) | | | +| `warnings` | [```List[WarningResponse]```](WarningResponse.md) | A list of warnings. | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/sdks/python/docs/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..fbc5cb023 --- /dev/null +++ b/sdks/python/dropbox_sign/api/fax_api.py @@ -0,0 +1,1315 @@ +# 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, StrictBytes, StrictStr +from typing import Union +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, + ) -> io.IOBase: + """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]] = { + "200": "io.IOBase", + "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[io.IOBase]: + """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]] = { + "200": "io.IOBase", + "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]] = { + "200": "io.IOBase", + "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/pdf", "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..cc3870ddc --- /dev/null +++ b/sdks/python/dropbox_sign/models/fax_response.py @@ -0,0 +1,151 @@ +# coding: utf-8 + +""" + Dropbox Sign API + + Dropbox Sign v3 API + + The version of the OpenAPI document: 3.0.0 + Contact: apisupport@hellosign.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field +from typing import Any, ClassVar, Dict, List, Optional +from dropbox_sign.models.fax_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[List[WarningResponse]] = Field( + default=None, description="A list of warnings." + ) + __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 each item in warnings (list) + _items = [] + if self.warnings: + for _item_warnings in self.warnings: + if _item_warnings: + _items.append(_item_warnings.to_dict()) + _dict["warnings"] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of 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(_item) for _item in obj["warnings"]] + if obj.get("warnings") is not None + else None + ), + } + ) + return _obj + + @classmethod + def init(cls, data: Any) -> Self: + """ + Attempt to instantiate and hydrate a new instance of this class + """ + if isinstance(data, str): + data = json.loads(data) + + return cls.from_dict(data) + + @classmethod + def openapi_types(cls) -> Dict[str, str]: + return { + "fax": "(FaxResponseFax,)", + "warnings": "(List[WarningResponse],)", + } + + @classmethod + def openapi_type_is_array(cls, property_name: str) -> bool: + return property_name in [ + "warnings", + ] diff --git a/sdks/python/dropbox_sign/models/fax_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..40d5ea6f2 --- /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` + +> `File 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, 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 # => File +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 + +**File** + +### Authorization + +[api_key](../README.md#api_key) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/pdf, 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..08055442d --- /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` | [```Array```](WarningResponse.md) | A list of warnings. | | + 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..a7a8e4f76 --- /dev/null +++ b/sdks/ruby/lib/dropbox-sign/api/fax_api.rb @@ -0,0 +1,503 @@ +=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 [File] + def get_fax_files(fax_id, opts = {}) + data, _status_code, _headers = get_fax_files_with_http_info(fax_id, opts) + data + end + + # List Fax Files + # Returns list of fax files + # @param fax_id [String] Fax ID + # @param [Hash] opts the optional parameters + # @return [Array<(File, Integer, Hash)>] File data, 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/pdf', '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] || 'File' + + # 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 + if e.code === 200 + body = @api_client.convert_to_type( + JSON.parse("[#{e.response_body}]", :symbolize_names => true)[0], + "Dropbox::Sign::File" + ) + + 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_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..3668befc3 --- /dev/null +++ b/sdks/ruby/lib/dropbox-sign/models/fax_response.rb @@ -0,0 +1,263 @@ +=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 + + # A list of warnings. + # @return [Array] + 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' => :'Array' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Returns attribute map of this model + parent + def self.merged_attributes + self.attribute_map + end + + # Attribute type mapping of this model + parent + def self.merged_types + self.openapi_types + end + + # Returns list of attributes with nullable: true of this model + parent + def self.merged_nullable + self.openapi_nullable + end + + # Attempt to instantiate and hydrate a new instance of this class + # @param [Object] data Data to be converted + # @return [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') + if (value = attributes[:'warnings']).is_a?(Array) + self.warnings = value + end + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + if @fax.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" From 409b946e416ea123e0c95e48fdf856985cf9f8ff Mon Sep 17 00:00:00 2001 From: Maksud Aghayev Date: Wed, 2 Oct 2024 15:25:07 -0700 Subject: [PATCH 02/11] SDKS generated --- ...xample.json => FaxGetResponseExample.json} | 0 sdks/dotnet/README.md | 15 +- sdks/dotnet/docs/FaxApi.md | 114 +-- .../docs/{SubFile.md => FaxGetResponse.md} | 5 +- sdks/dotnet/docs/FaxListResponse.md | 2 +- sdks/dotnet/docs/FaxResponse.md | 2 +- sdks/dotnet/docs/FaxResponseFax.md | 10 - ...smission.md => FaxResponseTransmission.md} | 2 +- sdks/dotnet/docs/FaxSendRequest.md | 2 +- sdks/dotnet/src/Dropbox.Sign/Api/FaxApi.cs | 320 ++++---- .../src/Dropbox.Sign/Model/FaxGetResponse.cs | 197 +++++ .../src/Dropbox.Sign/Model/FaxListResponse.cs | 6 +- .../src/Dropbox.Sign/Model/FaxResponse.cs | 276 ++++++- .../Model/FaxResponseTransmission.cs | 240 ++++++ .../src/Dropbox.Sign/Model/FaxSendRequest.cs | 99 +-- sdks/java-v1/README.md | 15 +- sdks/java-v1/docs/FaxApi.md | 72 +- sdks/java-v1/docs/FaxGetResponse.md | 15 + sdks/java-v1/docs/FaxListResponse.md | 2 +- sdks/java-v1/docs/FaxResponse.md | 12 +- sdks/java-v1/docs/FaxResponseFax.md | 23 - ...smission.md => FaxResponseTransmission.md} | 2 +- sdks/java-v1/docs/FaxSendRequest.md | 7 +- sdks/java-v1/docs/SubFile.md | 14 - .../java/com/dropbox/sign/api/FaxApi.java | 147 ++-- .../dropbox/sign/model/FaxGetResponse.java | 221 ++++++ .../dropbox/sign/model/FaxListResponse.java | 10 +- .../com/dropbox/sign/model/FaxResponse.java | 506 ++++++++++-- .../dropbox/sign/model/FaxResponseFax.java | 609 --------------- ...sion.java => FaxResponseTransmission.java} | 45 +- .../dropbox/sign/model/FaxSendRequest.java | 187 ++--- .../java/com/dropbox/sign/model/SubFile.java | 165 ---- sdks/java-v2/README.md | 15 +- sdks/java-v2/docs/FaxApi.md | 72 +- sdks/java-v2/docs/FaxGetResponse.md | 15 + sdks/java-v2/docs/FaxListResponse.md | 2 +- sdks/java-v2/docs/FaxResponse.md | 12 +- sdks/java-v2/docs/FaxResponseFax.md | 23 - ...smission.md => FaxResponseTransmission.md} | 2 +- sdks/java-v2/docs/FaxSendRequest.md | 7 +- sdks/java-v2/docs/SubFile.md | 14 - .../java/com/dropbox/sign/api/FaxApi.java | 151 ++-- .../dropbox/sign/model/FaxGetResponse.java | 240 ++++++ .../dropbox/sign/model/FaxListResponse.java | 12 +- .../com/dropbox/sign/model/FaxResponse.java | 523 +++++++++++-- .../dropbox/sign/model/FaxResponseFax.java | 639 ---------------- ...sion.java => FaxResponseTransmission.java} | 44 +- .../dropbox/sign/model/FaxSendRequest.java | 186 ++--- .../java/com/dropbox/sign/model/SubFile.java | 178 ----- sdks/node/README.md | 15 +- sdks/node/api/faxApi.ts | 88 +-- sdks/node/dist/api.js | 173 ++--- sdks/node/docs/api/FaxApi.md | 75 +- .../docs/model/FaxGetResponse.md} | 7 +- sdks/node/docs/model/FaxListResponse.md | 2 +- sdks/node/docs/model/FaxResponse.md | 12 +- sdks/node/docs/model/FaxResponseFax.md | 20 - ...smission.md => FaxResponseTransmission.md} | 2 +- sdks/node/docs/model/FaxSendRequest.md | 9 +- .../model/{subFile.ts => faxGetResponse.ts} | 29 +- sdks/node/model/faxListResponse.ts | 6 +- sdks/node/model/faxResponse.ts | 96 ++- sdks/node/model/faxResponseFax.ts | 133 ---- ...smission.ts => faxResponseTransmission.ts} | 8 +- sdks/node/model/faxSendRequest.ts | 40 +- sdks/node/model/index.ts | 15 +- sdks/node/types/api/faxApi.d.ts | 12 +- sdks/node/types/model/faxGetResponse.d.ts | 11 + sdks/node/types/model/faxListResponse.d.ts | 4 +- sdks/node/types/model/faxResponse.d.ts | 15 +- sdks/node/types/model/faxResponseFax.d.ts | 18 - ...sion.d.ts => faxResponseTransmission.d.ts} | 4 +- sdks/node/types/model/faxSendRequest.d.ts | 20 +- sdks/node/types/model/index.d.ts | 7 +- sdks/node/types/model/subFile.d.ts | 8 - sdks/php/README.md | 15 +- sdks/php/docs/Api/FaxApi.md | 60 +- .../docs/Model/FaxGetResponse.md} | 7 +- sdks/php/docs/Model/FaxListResponse.md | 2 +- sdks/php/docs/Model/FaxResponse.md | 12 +- sdks/php/docs/Model/FaxResponseFax.md | 20 - ...smission.md => FaxResponseTransmission.md} | 2 +- sdks/php/docs/Model/FaxSendRequest.md | 9 +- sdks/php/src/Api/FaxApi.php | 359 +++++---- .../Model/{SubFile.php => FaxGetResponse.php} | 92 ++- sdks/php/src/Model/FaxListResponse.php | 6 +- sdks/php/src/Model/FaxResponse.php | 347 ++++++++- sdks/php/src/Model/FaxResponseFax.php | 717 ------------------ ...ission.php => FaxResponseTransmission.php} | 16 +- sdks/php/src/Model/FaxSendRequest.php | 171 ++--- sdks/python/README.md | 15 +- sdks/python/docs/FaxApi.md | 70 +- .../docs/{SubFile.md => FaxGetResponse.md} | 7 +- sdks/python/docs/FaxListResponse.md | 2 +- sdks/python/docs/FaxResponse.md | 12 +- sdks/python/docs/FaxResponseFax.md | 20 - ...smission.md => FaxResponseTransmission.md} | 2 +- sdks/python/docs/FaxSendRequest.md | 9 +- sdks/python/dropbox_sign/__init__.py | 5 +- sdks/python/dropbox_sign/api/fax_api.py | 186 ++--- sdks/python/dropbox_sign/models/__init__.py | 5 +- .../dropbox_sign/models/fax_get_response.py | 151 ++++ .../dropbox_sign/models/fax_list_response.py | 8 +- .../dropbox_sign/models/fax_response.py | 90 ++- .../models/fax_response_transmission.py | 146 ++++ .../dropbox_sign/models/fax_send_request.py | 51 +- sdks/ruby/README.md | 15 +- sdks/ruby/docs/FaxApi.md | 112 +-- sdks/ruby/docs/FaxGetResponse.md | 11 + sdks/ruby/docs/FaxListResponse.md | 2 +- sdks/ruby/docs/FaxResponse.md | 12 +- sdks/ruby/docs/FaxResponseFax.md | 19 - ...smission.md => FaxResponseTransmission.md} | 2 +- sdks/ruby/docs/FaxSendRequest.md | 9 +- sdks/ruby/docs/SubFile.md | 10 - sdks/ruby/lib/dropbox-sign.rb | 5 +- sdks/ruby/lib/dropbox-sign/api/fax_api.rb | 150 ++-- .../{sub_file.rb => fax_get_response.rb} | 50 +- .../dropbox-sign/models/fax_list_response.rb | 4 +- .../lib/dropbox-sign/models/fax_response.rb | 128 +++- .../dropbox-sign/models/fax_response_fax.rb | 347 --------- ...ission.rb => fax_response_transmission.rb} | 12 +- .../dropbox-sign/models/fax_send_request.rb | 67 +- 123 files changed, 4733 insertions(+), 5142 deletions(-) rename examples/json/{FaxResponseExample.json => FaxGetResponseExample.json} (100%) rename sdks/dotnet/docs/{SubFile.md => FaxGetResponse.md} (57%) delete mode 100644 sdks/dotnet/docs/FaxResponseFax.md rename sdks/dotnet/docs/{FaxResponseFaxTransmission.md => FaxResponseTransmission.md} (92%) create mode 100644 sdks/dotnet/src/Dropbox.Sign/Model/FaxGetResponse.cs create mode 100644 sdks/dotnet/src/Dropbox.Sign/Model/FaxResponseTransmission.cs create mode 100644 sdks/java-v1/docs/FaxGetResponse.md delete mode 100644 sdks/java-v1/docs/FaxResponseFax.md rename sdks/java-v1/docs/{FaxResponseFaxTransmission.md => FaxResponseTransmission.md} (92%) delete mode 100644 sdks/java-v1/docs/SubFile.md create mode 100644 sdks/java-v1/src/main/java/com/dropbox/sign/model/FaxGetResponse.java delete mode 100644 sdks/java-v1/src/main/java/com/dropbox/sign/model/FaxResponseFax.java rename sdks/java-v1/src/main/java/com/dropbox/sign/model/{FaxResponseFaxTransmission.java => FaxResponseTransmission.java} (87%) delete mode 100644 sdks/java-v1/src/main/java/com/dropbox/sign/model/SubFile.java create mode 100644 sdks/java-v2/docs/FaxGetResponse.md delete mode 100644 sdks/java-v2/docs/FaxResponseFax.md rename sdks/java-v2/docs/{FaxResponseFaxTransmission.md => FaxResponseTransmission.md} (92%) delete mode 100644 sdks/java-v2/docs/SubFile.md create mode 100644 sdks/java-v2/src/main/java/com/dropbox/sign/model/FaxGetResponse.java delete mode 100644 sdks/java-v2/src/main/java/com/dropbox/sign/model/FaxResponseFax.java rename sdks/java-v2/src/main/java/com/dropbox/sign/model/{FaxResponseFaxTransmission.java => FaxResponseTransmission.java} (86%) delete mode 100644 sdks/java-v2/src/main/java/com/dropbox/sign/model/SubFile.java rename sdks/{php/docs/Model/SubFile.md => node/docs/model/FaxGetResponse.md} (55%) delete mode 100644 sdks/node/docs/model/FaxResponseFax.md rename sdks/node/docs/model/{FaxResponseFaxTransmission.md => FaxResponseTransmission.md} (94%) rename sdks/node/model/{subFile.ts => faxGetResponse.ts} (73%) delete mode 100644 sdks/node/model/faxResponseFax.ts rename sdks/node/model/{faxResponseFaxTransmission.ts => faxResponseTransmission.ts} (90%) create mode 100644 sdks/node/types/model/faxGetResponse.d.ts delete mode 100644 sdks/node/types/model/faxResponseFax.d.ts rename sdks/node/types/model/{faxResponseFaxTransmission.d.ts => faxResponseTransmission.d.ts} (72%) delete mode 100644 sdks/node/types/model/subFile.d.ts rename sdks/{node/docs/model/SubFile.md => php/docs/Model/FaxGetResponse.md} (51%) delete mode 100644 sdks/php/docs/Model/FaxResponseFax.md rename sdks/php/docs/Model/{FaxResponseFaxTransmission.md => FaxResponseTransmission.md} (94%) rename sdks/php/src/Model/{SubFile.php => FaxGetResponse.php} (80%) delete mode 100644 sdks/php/src/Model/FaxResponseFax.php rename sdks/php/src/Model/{FaxResponseFaxTransmission.php => FaxResponseTransmission.php} (96%) rename sdks/python/docs/{SubFile.md => FaxGetResponse.md} (59%) delete mode 100644 sdks/python/docs/FaxResponseFax.md rename sdks/python/docs/{FaxResponseFaxTransmission.md => FaxResponseTransmission.md} (94%) create mode 100644 sdks/python/dropbox_sign/models/fax_get_response.py create mode 100644 sdks/python/dropbox_sign/models/fax_response_transmission.py create mode 100644 sdks/ruby/docs/FaxGetResponse.md delete mode 100644 sdks/ruby/docs/FaxResponseFax.md rename sdks/ruby/docs/{FaxResponseFaxTransmission.md => FaxResponseTransmission.md} (89%) delete mode 100644 sdks/ruby/docs/SubFile.md rename sdks/ruby/lib/dropbox-sign/models/{sub_file.rb => fax_get_response.rb} (86%) delete mode 100644 sdks/ruby/lib/dropbox-sign/models/fax_response_fax.rb rename sdks/ruby/lib/dropbox-sign/models/{fax_response_fax_transmission.rb => fax_response_transmission.rb} (95%) diff --git a/examples/json/FaxResponseExample.json b/examples/json/FaxGetResponseExample.json similarity index 100% rename from examples/json/FaxResponseExample.json rename to examples/json/FaxGetResponseExample.json diff --git a/sdks/dotnet/README.md b/sdks/dotnet/README.md index de7d6e09c..a7c0c0edb 100644 --- a/sdks/dotnet/README.md +++ b/sdks/dotnet/README.md @@ -141,11 +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 +*FaxApi* | [**FaxDelete**](docs/FaxApi.md#faxdelete) | **DELETE** /fax/{fax_id} | Delete Fax +*FaxApi* | [**FaxFiles**](docs/FaxApi.md#faxfiles) | **GET** /fax/files/{fax_id} | List Fax Files +*FaxApi* | [**FaxGet**](docs/FaxApi.md#faxget) | **GET** /fax/{fax_id} | Get Fax +*FaxApi* | [**FaxList**](docs/FaxApi.md#faxlist) | **GET** /fax/list | Lists Faxes +*FaxApi* | [**FaxSend**](docs/FaxApi.md#faxsend) | **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 @@ -236,6 +236,7 @@ Class | Method | HTTP request | Description - [Model.EventCallbackRequest](docs/EventCallbackRequest.md) - [Model.EventCallbackRequestEvent](docs/EventCallbackRequestEvent.md) - [Model.EventCallbackRequestEventMetadata](docs/EventCallbackRequestEventMetadata.md) + - [Model.FaxGetResponse](docs/FaxGetResponse.md) - [Model.FaxLineAddUserRequest](docs/FaxLineAddUserRequest.md) - [Model.FaxLineAreaCodeGetCountryEnum](docs/FaxLineAreaCodeGetCountryEnum.md) - [Model.FaxLineAreaCodeGetProvinceEnum](docs/FaxLineAreaCodeGetProvinceEnum.md) @@ -249,8 +250,7 @@ Class | Method | HTTP request | Description - [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.FaxResponseTransmission](docs/FaxResponseTransmission.md) - [Model.FaxSendRequest](docs/FaxSendRequest.md) - [Model.FileResponse](docs/FileResponse.md) - [Model.FileResponseDataUri](docs/FileResponseDataUri.md) @@ -296,7 +296,6 @@ 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 index 52d2ddbcf..96412aeec 100644 --- a/sdks/dotnet/docs/FaxApi.md +++ b/sdks/dotnet/docs/FaxApi.md @@ -4,15 +4,15 @@ 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 | +| [**FaxDelete**](FaxApi.md#faxdelete) | **DELETE** /fax/{fax_id} | Delete Fax | +| [**FaxFiles**](FaxApi.md#faxfiles) | **GET** /fax/files/{fax_id} | List Fax Files | +| [**FaxGet**](FaxApi.md#faxget) | **GET** /fax/{fax_id} | Get Fax | +| [**FaxList**](FaxApi.md#faxlist) | **GET** /fax/list | Lists Faxes | +| [**FaxSend**](FaxApi.md#faxsend) | **POST** /fax/send | Send Fax | - -# **DeleteFax** -> void DeleteFax (string faxId) + +# **FaxDelete** +> void FaxDelete (string faxId) Delete Fax @@ -51,18 +51,18 @@ public class Example ``` -#### Using the DeleteFaxWithHttpInfo variant +#### Using the FaxDeleteWithHttpInfo variant This returns an ApiResponse object which contains the response data, status code and headers. ```csharp try { // Delete Fax - apiInstance.DeleteFaxWithHttpInfo(faxId); + apiInstance.FaxDeleteWithHttpInfo(faxId); } catch (ApiException e) { - Debug.Print("Exception when calling FaxApi.DeleteFaxWithHttpInfo: " + e.Message); + Debug.Print("Exception when calling FaxApi.FaxDeleteWithHttpInfo: " + e.Message); Debug.Print("Status Code: " + e.ErrorCode); Debug.Print(e.StackTrace); } @@ -91,23 +91,24 @@ void (empty response body) ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -| **200** | successful operation | * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
| +| **204** | 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) + +# **FaxFiles** +> System.IO.Stream FaxFiles (string faxId) -Get Fax +List Fax Files -Returns information about fax +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; @@ -117,7 +118,6 @@ 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); @@ -126,8 +126,7 @@ public class Example try { - var result = faxApi.GetFaxById(faxId); - Console.WriteLine(result); + faxApi.GetFaxFiles(faxId); } catch (ApiException e) { @@ -140,21 +139,21 @@ public class Example ``` -#### Using the GetFaxByIdWithHttpInfo variant +#### Using the FaxFilesWithHttpInfo variant This returns an ApiResponse object which contains the response data, status code and headers. ```csharp try { - // Get Fax - ApiResponse response = apiInstance.GetFaxByIdWithHttpInfo(faxId); + // List Fax Files + ApiResponse response = apiInstance.FaxFilesWithHttpInfo(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("Exception when calling FaxApi.FaxFilesWithHttpInfo: " + e.Message); Debug.Print("Status Code: " + e.ErrorCode); Debug.Print(e.StackTrace); } @@ -168,7 +167,7 @@ catch (ApiException e) ### Return type -[**FaxResponse**](FaxResponse.md) +**System.IO.Stream** ### Authorization @@ -177,7 +176,7 @@ catch (ApiException e) ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json + - **Accept**: application/pdf, application/json ### HTTP response details @@ -188,19 +187,18 @@ catch (ApiException e) [[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** -> System.IO.Stream GetFaxFiles (string faxId) + +# **FaxGet** +> FaxGetResponse FaxGet (string faxId) -List Fax Files +Get Fax -Returns list of fax files +Returns information about fax ### Example ```csharp using System; -using System.Collections.Generic; -using System.IO; + using Dropbox.Sign.Api; using Dropbox.Sign.Client; using Dropbox.Sign.Model; @@ -210,6 +208,7 @@ 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); @@ -218,7 +217,8 @@ public class Example try { - faxApi.GetFaxFiles(faxId); + var result = faxApi.GetFaxById(faxId); + Console.WriteLine(result); } catch (ApiException e) { @@ -231,21 +231,21 @@ public class Example ``` -#### Using the GetFaxFilesWithHttpInfo variant +#### Using the FaxGetWithHttpInfo variant This returns an ApiResponse object which contains the response data, status code and headers. ```csharp try { - // List Fax Files - ApiResponse response = apiInstance.GetFaxFilesWithHttpInfo(faxId); + // Get Fax + ApiResponse response = apiInstance.FaxGetWithHttpInfo(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.GetFaxFilesWithHttpInfo: " + e.Message); + Debug.Print("Exception when calling FaxApi.FaxGetWithHttpInfo: " + e.Message); Debug.Print("Status Code: " + e.ErrorCode); Debug.Print(e.StackTrace); } @@ -259,7 +259,7 @@ catch (ApiException e) ### Return type -**System.IO.Stream** +[**FaxGetResponse**](FaxGetResponse.md) ### Authorization @@ -268,7 +268,7 @@ catch (ApiException e) ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/pdf, application/json + - **Accept**: application/json ### HTTP response details @@ -279,9 +279,9 @@ catch (ApiException e) [[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) + +# **FaxList** +> FaxListResponse FaxList (int? page = null, int? pageSize = null) Lists Faxes @@ -324,21 +324,21 @@ public class Example ``` -#### Using the ListFaxesWithHttpInfo variant +#### Using the FaxListWithHttpInfo 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); + ApiResponse response = apiInstance.FaxListWithHttpInfo(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("Exception when calling FaxApi.FaxListWithHttpInfo: " + e.Message); Debug.Print("Status Code: " + e.ErrorCode); Debug.Print(e.StackTrace); } @@ -348,8 +348,8 @@ catch (ApiException e) | Name | Type | Description | Notes | |------|------|-------------|-------| -| **page** | **int** | Page | | -| **pageSize** | **int** | Page size | | +| **page** | **int?** | Page | [optional] [default to 1] | +| **pageSize** | **int?** | Page size | [optional] [default to 20] | ### Return type @@ -373,9 +373,9 @@ catch (ApiException e) [[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) + +# **FaxSend** +> FaxGetResponse FaxSend (FaxSendRequest faxSendRequest) Send Fax @@ -426,21 +426,21 @@ public class Example ``` -#### Using the SendFaxWithHttpInfo variant +#### Using the FaxSendWithHttpInfo variant This returns an ApiResponse object which contains the response data, status code and headers. ```csharp try { // Send Fax - ApiResponse response = apiInstance.SendFaxWithHttpInfo(faxSendRequest); + ApiResponse response = apiInstance.FaxSendWithHttpInfo(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("Exception when calling FaxApi.FaxSendWithHttpInfo: " + e.Message); Debug.Print("Status Code: " + e.ErrorCode); Debug.Print(e.StackTrace); } @@ -454,7 +454,7 @@ catch (ApiException e) ### Return type -[**FaxResponse**](FaxResponse.md) +[**FaxGetResponse**](FaxGetResponse.md) ### Authorization @@ -462,7 +462,7 @@ catch (ApiException e) ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: application/json, multipart/form-data - **Accept**: application/json diff --git a/sdks/dotnet/docs/SubFile.md b/sdks/dotnet/docs/FaxGetResponse.md similarity index 57% rename from sdks/dotnet/docs/SubFile.md rename to sdks/dotnet/docs/FaxGetResponse.md index 2fc19429d..42b82e12c 100644 --- a/sdks/dotnet/docs/SubFile.md +++ b/sdks/dotnet/docs/FaxGetResponse.md @@ -1,11 +1,10 @@ -# Dropbox.Sign.Model.SubFile -Actual uploaded physical file +# Dropbox.Sign.Model.FaxGetResponse ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Name** | **string** | Actual physical uploaded file name that is derived during upload. Not settable parameter. | [optional] [default to ""] +**Fax** | [**FaxResponse**](FaxResponse.md) | | **Warnings** | [**List<WarningResponse>**](WarningResponse.md) | A list of warnings. | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/sdks/dotnet/docs/FaxListResponse.md b/sdks/dotnet/docs/FaxListResponse.md index d6b0a28b7..1cea1149f 100644 --- a/sdks/dotnet/docs/FaxListResponse.md +++ b/sdks/dotnet/docs/FaxListResponse.md @@ -4,7 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Faxes** | [**List<FaxResponseFax>**](FaxResponseFax.md) | | **ListInfo** | [**ListInfoResponse**](ListInfoResponse.md) | | +**Faxes** | [**List<FaxResponse>**](FaxResponse.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 index 44b7cef62..2dbfb3444 100644 --- a/sdks/dotnet/docs/FaxResponse.md +++ b/sdks/dotnet/docs/FaxResponse.md @@ -4,7 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Fax** | [**FaxResponseFax**](FaxResponseFax.md) | | **Warnings** | [**List<WarningResponse>**](WarningResponse.md) | A list of warnings. | [optional] +**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<FaxResponseTransmission>**](FaxResponseTransmission.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/FaxResponseFax.md b/sdks/dotnet/docs/FaxResponseFax.md deleted file mode 100644 index 1debcc0a4..000000000 --- a/sdks/dotnet/docs/FaxResponseFax.md +++ /dev/null @@ -1,10 +0,0 @@ -# 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/FaxResponseTransmission.md similarity index 92% rename from sdks/dotnet/docs/FaxResponseFaxTransmission.md rename to sdks/dotnet/docs/FaxResponseTransmission.md index 92a8827b9..ed2878c46 100644 --- a/sdks/dotnet/docs/FaxResponseFaxTransmission.md +++ b/sdks/dotnet/docs/FaxResponseTransmission.md @@ -1,4 +1,4 @@ -# Dropbox.Sign.Model.FaxResponseFaxTransmission +# Dropbox.Sign.Model.FaxResponseTransmission ## Properties diff --git a/sdks/dotnet/docs/FaxSendRequest.md b/sdks/dotnet/docs/FaxSendRequest.md index 7b20abdc2..558880a8a 100644 --- a/sdks/dotnet/docs/FaxSendRequest.md +++ b/sdks/dotnet/docs/FaxSendRequest.md @@ -4,7 +4,7 @@ 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] +**To** | **string** | Fax Send To Recipient | **From** | **string** | Fax Send From Sender (used only with fax number) | [optional] **Files** | **List<System.IO.Stream>** | Fax File to Send | [optional] **FileUrls** | **List<string>** | Fax File URL to Send | [optional] **TestMode** | **bool** | API Test Mode Setting | [optional] [default to false]**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/src/Dropbox.Sign/Api/FaxApi.cs b/sdks/dotnet/src/Dropbox.Sign/Api/FaxApi.cs index f655ee7bf..b9819df28 100644 --- a/sdks/dotnet/src/Dropbox.Sign/Api/FaxApi.cs +++ b/sdks/dotnet/src/Dropbox.Sign/Api/FaxApi.cs @@ -37,7 +37,7 @@ public interface IFaxApiSync : IApiAccessor /// Fax ID /// Index associated with the operation. /// - void DeleteFax(string faxId, int operationIndex = 0); + void FaxDelete(string faxId, int operationIndex = 0); /// /// Delete Fax @@ -49,53 +49,53 @@ public interface IFaxApiSync : IApiAccessor /// Fax ID /// Index associated with the operation. /// ApiResponse of Object(void) - ApiResponse DeleteFaxWithHttpInfo(string faxId, int operationIndex = 0); + ApiResponse FaxDeleteWithHttpInfo(string faxId, int operationIndex = 0); /// - /// Get Fax + /// List Fax Files /// /// - /// Returns information about fax + /// Returns list of fax files /// /// Thrown when fails to make API call /// Fax ID /// Index associated with the operation. - /// FaxResponse - FaxResponse GetFaxById(string faxId, int operationIndex = 0); + /// System.IO.Stream + System.IO.Stream FaxFiles(string faxId, int operationIndex = 0); /// - /// Get Fax + /// List Fax Files /// /// - /// Returns information about fax + /// Returns list of fax files /// /// Thrown when fails to make API call /// Fax ID /// Index associated with the operation. - /// ApiResponse of FaxResponse - ApiResponse GetFaxByIdWithHttpInfo(string faxId, int operationIndex = 0); + /// ApiResponse of System.IO.Stream + ApiResponse FaxFilesWithHttpInfo(string faxId, int operationIndex = 0); /// - /// List Fax Files + /// Get Fax /// /// - /// Returns list of fax files + /// Returns information about fax /// /// Thrown when fails to make API call /// Fax ID /// Index associated with the operation. - /// System.IO.Stream - System.IO.Stream GetFaxFiles(string faxId, int operationIndex = 0); + /// FaxGetResponse + FaxGetResponse FaxGet(string faxId, int operationIndex = 0); /// - /// List Fax Files + /// Get Fax /// /// - /// Returns list of fax files + /// Returns information about fax /// /// Thrown when fails to make API call /// Fax ID /// Index associated with the operation. - /// ApiResponse of System.IO.Stream - ApiResponse GetFaxFilesWithHttpInfo(string faxId, int operationIndex = 0); + /// ApiResponse of FaxGetResponse + ApiResponse FaxGetWithHttpInfo(string faxId, int operationIndex = 0); /// /// Lists Faxes /// @@ -103,11 +103,11 @@ public interface IFaxApiSync : IApiAccessor /// Returns properties of multiple faxes /// /// Thrown when fails to make API call - /// Page - /// Page size + /// Page (optional, default to 1) + /// Page size (optional, default to 20) /// Index associated with the operation. /// FaxListResponse - FaxListResponse ListFaxes(int page, int pageSize, int operationIndex = 0); + FaxListResponse FaxList(int? page = default(int?), int? pageSize = default(int?), int operationIndex = 0); /// /// Lists Faxes @@ -116,11 +116,11 @@ public interface IFaxApiSync : IApiAccessor /// Returns properties of multiple faxes /// /// Thrown when fails to make API call - /// Page - /// Page size + /// Page (optional, default to 1) + /// Page size (optional, default to 20) /// Index associated with the operation. /// ApiResponse of FaxListResponse - ApiResponse ListFaxesWithHttpInfo(int page, int pageSize, int operationIndex = 0); + ApiResponse FaxListWithHttpInfo(int? page = default(int?), int? pageSize = default(int?), int operationIndex = 0); /// /// Send Fax /// @@ -130,8 +130,8 @@ public interface IFaxApiSync : IApiAccessor /// Thrown when fails to make API call /// /// Index associated with the operation. - /// FaxResponse - FaxResponse SendFax(FaxSendRequest faxSendRequest, int operationIndex = 0); + /// FaxGetResponse + FaxGetResponse FaxSend(FaxSendRequest faxSendRequest, int operationIndex = 0); /// /// Send Fax @@ -142,8 +142,8 @@ public interface IFaxApiSync : IApiAccessor /// Thrown when fails to make API call /// /// Index associated with the operation. - /// ApiResponse of FaxResponse - ApiResponse SendFaxWithHttpInfo(FaxSendRequest faxSendRequest, int operationIndex = 0); + /// ApiResponse of FaxGetResponse + ApiResponse FaxSendWithHttpInfo(FaxSendRequest faxSendRequest, int operationIndex = 0); #endregion Synchronous Operations } @@ -164,7 +164,7 @@ public interface IFaxApiAsync : IApiAccessor /// 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)); + System.Threading.Tasks.Task FaxDeleteAsync(string faxId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); /// /// Delete Fax @@ -177,57 +177,57 @@ public interface IFaxApiAsync : IApiAccessor /// 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)); + System.Threading.Tasks.Task> FaxDeleteWithHttpInfoAsync(string faxId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); /// - /// Get Fax + /// List Fax Files /// /// - /// Returns information about fax + /// 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 FaxResponse - System.Threading.Tasks.Task GetFaxByIdAsync(string faxId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + /// Task of System.IO.Stream + System.Threading.Tasks.Task FaxFilesAsync(string faxId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); /// - /// Get Fax + /// List Fax Files /// /// - /// Returns information about fax + /// 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 (FaxResponse) - System.Threading.Tasks.Task> GetFaxByIdWithHttpInfoAsync(string faxId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + /// Task of ApiResponse (System.IO.Stream) + System.Threading.Tasks.Task> FaxFilesWithHttpInfoAsync(string faxId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); /// - /// List Fax Files + /// Get Fax /// /// - /// Returns list of fax files + /// 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 System.IO.Stream - System.Threading.Tasks.Task GetFaxFilesAsync(string faxId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + /// Task of FaxGetResponse + System.Threading.Tasks.Task FaxGetAsync(string faxId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); /// - /// List Fax Files + /// Get Fax /// /// - /// Returns list of fax files + /// 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 (System.IO.Stream) - System.Threading.Tasks.Task> GetFaxFilesWithHttpInfoAsync(string faxId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + /// Task of ApiResponse (FaxGetResponse) + System.Threading.Tasks.Task> FaxGetWithHttpInfoAsync(string faxId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); /// /// Lists Faxes /// @@ -235,12 +235,12 @@ public interface IFaxApiAsync : IApiAccessor /// Returns properties of multiple faxes /// /// Thrown when fails to make API call - /// Page - /// Page size + /// Page (optional, default to 1) + /// Page size (optional, default to 20) /// 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)); + System.Threading.Tasks.Task FaxListAsync(int? page = default(int?), int? pageSize = default(int?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); /// /// Lists Faxes @@ -249,12 +249,12 @@ public interface IFaxApiAsync : IApiAccessor /// Returns properties of multiple faxes /// /// Thrown when fails to make API call - /// Page - /// Page size + /// Page (optional, default to 1) + /// Page size (optional, default to 20) /// 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)); + System.Threading.Tasks.Task> FaxListWithHttpInfoAsync(int? page = default(int?), int? pageSize = default(int?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); /// /// Send Fax /// @@ -265,8 +265,8 @@ public interface IFaxApiAsync : IApiAccessor /// /// 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)); + /// Task of FaxGetResponse + System.Threading.Tasks.Task FaxSendAsync(FaxSendRequest faxSendRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); /// /// Send Fax @@ -278,8 +278,8 @@ public interface IFaxApiAsync : IApiAccessor /// /// 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)); + /// Task of ApiResponse (FaxGetResponse) + System.Threading.Tasks.Task> FaxSendWithHttpInfoAsync(FaxSendRequest faxSendRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); #endregion Asynchronous Operations } @@ -407,9 +407,9 @@ public Dropbox.Sign.Client.ExceptionFactory ExceptionFactory /// Fax ID /// Index associated with the operation. /// - public void DeleteFax(string faxId, int operationIndex = 0) + public void FaxDelete(string faxId, int operationIndex = 0) { - DeleteFaxWithHttpInfo(faxId); + FaxDeleteWithHttpInfo(faxId); } /// @@ -419,12 +419,12 @@ public void DeleteFax(string faxId, int operationIndex = 0) /// Fax ID /// Index associated with the operation. /// ApiResponse of Object(void) - public Dropbox.Sign.Client.ApiResponse DeleteFaxWithHttpInfo(string faxId, int operationIndex = 0) + public Dropbox.Sign.Client.ApiResponse FaxDeleteWithHttpInfo(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"); + throw new Dropbox.Sign.Client.ApiException(400, "Missing required parameter 'faxId' when calling FaxApi->FaxDelete"); } Dropbox.Sign.Client.RequestOptions localVarRequestOptions = new Dropbox.Sign.Client.RequestOptions(); @@ -451,7 +451,7 @@ public Dropbox.Sign.Client.ApiResponse DeleteFaxWithHttpInfo(string faxI localVarRequestOptions.PathParameters.Add("fax_id", Dropbox.Sign.Client.ClientUtils.ParameterToString(faxId)); // path parameter - localVarRequestOptions.Operation = "FaxApi.DeleteFax"; + localVarRequestOptions.Operation = "FaxApi.FaxDelete"; localVarRequestOptions.OperationIndex = operationIndex; // authentication (api_key) required @@ -465,7 +465,7 @@ public Dropbox.Sign.Client.ApiResponse DeleteFaxWithHttpInfo(string faxI var localVarResponse = this.Client.Delete("/fax/{fax_id}", localVarRequestOptions, this.Configuration); if (this.ExceptionFactory != null) { - Exception _exception = this.ExceptionFactory("DeleteFax", localVarResponse); + Exception _exception = this.ExceptionFactory("FaxDelete", localVarResponse); if (_exception != null) { throw _exception; @@ -483,9 +483,9 @@ public Dropbox.Sign.Client.ApiResponse DeleteFaxWithHttpInfo(string faxI /// 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)) + public async System.Threading.Tasks.Task FaxDeleteAsync(string faxId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { - await DeleteFaxWithHttpInfoAsync(faxId, operationIndex, cancellationToken).ConfigureAwait(false); + await FaxDeleteWithHttpInfoAsync(faxId, operationIndex, cancellationToken).ConfigureAwait(false); } /// @@ -496,12 +496,12 @@ public Dropbox.Sign.Client.ApiResponse DeleteFaxWithHttpInfo(string faxI /// 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)) + public async System.Threading.Tasks.Task> FaxDeleteWithHttpInfoAsync(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"); + throw new Dropbox.Sign.Client.ApiException(400, "Missing required parameter 'faxId' when calling FaxApi->FaxDelete"); } @@ -529,7 +529,7 @@ public Dropbox.Sign.Client.ApiResponse DeleteFaxWithHttpInfo(string faxI localVarRequestOptions.PathParameters.Add("fax_id", Dropbox.Sign.Client.ClientUtils.ParameterToString(faxId)); // path parameter - localVarRequestOptions.Operation = "FaxApi.DeleteFax"; + localVarRequestOptions.Operation = "FaxApi.FaxDelete"; localVarRequestOptions.OperationIndex = operationIndex; // authentication (api_key) required @@ -544,7 +544,7 @@ public Dropbox.Sign.Client.ApiResponse DeleteFaxWithHttpInfo(string faxI if (this.ExceptionFactory != null) { - Exception _exception = this.ExceptionFactory("DeleteFax", localVarResponse); + Exception _exception = this.ExceptionFactory("FaxDelete", localVarResponse); if (_exception != null) { throw _exception; @@ -555,31 +555,31 @@ public Dropbox.Sign.Client.ApiResponse DeleteFaxWithHttpInfo(string faxI } /// - /// Get Fax Returns information about fax + /// List Fax Files Returns list of fax files /// /// Thrown when fails to make API call /// Fax ID /// Index associated with the operation. - /// FaxResponse - public FaxResponse GetFaxById(string faxId, int operationIndex = 0) + /// System.IO.Stream + public System.IO.Stream FaxFiles(string faxId, int operationIndex = 0) { - Dropbox.Sign.Client.ApiResponse localVarResponse = GetFaxByIdWithHttpInfo(faxId); + Dropbox.Sign.Client.ApiResponse localVarResponse = FaxFilesWithHttpInfo(faxId); return localVarResponse.Data; } /// - /// Get Fax Returns information about fax + /// List Fax Files Returns list of fax files /// /// 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) + /// ApiResponse of System.IO.Stream + public Dropbox.Sign.Client.ApiResponse FaxFilesWithHttpInfo(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"); + throw new Dropbox.Sign.Client.ApiException(400, "Missing required parameter 'faxId' when calling FaxApi->FaxFiles"); } Dropbox.Sign.Client.RequestOptions localVarRequestOptions = new Dropbox.Sign.Client.RequestOptions(); @@ -590,6 +590,7 @@ public Dropbox.Sign.Client.ApiResponse GetFaxByIdWithHttpInfo(strin // to determine the Accept header string[] _accepts = new string[] { + "application/pdf", "application/json" }; @@ -606,7 +607,7 @@ public Dropbox.Sign.Client.ApiResponse GetFaxByIdWithHttpInfo(strin localVarRequestOptions.PathParameters.Add("fax_id", Dropbox.Sign.Client.ClientUtils.ParameterToString(faxId)); // path parameter - localVarRequestOptions.Operation = "FaxApi.GetFaxById"; + localVarRequestOptions.Operation = "FaxApi.FaxFiles"; localVarRequestOptions.OperationIndex = operationIndex; // authentication (api_key) required @@ -617,10 +618,10 @@ public Dropbox.Sign.Client.ApiResponse GetFaxByIdWithHttpInfo(strin } // make the HTTP request - var localVarResponse = this.Client.Get("/fax/{fax_id}", localVarRequestOptions, this.Configuration); + var localVarResponse = this.Client.Get("/fax/files/{fax_id}", localVarRequestOptions, this.Configuration); if (this.ExceptionFactory != null) { - Exception _exception = this.ExceptionFactory("GetFaxById", localVarResponse); + Exception _exception = this.ExceptionFactory("FaxFiles", localVarResponse); if (_exception != null) { throw _exception; @@ -631,33 +632,33 @@ public Dropbox.Sign.Client.ApiResponse GetFaxByIdWithHttpInfo(strin } /// - /// Get Fax Returns information about fax + /// 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 FaxResponse - public async System.Threading.Tasks.Task GetFaxByIdAsync(string faxId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + /// Task of System.IO.Stream + public async System.Threading.Tasks.Task FaxFilesAsync(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); + Dropbox.Sign.Client.ApiResponse localVarResponse = await FaxFilesWithHttpInfoAsync(faxId, operationIndex, cancellationToken).ConfigureAwait(false); return localVarResponse.Data; } /// - /// Get Fax Returns information about fax + /// 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 (FaxResponse) - public async System.Threading.Tasks.Task> GetFaxByIdWithHttpInfoAsync(string faxId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + /// Task of ApiResponse (System.IO.Stream) + public async System.Threading.Tasks.Task> FaxFilesWithHttpInfoAsync(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"); + throw new Dropbox.Sign.Client.ApiException(400, "Missing required parameter 'faxId' when calling FaxApi->FaxFiles"); } @@ -669,6 +670,7 @@ public Dropbox.Sign.Client.ApiResponse GetFaxByIdWithHttpInfo(strin // to determine the Accept header string[] _accepts = new string[] { + "application/pdf", "application/json" }; @@ -685,7 +687,7 @@ public Dropbox.Sign.Client.ApiResponse GetFaxByIdWithHttpInfo(strin localVarRequestOptions.PathParameters.Add("fax_id", Dropbox.Sign.Client.ClientUtils.ParameterToString(faxId)); // path parameter - localVarRequestOptions.Operation = "FaxApi.GetFaxById"; + localVarRequestOptions.Operation = "FaxApi.FaxFiles"; localVarRequestOptions.OperationIndex = operationIndex; // authentication (api_key) required @@ -696,11 +698,11 @@ public Dropbox.Sign.Client.ApiResponse GetFaxByIdWithHttpInfo(strin } // make the HTTP request - var localVarResponse = await this.AsynchronousClient.GetAsync("/fax/{fax_id}", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); + var localVarResponse = await this.AsynchronousClient.GetAsync("/fax/files/{fax_id}", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); if (this.ExceptionFactory != null) { - Exception _exception = this.ExceptionFactory("GetFaxById", localVarResponse); + Exception _exception = this.ExceptionFactory("FaxFiles", localVarResponse); if (_exception != null) { throw _exception; @@ -711,31 +713,31 @@ public Dropbox.Sign.Client.ApiResponse GetFaxByIdWithHttpInfo(strin } /// - /// List Fax Files Returns list of fax files + /// Get Fax Returns information about fax /// /// Thrown when fails to make API call /// Fax ID /// Index associated with the operation. - /// System.IO.Stream - public System.IO.Stream GetFaxFiles(string faxId, int operationIndex = 0) + /// FaxGetResponse + public FaxGetResponse FaxGet(string faxId, int operationIndex = 0) { - Dropbox.Sign.Client.ApiResponse localVarResponse = GetFaxFilesWithHttpInfo(faxId); + Dropbox.Sign.Client.ApiResponse localVarResponse = FaxGetWithHttpInfo(faxId); return localVarResponse.Data; } /// - /// List Fax Files Returns list of fax files + /// Get Fax Returns information about fax /// /// Thrown when fails to make API call /// Fax ID /// Index associated with the operation. - /// ApiResponse of System.IO.Stream - public Dropbox.Sign.Client.ApiResponse GetFaxFilesWithHttpInfo(string faxId, int operationIndex = 0) + /// ApiResponse of FaxGetResponse + public Dropbox.Sign.Client.ApiResponse FaxGetWithHttpInfo(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"); + throw new Dropbox.Sign.Client.ApiException(400, "Missing required parameter 'faxId' when calling FaxApi->FaxGet"); } Dropbox.Sign.Client.RequestOptions localVarRequestOptions = new Dropbox.Sign.Client.RequestOptions(); @@ -746,7 +748,6 @@ public System.IO.Stream GetFaxFiles(string faxId, int operationIndex = 0) // to determine the Accept header string[] _accepts = new string[] { - "application/pdf", "application/json" }; @@ -763,7 +764,7 @@ public System.IO.Stream GetFaxFiles(string faxId, int operationIndex = 0) localVarRequestOptions.PathParameters.Add("fax_id", Dropbox.Sign.Client.ClientUtils.ParameterToString(faxId)); // path parameter - localVarRequestOptions.Operation = "FaxApi.GetFaxFiles"; + localVarRequestOptions.Operation = "FaxApi.FaxGet"; localVarRequestOptions.OperationIndex = operationIndex; // authentication (api_key) required @@ -774,10 +775,10 @@ public System.IO.Stream GetFaxFiles(string faxId, int operationIndex = 0) } // make the HTTP request - var localVarResponse = this.Client.Get("/fax/files/{fax_id}", localVarRequestOptions, this.Configuration); + var localVarResponse = this.Client.Get("/fax/{fax_id}", localVarRequestOptions, this.Configuration); if (this.ExceptionFactory != null) { - Exception _exception = this.ExceptionFactory("GetFaxFiles", localVarResponse); + Exception _exception = this.ExceptionFactory("FaxGet", localVarResponse); if (_exception != null) { throw _exception; @@ -788,33 +789,33 @@ public System.IO.Stream GetFaxFiles(string faxId, int operationIndex = 0) } /// - /// List Fax Files Returns list of fax files + /// 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 System.IO.Stream - public async System.Threading.Tasks.Task GetFaxFilesAsync(string faxId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + /// Task of FaxGetResponse + public async System.Threading.Tasks.Task FaxGetAsync(string faxId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { - Dropbox.Sign.Client.ApiResponse localVarResponse = await GetFaxFilesWithHttpInfoAsync(faxId, operationIndex, cancellationToken).ConfigureAwait(false); + Dropbox.Sign.Client.ApiResponse localVarResponse = await FaxGetWithHttpInfoAsync(faxId, operationIndex, cancellationToken).ConfigureAwait(false); return localVarResponse.Data; } /// - /// List Fax Files Returns list of fax files + /// 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 (System.IO.Stream) - public async System.Threading.Tasks.Task> GetFaxFilesWithHttpInfoAsync(string faxId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + /// Task of ApiResponse (FaxGetResponse) + public async System.Threading.Tasks.Task> FaxGetWithHttpInfoAsync(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"); + throw new Dropbox.Sign.Client.ApiException(400, "Missing required parameter 'faxId' when calling FaxApi->FaxGet"); } @@ -826,7 +827,6 @@ public System.IO.Stream GetFaxFiles(string faxId, int operationIndex = 0) // to determine the Accept header string[] _accepts = new string[] { - "application/pdf", "application/json" }; @@ -843,7 +843,7 @@ public System.IO.Stream GetFaxFiles(string faxId, int operationIndex = 0) localVarRequestOptions.PathParameters.Add("fax_id", Dropbox.Sign.Client.ClientUtils.ParameterToString(faxId)); // path parameter - localVarRequestOptions.Operation = "FaxApi.GetFaxFiles"; + localVarRequestOptions.Operation = "FaxApi.FaxGet"; localVarRequestOptions.OperationIndex = operationIndex; // authentication (api_key) required @@ -854,11 +854,11 @@ public System.IO.Stream GetFaxFiles(string faxId, int operationIndex = 0) } // make the HTTP request - var localVarResponse = await this.AsynchronousClient.GetAsync("/fax/files/{fax_id}", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); + var localVarResponse = await this.AsynchronousClient.GetAsync("/fax/{fax_id}", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); if (this.ExceptionFactory != null) { - Exception _exception = this.ExceptionFactory("GetFaxFiles", localVarResponse); + Exception _exception = this.ExceptionFactory("FaxGet", localVarResponse); if (_exception != null) { throw _exception; @@ -872,13 +872,13 @@ public System.IO.Stream GetFaxFiles(string faxId, int operationIndex = 0) /// Lists Faxes Returns properties of multiple faxes /// /// Thrown when fails to make API call - /// Page - /// Page size + /// Page (optional, default to 1) + /// Page size (optional, default to 20) /// Index associated with the operation. /// FaxListResponse - public FaxListResponse ListFaxes(int page, int pageSize, int operationIndex = 0) + public FaxListResponse FaxList(int? page = default(int?), int? pageSize = default(int?), int operationIndex = 0) { - Dropbox.Sign.Client.ApiResponse localVarResponse = ListFaxesWithHttpInfo(page, pageSize); + Dropbox.Sign.Client.ApiResponse localVarResponse = FaxListWithHttpInfo(page, pageSize); return localVarResponse.Data; } @@ -886,11 +886,11 @@ public 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 + /// Page (optional, default to 1) + /// Page size (optional, default to 20) /// Index associated with the operation. /// ApiResponse of FaxListResponse - public Dropbox.Sign.Client.ApiResponse ListFaxesWithHttpInfo(int page, int pageSize, int operationIndex = 0) + public Dropbox.Sign.Client.ApiResponse FaxListWithHttpInfo(int? page = default(int?), int? pageSize = default(int?), int operationIndex = 0) { Dropbox.Sign.Client.RequestOptions localVarRequestOptions = new Dropbox.Sign.Client.RequestOptions(); @@ -914,10 +914,16 @@ public Dropbox.Sign.Client.ApiResponse ListFaxesWithHttpInfo(in 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)); + if (page != null) + { + localVarRequestOptions.QueryParameters.Add(Dropbox.Sign.Client.ClientUtils.ParameterToMultiMap("", "page", page)); + } + if (pageSize != null) + { + localVarRequestOptions.QueryParameters.Add(Dropbox.Sign.Client.ClientUtils.ParameterToMultiMap("", "page_size", pageSize)); + } - localVarRequestOptions.Operation = "FaxApi.ListFaxes"; + localVarRequestOptions.Operation = "FaxApi.FaxList"; localVarRequestOptions.OperationIndex = operationIndex; // authentication (api_key) required @@ -931,7 +937,7 @@ public Dropbox.Sign.Client.ApiResponse ListFaxesWithHttpInfo(in var localVarResponse = this.Client.Get("/fax/list", localVarRequestOptions, this.Configuration); if (this.ExceptionFactory != null) { - Exception _exception = this.ExceptionFactory("ListFaxes", localVarResponse); + Exception _exception = this.ExceptionFactory("FaxList", localVarResponse); if (_exception != null) { throw _exception; @@ -945,14 +951,14 @@ public Dropbox.Sign.Client.ApiResponse ListFaxesWithHttpInfo(in /// Lists Faxes Returns properties of multiple faxes /// /// Thrown when fails to make API call - /// Page - /// Page size + /// Page (optional, default to 1) + /// Page size (optional, default to 20) /// 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)) + public async System.Threading.Tasks.Task FaxListAsync(int? page = default(int?), int? pageSize = default(int?), 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); + Dropbox.Sign.Client.ApiResponse localVarResponse = await FaxListWithHttpInfoAsync(page, pageSize, operationIndex, cancellationToken).ConfigureAwait(false); return localVarResponse.Data; } @@ -960,12 +966,12 @@ public Dropbox.Sign.Client.ApiResponse ListFaxesWithHttpInfo(in /// Lists Faxes Returns properties of multiple faxes /// /// Thrown when fails to make API call - /// Page - /// Page size + /// Page (optional, default to 1) + /// Page size (optional, default to 20) /// 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)) + public async System.Threading.Tasks.Task> FaxListWithHttpInfoAsync(int? page = default(int?), int? pageSize = default(int?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { Dropbox.Sign.Client.RequestOptions localVarRequestOptions = new Dropbox.Sign.Client.RequestOptions(); @@ -990,10 +996,16 @@ public Dropbox.Sign.Client.ApiResponse ListFaxesWithHttpInfo(in 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)); + if (page != null) + { + localVarRequestOptions.QueryParameters.Add(Dropbox.Sign.Client.ClientUtils.ParameterToMultiMap("", "page", page)); + } + if (pageSize != null) + { + localVarRequestOptions.QueryParameters.Add(Dropbox.Sign.Client.ClientUtils.ParameterToMultiMap("", "page_size", pageSize)); + } - localVarRequestOptions.Operation = "FaxApi.ListFaxes"; + localVarRequestOptions.Operation = "FaxApi.FaxList"; localVarRequestOptions.OperationIndex = operationIndex; // authentication (api_key) required @@ -1008,7 +1020,7 @@ public Dropbox.Sign.Client.ApiResponse ListFaxesWithHttpInfo(in if (this.ExceptionFactory != null) { - Exception _exception = this.ExceptionFactory("ListFaxes", localVarResponse); + Exception _exception = this.ExceptionFactory("FaxList", localVarResponse); if (_exception != null) { throw _exception; @@ -1024,10 +1036,10 @@ public Dropbox.Sign.Client.ApiResponse ListFaxesWithHttpInfo(in /// Thrown when fails to make API call /// /// Index associated with the operation. - /// FaxResponse - public FaxResponse SendFax(FaxSendRequest faxSendRequest, int operationIndex = 0) + /// FaxGetResponse + public FaxGetResponse FaxSend(FaxSendRequest faxSendRequest, int operationIndex = 0) { - Dropbox.Sign.Client.ApiResponse localVarResponse = SendFaxWithHttpInfo(faxSendRequest); + Dropbox.Sign.Client.ApiResponse localVarResponse = FaxSendWithHttpInfo(faxSendRequest); return localVarResponse.Data; } @@ -1037,13 +1049,13 @@ public FaxResponse SendFax(FaxSendRequest faxSendRequest, int operationIndex = 0 /// 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) + /// ApiResponse of FaxGetResponse + public Dropbox.Sign.Client.ApiResponse FaxSendWithHttpInfo(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"); + throw new Dropbox.Sign.Client.ApiException(400, "Missing required parameter 'faxSendRequest' when calling FaxApi->FaxSend"); } Dropbox.Sign.Client.RequestOptions localVarRequestOptions = new Dropbox.Sign.Client.RequestOptions(); @@ -1078,7 +1090,7 @@ public Dropbox.Sign.Client.ApiResponse SendFaxWithHttpInfo(FaxSendR } - localVarRequestOptions.Operation = "FaxApi.SendFax"; + localVarRequestOptions.Operation = "FaxApi.FaxSend"; localVarRequestOptions.OperationIndex = operationIndex; // authentication (api_key) required @@ -1089,10 +1101,10 @@ public Dropbox.Sign.Client.ApiResponse SendFaxWithHttpInfo(FaxSendR } // make the HTTP request - var localVarResponse = this.Client.Post("/fax/send", localVarRequestOptions, this.Configuration); + var localVarResponse = this.Client.Post("/fax/send", localVarRequestOptions, this.Configuration); if (this.ExceptionFactory != null) { - Exception _exception = this.ExceptionFactory("SendFax", localVarResponse); + Exception _exception = this.ExceptionFactory("FaxSend", localVarResponse); if (_exception != null) { throw _exception; @@ -1109,10 +1121,10 @@ public Dropbox.Sign.Client.ApiResponse SendFaxWithHttpInfo(FaxSendR /// /// 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)) + /// Task of FaxGetResponse + public async System.Threading.Tasks.Task FaxSendAsync(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); + Dropbox.Sign.Client.ApiResponse localVarResponse = await FaxSendWithHttpInfoAsync(faxSendRequest, operationIndex, cancellationToken).ConfigureAwait(false); return localVarResponse.Data; } @@ -1123,13 +1135,13 @@ public Dropbox.Sign.Client.ApiResponse SendFaxWithHttpInfo(FaxSendR /// /// 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)) + /// Task of ApiResponse (FaxGetResponse) + public async System.Threading.Tasks.Task> FaxSendWithHttpInfoAsync(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"); + throw new Dropbox.Sign.Client.ApiException(400, "Missing required parameter 'faxSendRequest' when calling FaxApi->FaxSend"); } @@ -1165,7 +1177,7 @@ public Dropbox.Sign.Client.ApiResponse SendFaxWithHttpInfo(FaxSendR } - localVarRequestOptions.Operation = "FaxApi.SendFax"; + localVarRequestOptions.Operation = "FaxApi.FaxSend"; localVarRequestOptions.OperationIndex = operationIndex; // authentication (api_key) required @@ -1176,11 +1188,11 @@ public Dropbox.Sign.Client.ApiResponse SendFaxWithHttpInfo(FaxSendR } // make the HTTP request - var localVarResponse = await this.AsynchronousClient.PostAsync("/fax/send", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); + var localVarResponse = await this.AsynchronousClient.PostAsync("/fax/send", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); if (this.ExceptionFactory != null) { - Exception _exception = this.ExceptionFactory("SendFax", localVarResponse); + Exception _exception = this.ExceptionFactory("FaxSend", localVarResponse); if (_exception != null) { throw _exception; diff --git a/sdks/dotnet/src/Dropbox.Sign/Model/FaxGetResponse.cs b/sdks/dotnet/src/Dropbox.Sign/Model/FaxGetResponse.cs new file mode 100644 index 000000000..59214ef6e --- /dev/null +++ b/sdks/dotnet/src/Dropbox.Sign/Model/FaxGetResponse.cs @@ -0,0 +1,197 @@ +/* + * Dropbox Sign API + * + * Dropbox Sign v3 API + * + * The version of the OpenAPI document: 3.0.0 + * Contact: apisupport@hellosign.com + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using System.ComponentModel.DataAnnotations; +using OpenAPIDateConverter = Dropbox.Sign.Client.OpenAPIDateConverter; + +namespace Dropbox.Sign.Model +{ + /// + /// FaxGetResponse + /// + [DataContract(Name = "FaxGetResponse")] + [JsonObject(ItemNullValueHandling = NullValueHandling.Ignore)] + public partial class FaxGetResponse : IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + [JsonConstructorAttribute] + protected FaxGetResponse() { } + /// + /// Initializes a new instance of the class. + /// + /// fax (required). + /// A list of warnings.. + public FaxGetResponse(FaxResponse fax = default(FaxResponse), List warnings = default(List)) + { + + // to ensure "fax" is required (not null) + if (fax == null) + { + throw new ArgumentNullException("fax is a required property for FaxGetResponse 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 FaxGetResponse Init(string jsonData) + { + var obj = JsonConvert.DeserializeObject(jsonData); + + if (obj == null) + { + throw new Exception("Unable to deserialize JSON to instance of FaxGetResponse"); + } + + return obj; + } + + /// + /// Gets or Sets Fax + /// + [DataMember(Name = "fax", IsRequired = true, EmitDefaultValue = true)] + public FaxResponse Fax { get; set; } + + /// + /// A list of warnings. + /// + /// A list of warnings. + [DataMember(Name = "warnings", EmitDefaultValue = true)] + public List Warnings { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class FaxGetResponse {\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 FaxGetResponse); + } + + /// + /// Returns true if FaxGetResponse instances are equal + /// + /// Instance of FaxGetResponse to be compared + /// Boolean + public bool Equals(FaxGetResponse 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 && + input.Warnings != null && + this.Warnings.SequenceEqual(input.Warnings) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.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 = "FaxResponse", + Value = Fax, + }); + types.Add(new OpenApiType() + { + Name = "warnings", + Property = "Warnings", + Type = "List", + Value = Warnings, + }); + + return types; + } + } + +} diff --git a/sdks/dotnet/src/Dropbox.Sign/Model/FaxListResponse.cs b/sdks/dotnet/src/Dropbox.Sign/Model/FaxListResponse.cs index fb04b1b4e..d5c62990a 100644 --- a/sdks/dotnet/src/Dropbox.Sign/Model/FaxListResponse.cs +++ b/sdks/dotnet/src/Dropbox.Sign/Model/FaxListResponse.cs @@ -43,7 +43,7 @@ protected FaxListResponse() { } /// /// faxes (required). /// listInfo (required). - public FaxListResponse(List faxes = default(List), ListInfoResponse listInfo = default(ListInfoResponse)) + public FaxListResponse(List faxes = default(List), ListInfoResponse listInfo = default(ListInfoResponse)) { // to ensure "faxes" is required (not null) @@ -80,7 +80,7 @@ public static FaxListResponse Init(string jsonData) /// Gets or Sets Faxes /// [DataMember(Name = "faxes", IsRequired = true, EmitDefaultValue = true)] - public List Faxes { get; set; } + public List Faxes { get; set; } /// /// Gets or Sets ListInfo @@ -183,7 +183,7 @@ public List GetOpenApiTypes() { Name = "faxes", Property = "Faxes", - Type = "List", + Type = "List", Value = Faxes, }); types.Add(new OpenApiType() diff --git a/sdks/dotnet/src/Dropbox.Sign/Model/FaxResponse.cs b/sdks/dotnet/src/Dropbox.Sign/Model/FaxResponse.cs index de5879774..814a1bb47 100644 --- a/sdks/dotnet/src/Dropbox.Sign/Model/FaxResponse.cs +++ b/sdks/dotnet/src/Dropbox.Sign/Model/FaxResponse.cs @@ -41,18 +41,29 @@ protected FaxResponse() { } /// /// Initializes a new instance of the class. /// - /// fax (required). - /// A list of warnings.. - public FaxResponse(FaxResponseFax fax = default(FaxResponseFax), List warnings = default(List)) + /// 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 FaxResponse(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)) { - // 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; + 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; } /// @@ -72,17 +83,74 @@ public static FaxResponse Init(string jsonData) } /// - /// Gets or Sets Fax + /// 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 /// - [DataMember(Name = "fax", IsRequired = true, EmitDefaultValue = true)] - public FaxResponseFax Fax { get; set; } + /// Fax Created At Timestamp + [DataMember(Name = "created_at", EmitDefaultValue = true)] + public int CreatedAt { get; set; } /// - /// A list of warnings. + /// Fax Sender Email /// - /// A list of warnings. - [DataMember(Name = "warnings", EmitDefaultValue = true)] - public List Warnings { get; set; } + /// 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 @@ -92,8 +160,16 @@ 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(" 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(); } @@ -130,15 +206,54 @@ public bool Equals(FaxResponse input) } return ( - this.Fax == input.Fax || - (this.Fax != null && - this.Fax.Equals(input.Fax)) + 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.Warnings == input.Warnings || - this.Warnings != null && - input.Warnings != null && - this.Warnings.SequenceEqual(input.Warnings) + 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)) ); } @@ -151,13 +266,42 @@ public override int GetHashCode() unchecked // Overflow is fine, just wrap { int hashCode = 41; - if (this.Fax != null) + 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.Fax.GetHashCode(); + hashCode = (hashCode * 59) + this.Message.GetHashCode(); } - if (this.Warnings != null) + if (this.Metadata != null) { - hashCode = (hashCode * 59) + this.Warnings.GetHashCode(); + 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; } @@ -177,17 +321,73 @@ public List GetOpenApiTypes() var types = new List(); types.Add(new OpenApiType() { - Name = "fax", - Property = "Fax", - Type = "FaxResponseFax", - Value = Fax, + 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 = "warnings", - Property = "Warnings", - Type = "List", - Value = Warnings, + Name = "files_url", + Property = "FilesUrl", + Type = "string", + Value = FilesUrl, }); return types; diff --git a/sdks/dotnet/src/Dropbox.Sign/Model/FaxResponseTransmission.cs b/sdks/dotnet/src/Dropbox.Sign/Model/FaxResponseTransmission.cs new file mode 100644 index 000000000..ae2938fd0 --- /dev/null +++ b/sdks/dotnet/src/Dropbox.Sign/Model/FaxResponseTransmission.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 +{ + /// + /// FaxResponseTransmission + /// + [DataContract(Name = "FaxResponseTransmission")] + [JsonObject(ItemNullValueHandling = NullValueHandling.Ignore)] + public partial class FaxResponseTransmission : IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + [JsonConstructorAttribute] + protected FaxResponseTransmission() { } + /// + /// Initializes a new instance of the class. + /// + /// Fax Transmission Recipient. + /// Fax Transmission Sender. + /// Fax Transmission Status Code. + /// Fax Transmission Sent Timestamp. + public FaxResponseTransmission(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 FaxResponseTransmission Init(string jsonData) + { + var obj = JsonConvert.DeserializeObject(jsonData); + + if (obj == null) + { + throw new Exception("Unable to deserialize JSON to instance of FaxResponseTransmission"); + } + + 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 FaxResponseTransmission {\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 FaxResponseTransmission); + } + + /// + /// Returns true if FaxResponseTransmission instances are equal + /// + /// Instance of FaxResponseTransmission to be compared + /// Boolean + public bool Equals(FaxResponseTransmission 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 index f7095cf60..04a2053fa 100644 --- a/sdks/dotnet/src/Dropbox.Sign/Model/FaxSendRequest.cs +++ b/sdks/dotnet/src/Dropbox.Sign/Model/FaxSendRequest.cs @@ -41,24 +41,27 @@ protected FaxSendRequest() { } /// /// Initializes a new instance of the class. /// - /// Fax Send To Recipient. + /// Fax Send To Recipient (required). /// 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 File to Send. + /// Fax File URL to Send. + /// API Test Mode Setting (default to false). /// 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)) + public FaxSendRequest(string to = default(string), string from = default(string), List files = default(List), List fileUrls = default(List), bool testMode = false, string coverPageTo = default(string), string coverPageFrom = default(string), string coverPageMessage = default(string), string title = default(string)) { + // to ensure "to" is required (not null) + if (to == null) + { + throw new ArgumentNullException("to is a required property for FaxSendRequest and cannot be null"); + } this.To = to; this.From = from; - this.File = file; - this.FileUrl = fileUrl; - this.FileUrlNames = fileUrlNames; + this.Files = files; + this.FileUrls = fileUrls; this.TestMode = testMode; this.CoverPageTo = coverPageTo; this.CoverPageFrom = coverPageFrom; @@ -87,7 +90,7 @@ public static FaxSendRequest Init(string jsonData) /// /// Fax Send To Recipient /// recipient@example.com - [DataMember(Name = "to", EmitDefaultValue = true)] + [DataMember(Name = "to", IsRequired = true, EmitDefaultValue = true)] public string To { get; set; } /// @@ -102,28 +105,20 @@ public static FaxSendRequest Init(string jsonData) /// Fax File to Send /// /// Fax File to Send - [DataMember(Name = "file", EmitDefaultValue = true)] - public List File { get; set; } + [DataMember(Name = "files", EmitDefaultValue = true)] + public List Files { 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; } + [DataMember(Name = "file_urls", EmitDefaultValue = true)] + public List FileUrls { get; set; } /// /// API Test Mode Setting /// /// API Test Mode Setting - /// false [DataMember(Name = "test_mode", EmitDefaultValue = true)] public bool TestMode { get; set; } @@ -169,9 +164,8 @@ public override string ToString() 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(" Files: ").Append(Files).Append("\n"); + sb.Append(" FileUrls: ").Append(FileUrls).Append("\n"); sb.Append(" TestMode: ").Append(TestMode).Append("\n"); sb.Append(" CoverPageTo: ").Append(CoverPageTo).Append("\n"); sb.Append(" CoverPageFrom: ").Append(CoverPageFrom).Append("\n"); @@ -223,22 +217,16 @@ public bool Equals(FaxSendRequest input) 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.Files == input.Files || + this.Files != null && + input.Files != null && + this.Files.SequenceEqual(input.Files) ) && ( - this.FileUrlNames == input.FileUrlNames || - this.FileUrlNames != null && - input.FileUrlNames != null && - this.FileUrlNames.SequenceEqual(input.FileUrlNames) + this.FileUrls == input.FileUrls || + this.FileUrls != null && + input.FileUrls != null && + this.FileUrls.SequenceEqual(input.FileUrls) ) && ( this.TestMode == input.TestMode || @@ -283,17 +271,13 @@ public override int GetHashCode() { hashCode = (hashCode * 59) + this.From.GetHashCode(); } - if (this.File != null) + if (this.Files != null) { - hashCode = (hashCode * 59) + this.File.GetHashCode(); + hashCode = (hashCode * 59) + this.Files.GetHashCode(); } - if (this.FileUrl != null) + if (this.FileUrls != null) { - hashCode = (hashCode * 59) + this.FileUrl.GetHashCode(); - } - if (this.FileUrlNames != null) - { - hashCode = (hashCode * 59) + this.FileUrlNames.GetHashCode(); + hashCode = (hashCode * 59) + this.FileUrls.GetHashCode(); } hashCode = (hashCode * 59) + this.TestMode.GetHashCode(); if (this.CoverPageTo != null) @@ -344,24 +328,17 @@ public List GetOpenApiTypes() }); 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, + Name = "files", + Property = "Files", + Type = "List", + Value = Files, }); types.Add(new OpenApiType() { - Name = "file_url_names", - Property = "FileUrlNames", + Name = "file_urls", + Property = "FileUrls", Type = "List", - Value = FileUrlNames, + Value = FileUrls, }); types.Add(new OpenApiType() { diff --git a/sdks/java-v1/README.md b/sdks/java-v1/README.md index 3d962d543..f03e09094 100644 --- a/sdks/java-v1/README.md +++ b/sdks/java-v1/README.md @@ -177,11 +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 +*FaxApi* | [**faxDelete**](docs/FaxApi.md#faxDelete) | **DELETE** /fax/{fax_id} | Delete Fax +*FaxApi* | [**faxFiles**](docs/FaxApi.md#faxFiles) | **GET** /fax/files/{fax_id} | List Fax Files +*FaxApi* | [**faxGet**](docs/FaxApi.md#faxGet) | **GET** /fax/{fax_id} | Get Fax +*FaxApi* | [**faxList**](docs/FaxApi.md#faxList) | **GET** /fax/list | Lists Faxes +*FaxApi* | [**faxSend**](docs/FaxApi.md#faxSend) | **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 @@ -271,6 +271,7 @@ Class | Method | HTTP request | Description - [EventCallbackRequest](docs/EventCallbackRequest.md) - [EventCallbackRequestEvent](docs/EventCallbackRequestEvent.md) - [EventCallbackRequestEventMetadata](docs/EventCallbackRequestEventMetadata.md) + - [FaxGetResponse](docs/FaxGetResponse.md) - [FaxLineAddUserRequest](docs/FaxLineAddUserRequest.md) - [FaxLineAreaCodeGetCountryEnum](docs/FaxLineAreaCodeGetCountryEnum.md) - [FaxLineAreaCodeGetProvinceEnum](docs/FaxLineAreaCodeGetProvinceEnum.md) @@ -284,8 +285,7 @@ Class | Method | HTTP request | Description - [FaxLineResponseFaxLine](docs/FaxLineResponseFaxLine.md) - [FaxListResponse](docs/FaxListResponse.md) - [FaxResponse](docs/FaxResponse.md) - - [FaxResponseFax](docs/FaxResponseFax.md) - - [FaxResponseFaxTransmission](docs/FaxResponseFaxTransmission.md) + - [FaxResponseTransmission](docs/FaxResponseTransmission.md) - [FaxSendRequest](docs/FaxSendRequest.md) - [FileResponse](docs/FileResponse.md) - [FileResponseDataUri](docs/FileResponseDataUri.md) @@ -331,7 +331,6 @@ 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 index f917f4c3e..1799fb847 100644 --- a/sdks/java-v1/docs/FaxApi.md +++ b/sdks/java-v1/docs/FaxApi.md @@ -4,17 +4,17 @@ 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 +[**faxDelete**](FaxApi.md#faxDelete) | **DELETE** /fax/{fax_id} | Delete Fax +[**faxFiles**](FaxApi.md#faxFiles) | **GET** /fax/files/{fax_id} | List Fax Files +[**faxGet**](FaxApi.md#faxGet) | **GET** /fax/{fax_id} | Get Fax +[**faxList**](FaxApi.md#faxList) | **GET** /fax/list | Lists Faxes +[**faxSend**](FaxApi.md#faxSend) | **POST** /fax/send | Send Fax -## deleteFax +## faxDelete -> deleteFax(faxId) +> faxDelete(faxId) Delete Fax @@ -36,10 +36,10 @@ public class Example { var apiClient = Configuration.getDefaultApiClient() .setApiKey("YOUR_API_KEY"); - var faxAPi = new FaxApi(apiClient); + var faxApi = new FaxApi(apiClient); try { - faxAPi.deleteFax("[FAX_NUMBER]"); + faxApi.deleteFax("[FAX_NUMBER]"); } catch (ApiException e) { System.err.println("Status code: " + e.getCode()); System.err.println("Reason: " + e.getResponseBody()); @@ -74,17 +74,17 @@ null (empty response body) ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -| **200** | successful operation | * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
| +| **204** | successful operation | * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
| | **4XX** | failed_operation | - | -## getFaxById +## faxFiles -> FaxResponse getFaxById(faxId) +> File faxFiles(faxId) -Get Fax +List Fax Files -Returns information about fax +Returns list of fax files ### Example @@ -95,6 +95,8 @@ 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() @@ -105,10 +107,8 @@ public class Example { var faxId = "fa5c8a0b0f492d768749333ad6fcc214c111e967"; try { - FaxGetResponse result = faxApi.getFaxById(faxId); - System.out.println(result); + faxApi.getFaxFiles(faxId); } 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()); @@ -128,7 +128,7 @@ public class Example { ### Return type -[**FaxResponse**](FaxResponse.md) +[**File**](File.md) ### Authorization @@ -137,7 +137,7 @@ public class Example { ### HTTP request headers - **Content-Type**: Not defined -- **Accept**: application/json +- **Accept**: application/pdf, application/json ### HTTP response details | Status code | Description | Response headers | @@ -146,13 +146,13 @@ public class Example { | **4XX** | failed_operation | - | -## getFaxFiles +## faxGet -> File getFaxFiles(faxId) +> FaxGetResponse faxGet(faxId) -List Fax Files +Get Fax -Returns list of fax files +Returns information about fax ### Example @@ -163,8 +163,6 @@ 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() @@ -175,8 +173,10 @@ public class Example { var faxId = "fa5c8a0b0f492d768749333ad6fcc214c111e967"; try { - faxApi.getFaxFiles(faxId); + 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()); @@ -196,7 +196,7 @@ public class Example { ### Return type -[**File**](File.md) +[**FaxGetResponse**](FaxGetResponse.md) ### Authorization @@ -205,7 +205,7 @@ public class Example { ### HTTP request headers - **Content-Type**: Not defined -- **Accept**: application/pdf, application/json +- **Accept**: application/json ### HTTP response details | Status code | Description | Response headers | @@ -214,9 +214,9 @@ public class Example { | **4XX** | failed_operation | - | -## listFaxes +## faxList -> FaxListResponse listFaxes(page, pageSize) +> FaxListResponse faxList(page, pageSize) Lists Faxes @@ -261,8 +261,8 @@ public class Example { | Name | Type | Description | Notes | |------------- | ------------- | ------------- | -------------| - **page** | **Integer**| Page | - **pageSize** | **Integer**| Page size | + **page** | **Integer**| Page | [optional] [default to 1] + **pageSize** | **Integer**| Page size | [optional] [default to 20] ### Return type @@ -284,9 +284,9 @@ public class Example { | **4XX** | failed_operation | - | -## sendFax +## faxSend -> FaxResponse sendFax(faxSendRequest) +> FaxGetResponse faxSend(faxSendRequest) Send Fax @@ -337,7 +337,7 @@ public class Example { ### Return type -[**FaxResponse**](FaxResponse.md) +[**FaxGetResponse**](FaxGetResponse.md) ### Authorization @@ -345,7 +345,7 @@ public class Example { ### HTTP request headers -- **Content-Type**: application/json +- **Content-Type**: application/json, multipart/form-data - **Accept**: application/json ### HTTP response details diff --git a/sdks/java-v1/docs/FaxGetResponse.md b/sdks/java-v1/docs/FaxGetResponse.md new file mode 100644 index 000000000..cc9dc6e57 --- /dev/null +++ b/sdks/java-v1/docs/FaxGetResponse.md @@ -0,0 +1,15 @@ + + +# FaxGetResponse + + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +| `fax`*_required_ | [```FaxResponse```](FaxResponse.md) | | | +| `warnings` | [```List```](WarningResponse.md) | A list of warnings. | | + + + diff --git a/sdks/java-v1/docs/FaxListResponse.md b/sdks/java-v1/docs/FaxListResponse.md index 22e92f955..f25379a27 100644 --- a/sdks/java-v1/docs/FaxListResponse.md +++ b/sdks/java-v1/docs/FaxListResponse.md @@ -8,7 +8,7 @@ | Name | Type | Description | Notes | |------------ | ------------- | ------------- | -------------| -| `faxes`*_required_ | [```List```](FaxResponseFax.md) | | | +| `faxes`*_required_ | [```List```](FaxResponse.md) | | | | `listInfo`*_required_ | [```ListInfoResponse```](ListInfoResponse.md) | | | diff --git a/sdks/java-v1/docs/FaxResponse.md b/sdks/java-v1/docs/FaxResponse.md index 76e4a451f..6fe6fc0f3 100644 --- a/sdks/java-v1/docs/FaxResponse.md +++ b/sdks/java-v1/docs/FaxResponse.md @@ -8,8 +8,16 @@ | Name | Type | Description | Notes | |------------ | ------------- | ------------- | -------------| -| `fax`*_required_ | [```FaxResponseFax```](FaxResponseFax.md) | | | -| `warnings` | [```List```](WarningResponse.md) | A list of warnings. | | +| `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```](FaxResponseTransmission.md) | Fax Transmissions List | | +| `filesUrl` | ```String``` | Fax Files URL | | diff --git a/sdks/java-v1/docs/FaxResponseFax.md b/sdks/java-v1/docs/FaxResponseFax.md deleted file mode 100644 index ef62af24a..000000000 --- a/sdks/java-v1/docs/FaxResponseFax.md +++ /dev/null @@ -1,23 +0,0 @@ - - -# 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/FaxResponseTransmission.md similarity index 92% rename from sdks/java-v1/docs/FaxResponseFaxTransmission.md rename to sdks/java-v1/docs/FaxResponseTransmission.md index 74a4c7cf2..bb3a77d85 100644 --- a/sdks/java-v1/docs/FaxResponseFaxTransmission.md +++ b/sdks/java-v1/docs/FaxResponseTransmission.md @@ -1,6 +1,6 @@ -# FaxResponseFaxTransmission +# FaxResponseTransmission diff --git a/sdks/java-v1/docs/FaxSendRequest.md b/sdks/java-v1/docs/FaxSendRequest.md index c77fd7a0e..cd3959fde 100644 --- a/sdks/java-v1/docs/FaxSendRequest.md +++ b/sdks/java-v1/docs/FaxSendRequest.md @@ -8,11 +8,10 @@ | Name | Type | Description | Notes | |------------ | ------------- | ------------- | -------------| -| `to` | ```String``` | Fax Send To Recipient | | +| `to`*_required_ | ```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 | | +| `files` | ```List``` | Fax File to Send | | +| `fileUrls` | ```List``` | Fax File URL to Send | | | `testMode` | ```Boolean``` | API Test Mode Setting | | | `coverPageTo` | ```String``` | Fax Cover Page for Recipient | | | `coverPageFrom` | ```String``` | Fax Cover Page for Sender | | diff --git a/sdks/java-v1/docs/SubFile.md b/sdks/java-v1/docs/SubFile.md deleted file mode 100644 index 376475b8c..000000000 --- a/sdks/java-v1/docs/SubFile.md +++ /dev/null @@ -1,14 +0,0 @@ - - -# 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 index 33c0bd28c..ce101cc84 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/api/FaxApi.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/api/FaxApi.java @@ -5,8 +5,8 @@ import com.dropbox.sign.ApiResponse; import com.dropbox.sign.Configuration; import com.dropbox.sign.Pair; +import com.dropbox.sign.model.FaxGetResponse; import com.dropbox.sign.model.FaxListResponse; -import com.dropbox.sign.model.FaxResponse; import com.dropbox.sign.model.FaxSendRequest; import java.io.File; import java.util.ArrayList; @@ -56,12 +56,12 @@ public void setApiClient(ApiClient apiClient) { * @http.response.details * * - * + * * *
Status Code Description Response Headers
200 successful operation * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
204 successful operation * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
4XX failed_operation -
*/ - public void deleteFax(String faxId) throws ApiException { - deleteFaxWithHttpInfo(faxId); + public void faxDelete(String faxId) throws ApiException { + faxDeleteWithHttpInfo(faxId); } /** @@ -73,16 +73,16 @@ public void deleteFax(String faxId) throws ApiException { * @http.response.details * * - * + * * *
Status Code Description Response Headers
200 successful operation * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
204 successful operation * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
4XX failed_operation -
*/ - public ApiResponse deleteFaxWithHttpInfo(String faxId) throws ApiException { + public ApiResponse faxDeleteWithHttpInfo(String faxId) throws ApiException { // Check required parameters if (faxId == null) { throw new ApiException( - 400, "Missing the required parameter 'faxId' when calling deleteFax"); + 400, "Missing the required parameter 'faxId' when calling faxDelete"); } // Path parameters @@ -97,7 +97,7 @@ public ApiResponse deleteFaxWithHttpInfo(String faxId) throws ApiException isFileTypeFound ? "multipart/form-data" : apiClient.selectHeaderContentType(); String[] localVarAuthNames = new String[] {"api_key"}; return apiClient.invokeAPI( - "FaxApi.deleteFax", + "FaxApi.faxDelete", localVarPath, "DELETE", new ArrayList<>(), @@ -113,10 +113,10 @@ public ApiResponse deleteFaxWithHttpInfo(String faxId) throws ApiException } /** - * Get Fax. Returns information about fax + * List Fax Files. Returns list of fax files * * @param faxId Fax ID (required) - * @return FaxResponse + * @return File * @throws ApiException if fails to make API call * @http.response.details * @@ -125,15 +125,15 @@ public ApiResponse deleteFaxWithHttpInfo(String faxId) throws ApiException * *
4XX failed_operation -
*/ - public FaxResponse getFaxById(String faxId) throws ApiException { - return getFaxByIdWithHttpInfo(faxId).getData(); + public File faxFiles(String faxId) throws ApiException { + return faxFilesWithHttpInfo(faxId).getData(); } /** - * Get Fax. Returns information about fax + * List Fax Files. Returns list of fax files * * @param faxId Fax ID (required) - * @return ApiResponse<FaxResponse> + * @return ApiResponse<File> * @throws ApiException if fails to make API call * @http.response.details * @@ -142,28 +142,29 @@ public FaxResponse getFaxById(String faxId) throws ApiException { * *
4XX failed_operation -
*/ - public ApiResponse getFaxByIdWithHttpInfo(String faxId) throws ApiException { + public ApiResponse faxFilesWithHttpInfo(String faxId) throws ApiException { // Check required parameters if (faxId == null) { throw new ApiException( - 400, "Missing the required parameter 'faxId' when calling getFaxById"); + 400, "Missing the required parameter 'faxId' when calling faxFiles"); } // Path parameters String localVarPath = - "/fax/{fax_id}".replaceAll("\\{fax_id}", apiClient.escapeString(faxId.toString())); + "/fax/files/{fax_id}" + .replaceAll("\\{fax_id}", apiClient.escapeString(faxId.toString())); - String localVarAccept = apiClient.selectHeaderAccept("application/json"); + String localVarAccept = apiClient.selectHeaderAccept("application/pdf", "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() {}; + GenericType localVarReturnType = new GenericType() {}; return apiClient.invokeAPI( - "FaxApi.getFaxById", + "FaxApi.faxFiles", localVarPath, "GET", new ArrayList<>(), @@ -179,10 +180,10 @@ public ApiResponse getFaxByIdWithHttpInfo(String faxId) throws ApiE } /** - * List Fax Files. Returns list of fax files + * Get Fax. Returns information about fax * * @param faxId Fax ID (required) - * @return File + * @return FaxGetResponse * @throws ApiException if fails to make API call * @http.response.details * @@ -191,15 +192,15 @@ public ApiResponse getFaxByIdWithHttpInfo(String faxId) throws ApiE * *
4XX failed_operation -
*/ - public File getFaxFiles(String faxId) throws ApiException { - return getFaxFilesWithHttpInfo(faxId).getData(); + public FaxGetResponse faxGet(String faxId) throws ApiException { + return faxGetWithHttpInfo(faxId).getData(); } /** - * List Fax Files. Returns list of fax files + * Get Fax. Returns information about fax * * @param faxId Fax ID (required) - * @return ApiResponse<File> + * @return ApiResponse<FaxGetResponse> * @throws ApiException if fails to make API call * @http.response.details * @@ -208,29 +209,28 @@ public File getFaxFiles(String faxId) throws ApiException { * *
4XX failed_operation -
*/ - public ApiResponse getFaxFilesWithHttpInfo(String faxId) throws ApiException { + public ApiResponse faxGetWithHttpInfo(String faxId) throws ApiException { // Check required parameters if (faxId == null) { throw new ApiException( - 400, "Missing the required parameter 'faxId' when calling getFaxFiles"); + 400, "Missing the required parameter 'faxId' when calling faxGet"); } // Path parameters String localVarPath = - "/fax/files/{fax_id}" - .replaceAll("\\{fax_id}", apiClient.escapeString(faxId.toString())); + "/fax/{fax_id}".replaceAll("\\{fax_id}", apiClient.escapeString(faxId.toString())); - String localVarAccept = apiClient.selectHeaderAccept("application/pdf", "application/json"); + 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() {}; + GenericType localVarReturnType = new GenericType() {}; return apiClient.invokeAPI( - "FaxApi.getFaxFiles", + "FaxApi.faxGet", localVarPath, "GET", new ArrayList<>(), @@ -248,8 +248,8 @@ public ApiResponse getFaxFilesWithHttpInfo(String faxId) throws ApiExcepti /** * Lists Faxes. Returns properties of multiple faxes * - * @param page Page (required) - * @param pageSize Page size (required) + * @param page Page (optional, default to 1) + * @param pageSize Page size (optional, default to 20) * @return FaxListResponse * @throws ApiException if fails to make API call * @http.response.details @@ -259,15 +259,53 @@ public ApiResponse getFaxFilesWithHttpInfo(String faxId) throws ApiExcepti * 4XX failed_operation - * */ - public FaxListResponse listFaxes(Integer page, Integer pageSize) throws ApiException { - return listFaxesWithHttpInfo(page, pageSize).getData(); + public FaxListResponse faxList(Integer page, Integer pageSize) throws ApiException { + return faxListWithHttpInfo(page, pageSize).getData(); + } + + /** + * @see FaxApi#faxList(Integer, Integer) + */ + public FaxListResponse faxList() throws ApiException { + Integer page = 1; + Integer pageSize = 20; + + return faxListWithHttpInfo(page, pageSize).getData(); + } + + /** + * @see FaxApi#faxListWithHttpInfo(Integer, Integer) + */ + public ApiResponse faxListWithHttpInfo() throws ApiException { + Integer page = 1; + Integer pageSize = 20; + + return faxListWithHttpInfo(page, pageSize); + } + + /** + * @see FaxApi#faxList(Integer, Integer) + */ + public FaxListResponse faxList(Integer page) throws ApiException { + Integer pageSize = 20; + + return faxListWithHttpInfo(page, pageSize).getData(); + } + + /** + * @see FaxApi#faxListWithHttpInfo(Integer, Integer) + */ + public ApiResponse faxListWithHttpInfo(Integer page) throws ApiException { + Integer pageSize = 20; + + return faxListWithHttpInfo(page, pageSize); } /** * Lists Faxes. Returns properties of multiple faxes * - * @param page Page (required) - * @param pageSize Page size (required) + * @param page Page (optional, default to 1) + * @param pageSize Page size (optional, default to 20) * @return ApiResponse<FaxListResponse> * @throws ApiException if fails to make API call * @http.response.details @@ -277,19 +315,15 @@ public FaxListResponse listFaxes(Integer page, Integer pageSize) throws ApiExcep * 4XX failed_operation - * */ - public ApiResponse listFaxesWithHttpInfo(Integer page, Integer pageSize) + public ApiResponse faxListWithHttpInfo(Integer page, Integer pageSize) throws ApiException { - // Check required parameters if (page == null) { - throw new ApiException( - 400, "Missing the required parameter 'page' when calling listFaxes"); + page = 1; } if (pageSize == null) { - throw new ApiException( - 400, "Missing the required parameter 'pageSize' when calling listFaxes"); + pageSize = 20; } - // Query parameters List localVarQueryParams = new ArrayList<>(apiClient.parameterToPairs("", "page", page)); @@ -304,7 +338,7 @@ public ApiResponse listFaxesWithHttpInfo(Integer page, Integer String[] localVarAuthNames = new String[] {"api_key"}; GenericType localVarReturnType = new GenericType() {}; return apiClient.invokeAPI( - "FaxApi.listFaxes", + "FaxApi.faxList", "/fax/list", "GET", localVarQueryParams, @@ -323,7 +357,7 @@ public ApiResponse listFaxesWithHttpInfo(Integer page, Integer * Send Fax. Action to prepare and send a fax * * @param faxSendRequest (required) - * @return FaxResponse + * @return FaxGetResponse * @throws ApiException if fails to make API call * @http.response.details * @@ -332,15 +366,15 @@ public ApiResponse listFaxesWithHttpInfo(Integer page, Integer * *
4XX failed_operation -
*/ - public FaxResponse sendFax(FaxSendRequest faxSendRequest) throws ApiException { - return sendFaxWithHttpInfo(faxSendRequest).getData(); + public FaxGetResponse faxSend(FaxSendRequest faxSendRequest) throws ApiException { + return faxSendWithHttpInfo(faxSendRequest).getData(); } /** * Send Fax. Action to prepare and send a fax * * @param faxSendRequest (required) - * @return ApiResponse<FaxResponse> + * @return ApiResponse<FaxGetResponse> * @throws ApiException if fails to make API call * @http.response.details * @@ -349,13 +383,13 @@ public FaxResponse sendFax(FaxSendRequest faxSendRequest) throws ApiException { * *
4XX failed_operation -
*/ - public ApiResponse sendFaxWithHttpInfo(FaxSendRequest faxSendRequest) + public ApiResponse faxSendWithHttpInfo(FaxSendRequest faxSendRequest) throws ApiException { // Check required parameters if (faxSendRequest == null) { throw new ApiException( - 400, "Missing the required parameter 'faxSendRequest' when calling sendFax"); + 400, "Missing the required parameter 'faxSendRequest' when calling faxSend"); } String localVarAccept = apiClient.selectHeaderAccept("application/json"); @@ -365,11 +399,12 @@ public ApiResponse sendFaxWithHttpInfo(FaxSendRequest faxSendReques String localVarContentType = isFileTypeFound ? "multipart/form-data" - : apiClient.selectHeaderContentType("application/json"); + : apiClient.selectHeaderContentType( + "application/json", "multipart/form-data"); String[] localVarAuthNames = new String[] {"api_key"}; - GenericType localVarReturnType = new GenericType() {}; + GenericType localVarReturnType = new GenericType() {}; return apiClient.invokeAPI( - "FaxApi.sendFax", + "FaxApi.faxSend", "/fax/send", "POST", new ArrayList<>(), diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/model/FaxGetResponse.java b/sdks/java-v1/src/main/java/com/dropbox/sign/model/FaxGetResponse.java new file mode 100644 index 000000000..c4f86dd50 --- /dev/null +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/model/FaxGetResponse.java @@ -0,0 +1,221 @@ +/* + * 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; + +/** FaxGetResponse */ +@JsonPropertyOrder({FaxGetResponse.JSON_PROPERTY_FAX, FaxGetResponse.JSON_PROPERTY_WARNINGS}) +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.8.0") +@JsonIgnoreProperties(ignoreUnknown = true) +public class FaxGetResponse { + public static final String JSON_PROPERTY_FAX = "fax"; + private FaxResponse fax; + + public static final String JSON_PROPERTY_WARNINGS = "warnings"; + private List warnings = null; + + public FaxGetResponse() {} + + /** + * Attempt to instantiate and hydrate a new instance of this class + * + * @param jsonData String of JSON data representing target object + */ + public static FaxGetResponse init(String jsonData) throws Exception { + return new ObjectMapper().readValue(jsonData, FaxGetResponse.class); + } + + public static FaxGetResponse init(HashMap data) throws Exception { + return new ObjectMapper() + .readValue(new ObjectMapper().writeValueAsString(data), FaxGetResponse.class); + } + + public FaxGetResponse fax(FaxResponse fax) { + this.fax = fax; + return this; + } + + /** + * Get fax + * + * @return fax + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_FAX) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public FaxResponse getFax() { + return fax; + } + + @JsonProperty(JSON_PROPERTY_FAX) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setFax(FaxResponse fax) { + this.fax = fax; + } + + public FaxGetResponse warnings(List warnings) { + this.warnings = warnings; + return this; + } + + public FaxGetResponse addWarningsItem(WarningResponse warningsItem) { + if (this.warnings == null) { + this.warnings = new ArrayList<>(); + } + this.warnings.add(warningsItem); + return this; + } + + /** + * A list of warnings. + * + * @return warnings + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_WARNINGS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getWarnings() { + return warnings; + } + + @JsonProperty(JSON_PROPERTY_WARNINGS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setWarnings(List warnings) { + this.warnings = warnings; + } + + /** Return true if this FaxGetResponse object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + FaxGetResponse faxGetResponse = (FaxGetResponse) o; + return Objects.equals(this.fax, faxGetResponse.fax) + && Objects.equals(this.warnings, faxGetResponse.warnings); + } + + @Override + public int hashCode() { + return Objects.hash(fax, warnings); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class FaxGetResponse {\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/FaxListResponse.java b/sdks/java-v1/src/main/java/com/dropbox/sign/model/FaxListResponse.java index 606b204b9..7da2189b9 100644 --- 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 @@ -33,7 +33,7 @@ @JsonIgnoreProperties(ignoreUnknown = true) public class FaxListResponse { public static final String JSON_PROPERTY_FAXES = "faxes"; - private List faxes = new ArrayList<>(); + private List faxes = new ArrayList<>(); public static final String JSON_PROPERTY_LIST_INFO = "list_info"; private ListInfoResponse listInfo; @@ -54,12 +54,12 @@ public static FaxListResponse init(HashMap data) throws Exception { .readValue(new ObjectMapper().writeValueAsString(data), FaxListResponse.class); } - public FaxListResponse faxes(List faxes) { + public FaxListResponse faxes(List faxes) { this.faxes = faxes; return this; } - public FaxListResponse addFaxesItem(FaxResponseFax faxesItem) { + public FaxListResponse addFaxesItem(FaxResponse faxesItem) { if (this.faxes == null) { this.faxes = new ArrayList<>(); } @@ -75,13 +75,13 @@ public FaxListResponse addFaxesItem(FaxResponseFax faxesItem) { @javax.annotation.Nonnull @JsonProperty(JSON_PROPERTY_FAXES) @JsonInclude(value = JsonInclude.Include.ALWAYS) - public List getFaxes() { + public List getFaxes() { return faxes; } @JsonProperty(JSON_PROPERTY_FAXES) @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setFaxes(List faxes) { + public void setFaxes(List faxes) { this.faxes = faxes; } diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/model/FaxResponse.java b/sdks/java-v1/src/main/java/com/dropbox/sign/model/FaxResponse.java index 5ccf3f755..3c8b7c968 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/model/FaxResponse.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/model/FaxResponse.java @@ -26,17 +26,52 @@ import java.util.Objects; /** FaxResponse */ -@JsonPropertyOrder({FaxResponse.JSON_PROPERTY_FAX, FaxResponse.JSON_PROPERTY_WARNINGS}) +@JsonPropertyOrder({ + FaxResponse.JSON_PROPERTY_FAX_ID, + FaxResponse.JSON_PROPERTY_TITLE, + FaxResponse.JSON_PROPERTY_ORIGINAL_TITLE, + FaxResponse.JSON_PROPERTY_SUBJECT, + FaxResponse.JSON_PROPERTY_MESSAGE, + FaxResponse.JSON_PROPERTY_METADATA, + FaxResponse.JSON_PROPERTY_CREATED_AT, + FaxResponse.JSON_PROPERTY_FROM, + FaxResponse.JSON_PROPERTY_TRANSMISSIONS, + FaxResponse.JSON_PROPERTY_FILES_URL +}) @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_FAX_ID = "fax_id"; + private String faxId; - public static final String JSON_PROPERTY_WARNINGS = "warnings"; - private List warnings = null; + 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 FaxResponse() {} @@ -54,57 +89,232 @@ public static FaxResponse init(HashMap data) throws Exception { .readValue(new ObjectMapper().writeValueAsString(data), FaxResponse.class); } - public FaxResponse fax(FaxResponseFax fax) { - this.fax = fax; + public FaxResponse 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 FaxResponse 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 FaxResponse 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 FaxResponse 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 FaxResponse 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 FaxResponse 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 FaxResponse 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 FaxResponse from(String from) { + this.from = from; return this; } /** - * Get fax + * Fax Sender Email * - * @return fax + * @return from */ - @javax.annotation.Nonnull - @JsonProperty(JSON_PROPERTY_FAX) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public FaxResponseFax getFax() { - return fax; + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_FROM) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getFrom() { + return from; } - @JsonProperty(JSON_PROPERTY_FAX) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setFax(FaxResponseFax fax) { - this.fax = fax; + @JsonProperty(JSON_PROPERTY_FROM) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setFrom(String from) { + this.from = from; } - public FaxResponse warnings(List warnings) { - this.warnings = warnings; + public FaxResponse transmissions(List transmissions) { + this.transmissions = transmissions; return this; } - public FaxResponse addWarningsItem(WarningResponse warningsItem) { - if (this.warnings == null) { - this.warnings = new ArrayList<>(); + public FaxResponse addTransmissionsItem(FaxResponseTransmission transmissionsItem) { + if (this.transmissions == null) { + this.transmissions = new ArrayList<>(); } - this.warnings.add(warningsItem); + this.transmissions.add(transmissionsItem); return this; } /** - * A list of warnings. + * Fax Transmissions List * - * @return warnings + * @return transmissions */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_WARNINGS) + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_TRANSMISSIONS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public List getWarnings() { - return warnings; + public List getTransmissions() { + return transmissions; } - @JsonProperty(JSON_PROPERTY_WARNINGS) + @JsonProperty(JSON_PROPERTY_TRANSMISSIONS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setWarnings(List warnings) { - this.warnings = warnings; + public void setTransmissions(List transmissions) { + this.transmissions = transmissions; + } + + public FaxResponse 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 FaxResponse object is equal to o. */ @@ -117,21 +327,47 @@ public boolean equals(Object o) { return false; } FaxResponse faxResponse = (FaxResponse) o; - return Objects.equals(this.fax, faxResponse.fax) - && Objects.equals(this.warnings, faxResponse.warnings); + return Objects.equals(this.faxId, faxResponse.faxId) + && Objects.equals(this.title, faxResponse.title) + && Objects.equals(this.originalTitle, faxResponse.originalTitle) + && Objects.equals(this.subject, faxResponse.subject) + && Objects.equals(this.message, faxResponse.message) + && Objects.equals(this.metadata, faxResponse.metadata) + && Objects.equals(this.createdAt, faxResponse.createdAt) + && Objects.equals(this.from, faxResponse.from) + && Objects.equals(this.transmissions, faxResponse.transmissions) + && Objects.equals(this.filesUrl, faxResponse.filesUrl); } @Override public int hashCode() { - return Objects.hash(fax, warnings); + return Objects.hash( + faxId, + title, + originalTitle, + subject, + message, + metadata, + createdAt, + from, + transmissions, + filesUrl); } @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(" 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(); } @@ -140,40 +376,192 @@ public Map createFormData() throws ApiException { Map map = new HashMap<>(); boolean fileTypeFound = false; try { - if (fax != null) { - if (isFileTypeOrListOfFiles(fax)) { + 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 (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)); + 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("fax", JSON.getDefault().getMapper().writeValueAsString(fax)); + map.put( + "transmissions", + JSON.getDefault().getMapper().writeValueAsString(transmissions)); } } - if (warnings != null) { - if (isFileTypeOrListOfFiles(warnings)) { + if (filesUrl != null) { + if (isFileTypeOrListOfFiles(filesUrl)) { 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)); + 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("warnings", JSON.getDefault().getMapper().writeValueAsString(warnings)); + map.put( + "files_url", + JSON.getDefault().getMapper().writeValueAsString(filesUrl)); } } } catch (Exception e) { 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 deleted file mode 100644 index 23dc3dbcb..000000000 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/model/FaxResponseFax.java +++ /dev/null @@ -1,609 +0,0 @@ -/* - * 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/FaxResponseTransmission.java similarity index 87% rename from sdks/java-v1/src/main/java/com/dropbox/sign/model/FaxResponseFaxTransmission.java rename to sdks/java-v1/src/main/java/com/dropbox/sign/model/FaxResponseTransmission.java index da6b421ac..05954e5f7 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/model/FaxResponseFaxTransmission.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/model/FaxResponseTransmission.java @@ -23,18 +23,18 @@ import java.util.Map; import java.util.Objects; -/** FaxResponseFaxTransmission */ +/** FaxResponseTransmission */ @JsonPropertyOrder({ - FaxResponseFaxTransmission.JSON_PROPERTY_RECIPIENT, - FaxResponseFaxTransmission.JSON_PROPERTY_SENDER, - FaxResponseFaxTransmission.JSON_PROPERTY_STATUS_CODE, - FaxResponseFaxTransmission.JSON_PROPERTY_SENT_AT + FaxResponseTransmission.JSON_PROPERTY_RECIPIENT, + FaxResponseTransmission.JSON_PROPERTY_SENDER, + FaxResponseTransmission.JSON_PROPERTY_STATUS_CODE, + FaxResponseTransmission.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 class FaxResponseTransmission { public static final String JSON_PROPERTY_RECIPIENT = "recipient"; private String recipient; @@ -47,25 +47,24 @@ public class FaxResponseFaxTransmission { public static final String JSON_PROPERTY_SENT_AT = "sent_at"; private Integer sentAt; - public FaxResponseFaxTransmission() {} + public FaxResponseTransmission() {} /** * 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 FaxResponseTransmission init(String jsonData) throws Exception { + return new ObjectMapper().readValue(jsonData, FaxResponseTransmission.class); } - public static FaxResponseFaxTransmission init(HashMap data) throws Exception { + public static FaxResponseTransmission init(HashMap data) throws Exception { return new ObjectMapper() .readValue( - new ObjectMapper().writeValueAsString(data), - FaxResponseFaxTransmission.class); + new ObjectMapper().writeValueAsString(data), FaxResponseTransmission.class); } - public FaxResponseFaxTransmission recipient(String recipient) { + public FaxResponseTransmission recipient(String recipient) { this.recipient = recipient; return this; } @@ -87,7 +86,7 @@ public void setRecipient(String recipient) { this.recipient = recipient; } - public FaxResponseFaxTransmission sender(String sender) { + public FaxResponseTransmission sender(String sender) { this.sender = sender; return this; } @@ -109,7 +108,7 @@ public void setSender(String sender) { this.sender = sender; } - public FaxResponseFaxTransmission statusCode(String statusCode) { + public FaxResponseTransmission statusCode(String statusCode) { this.statusCode = statusCode; return this; } @@ -131,7 +130,7 @@ public void setStatusCode(String statusCode) { this.statusCode = statusCode; } - public FaxResponseFaxTransmission sentAt(Integer sentAt) { + public FaxResponseTransmission sentAt(Integer sentAt) { this.sentAt = sentAt; return this; } @@ -153,7 +152,7 @@ public void setSentAt(Integer sentAt) { this.sentAt = sentAt; } - /** Return true if this FaxResponseFaxTransmission object is equal to o. */ + /** Return true if this FaxResponseTransmission object is equal to o. */ @Override public boolean equals(Object o) { if (this == o) { @@ -162,11 +161,11 @@ public boolean equals(Object o) { 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); + FaxResponseTransmission faxResponseTransmission = (FaxResponseTransmission) o; + return Objects.equals(this.recipient, faxResponseTransmission.recipient) + && Objects.equals(this.sender, faxResponseTransmission.sender) + && Objects.equals(this.statusCode, faxResponseTransmission.statusCode) + && Objects.equals(this.sentAt, faxResponseTransmission.sentAt); } @Override @@ -177,7 +176,7 @@ public int hashCode() { @Override public String toString() { StringBuilder sb = new StringBuilder(); - sb.append("class FaxResponseFaxTransmission {\n"); + sb.append("class FaxResponseTransmission {\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"); 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 index a5b560f2b..6e1d4c74b 100644 --- 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 @@ -19,6 +19,7 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; import com.fasterxml.jackson.databind.ObjectMapper; +import java.io.File; import java.util.ArrayList; import java.util.HashMap; import java.util.List; @@ -29,9 +30,8 @@ @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_FILES, + FaxSendRequest.JSON_PROPERTY_FILE_URLS, FaxSendRequest.JSON_PROPERTY_TEST_MODE, FaxSendRequest.JSON_PROPERTY_COVER_PAGE_TO, FaxSendRequest.JSON_PROPERTY_COVER_PAGE_FROM, @@ -49,17 +49,14 @@ public class FaxSendRequest { 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_FILES = "files"; + private List files = 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_FILE_URLS = "file_urls"; + private List fileUrls = null; public static final String JSON_PROPERTY_TEST_MODE = "test_mode"; - private Boolean testMode; + private Boolean testMode = false; public static final String JSON_PROPERTY_COVER_PAGE_TO = "cover_page_to"; private String coverPageTo; @@ -99,14 +96,15 @@ public FaxSendRequest to(String to) { * * @return to */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_TO) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_TO) + @JsonInclude(value = JsonInclude.Include.ALWAYS) public String getTo() { return to; } @JsonProperty(JSON_PROPERTY_TO) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) public void setTo(String to) { this.to = to; } @@ -133,94 +131,64 @@ public void setFrom(String from) { this.from = from; } - public FaxSendRequest _file(List _file) { - this._file = _file; + public FaxSendRequest files(List files) { + this.files = files; return this; } - public FaxSendRequest addFileItem(SubFile _fileItem) { - if (this._file == null) { - this._file = new ArrayList<>(); + public FaxSendRequest addFilesItem(File filesItem) { + if (this.files == null) { + this.files = new ArrayList<>(); } - this._file.add(_fileItem); + this.files.add(filesItem); return this; } /** * Fax File to Send * - * @return _file + * @return files */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_FILE) + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_FILES) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public List getFile() { - return _file; + public List getFiles() { + return files; } - @JsonProperty(JSON_PROPERTY_FILE) + @JsonProperty(JSON_PROPERTY_FILES) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setFile(List _file) { - this._file = _file; + public void setFiles(List files) { + this.files = files; } - public FaxSendRequest fileUrl(List fileUrl) { - this.fileUrl = fileUrl; + public FaxSendRequest fileUrls(List fileUrls) { + this.fileUrls = fileUrls; return this; } - public FaxSendRequest addFileUrlItem(String fileUrlItem) { - if (this.fileUrl == null) { - this.fileUrl = new ArrayList<>(); + public FaxSendRequest addFileUrlsItem(String fileUrlsItem) { + if (this.fileUrls == null) { + this.fileUrls = new ArrayList<>(); } - this.fileUrl.add(fileUrlItem); + this.fileUrls.add(fileUrlsItem); return this; } /** * Fax File URL to Send * - * @return fileUrl + * @return fileUrls */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_FILE_URL) + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_FILE_URLS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public List getFileUrl() { - return fileUrl; + public List getFileUrls() { + return fileUrls; } - @JsonProperty(JSON_PROPERTY_FILE_URL) + @JsonProperty(JSON_PROPERTY_FILE_URLS) @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 void setFileUrls(List fileUrls) { + this.fileUrls = fileUrls; } public FaxSendRequest testMode(Boolean testMode) { @@ -345,9 +313,8 @@ public boolean equals(Object o) { 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.files, faxSendRequest.files) + && Objects.equals(this.fileUrls, faxSendRequest.fileUrls) && Objects.equals(this.testMode, faxSendRequest.testMode) && Objects.equals(this.coverPageTo, faxSendRequest.coverPageTo) && Objects.equals(this.coverPageFrom, faxSendRequest.coverPageFrom) @@ -360,9 +327,8 @@ public int hashCode() { return Objects.hash( to, from, - _file, - fileUrl, - fileUrlNames, + files, + fileUrls, testMode, coverPageTo, coverPageFrom, @@ -376,9 +342,8 @@ public String toString() { 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(" files: ").append(toIndentedString(files)).append("\n"); + sb.append(" fileUrls: ").append(toIndentedString(fileUrls)).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"); @@ -428,60 +393,42 @@ public Map createFormData() throws ApiException { 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)) { + if (files != null) { + if (isFileTypeOrListOfFiles(files)) { 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)); + if (files.getClass().equals(java.io.File.class) + || files.getClass().equals(Integer.class) + || files.getClass().equals(String.class) + || files.getClass().isEnum()) { + map.put("files", files); + } else if (isListOfFile(files)) { + for (int i = 0; i < getListSize(files); i++) { + map.put("files[" + i + "]", getFromList(files, i)); } } else { - map.put("file_url", JSON.getDefault().getMapper().writeValueAsString(fileUrl)); + map.put("files", JSON.getDefault().getMapper().writeValueAsString(files)); } } - if (fileUrlNames != null) { - if (isFileTypeOrListOfFiles(fileUrlNames)) { + if (fileUrls != null) { + if (isFileTypeOrListOfFiles(fileUrls)) { 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)); + if (fileUrls.getClass().equals(java.io.File.class) + || fileUrls.getClass().equals(Integer.class) + || fileUrls.getClass().equals(String.class) + || fileUrls.getClass().isEnum()) { + map.put("file_urls", fileUrls); + } else if (isListOfFile(fileUrls)) { + for (int i = 0; i < getListSize(fileUrls); i++) { + map.put("file_urls[" + i + "]", getFromList(fileUrls, i)); } } else { map.put( - "file_url_names", - JSON.getDefault().getMapper().writeValueAsString(fileUrlNames)); + "file_urls", + JSON.getDefault().getMapper().writeValueAsString(fileUrls)); } } if (testMode != null) { 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 deleted file mode 100644 index dc4e6c6ba..000000000 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/model/SubFile.java +++ /dev/null @@ -1,165 +0,0 @@ -/* - * 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 61d39c288..ea6944786 100644 --- a/sdks/java-v2/README.md +++ b/sdks/java-v2/README.md @@ -153,11 +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 +*FaxApi* | [**faxDelete**](docs/FaxApi.md#faxDelete) | **DELETE** /fax/{fax_id} | Delete Fax +*FaxApi* | [**faxFiles**](docs/FaxApi.md#faxFiles) | **GET** /fax/files/{fax_id} | List Fax Files +*FaxApi* | [**faxGet**](docs/FaxApi.md#faxGet) | **GET** /fax/{fax_id} | Get Fax +*FaxApi* | [**faxList**](docs/FaxApi.md#faxList) | **GET** /fax/list | Lists Faxes +*FaxApi* | [**faxSend**](docs/FaxApi.md#faxSend) | **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 @@ -247,6 +247,7 @@ Class | Method | HTTP request | Description - [EventCallbackRequest](docs/EventCallbackRequest.md) - [EventCallbackRequestEvent](docs/EventCallbackRequestEvent.md) - [EventCallbackRequestEventMetadata](docs/EventCallbackRequestEventMetadata.md) + - [FaxGetResponse](docs/FaxGetResponse.md) - [FaxLineAddUserRequest](docs/FaxLineAddUserRequest.md) - [FaxLineAreaCodeGetCountryEnum](docs/FaxLineAreaCodeGetCountryEnum.md) - [FaxLineAreaCodeGetProvinceEnum](docs/FaxLineAreaCodeGetProvinceEnum.md) @@ -260,8 +261,7 @@ Class | Method | HTTP request | Description - [FaxLineResponseFaxLine](docs/FaxLineResponseFaxLine.md) - [FaxListResponse](docs/FaxListResponse.md) - [FaxResponse](docs/FaxResponse.md) - - [FaxResponseFax](docs/FaxResponseFax.md) - - [FaxResponseFaxTransmission](docs/FaxResponseFaxTransmission.md) + - [FaxResponseTransmission](docs/FaxResponseTransmission.md) - [FaxSendRequest](docs/FaxSendRequest.md) - [FileResponse](docs/FileResponse.md) - [FileResponseDataUri](docs/FileResponseDataUri.md) @@ -307,7 +307,6 @@ 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 index f917f4c3e..1799fb847 100644 --- a/sdks/java-v2/docs/FaxApi.md +++ b/sdks/java-v2/docs/FaxApi.md @@ -4,17 +4,17 @@ 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 +[**faxDelete**](FaxApi.md#faxDelete) | **DELETE** /fax/{fax_id} | Delete Fax +[**faxFiles**](FaxApi.md#faxFiles) | **GET** /fax/files/{fax_id} | List Fax Files +[**faxGet**](FaxApi.md#faxGet) | **GET** /fax/{fax_id} | Get Fax +[**faxList**](FaxApi.md#faxList) | **GET** /fax/list | Lists Faxes +[**faxSend**](FaxApi.md#faxSend) | **POST** /fax/send | Send Fax -## deleteFax +## faxDelete -> deleteFax(faxId) +> faxDelete(faxId) Delete Fax @@ -36,10 +36,10 @@ public class Example { var apiClient = Configuration.getDefaultApiClient() .setApiKey("YOUR_API_KEY"); - var faxAPi = new FaxApi(apiClient); + var faxApi = new FaxApi(apiClient); try { - faxAPi.deleteFax("[FAX_NUMBER]"); + faxApi.deleteFax("[FAX_NUMBER]"); } catch (ApiException e) { System.err.println("Status code: " + e.getCode()); System.err.println("Reason: " + e.getResponseBody()); @@ -74,17 +74,17 @@ null (empty response body) ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -| **200** | successful operation | * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
| +| **204** | successful operation | * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
| | **4XX** | failed_operation | - | -## getFaxById +## faxFiles -> FaxResponse getFaxById(faxId) +> File faxFiles(faxId) -Get Fax +List Fax Files -Returns information about fax +Returns list of fax files ### Example @@ -95,6 +95,8 @@ 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() @@ -105,10 +107,8 @@ public class Example { var faxId = "fa5c8a0b0f492d768749333ad6fcc214c111e967"; try { - FaxGetResponse result = faxApi.getFaxById(faxId); - System.out.println(result); + faxApi.getFaxFiles(faxId); } 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()); @@ -128,7 +128,7 @@ public class Example { ### Return type -[**FaxResponse**](FaxResponse.md) +[**File**](File.md) ### Authorization @@ -137,7 +137,7 @@ public class Example { ### HTTP request headers - **Content-Type**: Not defined -- **Accept**: application/json +- **Accept**: application/pdf, application/json ### HTTP response details | Status code | Description | Response headers | @@ -146,13 +146,13 @@ public class Example { | **4XX** | failed_operation | - | -## getFaxFiles +## faxGet -> File getFaxFiles(faxId) +> FaxGetResponse faxGet(faxId) -List Fax Files +Get Fax -Returns list of fax files +Returns information about fax ### Example @@ -163,8 +163,6 @@ 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() @@ -175,8 +173,10 @@ public class Example { var faxId = "fa5c8a0b0f492d768749333ad6fcc214c111e967"; try { - faxApi.getFaxFiles(faxId); + 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()); @@ -196,7 +196,7 @@ public class Example { ### Return type -[**File**](File.md) +[**FaxGetResponse**](FaxGetResponse.md) ### Authorization @@ -205,7 +205,7 @@ public class Example { ### HTTP request headers - **Content-Type**: Not defined -- **Accept**: application/pdf, application/json +- **Accept**: application/json ### HTTP response details | Status code | Description | Response headers | @@ -214,9 +214,9 @@ public class Example { | **4XX** | failed_operation | - | -## listFaxes +## faxList -> FaxListResponse listFaxes(page, pageSize) +> FaxListResponse faxList(page, pageSize) Lists Faxes @@ -261,8 +261,8 @@ public class Example { | Name | Type | Description | Notes | |------------- | ------------- | ------------- | -------------| - **page** | **Integer**| Page | - **pageSize** | **Integer**| Page size | + **page** | **Integer**| Page | [optional] [default to 1] + **pageSize** | **Integer**| Page size | [optional] [default to 20] ### Return type @@ -284,9 +284,9 @@ public class Example { | **4XX** | failed_operation | - | -## sendFax +## faxSend -> FaxResponse sendFax(faxSendRequest) +> FaxGetResponse faxSend(faxSendRequest) Send Fax @@ -337,7 +337,7 @@ public class Example { ### Return type -[**FaxResponse**](FaxResponse.md) +[**FaxGetResponse**](FaxGetResponse.md) ### Authorization @@ -345,7 +345,7 @@ public class Example { ### HTTP request headers -- **Content-Type**: application/json +- **Content-Type**: application/json, multipart/form-data - **Accept**: application/json ### HTTP response details diff --git a/sdks/java-v2/docs/FaxGetResponse.md b/sdks/java-v2/docs/FaxGetResponse.md new file mode 100644 index 000000000..cc9dc6e57 --- /dev/null +++ b/sdks/java-v2/docs/FaxGetResponse.md @@ -0,0 +1,15 @@ + + +# FaxGetResponse + + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +| `fax`*_required_ | [```FaxResponse```](FaxResponse.md) | | | +| `warnings` | [```List```](WarningResponse.md) | A list of warnings. | | + + + diff --git a/sdks/java-v2/docs/FaxListResponse.md b/sdks/java-v2/docs/FaxListResponse.md index 22e92f955..f25379a27 100644 --- a/sdks/java-v2/docs/FaxListResponse.md +++ b/sdks/java-v2/docs/FaxListResponse.md @@ -8,7 +8,7 @@ | Name | Type | Description | Notes | |------------ | ------------- | ------------- | -------------| -| `faxes`*_required_ | [```List```](FaxResponseFax.md) | | | +| `faxes`*_required_ | [```List```](FaxResponse.md) | | | | `listInfo`*_required_ | [```ListInfoResponse```](ListInfoResponse.md) | | | diff --git a/sdks/java-v2/docs/FaxResponse.md b/sdks/java-v2/docs/FaxResponse.md index 76e4a451f..6fe6fc0f3 100644 --- a/sdks/java-v2/docs/FaxResponse.md +++ b/sdks/java-v2/docs/FaxResponse.md @@ -8,8 +8,16 @@ | Name | Type | Description | Notes | |------------ | ------------- | ------------- | -------------| -| `fax`*_required_ | [```FaxResponseFax```](FaxResponseFax.md) | | | -| `warnings` | [```List```](WarningResponse.md) | A list of warnings. | | +| `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```](FaxResponseTransmission.md) | Fax Transmissions List | | +| `filesUrl` | ```String``` | Fax Files URL | | diff --git a/sdks/java-v2/docs/FaxResponseFax.md b/sdks/java-v2/docs/FaxResponseFax.md deleted file mode 100644 index ef62af24a..000000000 --- a/sdks/java-v2/docs/FaxResponseFax.md +++ /dev/null @@ -1,23 +0,0 @@ - - -# 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/FaxResponseTransmission.md similarity index 92% rename from sdks/java-v2/docs/FaxResponseFaxTransmission.md rename to sdks/java-v2/docs/FaxResponseTransmission.md index 74a4c7cf2..bb3a77d85 100644 --- a/sdks/java-v2/docs/FaxResponseFaxTransmission.md +++ b/sdks/java-v2/docs/FaxResponseTransmission.md @@ -1,6 +1,6 @@ -# FaxResponseFaxTransmission +# FaxResponseTransmission diff --git a/sdks/java-v2/docs/FaxSendRequest.md b/sdks/java-v2/docs/FaxSendRequest.md index c77fd7a0e..cd3959fde 100644 --- a/sdks/java-v2/docs/FaxSendRequest.md +++ b/sdks/java-v2/docs/FaxSendRequest.md @@ -8,11 +8,10 @@ | Name | Type | Description | Notes | |------------ | ------------- | ------------- | -------------| -| `to` | ```String``` | Fax Send To Recipient | | +| `to`*_required_ | ```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 | | +| `files` | ```List``` | Fax File to Send | | +| `fileUrls` | ```List``` | Fax File URL to Send | | | `testMode` | ```Boolean``` | API Test Mode Setting | | | `coverPageTo` | ```String``` | Fax Cover Page for Recipient | | | `coverPageFrom` | ```String``` | Fax Cover Page for Sender | | diff --git a/sdks/java-v2/docs/SubFile.md b/sdks/java-v2/docs/SubFile.md deleted file mode 100644 index 376475b8c..000000000 --- a/sdks/java-v2/docs/SubFile.md +++ /dev/null @@ -1,14 +0,0 @@ - - -# 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 index 20435dd12..e010c8323 100644 --- a/sdks/java-v2/src/main/java/com/dropbox/sign/api/FaxApi.java +++ b/sdks/java-v2/src/main/java/com/dropbox/sign/api/FaxApi.java @@ -9,8 +9,8 @@ import jakarta.ws.rs.core.GenericType; import com.dropbox.sign.model.ErrorResponse; +import com.dropbox.sign.model.FaxGetResponse; import com.dropbox.sign.model.FaxListResponse; -import com.dropbox.sign.model.FaxResponse; import com.dropbox.sign.model.FaxSendRequest; import java.io.File; @@ -58,12 +58,12 @@ public void setApiClient(ApiClient apiClient) { * @http.response.details - +
Status Code Description Response Headers
200 successful operation * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
204 successful operation * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
4XX failed_operation -
*/ - public void deleteFax(String faxId) throws ApiException { - deleteFaxWithHttpInfo(faxId); + public void faxDelete(String faxId) throws ApiException { + faxDeleteWithHttpInfo(faxId); } @@ -76,15 +76,15 @@ public void deleteFax(String faxId) throws ApiException { * @http.response.details - +
Status Code Description Response Headers
200 successful operation * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
204 successful operation * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
4XX failed_operation -
*/ - public ApiResponse deleteFaxWithHttpInfo(String faxId) throws ApiException { + public ApiResponse faxDeleteWithHttpInfo(String faxId) throws ApiException { // Check required parameters if (faxId == null) { - throw new ApiException(400, "Missing the required parameter 'faxId' when calling deleteFax"); + throw new ApiException(400, "Missing the required parameter 'faxId' when calling faxDelete"); } // Path parameters @@ -98,7 +98,7 @@ public ApiResponse deleteFaxWithHttpInfo(String faxId) throws ApiException String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType(); String[] localVarAuthNames = new String[] {"api_key"}; return apiClient.invokeAPI( - "FaxApi.deleteFax", + "FaxApi.faxDelete", localVarPath, "DELETE", new ArrayList<>(), @@ -114,10 +114,10 @@ public ApiResponse deleteFaxWithHttpInfo(String faxId) throws ApiException ); } /** - * Get Fax. - * Returns information about fax + * List Fax Files. + * Returns list of fax files * @param faxId Fax ID (required) - * @return FaxResponse + * @return File * @throws ApiException if fails to make API call * @http.response.details @@ -126,16 +126,16 @@ public ApiResponse deleteFaxWithHttpInfo(String faxId) throws ApiException
4XX failed_operation -
*/ - public FaxResponse getFaxById(String faxId) throws ApiException { - return getFaxByIdWithHttpInfo(faxId).getData(); + public File faxFiles(String faxId) throws ApiException { + return faxFilesWithHttpInfo(faxId).getData(); } /** - * Get Fax. - * Returns information about fax + * List Fax Files. + * Returns list of fax files * @param faxId Fax ID (required) - * @return ApiResponse<FaxResponse> + * @return ApiResponse<File> * @throws ApiException if fails to make API call * @http.response.details @@ -144,26 +144,26 @@ public FaxResponse getFaxById(String faxId) throws ApiException {
4XX failed_operation -
*/ - public ApiResponse getFaxByIdWithHttpInfo(String faxId) throws ApiException { + public ApiResponse faxFilesWithHttpInfo(String faxId) throws ApiException { // Check required parameters if (faxId == null) { - throw new ApiException(400, "Missing the required parameter 'faxId' when calling getFaxById"); + throw new ApiException(400, "Missing the required parameter 'faxId' when calling faxFiles"); } // Path parameters - String localVarPath = "/fax/{fax_id}" + String localVarPath = "/fax/files/{fax_id}" .replaceAll("\\{fax_id}", apiClient.escapeString(faxId.toString())); - String localVarAccept = apiClient.selectHeaderAccept("application/json"); + String localVarAccept = apiClient.selectHeaderAccept("application/pdf", "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() {}; + GenericType localVarReturnType = new GenericType() {}; return apiClient.invokeAPI( - "FaxApi.getFaxById", + "FaxApi.faxFiles", localVarPath, "GET", new ArrayList<>(), @@ -179,10 +179,10 @@ public ApiResponse getFaxByIdWithHttpInfo(String faxId) throws ApiE ); } /** - * List Fax Files. - * Returns list of fax files + * Get Fax. + * Returns information about fax * @param faxId Fax ID (required) - * @return File + * @return FaxGetResponse * @throws ApiException if fails to make API call * @http.response.details @@ -191,16 +191,16 @@ public ApiResponse getFaxByIdWithHttpInfo(String faxId) throws ApiE
4XX failed_operation -
*/ - public File getFaxFiles(String faxId) throws ApiException { - return getFaxFilesWithHttpInfo(faxId).getData(); + public FaxGetResponse faxGet(String faxId) throws ApiException { + return faxGetWithHttpInfo(faxId).getData(); } /** - * List Fax Files. - * Returns list of fax files + * Get Fax. + * Returns information about fax * @param faxId Fax ID (required) - * @return ApiResponse<File> + * @return ApiResponse<FaxGetResponse> * @throws ApiException if fails to make API call * @http.response.details @@ -209,26 +209,26 @@ public File getFaxFiles(String faxId) throws ApiException {
4XX failed_operation -
*/ - public ApiResponse getFaxFilesWithHttpInfo(String faxId) throws ApiException { + public ApiResponse faxGetWithHttpInfo(String faxId) throws ApiException { // Check required parameters if (faxId == null) { - throw new ApiException(400, "Missing the required parameter 'faxId' when calling getFaxFiles"); + throw new ApiException(400, "Missing the required parameter 'faxId' when calling faxGet"); } // Path parameters - String localVarPath = "/fax/files/{fax_id}" + String localVarPath = "/fax/{fax_id}" .replaceAll("\\{fax_id}", apiClient.escapeString(faxId.toString())); - String localVarAccept = apiClient.selectHeaderAccept("application/pdf", "application/json"); + 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() {}; + GenericType localVarReturnType = new GenericType() {}; return apiClient.invokeAPI( - "FaxApi.getFaxFiles", + "FaxApi.faxGet", localVarPath, "GET", new ArrayList<>(), @@ -246,8 +246,8 @@ public ApiResponse getFaxFilesWithHttpInfo(String faxId) throws ApiExcepti /** * Lists Faxes. * Returns properties of multiple faxes - * @param page Page (required) - * @param pageSize Page size (required) + * @param page Page (optional, default to 1) + * @param pageSize Page size (optional, default to 20) * @return FaxListResponse * @throws ApiException if fails to make API call * @http.response.details @@ -257,16 +257,55 @@ public ApiResponse getFaxFilesWithHttpInfo(String faxId) throws ApiExcepti 4XX failed_operation - */ - public FaxListResponse listFaxes(Integer page, Integer pageSize) throws ApiException { - return listFaxesWithHttpInfo(page, pageSize).getData(); + public FaxListResponse faxList(Integer page, Integer pageSize) throws ApiException { + return faxListWithHttpInfo(page, pageSize).getData(); + } + + + /** + * @see FaxApi#faxList(Integer, Integer) + */ + public FaxListResponse faxList() throws ApiException { + Integer page = 1; + Integer pageSize = 20; + + return faxListWithHttpInfo(page, pageSize).getData(); + } + + /** + * @see FaxApi#faxListWithHttpInfo(Integer, Integer) + */ + public ApiResponse faxListWithHttpInfo() throws ApiException { + Integer page = 1; + Integer pageSize = 20; + + return faxListWithHttpInfo(page, pageSize); + } + + /** + * @see FaxApi#faxList(Integer, Integer) + */ + public FaxListResponse faxList(Integer page) throws ApiException { + Integer pageSize = 20; + + return faxListWithHttpInfo(page, pageSize).getData(); + } + + /** + * @see FaxApi#faxListWithHttpInfo(Integer, Integer) + */ + public ApiResponse faxListWithHttpInfo(Integer page) throws ApiException { + Integer pageSize = 20; + + return faxListWithHttpInfo(page, pageSize); } /** * Lists Faxes. * Returns properties of multiple faxes - * @param page Page (required) - * @param pageSize Page size (required) + * @param page Page (optional, default to 1) + * @param pageSize Page size (optional, default to 20) * @return ApiResponse<FaxListResponse> * @throws ApiException if fails to make API call * @http.response.details @@ -276,16 +315,14 @@ public FaxListResponse listFaxes(Integer page, Integer pageSize) throws ApiExcep 4XX failed_operation - */ - public ApiResponse listFaxesWithHttpInfo(Integer page, Integer pageSize) throws ApiException { + public ApiResponse faxListWithHttpInfo(Integer page, Integer pageSize) throws ApiException { - // Check required parameters if (page == null) { - throw new ApiException(400, "Missing the required parameter 'page' when calling listFaxes"); + page = 1; } if (pageSize == null) { - throw new ApiException(400, "Missing the required parameter 'pageSize' when calling listFaxes"); + pageSize = 20; } - // Query parameters List localVarQueryParams = new ArrayList<>( apiClient.parameterToPairs("", "page", page) @@ -300,7 +337,7 @@ public ApiResponse listFaxesWithHttpInfo(Integer page, Integer String[] localVarAuthNames = new String[] {"api_key"}; GenericType localVarReturnType = new GenericType() {}; return apiClient.invokeAPI( - "FaxApi.listFaxes", + "FaxApi.faxList", "/fax/list", "GET", localVarQueryParams, @@ -319,7 +356,7 @@ public ApiResponse listFaxesWithHttpInfo(Integer page, Integer * Send Fax. * Action to prepare and send a fax * @param faxSendRequest (required) - * @return FaxResponse + * @return FaxGetResponse * @throws ApiException if fails to make API call * @http.response.details @@ -328,8 +365,8 @@ public ApiResponse listFaxesWithHttpInfo(Integer page, Integer
4XX failed_operation -
*/ - public FaxResponse sendFax(FaxSendRequest faxSendRequest) throws ApiException { - return sendFaxWithHttpInfo(faxSendRequest).getData(); + public FaxGetResponse faxSend(FaxSendRequest faxSendRequest) throws ApiException { + return faxSendWithHttpInfo(faxSendRequest).getData(); } @@ -337,7 +374,7 @@ public FaxResponse sendFax(FaxSendRequest faxSendRequest) throws ApiException { * Send Fax. * Action to prepare and send a fax * @param faxSendRequest (required) - * @return ApiResponse<FaxResponse> + * @return ApiResponse<FaxGetResponse> * @throws ApiException if fails to make API call * @http.response.details @@ -346,22 +383,22 @@ public FaxResponse sendFax(FaxSendRequest faxSendRequest) throws ApiException {
4XX failed_operation -
*/ - public ApiResponse sendFaxWithHttpInfo(FaxSendRequest faxSendRequest) throws ApiException { + public ApiResponse faxSendWithHttpInfo(FaxSendRequest faxSendRequest) throws ApiException { // Check required parameters if (faxSendRequest == null) { - throw new ApiException(400, "Missing the required parameter 'faxSendRequest' when calling sendFax"); + throw new ApiException(400, "Missing the required parameter 'faxSendRequest' when calling faxSend"); } 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 localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType("application/json", "multipart/form-data"); String[] localVarAuthNames = new String[] {"api_key"}; - GenericType localVarReturnType = new GenericType() {}; + GenericType localVarReturnType = new GenericType() {}; return apiClient.invokeAPI( - "FaxApi.sendFax", + "FaxApi.faxSend", "/fax/send", "POST", new ArrayList<>(), diff --git a/sdks/java-v2/src/main/java/com/dropbox/sign/model/FaxGetResponse.java b/sdks/java-v2/src/main/java/com/dropbox/sign/model/FaxGetResponse.java new file mode 100644 index 000000000..7b08c8e76 --- /dev/null +++ b/sdks/java-v2/src/main/java/com/dropbox/sign/model/FaxGetResponse.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.FaxResponse; +import com.dropbox.sign.model.WarningResponse; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.dropbox.sign.JSON; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.databind.ObjectMapper; + + +import com.dropbox.sign.ApiException; +/** + * FaxGetResponse + */ +@JsonPropertyOrder({ + FaxGetResponse.JSON_PROPERTY_FAX, + FaxGetResponse.JSON_PROPERTY_WARNINGS +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") +@JsonIgnoreProperties(ignoreUnknown=true) +public class FaxGetResponse { + public static final String JSON_PROPERTY_FAX = "fax"; + private FaxResponse fax; + + public static final String JSON_PROPERTY_WARNINGS = "warnings"; + private List warnings = null; + + public FaxGetResponse() { + } + + /** + * Attempt to instantiate and hydrate a new instance of this class + * @param jsonData String of JSON data representing target object + */ + static public FaxGetResponse init(String jsonData) throws Exception { + return new ObjectMapper().readValue(jsonData, FaxGetResponse.class); + } + + static public FaxGetResponse init(HashMap data) throws Exception { + return new ObjectMapper().readValue( + new ObjectMapper().writeValueAsString(data), + FaxGetResponse.class + ); + } + + public FaxGetResponse fax(FaxResponse fax) { + this.fax = fax; + return this; + } + + /** + * Get fax + * @return fax + */ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_FAX) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public FaxResponse getFax() { + return fax; + } + + + @JsonProperty(JSON_PROPERTY_FAX) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setFax(FaxResponse fax) { + this.fax = fax; + } + + + public FaxGetResponse warnings(List warnings) { + this.warnings = warnings; + return this; + } + + public FaxGetResponse addWarningsItem(WarningResponse warningsItem) { + if (this.warnings == null) { + this.warnings = new ArrayList<>(); + } + this.warnings.add(warningsItem); + return this; + } + + /** + * A list of warnings. + * @return warnings + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_WARNINGS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getWarnings() { + return warnings; + } + + + @JsonProperty(JSON_PROPERTY_WARNINGS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setWarnings(List warnings) { + this.warnings = warnings; + } + + + /** + * Return true if this FaxGetResponse object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + FaxGetResponse faxGetResponse = (FaxGetResponse) o; + return Objects.equals(this.fax, faxGetResponse.fax) && + Objects.equals(this.warnings, faxGetResponse.warnings); + } + + @Override + public int hashCode() { + return Objects.hash(fax, warnings); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class FaxGetResponse {\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/FaxListResponse.java b/sdks/java-v2/src/main/java/com/dropbox/sign/model/FaxListResponse.java index 7fb8ccdf9..13c0d94e3 100644 --- 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 @@ -16,7 +16,7 @@ import java.util.Objects; import java.util.Map; import java.util.HashMap; -import com.dropbox.sign.model.FaxResponseFax; +import com.dropbox.sign.model.FaxResponse; import com.dropbox.sign.model.ListInfoResponse; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; @@ -44,7 +44,7 @@ @JsonIgnoreProperties(ignoreUnknown=true) public class FaxListResponse { public static final String JSON_PROPERTY_FAXES = "faxes"; - private List faxes = new ArrayList<>(); + private List faxes = new ArrayList<>(); public static final String JSON_PROPERTY_LIST_INFO = "list_info"; private ListInfoResponse listInfo; @@ -67,12 +67,12 @@ static public FaxListResponse init(HashMap data) throws Exception { ); } - public FaxListResponse faxes(List faxes) { + public FaxListResponse faxes(List faxes) { this.faxes = faxes; return this; } - public FaxListResponse addFaxesItem(FaxResponseFax faxesItem) { + public FaxListResponse addFaxesItem(FaxResponse faxesItem) { if (this.faxes == null) { this.faxes = new ArrayList<>(); } @@ -88,14 +88,14 @@ public FaxListResponse addFaxesItem(FaxResponseFax faxesItem) { @JsonProperty(JSON_PROPERTY_FAXES) @JsonInclude(value = JsonInclude.Include.ALWAYS) - public List getFaxes() { + public List getFaxes() { return faxes; } @JsonProperty(JSON_PROPERTY_FAXES) @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setFaxes(List faxes) { + public void setFaxes(List faxes) { this.faxes = faxes; } diff --git a/sdks/java-v2/src/main/java/com/dropbox/sign/model/FaxResponse.java b/sdks/java-v2/src/main/java/com/dropbox/sign/model/FaxResponse.java index 22b995ecc..d1c1c6637 100644 --- a/sdks/java-v2/src/main/java/com/dropbox/sign/model/FaxResponse.java +++ b/sdks/java-v2/src/main/java/com/dropbox/sign/model/FaxResponse.java @@ -16,8 +16,7 @@ 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.dropbox.sign.model.FaxResponseTransmission; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -37,17 +36,49 @@ * FaxResponse */ @JsonPropertyOrder({ - FaxResponse.JSON_PROPERTY_FAX, - FaxResponse.JSON_PROPERTY_WARNINGS + FaxResponse.JSON_PROPERTY_FAX_ID, + FaxResponse.JSON_PROPERTY_TITLE, + FaxResponse.JSON_PROPERTY_ORIGINAL_TITLE, + FaxResponse.JSON_PROPERTY_SUBJECT, + FaxResponse.JSON_PROPERTY_MESSAGE, + FaxResponse.JSON_PROPERTY_METADATA, + FaxResponse.JSON_PROPERTY_CREATED_AT, + FaxResponse.JSON_PROPERTY_FROM, + FaxResponse.JSON_PROPERTY_TRANSMISSIONS, + FaxResponse.JSON_PROPERTY_FILES_URL }) @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_FAX_ID = "fax_id"; + private String faxId; - public static final String JSON_PROPERTY_WARNINGS = "warnings"; - private List warnings = null; + 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 FaxResponse() { } @@ -67,61 +98,261 @@ static public FaxResponse init(HashMap data) throws Exception { ); } - public FaxResponse fax(FaxResponseFax fax) { - this.fax = fax; + public FaxResponse 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 FaxResponse 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 FaxResponse 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 FaxResponse subject(String subject) { + this.subject = subject; return this; } /** - * Get fax - * @return fax + * Fax Subject + * @return subject */ - @jakarta.annotation.Nonnull - @JsonProperty(JSON_PROPERTY_FAX) - @JsonInclude(value = JsonInclude.Include.ALWAYS) + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SUBJECT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public FaxResponseFax getFax() { - return fax; + public String getSubject() { + return subject; } - @JsonProperty(JSON_PROPERTY_FAX) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setFax(FaxResponseFax fax) { - this.fax = fax; + @JsonProperty(JSON_PROPERTY_SUBJECT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSubject(String subject) { + this.subject = subject; } - public FaxResponse warnings(List warnings) { - this.warnings = warnings; + public FaxResponse message(String message) { + this.message = message; return this; } - public FaxResponse addWarningsItem(WarningResponse warningsItem) { - if (this.warnings == null) { - this.warnings = new ArrayList<>(); + /** + * 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 FaxResponse 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 FaxResponse 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 FaxResponse 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 FaxResponse transmissions(List transmissions) { + this.transmissions = transmissions; + return this; + } + + public FaxResponse addTransmissionsItem(FaxResponseTransmission transmissionsItem) { + if (this.transmissions == null) { + this.transmissions = new ArrayList<>(); } - this.warnings.add(warningsItem); + this.transmissions.add(transmissionsItem); return this; } /** - * A list of warnings. - * @return warnings + * Fax Transmissions List + * @return transmissions */ @jakarta.annotation.Nullable - @JsonProperty(JSON_PROPERTY_WARNINGS) + @JsonProperty(JSON_PROPERTY_TRANSMISSIONS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public List getWarnings() { - return warnings; + public List getTransmissions() { + return transmissions; } - @JsonProperty(JSON_PROPERTY_WARNINGS) + @JsonProperty(JSON_PROPERTY_TRANSMISSIONS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setWarnings(List warnings) { - this.warnings = warnings; + public void setTransmissions(List transmissions) { + this.transmissions = transmissions; + } + + + public FaxResponse 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; } @@ -137,21 +368,37 @@ public boolean equals(Object o) { return false; } FaxResponse faxResponse = (FaxResponse) o; - return Objects.equals(this.fax, faxResponse.fax) && - Objects.equals(this.warnings, faxResponse.warnings); + return Objects.equals(this.faxId, faxResponse.faxId) && + Objects.equals(this.title, faxResponse.title) && + Objects.equals(this.originalTitle, faxResponse.originalTitle) && + Objects.equals(this.subject, faxResponse.subject) && + Objects.equals(this.message, faxResponse.message) && + Objects.equals(this.metadata, faxResponse.metadata) && + Objects.equals(this.createdAt, faxResponse.createdAt) && + Objects.equals(this.from, faxResponse.from) && + Objects.equals(this.transmissions, faxResponse.transmissions) && + Objects.equals(this.filesUrl, faxResponse.filesUrl); } @Override public int hashCode() { - return Objects.hash(fax, warnings); + return Objects.hash(faxId, title, originalTitle, subject, message, metadata, createdAt, from, transmissions, filesUrl); } @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(" 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(); } @@ -160,42 +407,194 @@ public Map createFormData() throws ApiException { Map map = new HashMap<>(); boolean fileTypeFound = false; try { - if (fax != null) { - if (isFileTypeOrListOfFiles(fax)) { + 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 (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)); + 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("fax", JSON.getDefault().getMapper().writeValueAsString(fax)); + map.put("transmissions", JSON.getDefault().getMapper().writeValueAsString(transmissions)); } } - if (warnings != null) { - if (isFileTypeOrListOfFiles(warnings)) { + if (filesUrl != null) { + if (isFileTypeOrListOfFiles(filesUrl)) { 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)); + 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("warnings", JSON.getDefault().getMapper().writeValueAsString(warnings)); + map.put("files_url", JSON.getDefault().getMapper().writeValueAsString(filesUrl)); } } } catch (Exception e) { 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 deleted file mode 100644 index 69274c5ce..000000000 --- a/sdks/java-v2/src/main/java/com/dropbox/sign/model/FaxResponseFax.java +++ /dev/null @@ -1,639 +0,0 @@ -/* - * 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/FaxResponseTransmission.java similarity index 86% rename from sdks/java-v2/src/main/java/com/dropbox/sign/model/FaxResponseFaxTransmission.java rename to sdks/java-v2/src/main/java/com/dropbox/sign/model/FaxResponseTransmission.java index 09027a786..aa83487de 100644 --- a/sdks/java-v2/src/main/java/com/dropbox/sign/model/FaxResponseFaxTransmission.java +++ b/sdks/java-v2/src/main/java/com/dropbox/sign/model/FaxResponseTransmission.java @@ -30,17 +30,17 @@ import com.dropbox.sign.ApiException; /** - * FaxResponseFaxTransmission + * FaxResponseTransmission */ @JsonPropertyOrder({ - FaxResponseFaxTransmission.JSON_PROPERTY_RECIPIENT, - FaxResponseFaxTransmission.JSON_PROPERTY_SENDER, - FaxResponseFaxTransmission.JSON_PROPERTY_STATUS_CODE, - FaxResponseFaxTransmission.JSON_PROPERTY_SENT_AT + FaxResponseTransmission.JSON_PROPERTY_RECIPIENT, + FaxResponseTransmission.JSON_PROPERTY_SENDER, + FaxResponseTransmission.JSON_PROPERTY_STATUS_CODE, + FaxResponseTransmission.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 class FaxResponseTransmission { public static final String JSON_PROPERTY_RECIPIENT = "recipient"; private String recipient; @@ -53,25 +53,25 @@ public class FaxResponseFaxTransmission { public static final String JSON_PROPERTY_SENT_AT = "sent_at"; private Integer sentAt; - public FaxResponseFaxTransmission() { + public FaxResponseTransmission() { } /** * 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 FaxResponseTransmission init(String jsonData) throws Exception { + return new ObjectMapper().readValue(jsonData, FaxResponseTransmission.class); } - static public FaxResponseFaxTransmission init(HashMap data) throws Exception { + static public FaxResponseTransmission init(HashMap data) throws Exception { return new ObjectMapper().readValue( new ObjectMapper().writeValueAsString(data), - FaxResponseFaxTransmission.class + FaxResponseTransmission.class ); } - public FaxResponseFaxTransmission recipient(String recipient) { + public FaxResponseTransmission recipient(String recipient) { this.recipient = recipient; return this; } @@ -96,7 +96,7 @@ public void setRecipient(String recipient) { } - public FaxResponseFaxTransmission sender(String sender) { + public FaxResponseTransmission sender(String sender) { this.sender = sender; return this; } @@ -121,7 +121,7 @@ public void setSender(String sender) { } - public FaxResponseFaxTransmission statusCode(String statusCode) { + public FaxResponseTransmission statusCode(String statusCode) { this.statusCode = statusCode; return this; } @@ -146,7 +146,7 @@ public void setStatusCode(String statusCode) { } - public FaxResponseFaxTransmission sentAt(Integer sentAt) { + public FaxResponseTransmission sentAt(Integer sentAt) { this.sentAt = sentAt; return this; } @@ -172,7 +172,7 @@ public void setSentAt(Integer sentAt) { /** - * Return true if this FaxResponseFaxTransmission object is equal to o. + * Return true if this FaxResponseTransmission object is equal to o. */ @Override public boolean equals(Object o) { @@ -182,11 +182,11 @@ public boolean equals(Object o) { 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); + FaxResponseTransmission faxResponseTransmission = (FaxResponseTransmission) o; + return Objects.equals(this.recipient, faxResponseTransmission.recipient) && + Objects.equals(this.sender, faxResponseTransmission.sender) && + Objects.equals(this.statusCode, faxResponseTransmission.statusCode) && + Objects.equals(this.sentAt, faxResponseTransmission.sentAt); } @Override @@ -197,7 +197,7 @@ public int hashCode() { @Override public String toString() { StringBuilder sb = new StringBuilder(); - sb.append("class FaxResponseFaxTransmission {\n"); + sb.append("class FaxResponseTransmission {\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"); 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 index 56e58dce7..1da568838 100644 --- 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 @@ -16,12 +16,12 @@ 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.io.File; import java.util.ArrayList; import java.util.Arrays; import java.util.List; @@ -38,9 +38,8 @@ @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_FILES, + FaxSendRequest.JSON_PROPERTY_FILE_URLS, FaxSendRequest.JSON_PROPERTY_TEST_MODE, FaxSendRequest.JSON_PROPERTY_COVER_PAGE_TO, FaxSendRequest.JSON_PROPERTY_COVER_PAGE_FROM, @@ -56,17 +55,14 @@ public class FaxSendRequest { 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_FILES = "files"; + private List files = 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_FILE_URLS = "file_urls"; + private List fileUrls = null; public static final String JSON_PROPERTY_TEST_MODE = "test_mode"; - private Boolean testMode; + private Boolean testMode = false; public static final String JSON_PROPERTY_COVER_PAGE_TO = "cover_page_to"; private String coverPageTo; @@ -107,9 +103,9 @@ public FaxSendRequest to(String to) { * Fax Send To Recipient * @return to */ - @jakarta.annotation.Nullable + @jakarta.annotation.Nonnull @JsonProperty(JSON_PROPERTY_TO) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) public String getTo() { return to; @@ -117,7 +113,7 @@ public String getTo() { @JsonProperty(JSON_PROPERTY_TO) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) public void setTo(String to) { this.to = to; } @@ -148,102 +144,69 @@ public void setFrom(String from) { } - public FaxSendRequest _file(List _file) { - this._file = _file; + public FaxSendRequest files(List files) { + this.files = files; return this; } - public FaxSendRequest addFileItem(SubFile _fileItem) { - if (this._file == null) { - this._file = new ArrayList<>(); + public FaxSendRequest addFilesItem(File filesItem) { + if (this.files == null) { + this.files = new ArrayList<>(); } - this._file.add(_fileItem); + this.files.add(filesItem); return this; } /** * Fax File to Send - * @return _file + * @return files */ @jakarta.annotation.Nullable - @JsonProperty(JSON_PROPERTY_FILE) + @JsonProperty(JSON_PROPERTY_FILES) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public List getFile() { - return _file; + public List getFiles() { + return files; } - @JsonProperty(JSON_PROPERTY_FILE) + @JsonProperty(JSON_PROPERTY_FILES) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setFile(List _file) { - this._file = _file; + public void setFiles(List files) { + this.files = files; } - public FaxSendRequest fileUrl(List fileUrl) { - this.fileUrl = fileUrl; + public FaxSendRequest fileUrls(List fileUrls) { + this.fileUrls = fileUrls; return this; } - public FaxSendRequest addFileUrlItem(String fileUrlItem) { - if (this.fileUrl == null) { - this.fileUrl = new ArrayList<>(); + public FaxSendRequest addFileUrlsItem(String fileUrlsItem) { + if (this.fileUrls == null) { + this.fileUrls = new ArrayList<>(); } - this.fileUrl.add(fileUrlItem); + this.fileUrls.add(fileUrlsItem); return this; } /** * Fax File URL to Send - * @return fileUrl + * @return fileUrls */ @jakarta.annotation.Nullable - @JsonProperty(JSON_PROPERTY_FILE_URL) + @JsonProperty(JSON_PROPERTY_FILE_URLS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public List getFileUrl() { - return fileUrl; + public List getFileUrls() { + return fileUrls; } - @JsonProperty(JSON_PROPERTY_FILE_URL) + @JsonProperty(JSON_PROPERTY_FILE_URLS) @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 void setFileUrls(List fileUrls) { + this.fileUrls = fileUrls; } @@ -386,9 +349,8 @@ public boolean equals(Object o) { 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.files, faxSendRequest.files) && + Objects.equals(this.fileUrls, faxSendRequest.fileUrls) && Objects.equals(this.testMode, faxSendRequest.testMode) && Objects.equals(this.coverPageTo, faxSendRequest.coverPageTo) && Objects.equals(this.coverPageFrom, faxSendRequest.coverPageFrom) && @@ -398,7 +360,7 @@ public boolean equals(Object o) { @Override public int hashCode() { - return Objects.hash(to, from, _file, fileUrl, fileUrlNames, testMode, coverPageTo, coverPageFrom, coverPageMessage, title); + return Objects.hash(to, from, files, fileUrls, testMode, coverPageTo, coverPageFrom, coverPageMessage, title); } @Override @@ -407,9 +369,8 @@ public String toString() { 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(" files: ").append(toIndentedString(files)).append("\n"); + sb.append(" fileUrls: ").append(toIndentedString(fileUrls)).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"); @@ -461,61 +422,42 @@ public Map createFormData() throws ApiException { 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)) { + if (files != null) { + if (isFileTypeOrListOfFiles(files)) { 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)); + if (files.getClass().equals(java.io.File.class) || + files.getClass().equals(Integer.class) || + files.getClass().equals(String.class) || + files.getClass().isEnum()) { + map.put("files", files); + } else if (isListOfFile(files)) { + for(int i = 0; i< getListSize(files); i++) { + map.put("files[" + i + "]", getFromList(files, i)); } } else { - map.put("file_url", JSON.getDefault().getMapper().writeValueAsString(fileUrl)); + map.put("files", JSON.getDefault().getMapper().writeValueAsString(files)); } } - if (fileUrlNames != null) { - if (isFileTypeOrListOfFiles(fileUrlNames)) { + if (fileUrls != null) { + if (isFileTypeOrListOfFiles(fileUrls)) { 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)); + if (fileUrls.getClass().equals(java.io.File.class) || + fileUrls.getClass().equals(Integer.class) || + fileUrls.getClass().equals(String.class) || + fileUrls.getClass().isEnum()) { + map.put("file_urls", fileUrls); + } else if (isListOfFile(fileUrls)) { + for(int i = 0; i< getListSize(fileUrls); i++) { + map.put("file_urls[" + i + "]", getFromList(fileUrls, i)); } } else { - map.put("file_url_names", JSON.getDefault().getMapper().writeValueAsString(fileUrlNames)); + map.put("file_urls", JSON.getDefault().getMapper().writeValueAsString(fileUrls)); } } if (testMode != null) { 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 deleted file mode 100644 index dc654fb2c..000000000 --- a/sdks/java-v2/src/main/java/com/dropbox/sign/model/SubFile.java +++ /dev/null @@ -1,178 +0,0 @@ -/* - * 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 770e86178..edacf04ad 100644 --- a/sdks/node/README.md +++ b/sdks/node/README.md @@ -120,11 +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 | +| *FaxApi* | [**faxDelete**](./docs/api/FaxApi.md#faxdelete) | **DELETE** /fax/{fax_id} | Delete Fax | +| *FaxApi* | [**faxFiles**](./docs/api/FaxApi.md#faxfiles) | **GET** /fax/files/{fax_id} | List Fax Files | +| *FaxApi* | [**faxGet**](./docs/api/FaxApi.md#faxget) | **GET** /fax/{fax_id} | Get Fax | +| *FaxApi* | [**faxList**](./docs/api/FaxApi.md#faxlist) | **GET** /fax/list | Lists Faxes | +| *FaxApi* | [**faxSend**](./docs/api/FaxApi.md#faxsend) | **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 | @@ -213,6 +213,7 @@ All URIs are relative to *https://api.hellosign.com/v3* - [EventCallbackRequest](./docs/model/EventCallbackRequest.md) - [EventCallbackRequestEvent](./docs/model/EventCallbackRequestEvent.md) - [EventCallbackRequestEventMetadata](./docs/model/EventCallbackRequestEventMetadata.md) +- [FaxGetResponse](./docs/model/FaxGetResponse.md) - [FaxLineAddUserRequest](./docs/model/FaxLineAddUserRequest.md) - [FaxLineAreaCodeGetCountryEnum](./docs/model/FaxLineAreaCodeGetCountryEnum.md) - [FaxLineAreaCodeGetProvinceEnum](./docs/model/FaxLineAreaCodeGetProvinceEnum.md) @@ -226,8 +227,7 @@ All URIs are relative to *https://api.hellosign.com/v3* - [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) +- [FaxResponseTransmission](./docs/model/FaxResponseTransmission.md) - [FaxSendRequest](./docs/model/FaxSendRequest.md) - [FileResponse](./docs/model/FileResponse.md) - [FileResponseDataUri](./docs/model/FileResponseDataUri.md) @@ -273,7 +273,6 @@ 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 index 3b8a6b0ae..dd9c6df2a 100644 --- a/sdks/node/api/faxApi.ts +++ b/sdks/node/api/faxApi.ts @@ -26,8 +26,8 @@ import axios, { AxiosError, AxiosRequestConfig, AxiosResponse } from "axios"; import { Authentication, + FaxGetResponse, FaxListResponse, - FaxResponse, FaxSendRequest, HttpBasicAuth, HttpBearerAuth, @@ -124,7 +124,7 @@ export class FaxApi { * @param faxId Fax ID * @param options */ - public async deleteFax( + public async faxDelete( faxId: string, options: optionsI = { headers: {} } ): Promise { @@ -152,7 +152,7 @@ export class FaxApi { // 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." + "Required parameter faxId was null or undefined when calling faxDelete." ); } @@ -220,18 +220,18 @@ export class FaxApi { }); } /** - * Returns information about fax - * @summary Get Fax + * Returns list of fax files + * @summary List Fax Files * @param faxId Fax ID * @param options */ - public async getFaxById( + public async faxFiles( faxId: string, options: optionsI = { headers: {} } - ): Promise> { + ): Promise> { const localVarPath = this.basePath + - "/fax/{fax_id}".replace( + "/fax/files/{fax_id}".replace( "{" + "fax_id" + "}", encodeURIComponent(String(faxId)) ); @@ -240,7 +240,7 @@ export class FaxApi { {}, this._defaultHeaders ); - const produces = ["application/json"]; + const produces = ["application/pdf", "application/json"]; // give precedence to 'application/json' if (produces.indexOf("application/json") >= 0) { localVarHeaderParams["content-type"] = "application/json"; @@ -253,7 +253,7 @@ export class FaxApi { // 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." + "Required parameter faxId was null or undefined when calling faxFiles." ); } @@ -271,7 +271,7 @@ export class FaxApi { : undefined, maxContentLength: Infinity, maxBodyLength: Infinity, - responseType: "json", + responseType: "arraybuffer", }; let authenticationPromise = Promise.resolve(); @@ -292,14 +292,14 @@ export class FaxApi { } return interceptorPromise.then(() => { - return new Promise>((resolve, reject) => { + return new Promise>((resolve, reject) => { axios.request(localVarRequestOptions).then( (response) => { - handleSuccessfulResponse( + handleSuccessfulResponse( resolve, reject, response, - "FaxResponse" + "Buffer" ); }, (error: AxiosError) => { @@ -313,7 +313,7 @@ export class FaxApi { reject, error.response, 200, - "FaxResponse" + "RequestFile" ) ) { return; @@ -337,18 +337,18 @@ export class FaxApi { }); } /** - * Returns list of fax files - * @summary List Fax Files + * Returns information about fax + * @summary Get Fax * @param faxId Fax ID * @param options */ - public async getFaxFiles( + public async faxGet( faxId: string, options: optionsI = { headers: {} } - ): Promise> { + ): Promise> { const localVarPath = this.basePath + - "/fax/files/{fax_id}".replace( + "/fax/{fax_id}".replace( "{" + "fax_id" + "}", encodeURIComponent(String(faxId)) ); @@ -357,7 +357,7 @@ export class FaxApi { {}, this._defaultHeaders ); - const produces = ["application/pdf", "application/json"]; + const produces = ["application/json"]; // give precedence to 'application/json' if (produces.indexOf("application/json") >= 0) { localVarHeaderParams["content-type"] = "application/json"; @@ -370,7 +370,7 @@ export class FaxApi { // 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." + "Required parameter faxId was null or undefined when calling faxGet." ); } @@ -388,7 +388,7 @@ export class FaxApi { : undefined, maxContentLength: Infinity, maxBodyLength: Infinity, - responseType: "arraybuffer", + responseType: "json", }; let authenticationPromise = Promise.resolve(); @@ -409,14 +409,14 @@ export class FaxApi { } return interceptorPromise.then(() => { - return new Promise>((resolve, reject) => { + return new Promise>((resolve, reject) => { axios.request(localVarRequestOptions).then( (response) => { - handleSuccessfulResponse( + handleSuccessfulResponse( resolve, reject, response, - "Buffer" + "FaxGetResponse" ); }, (error: AxiosError) => { @@ -430,7 +430,7 @@ export class FaxApi { reject, error.response, 200, - "RequestFile" + "FaxGetResponse" ) ) { return; @@ -460,9 +460,9 @@ export class FaxApi { * @param pageSize Page size * @param options */ - public async listFaxes( - page: number, - pageSize: number, + public async faxList( + page?: number, + pageSize?: number, options: optionsI = { headers: {} } ): Promise> { const localVarPath = this.basePath + "/fax/list"; @@ -481,20 +481,6 @@ export class FaxApi { 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, @@ -594,10 +580,10 @@ export class FaxApi { * @param faxSendRequest * @param options */ - public async sendFax( + public async faxSend( faxSendRequest: FaxSendRequest, options: optionsI = { headers: {} } - ): Promise> { + ): Promise> { faxSendRequest = deserializeIfNeeded(faxSendRequest, "FaxSendRequest"); const localVarPath = this.basePath + "/fax/send"; let localVarQueryParameters: any = {}; @@ -618,7 +604,7 @@ export class FaxApi { // 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." + "Required parameter faxSendRequest was null or undefined when calling faxSend." ); } @@ -676,14 +662,14 @@ export class FaxApi { } return interceptorPromise.then(() => { - return new Promise>((resolve, reject) => { + return new Promise>((resolve, reject) => { axios.request(localVarRequestOptions).then( (response) => { - handleSuccessfulResponse( + handleSuccessfulResponse( resolve, reject, response, - "FaxResponse" + "FaxGetResponse" ); }, (error: AxiosError) => { @@ -697,7 +683,7 @@ export class FaxApi { reject, error.response, 200, - "FaxResponse" + "FaxGetResponse" ) ) { return; diff --git a/sdks/node/dist/api.js b/sdks/node/dist/api.js index 92b7c1433..a5f227ca1 100644 --- a/sdks/node/dist/api.js +++ b/sdks/node/dist/api.js @@ -12977,6 +12977,7 @@ __export(api_exports, { EventCallbackRequestEvent: () => EventCallbackRequestEvent, EventCallbackRequestEventMetadata: () => EventCallbackRequestEventMetadata, FaxApi: () => FaxApi, + FaxGetResponse: () => FaxGetResponse, FaxLineAddUserRequest: () => FaxLineAddUserRequest, FaxLineApi: () => FaxLineApi, FaxLineAreaCodeGetCountryEnum: () => FaxLineAreaCodeGetCountryEnum, @@ -12991,8 +12992,7 @@ __export(api_exports, { FaxLineResponseFaxLine: () => FaxLineResponseFaxLine, FaxListResponse: () => FaxListResponse, FaxResponse: () => FaxResponse, - FaxResponseFax: () => FaxResponseFax, - FaxResponseFaxTransmission: () => FaxResponseFaxTransmission, + FaxResponseTransmission: () => FaxResponseTransmission, FaxSendRequest: () => FaxSendRequest, FileResponse: () => FileResponse, FileResponseDataUri: () => FileResponseDataUri, @@ -13046,7 +13046,6 @@ __export(api_exports, { SubCustomField: () => SubCustomField, SubEditorOptions: () => SubEditorOptions, SubFieldOptions: () => SubFieldOptions, - SubFile: () => SubFile, SubFormFieldGroup: () => SubFormFieldGroup, SubFormFieldRule: () => SubFormFieldRule, SubFormFieldRuleAction: () => SubFormFieldRuleAction, @@ -17699,6 +17698,30 @@ EventCallbackRequestEventMetadata.attributeTypeMap = [ } ]; +// model/faxGetResponse.ts +var _FaxGetResponse = class { + static getAttributeTypeMap() { + return _FaxGetResponse.attributeTypeMap; + } + static init(data) { + return ObjectSerializer.deserialize(data, "FaxGetResponse"); + } +}; +var FaxGetResponse = _FaxGetResponse; +FaxGetResponse.discriminator = void 0; +FaxGetResponse.attributeTypeMap = [ + { + name: "fax", + baseName: "fax", + type: "FaxResponse" + }, + { + name: "warnings", + baseName: "warnings", + type: "Array" + } +]; + // model/faxLineAddUserRequest.ts var _FaxLineAddUserRequest = class { static getAttributeTypeMap() { @@ -18021,7 +18044,7 @@ FaxListResponse.attributeTypeMap = [ { name: "faxes", baseName: "faxes", - type: "Array" + type: "Array" }, { name: "listInfo", @@ -18042,30 +18065,6 @@ var _FaxResponse = class { var FaxResponse = _FaxResponse; FaxResponse.discriminator = void 0; FaxResponse.attributeTypeMap = [ - { - name: "fax", - baseName: "fax", - type: "FaxResponseFax" - }, - { - name: "warnings", - baseName: "warnings", - type: "Array" - } -]; - -// 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", @@ -18109,7 +18108,7 @@ FaxResponseFax.attributeTypeMap = [ { name: "transmissions", baseName: "transmissions", - type: "Array" + type: "Array" }, { name: "filesUrl", @@ -18118,18 +18117,18 @@ FaxResponseFax.attributeTypeMap = [ } ]; -// model/faxResponseFaxTransmission.ts -var _FaxResponseFaxTransmission = class { +// model/faxResponseTransmission.ts +var _FaxResponseTransmission = class { static getAttributeTypeMap() { - return _FaxResponseFaxTransmission.attributeTypeMap; + return _FaxResponseTransmission.attributeTypeMap; } static init(data) { - return ObjectSerializer.deserialize(data, "FaxResponseFaxTransmission"); + return ObjectSerializer.deserialize(data, "FaxResponseTransmission"); } }; -var FaxResponseFaxTransmission = _FaxResponseFaxTransmission; -FaxResponseFaxTransmission.discriminator = void 0; -FaxResponseFaxTransmission.attributeTypeMap = [ +var FaxResponseTransmission = _FaxResponseTransmission; +FaxResponseTransmission.discriminator = void 0; +FaxResponseTransmission.attributeTypeMap = [ { name: "recipient", baseName: "recipient", @@ -18154,6 +18153,9 @@ FaxResponseFaxTransmission.attributeTypeMap = [ // model/faxSendRequest.ts var _FaxSendRequest = class { + constructor() { + this["testMode"] = false; + } static getAttributeTypeMap() { return _FaxSendRequest.attributeTypeMap; } @@ -18175,18 +18177,13 @@ FaxSendRequest.attributeTypeMap = [ type: "string" }, { - name: "file", - baseName: "file", - type: "Array" - }, - { - name: "fileUrl", - baseName: "file_url", - type: "Array" + name: "files", + baseName: "files", + type: "Array" }, { - name: "fileUrlNames", - baseName: "file_url_names", + name: "fileUrls", + baseName: "file_urls", type: "Array" }, { @@ -20461,28 +20458,6 @@ 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() { @@ -24713,6 +24688,7 @@ var typeMap = { EventCallbackRequest, EventCallbackRequestEvent, EventCallbackRequestEventMetadata, + FaxGetResponse, FaxLineAddUserRequest, FaxLineAreaCodeGetResponse, FaxLineCreateRequest, @@ -24723,8 +24699,7 @@ var typeMap = { FaxLineResponseFaxLine, FaxListResponse, FaxResponse, - FaxResponseFax, - FaxResponseFaxTransmission, + FaxResponseTransmission, FaxSendRequest, FileResponse, FileResponseDataUri, @@ -24768,7 +24743,6 @@ var typeMap = { SubCustomField, SubEditorOptions, SubFieldOptions, - SubFile, SubFormFieldGroup, SubFormFieldRule, SubFormFieldRuleAction, @@ -26637,7 +26611,7 @@ var FaxApi = class { addInterceptor(interceptor) { this.interceptors.push(interceptor); } - deleteFax(_0) { + faxDelete(_0) { return __async(this, arguments, function* (faxId, options = { headers: {} }) { const localVarPath = this.basePath + "/fax/{fax_id}".replace( "{fax_id}", @@ -26658,7 +26632,7 @@ var FaxApi = class { let localVarBodyParams = void 0; if (faxId === null || faxId === void 0) { throw new Error( - "Required parameter faxId was null or undefined when calling deleteFax." + "Required parameter faxId was null or undefined when calling faxDelete." ); } Object.assign(localVarHeaderParams, options.headers); @@ -26714,9 +26688,9 @@ var FaxApi = class { }); }); } - getFaxById(_0) { + faxFiles(_0) { return __async(this, arguments, function* (faxId, options = { headers: {} }) { - const localVarPath = this.basePath + "/fax/{fax_id}".replace( + const localVarPath = this.basePath + "/fax/files/{fax_id}".replace( "{fax_id}", encodeURIComponent(String(faxId)) ); @@ -26725,7 +26699,7 @@ var FaxApi = class { {}, this._defaultHeaders ); - const produces = ["application/json"]; + const produces = ["application/pdf", "application/json"]; if (produces.indexOf("application/json") >= 0) { localVarHeaderParams["content-type"] = "application/json"; } else { @@ -26735,7 +26709,7 @@ var FaxApi = class { let localVarBodyParams = void 0; if (faxId === null || faxId === void 0) { throw new Error( - "Required parameter faxId was null or undefined when calling getFaxById." + "Required parameter faxId was null or undefined when calling faxFiles." ); } Object.assign(localVarHeaderParams, options.headers); @@ -26748,7 +26722,7 @@ var FaxApi = class { paramsSerializer: this._useQuerystring ? queryParamsSerializer : void 0, maxContentLength: Infinity, maxBodyLength: Infinity, - responseType: "json" + responseType: "arraybuffer" }; let authenticationPromise = Promise.resolve(); if (this.authentications.api_key.username) { @@ -26773,7 +26747,7 @@ var FaxApi = class { resolve, reject, response, - "FaxResponse" + "Buffer" ); }, (error) => { @@ -26785,7 +26759,7 @@ var FaxApi = class { reject, error.response, 200, - "FaxResponse" + "RequestFile" )) { return; } @@ -26804,9 +26778,9 @@ var FaxApi = class { }); }); } - getFaxFiles(_0) { + faxGet(_0) { return __async(this, arguments, function* (faxId, options = { headers: {} }) { - const localVarPath = this.basePath + "/fax/files/{fax_id}".replace( + const localVarPath = this.basePath + "/fax/{fax_id}".replace( "{fax_id}", encodeURIComponent(String(faxId)) ); @@ -26815,7 +26789,7 @@ var FaxApi = class { {}, this._defaultHeaders ); - const produces = ["application/pdf", "application/json"]; + const produces = ["application/json"]; if (produces.indexOf("application/json") >= 0) { localVarHeaderParams["content-type"] = "application/json"; } else { @@ -26825,7 +26799,7 @@ var FaxApi = class { let localVarBodyParams = void 0; if (faxId === null || faxId === void 0) { throw new Error( - "Required parameter faxId was null or undefined when calling getFaxFiles." + "Required parameter faxId was null or undefined when calling faxGet." ); } Object.assign(localVarHeaderParams, options.headers); @@ -26838,7 +26812,7 @@ var FaxApi = class { paramsSerializer: this._useQuerystring ? queryParamsSerializer : void 0, maxContentLength: Infinity, maxBodyLength: Infinity, - responseType: "arraybuffer" + responseType: "json" }; let authenticationPromise = Promise.resolve(); if (this.authentications.api_key.username) { @@ -26863,7 +26837,7 @@ var FaxApi = class { resolve, reject, response, - "Buffer" + "FaxGetResponse" ); }, (error) => { @@ -26875,7 +26849,7 @@ var FaxApi = class { reject, error.response, 200, - "RequestFile" + "FaxGetResponse" )) { return; } @@ -26894,7 +26868,7 @@ var FaxApi = class { }); }); } - listFaxes(_0, _1) { + faxList(_0, _1) { return __async(this, arguments, function* (page, pageSize, options = { headers: {} }) { const localVarPath = this.basePath + "/fax/list"; let localVarQueryParameters = {}; @@ -26910,16 +26884,6 @@ var FaxApi = class { } 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, @@ -26998,7 +26962,7 @@ var FaxApi = class { }); }); } - sendFax(_0) { + faxSend(_0) { return __async(this, arguments, function* (faxSendRequest, options = { headers: {} }) { faxSendRequest = deserializeIfNeeded4(faxSendRequest, "FaxSendRequest"); const localVarPath = this.basePath + "/fax/send"; @@ -27017,7 +26981,7 @@ var FaxApi = class { let localVarBodyParams = void 0; if (faxSendRequest === null || faxSendRequest === void 0) { throw new Error( - "Required parameter faxSendRequest was null or undefined when calling sendFax." + "Required parameter faxSendRequest was null or undefined when calling faxSend." ); } Object.assign(localVarHeaderParams, options.headers); @@ -27069,7 +27033,7 @@ var FaxApi = class { resolve, reject, response, - "FaxResponse" + "FaxGetResponse" ); }, (error) => { @@ -27081,7 +27045,7 @@ var FaxApi = class { reject, error.response, 200, - "FaxResponse" + "FaxGetResponse" )) { return; } @@ -33276,6 +33240,7 @@ var APIS = [ EventCallbackRequestEvent, EventCallbackRequestEventMetadata, FaxApi, + FaxGetResponse, FaxLineAddUserRequest, FaxLineApi, FaxLineAreaCodeGetCountryEnum, @@ -33290,8 +33255,7 @@ var APIS = [ FaxLineResponseFaxLine, FaxListResponse, FaxResponse, - FaxResponseFax, - FaxResponseFaxTransmission, + FaxResponseTransmission, FaxSendRequest, FileResponse, FileResponseDataUri, @@ -33345,7 +33309,6 @@ 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 index 6fb7355c1..fb529b8f6 100644 --- a/sdks/node/docs/api/FaxApi.md +++ b/sdks/node/docs/api/FaxApi.md @@ -4,17 +4,17 @@ 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 | +| [**faxDelete()**](FaxApi.md#faxDelete) | **DELETE** /fax/{fax_id} | Delete Fax | +| [**faxFiles()**](FaxApi.md#faxFiles) | **GET** /fax/files/{fax_id} | List Fax Files | +| [**faxGet()**](FaxApi.md#faxGet) | **GET** /fax/{fax_id} | Get Fax | +| [**faxList()**](FaxApi.md#faxList) | **GET** /fax/list | Lists Faxes | +| [**faxSend()**](FaxApi.md#faxSend) | **POST** /fax/send | Send Fax | -## `deleteFax()` +## `faxDelete()` ```typescript -deleteFax(faxId: string) +faxDelete(faxId: string) ``` Delete Fax @@ -50,7 +50,6 @@ 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 => { @@ -83,29 +82,29 @@ void (empty response body) [[Back to Model list]](../../README.md#models) [[Back to README]](../../README.md) -## `getFaxById()` +## `faxFiles()` ```typescript -getFaxById(faxId: string): FaxResponse +faxFiles(faxId: string): Buffer ``` -Get Fax +List Fax Files -Returns information about fax +Returns list of fax files ### TypeScript Example ```typescript import * as DropboxSign from "@dropbox/sign"; -const faxApi = new DropboxSign.ApiAppApi(); +const faxApi = new DropboxSign.FaxApi(); // Configure HTTP basic authorization: api_key faxApi.username = "YOUR_API_KEY"; -const faxId = "fa5c8a0b0f492d768749333ad6fcc214c111e967" +const faxId = "fa5c8a0b0f492d768749333ad6fcc214c111e967"; -const result = faxApi.getFaxById(faxId); +const result = faxApi.getFaxFiles(faxId); result.then(response => { console.log(response.body); }).catch(error => { @@ -125,9 +124,9 @@ const faxApi = new DropboxSign.FaxApi(); // Configure HTTP basic authorization: api_key faxApi.username = "YOUR_API_KEY"; -const faxId = "fa5c8a0b0f492d768749333ad6fcc214c111e967" +const faxId = "fa5c8a0b0f492d768749333ad6fcc214c111e967"; -const result = faxApi.getFaxById(faxId); +const result = faxApi.getFaxFiles(faxId); result.then(response => { console.log(response.body); }).catch(error => { @@ -145,7 +144,7 @@ result.then(response => { ### Return type -[**FaxResponse**](../model/FaxResponse.md) +**Buffer** ### Authorization @@ -154,35 +153,35 @@ result.then(response => { ### HTTP request headers - **Content-Type**: Not defined -- **Accept**: `application/json` +- **Accept**: `application/pdf`, `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()` +## `faxGet()` ```typescript -getFaxFiles(faxId: string): Buffer +faxGet(faxId: string): FaxGetResponse ``` -List Fax Files +Get Fax -Returns list of fax files +Returns information about fax ### TypeScript Example ```typescript import * as DropboxSign from "@dropbox/sign"; -const faxApi = new DropboxSign.FaxApi(); +const faxApi = new DropboxSign.ApiAppApi(); // Configure HTTP basic authorization: api_key faxApi.username = "YOUR_API_KEY"; -const faxId = "fa5c8a0b0f492d768749333ad6fcc214c111e967"; +const faxId = "fa5c8a0b0f492d768749333ad6fcc214c111e967" -const result = faxApi.getFaxFiles(faxId); +const result = faxApi.getFaxById(faxId); result.then(response => { console.log(response.body); }).catch(error => { @@ -202,9 +201,9 @@ const faxApi = new DropboxSign.FaxApi(); // Configure HTTP basic authorization: api_key faxApi.username = "YOUR_API_KEY"; -const faxId = "fa5c8a0b0f492d768749333ad6fcc214c111e967"; +const faxId = "fa5c8a0b0f492d768749333ad6fcc214c111e967" -const result = faxApi.getFaxFiles(faxId); +const result = faxApi.getFaxById(faxId); result.then(response => { console.log(response.body); }).catch(error => { @@ -222,7 +221,7 @@ result.then(response => { ### Return type -**Buffer** +[**FaxGetResponse**](../model/FaxGetResponse.md) ### Authorization @@ -231,16 +230,16 @@ result.then(response => { ### HTTP request headers - **Content-Type**: Not defined -- **Accept**: `application/pdf`, `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) -## `listFaxes()` +## `faxList()` ```typescript -listFaxes(page: number, pageSize: number): FaxListResponse +faxList(page: number, pageSize: number): FaxListResponse ``` Lists Faxes @@ -297,8 +296,8 @@ result.then(response => { |Name | Type | Description | Notes | | ------------- | ------------- | ------------- | ------------- | -| **page** | **number**| Page | | -| **pageSize** | **number**| Page size | | +| **page** | **number**| Page | [optional] [default to 1] | +| **pageSize** | **number**| Page size | [optional] [default to 20] | ### Return type @@ -317,10 +316,10 @@ result.then(response => { [[Back to Model list]](../../README.md#models) [[Back to README]](../../README.md) -## `sendFax()` +## `faxSend()` ```typescript -sendFax(faxSendRequest: FaxSendRequest): FaxResponse +faxSend(faxSendRequest: FaxSendRequest): FaxGetResponse ``` Send Fax @@ -385,7 +384,7 @@ result.then(response => { ### Return type -[**FaxResponse**](../model/FaxResponse.md) +[**FaxGetResponse**](../model/FaxGetResponse.md) ### Authorization @@ -393,7 +392,7 @@ result.then(response => { ### HTTP request headers -- **Content-Type**: `application/json` +- **Content-Type**: `application/json`, `multipart/form-data` - **Accept**: `application/json` [[Back to top]](#) [[Back to API list]](../../README.md#endpoints) diff --git a/sdks/php/docs/Model/SubFile.md b/sdks/node/docs/model/FaxGetResponse.md similarity index 55% rename from sdks/php/docs/Model/SubFile.md rename to sdks/node/docs/model/FaxGetResponse.md index b08f3ed5d..d688d55b8 100644 --- a/sdks/php/docs/Model/SubFile.md +++ b/sdks/node/docs/model/FaxGetResponse.md @@ -1,11 +1,12 @@ -# # SubFile +# # FaxGetResponse + -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 ''] | +| `fax`*_required_ | [```FaxResponse```](FaxResponse.md) | | | +| `warnings` | [```Array```](WarningResponse.md) | A list of warnings. | | [[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/sdks/node/docs/model/FaxListResponse.md b/sdks/node/docs/model/FaxListResponse.md index e5bf8adb6..53d9cf57c 100644 --- a/sdks/node/docs/model/FaxListResponse.md +++ b/sdks/node/docs/model/FaxListResponse.md @@ -6,7 +6,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -| `faxes`*_required_ | [```Array```](FaxResponseFax.md) | | | +| `faxes`*_required_ | [```Array```](FaxResponse.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 index bab270da1..d4d1ed889 100644 --- a/sdks/node/docs/model/FaxResponse.md +++ b/sdks/node/docs/model/FaxResponse.md @@ -6,7 +6,15 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -| `fax`*_required_ | [```FaxResponseFax```](FaxResponseFax.md) | | | -| `warnings` | [```Array```](WarningResponse.md) | A list of warnings. | | +| `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```](FaxResponseTransmission.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/FaxResponseFax.md b/sdks/node/docs/model/FaxResponseFax.md deleted file mode 100644 index fdeab50f4..000000000 --- a/sdks/node/docs/model/FaxResponseFax.md +++ /dev/null @@ -1,20 +0,0 @@ -# # 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/FaxResponseTransmission.md similarity index 94% rename from sdks/node/docs/model/FaxResponseFaxTransmission.md rename to sdks/node/docs/model/FaxResponseTransmission.md index ef86d2c9f..b77f25f2c 100644 --- a/sdks/node/docs/model/FaxResponseFaxTransmission.md +++ b/sdks/node/docs/model/FaxResponseTransmission.md @@ -1,4 +1,4 @@ -# # FaxResponseFaxTransmission +# # FaxResponseTransmission diff --git a/sdks/node/docs/model/FaxSendRequest.md b/sdks/node/docs/model/FaxSendRequest.md index 16496eaba..a5f0e5fec 100644 --- a/sdks/node/docs/model/FaxSendRequest.md +++ b/sdks/node/docs/model/FaxSendRequest.md @@ -6,12 +6,11 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -| `to` | ```string``` | Fax Send To Recipient | | +| `to`*_required_ | ```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 | | +| `files` | ```Array``` | Fax File to Send | | +| `fileUrls` | ```Array``` | Fax File URL to Send | | +| `testMode` | ```boolean``` | API Test Mode Setting | [default to false] | | `coverPageTo` | ```string``` | Fax Cover Page for Recipient | | | `coverPageFrom` | ```string``` | Fax Cover Page for Sender | | | `coverPageMessage` | ```string``` | Fax Cover Page Message | | diff --git a/sdks/node/model/subFile.ts b/sdks/node/model/faxGetResponse.ts similarity index 73% rename from sdks/node/model/subFile.ts rename to sdks/node/model/faxGetResponse.ts index 4c434908c..aa016746a 100644 --- a/sdks/node/model/subFile.ts +++ b/sdks/node/model/faxGetResponse.ts @@ -23,32 +23,37 @@ */ import { AttributeTypeMap, ObjectSerializer } from "./"; +import { FaxResponse } from "./faxResponse"; +import { WarningResponse } from "./warningResponse"; -/** - * Actual uploaded physical file - */ -export class SubFile { +export class FaxGetResponse { + "fax": FaxResponse; /** - * Actual physical uploaded file name that is derived during upload. Not settable parameter. + * A list of warnings. */ - "name"?: string = ""; + "warnings"?: Array; static discriminator: string | undefined = undefined; static attributeTypeMap: AttributeTypeMap = [ { - name: "name", - baseName: "name", - type: "string", + name: "fax", + baseName: "fax", + type: "FaxResponse", + }, + { + name: "warnings", + baseName: "warnings", + type: "Array", }, ]; static getAttributeTypeMap(): AttributeTypeMap { - return SubFile.attributeTypeMap; + return FaxGetResponse.attributeTypeMap; } /** Attempt to instantiate and hydrate a new instance of this class */ - static init(data: any): SubFile { - return ObjectSerializer.deserialize(data, "SubFile"); + static init(data: any): FaxGetResponse { + return ObjectSerializer.deserialize(data, "FaxGetResponse"); } } diff --git a/sdks/node/model/faxListResponse.ts b/sdks/node/model/faxListResponse.ts index 09c10a399..f3bb7bec7 100644 --- a/sdks/node/model/faxListResponse.ts +++ b/sdks/node/model/faxListResponse.ts @@ -23,11 +23,11 @@ */ import { AttributeTypeMap, ObjectSerializer } from "./"; -import { FaxResponseFax } from "./faxResponseFax"; +import { FaxResponse } from "./faxResponse"; import { ListInfoResponse } from "./listInfoResponse"; export class FaxListResponse { - "faxes": Array; + "faxes": Array; "listInfo": ListInfoResponse; static discriminator: string | undefined = undefined; @@ -36,7 +36,7 @@ export class FaxListResponse { { name: "faxes", baseName: "faxes", - type: "Array", + type: "Array", }, { name: "listInfo", diff --git a/sdks/node/model/faxResponse.ts b/sdks/node/model/faxResponse.ts index 5c8ec7778..f97c6fc4f 100644 --- a/sdks/node/model/faxResponse.ts +++ b/sdks/node/model/faxResponse.ts @@ -23,28 +23,102 @@ */ import { AttributeTypeMap, ObjectSerializer } from "./"; -import { FaxResponseFax } from "./faxResponseFax"; -import { WarningResponse } from "./warningResponse"; +import { FaxResponseTransmission } from "./faxResponseTransmission"; export class FaxResponse { - "fax": FaxResponseFax; /** - * A list of warnings. + * Fax ID */ - "warnings"?: Array; + "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: "fax", - baseName: "fax", - type: "FaxResponseFax", + 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: "warnings", - baseName: "warnings", - type: "Array", + name: "filesUrl", + baseName: "files_url", + type: "string", }, ]; diff --git a/sdks/node/model/faxResponseFax.ts b/sdks/node/model/faxResponseFax.ts deleted file mode 100644 index 079bdc1bf..000000000 --- a/sdks/node/model/faxResponseFax.ts +++ /dev/null @@ -1,133 +0,0 @@ -/** - * 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/faxResponseTransmission.ts similarity index 90% rename from sdks/node/model/faxResponseFaxTransmission.ts rename to sdks/node/model/faxResponseTransmission.ts index 5f650f6ef..9247d7208 100644 --- a/sdks/node/model/faxResponseFaxTransmission.ts +++ b/sdks/node/model/faxResponseTransmission.ts @@ -24,7 +24,7 @@ import { AttributeTypeMap, ObjectSerializer } from "./"; -export class FaxResponseFaxTransmission { +export class FaxResponseTransmission { /** * Fax Transmission Recipient */ @@ -68,11 +68,11 @@ export class FaxResponseFaxTransmission { ]; static getAttributeTypeMap(): AttributeTypeMap { - return FaxResponseFaxTransmission.attributeTypeMap; + return FaxResponseTransmission.attributeTypeMap; } /** Attempt to instantiate and hydrate a new instance of this class */ - static init(data: any): FaxResponseFaxTransmission { - return ObjectSerializer.deserialize(data, "FaxResponseFaxTransmission"); + static init(data: any): FaxResponseTransmission { + return ObjectSerializer.deserialize(data, "FaxResponseTransmission"); } } diff --git a/sdks/node/model/faxSendRequest.ts b/sdks/node/model/faxSendRequest.ts index 4480e3bb3..0cafc2f47 100644 --- a/sdks/node/model/faxSendRequest.ts +++ b/sdks/node/model/faxSendRequest.ts @@ -22,50 +22,45 @@ * SOFTWARE. */ -import { AttributeTypeMap, ObjectSerializer } from "./"; -import { SubFile } from "./subFile"; +import { AttributeTypeMap, ObjectSerializer, RequestFile } from "./"; export class FaxSendRequest { /** * Fax Send To Recipient */ - "to"?: string; + "to": string; /** * Fax Send From Sender (used only with fax number) */ - "from"?: string | null; + "from"?: string; /** * Fax File to Send */ - "file"?: Array; + "files"?: Array; /** * Fax File URL to Send */ - "fileUrl"?: Array; - /** - * Fax File URL Names - */ - "fileUrlNames"?: Array; + "fileUrls"?: Array; /** * API Test Mode Setting */ - "testMode"?: boolean; + "testMode"?: boolean = false; /** * Fax Cover Page for Recipient */ - "coverPageTo"?: string | null; + "coverPageTo"?: string; /** * Fax Cover Page for Sender */ - "coverPageFrom"?: string | null; + "coverPageFrom"?: string; /** * Fax Cover Page Message */ - "coverPageMessage"?: string | null; + "coverPageMessage"?: string; /** * Fax Title */ - "title"?: string | null; + "title"?: string; static discriminator: string | undefined = undefined; @@ -81,18 +76,13 @@ export class FaxSendRequest { type: "string", }, { - name: "file", - baseName: "file", - type: "Array", - }, - { - name: "fileUrl", - baseName: "file_url", - type: "Array", + name: "files", + baseName: "files", + type: "Array", }, { - name: "fileUrlNames", - baseName: "file_url_names", + name: "fileUrls", + baseName: "file_urls", type: "Array", }, { diff --git a/sdks/node/model/index.ts b/sdks/node/model/index.ts index a0991d6c3..b61b497b5 100644 --- a/sdks/node/model/index.ts +++ b/sdks/node/model/index.ts @@ -33,6 +33,7 @@ import { EventCallbackHelper } from "./eventCallbackHelper"; import { EventCallbackRequest } from "./eventCallbackRequest"; import { EventCallbackRequestEvent } from "./eventCallbackRequestEvent"; import { EventCallbackRequestEventMetadata } from "./eventCallbackRequestEventMetadata"; +import { FaxGetResponse } from "./faxGetResponse"; import { FaxLineAddUserRequest } from "./faxLineAddUserRequest"; import { FaxLineAreaCodeGetCountryEnum } from "./faxLineAreaCodeGetCountryEnum"; import { FaxLineAreaCodeGetProvinceEnum } from "./faxLineAreaCodeGetProvinceEnum"; @@ -46,8 +47,7 @@ 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 { FaxResponseTransmission } from "./faxResponseTransmission"; import { FaxSendRequest } from "./faxSendRequest"; import { FileResponse } from "./fileResponse"; import { FileResponseDataUri } from "./fileResponseDataUri"; @@ -106,7 +106,6 @@ 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"; @@ -285,6 +284,7 @@ export let typeMap: { [index: string]: any } = { EventCallbackRequest: EventCallbackRequest, EventCallbackRequestEvent: EventCallbackRequestEvent, EventCallbackRequestEventMetadata: EventCallbackRequestEventMetadata, + FaxGetResponse: FaxGetResponse, FaxLineAddUserRequest: FaxLineAddUserRequest, FaxLineAreaCodeGetResponse: FaxLineAreaCodeGetResponse, FaxLineCreateRequest: FaxLineCreateRequest, @@ -295,8 +295,7 @@ export let typeMap: { [index: string]: any } = { FaxLineResponseFaxLine: FaxLineResponseFaxLine, FaxListResponse: FaxListResponse, FaxResponse: FaxResponse, - FaxResponseFax: FaxResponseFax, - FaxResponseFaxTransmission: FaxResponseFaxTransmission, + FaxResponseTransmission: FaxResponseTransmission, FaxSendRequest: FaxSendRequest, FileResponse: FileResponse, FileResponseDataUri: FileResponseDataUri, @@ -355,7 +354,6 @@ export let typeMap: { [index: string]: any } = { SubCustomField: SubCustomField, SubEditorOptions: SubEditorOptions, SubFieldOptions: SubFieldOptions, - SubFile: SubFile, SubFormFieldGroup: SubFormFieldGroup, SubFormFieldRule: SubFormFieldRule, SubFormFieldRuleAction: SubFormFieldRuleAction, @@ -511,6 +509,7 @@ export { EventCallbackRequest, EventCallbackRequestEvent, EventCallbackRequestEventMetadata, + FaxGetResponse, FaxLineAddUserRequest, FaxLineAreaCodeGetCountryEnum, FaxLineAreaCodeGetProvinceEnum, @@ -524,8 +523,7 @@ export { FaxLineResponseFaxLine, FaxListResponse, FaxResponse, - FaxResponseFax, - FaxResponseFaxTransmission, + FaxResponseTransmission, FaxSendRequest, FileResponse, FileResponseDataUri, @@ -578,7 +576,6 @@ export { SubCustomField, SubEditorOptions, SubFieldOptions, - SubFile, SubFormFieldGroup, SubFormFieldRule, SubFormFieldRuleAction, diff --git a/sdks/node/types/api/faxApi.d.ts b/sdks/node/types/api/faxApi.d.ts index 6ed6ee189..f18e42259 100644 --- a/sdks/node/types/api/faxApi.d.ts +++ b/sdks/node/types/api/faxApi.d.ts @@ -1,4 +1,4 @@ -import { Authentication, FaxListResponse, FaxResponse, FaxSendRequest, HttpBasicAuth, HttpBearerAuth, Interceptor } from "../model"; +import { Authentication, FaxGetResponse, FaxListResponse, FaxSendRequest, HttpBasicAuth, HttpBearerAuth, Interceptor } from "../model"; import { optionsI, returnTypeI, returnTypeT } from "./"; export declare enum FaxApiApiKeys { } @@ -24,9 +24,9 @@ export declare class FaxApi { 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>; + faxDelete(faxId: string, options?: optionsI): Promise; + faxFiles(faxId: string, options?: optionsI): Promise>; + faxGet(faxId: string, options?: optionsI): Promise>; + faxList(page?: number, pageSize?: number, options?: optionsI): Promise>; + faxSend(faxSendRequest: FaxSendRequest, options?: optionsI): Promise>; } diff --git a/sdks/node/types/model/faxGetResponse.d.ts b/sdks/node/types/model/faxGetResponse.d.ts new file mode 100644 index 000000000..05b6196dd --- /dev/null +++ b/sdks/node/types/model/faxGetResponse.d.ts @@ -0,0 +1,11 @@ +import { AttributeTypeMap } from "./"; +import { FaxResponse } from "./faxResponse"; +import { WarningResponse } from "./warningResponse"; +export declare class FaxGetResponse { + "fax": FaxResponse; + "warnings"?: Array; + static discriminator: string | undefined; + static attributeTypeMap: AttributeTypeMap; + static getAttributeTypeMap(): AttributeTypeMap; + static init(data: any): FaxGetResponse; +} diff --git a/sdks/node/types/model/faxListResponse.d.ts b/sdks/node/types/model/faxListResponse.d.ts index 843240400..e36e8a061 100644 --- a/sdks/node/types/model/faxListResponse.d.ts +++ b/sdks/node/types/model/faxListResponse.d.ts @@ -1,8 +1,8 @@ import { AttributeTypeMap } from "./"; -import { FaxResponseFax } from "./faxResponseFax"; +import { FaxResponse } from "./faxResponse"; import { ListInfoResponse } from "./listInfoResponse"; export declare class FaxListResponse { - "faxes": Array; + "faxes": Array; "listInfo": ListInfoResponse; static discriminator: string | undefined; static attributeTypeMap: AttributeTypeMap; diff --git a/sdks/node/types/model/faxResponse.d.ts b/sdks/node/types/model/faxResponse.d.ts index 495b09679..c4542ff6b 100644 --- a/sdks/node/types/model/faxResponse.d.ts +++ b/sdks/node/types/model/faxResponse.d.ts @@ -1,9 +1,16 @@ import { AttributeTypeMap } from "./"; -import { FaxResponseFax } from "./faxResponseFax"; -import { WarningResponse } from "./warningResponse"; +import { FaxResponseTransmission } from "./faxResponseTransmission"; export declare class FaxResponse { - "fax": FaxResponseFax; - "warnings"?: Array; + "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; diff --git a/sdks/node/types/model/faxResponseFax.d.ts b/sdks/node/types/model/faxResponseFax.d.ts deleted file mode 100644 index 628c3fe9f..000000000 --- a/sdks/node/types/model/faxResponseFax.d.ts +++ /dev/null @@ -1,18 +0,0 @@ -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/faxResponseTransmission.d.ts similarity index 72% rename from sdks/node/types/model/faxResponseFaxTransmission.d.ts rename to sdks/node/types/model/faxResponseTransmission.d.ts index 4bbafb752..2c29f3588 100644 --- a/sdks/node/types/model/faxResponseFaxTransmission.d.ts +++ b/sdks/node/types/model/faxResponseTransmission.d.ts @@ -1,5 +1,5 @@ import { AttributeTypeMap } from "./"; -export declare class FaxResponseFaxTransmission { +export declare class FaxResponseTransmission { "recipient"?: string; "sender"?: string; "statusCode"?: string; @@ -7,5 +7,5 @@ export declare class FaxResponseFaxTransmission { static discriminator: string | undefined; static attributeTypeMap: AttributeTypeMap; static getAttributeTypeMap(): AttributeTypeMap; - static init(data: any): FaxResponseFaxTransmission; + static init(data: any): FaxResponseTransmission; } diff --git a/sdks/node/types/model/faxSendRequest.d.ts b/sdks/node/types/model/faxSendRequest.d.ts index e7e609d30..24035d908 100644 --- a/sdks/node/types/model/faxSendRequest.d.ts +++ b/sdks/node/types/model/faxSendRequest.d.ts @@ -1,16 +1,14 @@ -import { AttributeTypeMap } from "./"; -import { SubFile } from "./subFile"; +import { AttributeTypeMap, RequestFile } from "./"; export declare class FaxSendRequest { - "to"?: string; - "from"?: string | null; - "file"?: Array; - "fileUrl"?: Array; - "fileUrlNames"?: Array; + "to": string; + "from"?: string; + "files"?: Array; + "fileUrls"?: Array; "testMode"?: boolean; - "coverPageTo"?: string | null; - "coverPageFrom"?: string | null; - "coverPageMessage"?: string | null; - "title"?: string | null; + "coverPageTo"?: string; + "coverPageFrom"?: string; + "coverPageMessage"?: string; + "title"?: string; static discriminator: string | undefined; static attributeTypeMap: AttributeTypeMap; static getAttributeTypeMap(): AttributeTypeMap; diff --git a/sdks/node/types/model/index.d.ts b/sdks/node/types/model/index.d.ts index 77b570a4f..664b47950 100644 --- a/sdks/node/types/model/index.d.ts +++ b/sdks/node/types/model/index.d.ts @@ -33,6 +33,7 @@ import { EventCallbackHelper } from "./eventCallbackHelper"; import { EventCallbackRequest } from "./eventCallbackRequest"; import { EventCallbackRequestEvent } from "./eventCallbackRequestEvent"; import { EventCallbackRequestEventMetadata } from "./eventCallbackRequestEventMetadata"; +import { FaxGetResponse } from "./faxGetResponse"; import { FaxLineAddUserRequest } from "./faxLineAddUserRequest"; import { FaxLineAreaCodeGetCountryEnum } from "./faxLineAreaCodeGetCountryEnum"; import { FaxLineAreaCodeGetProvinceEnum } from "./faxLineAreaCodeGetProvinceEnum"; @@ -46,8 +47,7 @@ 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 { FaxResponseTransmission } from "./faxResponseTransmission"; import { FaxSendRequest } from "./faxSendRequest"; import { FileResponse } from "./fileResponse"; import { FileResponseDataUri } from "./fileResponseDataUri"; @@ -94,7 +94,6 @@ 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"; @@ -195,4 +194,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, 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, }; +export { AccountCreateRequest, AccountCreateResponse, AccountGetResponse, AccountResponse, AccountResponseQuotas, AccountResponseUsage, AccountUpdateRequest, AccountVerifyRequest, AccountVerifyResponse, AccountVerifyResponseAccount, ApiAppCreateRequest, ApiAppGetResponse, ApiAppListResponse, ApiAppResponse, ApiAppResponseOAuth, ApiAppResponseOptions, ApiAppResponseOwnerAccount, ApiAppResponseWhiteLabelingOptions, ApiAppUpdateRequest, ApiKeyAuth, AttributeTypeMap, Authentication, BulkSendJobGetResponse, BulkSendJobGetResponseSignatureRequests, BulkSendJobListResponse, BulkSendJobResponse, BulkSendJobSendResponse, EmbeddedEditUrlRequest, EmbeddedEditUrlResponse, EmbeddedEditUrlResponseEmbedded, EmbeddedSignUrlResponse, EmbeddedSignUrlResponseEmbedded, ErrorResponse, ErrorResponseError, EventCallbackHelper, EventCallbackRequest, EventCallbackRequestEvent, EventCallbackRequestEventMetadata, FaxGetResponse, FaxLineAddUserRequest, FaxLineAreaCodeGetCountryEnum, FaxLineAreaCodeGetProvinceEnum, FaxLineAreaCodeGetResponse, FaxLineAreaCodeGetStateEnum, FaxLineCreateRequest, FaxLineDeleteRequest, FaxLineListResponse, FaxLineRemoveUserRequest, FaxLineResponse, FaxLineResponseFaxLine, FaxListResponse, FaxResponse, FaxResponseTransmission, FaxSendRequest, FileResponse, FileResponseDataUri, HttpBasicAuth, HttpBearerAuth, Interceptor, ListInfoResponse, OAuth, OAuthTokenGenerateRequest, OAuthTokenRefreshRequest, OAuthTokenResponse, ObjectSerializer, ReportCreateRequest, ReportCreateResponse, ReportResponse, RequestDetailedFile, RequestFile, SignatureRequestBulkCreateEmbeddedWithTemplateRequest, SignatureRequestBulkSendWithTemplateRequest, SignatureRequestCreateEmbeddedRequest, SignatureRequestCreateEmbeddedWithTemplateRequest, SignatureRequestGetResponse, SignatureRequestListResponse, SignatureRequestRemindRequest, SignatureRequestResponse, SignatureRequestResponseAttachment, SignatureRequestResponseCustomFieldBase, SignatureRequestResponseCustomFieldCheckbox, SignatureRequestResponseCustomFieldText, SignatureRequestResponseCustomFieldTypeEnum, SignatureRequestResponseDataBase, SignatureRequestResponseDataTypeEnum, SignatureRequestResponseDataValueCheckbox, SignatureRequestResponseDataValueCheckboxMerge, SignatureRequestResponseDataValueDateSigned, SignatureRequestResponseDataValueDropdown, SignatureRequestResponseDataValueInitials, SignatureRequestResponseDataValueRadio, SignatureRequestResponseDataValueSignature, SignatureRequestResponseDataValueText, SignatureRequestResponseDataValueTextMerge, SignatureRequestResponseSignatures, SignatureRequestSendRequest, SignatureRequestSendWithTemplateRequest, SignatureRequestUpdateRequest, SubAttachment, SubBulkSignerList, SubBulkSignerListCustomField, SubCC, SubCustomField, SubEditorOptions, SubFieldOptions, SubFormFieldGroup, SubFormFieldRule, SubFormFieldRuleAction, SubFormFieldRuleTrigger, SubFormFieldsPerDocumentBase, SubFormFieldsPerDocumentCheckbox, SubFormFieldsPerDocumentCheckboxMerge, SubFormFieldsPerDocumentDateSigned, SubFormFieldsPerDocumentDropdown, SubFormFieldsPerDocumentFontEnum, SubFormFieldsPerDocumentHyperlink, SubFormFieldsPerDocumentInitials, SubFormFieldsPerDocumentRadio, SubFormFieldsPerDocumentSignature, SubFormFieldsPerDocumentText, SubFormFieldsPerDocumentTextMerge, SubFormFieldsPerDocumentTypeEnum, SubMergeField, SubOAuth, SubOptions, SubSignatureRequestGroupedSigners, SubSignatureRequestSigner, SubSignatureRequestTemplateSigner, SubSigningOptions, SubTeamResponse, SubTemplateRole, SubUnclaimedDraftSigner, SubUnclaimedDraftTemplateSigner, SubWhiteLabelingOptions, TeamAddMemberRequest, TeamCreateRequest, TeamGetInfoResponse, TeamGetResponse, TeamInfoResponse, TeamInviteResponse, TeamInvitesResponse, TeamMemberResponse, TeamMembersResponse, TeamParentResponse, TeamRemoveMemberRequest, TeamResponse, TeamSubTeamsResponse, TeamUpdateRequest, TemplateAddUserRequest, TemplateCreateEmbeddedDraftRequest, TemplateCreateEmbeddedDraftResponse, TemplateCreateEmbeddedDraftResponseTemplate, TemplateCreateRequest, TemplateCreateResponse, TemplateCreateResponseTemplate, TemplateEditResponse, TemplateGetResponse, TemplateListResponse, TemplateRemoveUserRequest, TemplateResponse, TemplateResponseAccount, TemplateResponseAccountQuota, TemplateResponseCCRole, TemplateResponseDocument, TemplateResponseDocumentCustomFieldBase, TemplateResponseDocumentCustomFieldCheckbox, TemplateResponseDocumentCustomFieldText, TemplateResponseDocumentFieldGroup, TemplateResponseDocumentFieldGroupRule, TemplateResponseDocumentFormFieldBase, TemplateResponseDocumentFormFieldCheckbox, TemplateResponseDocumentFormFieldDateSigned, TemplateResponseDocumentFormFieldDropdown, TemplateResponseDocumentFormFieldHyperlink, TemplateResponseDocumentFormFieldInitials, TemplateResponseDocumentFormFieldRadio, TemplateResponseDocumentFormFieldSignature, TemplateResponseDocumentFormFieldText, TemplateResponseDocumentStaticFieldBase, TemplateResponseDocumentStaticFieldCheckbox, TemplateResponseDocumentStaticFieldDateSigned, TemplateResponseDocumentStaticFieldDropdown, TemplateResponseDocumentStaticFieldHyperlink, TemplateResponseDocumentStaticFieldInitials, TemplateResponseDocumentStaticFieldRadio, TemplateResponseDocumentStaticFieldSignature, TemplateResponseDocumentStaticFieldText, TemplateResponseFieldAvgTextLength, TemplateResponseSignerRole, TemplateUpdateFilesRequest, TemplateUpdateFilesResponse, TemplateUpdateFilesResponseTemplate, UnclaimedDraftCreateEmbeddedRequest, UnclaimedDraftCreateEmbeddedWithTemplateRequest, UnclaimedDraftCreateRequest, UnclaimedDraftCreateResponse, UnclaimedDraftEditAndResendRequest, UnclaimedDraftResponse, VoidAuth, WarningResponse, }; diff --git a/sdks/node/types/model/subFile.d.ts b/sdks/node/types/model/subFile.d.ts deleted file mode 100644 index 56706fc54..000000000 --- a/sdks/node/types/model/subFile.d.ts +++ /dev/null @@ -1,8 +0,0 @@ -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 47a9091a0..a219f62fb 100644 --- a/sdks/php/README.md +++ b/sdks/php/README.md @@ -160,11 +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 | +| *FaxApi* | [**faxDelete**](docs/Api/FaxApi.md#faxdelete) | **DELETE** /fax/{fax_id} | Delete Fax | +| *FaxApi* | [**faxFiles**](docs/Api/FaxApi.md#faxfiles) | **GET** /fax/files/{fax_id} | List Fax Files | +| *FaxApi* | [**faxGet**](docs/Api/FaxApi.md#faxget) | **GET** /fax/{fax_id} | Get Fax | +| *FaxApi* | [**faxList**](docs/Api/FaxApi.md#faxlist) | **GET** /fax/list | Lists Faxes | +| *FaxApi* | [**faxSend**](docs/Api/FaxApi.md#faxsend) | **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 | @@ -254,6 +254,7 @@ All URIs are relative to *https://api.hellosign.com/v3* - [EventCallbackRequest](docs/Model/EventCallbackRequest.md) - [EventCallbackRequestEvent](docs/Model/EventCallbackRequestEvent.md) - [EventCallbackRequestEventMetadata](docs/Model/EventCallbackRequestEventMetadata.md) +- [FaxGetResponse](docs/Model/FaxGetResponse.md) - [FaxLineAddUserRequest](docs/Model/FaxLineAddUserRequest.md) - [FaxLineAreaCodeGetCountryEnum](docs/Model/FaxLineAreaCodeGetCountryEnum.md) - [FaxLineAreaCodeGetProvinceEnum](docs/Model/FaxLineAreaCodeGetProvinceEnum.md) @@ -267,8 +268,7 @@ All URIs are relative to *https://api.hellosign.com/v3* - [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) +- [FaxResponseTransmission](docs/Model/FaxResponseTransmission.md) - [FaxSendRequest](docs/Model/FaxSendRequest.md) - [FileResponse](docs/Model/FileResponse.md) - [FileResponseDataUri](docs/Model/FileResponseDataUri.md) @@ -314,7 +314,6 @@ 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 index 564802cd9..048cfe610 100644 --- a/sdks/php/docs/Api/FaxApi.md +++ b/sdks/php/docs/Api/FaxApi.md @@ -4,17 +4,17 @@ 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 | +| [**faxDelete()**](FaxApi.md#faxDelete) | **DELETE** /fax/{fax_id} | Delete Fax | +| [**faxFiles()**](FaxApi.md#faxFiles) | **GET** /fax/files/{fax_id} | List Fax Files | +| [**faxGet()**](FaxApi.md#faxGet) | **GET** /fax/{fax_id} | Get Fax | +| [**faxList()**](FaxApi.md#faxList) | **GET** /fax/list | Lists Faxes | +| [**faxSend()**](FaxApi.md#faxSend) | **POST** /fax/send | Send Fax | -## `deleteFax()` +## `faxDelete()` ```php -deleteFax($fax_id) +faxDelete($fax_id) ``` Delete Fax @@ -67,14 +67,14 @@ void (empty response body) [[Back to Model list]](../../README.md#models) [[Back to README]](../../README.md) -## `getFaxById()` +## `faxFiles()` ```php -getFaxById($fax_id): \Dropbox\Sign\Model\FaxResponse +faxFiles($fax_id): \SplFileObject ``` -Get Fax +List Fax Files -Returns information about fax +Returns list of fax files ### Example @@ -93,8 +93,7 @@ $faxApi = new Dropbox\Sign\Api\FaxApi($config); $faxId = "fa5c8a0b0f492d768749333ad6fcc214c111e967"; try { - $result = $faxApi->getFaxById($faxId); - print_r($result); + $faxApi->getFaxFiles($faxId); } catch (Dropbox\Sign\ApiException $e) { $error = $e->getResponseObject(); echo "Exception when calling Dropbox Sign API: " @@ -111,7 +110,7 @@ try { ### Return type -[**\Dropbox\Sign\Model\FaxResponse**](../Model/FaxResponse.md) +**\SplFileObject** ### Authorization @@ -120,20 +119,20 @@ try { ### HTTP request headers - **Content-Type**: Not defined -- **Accept**: `application/json` +- **Accept**: `application/pdf`, `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()` +## `faxGet()` ```php -getFaxFiles($fax_id): \SplFileObject +faxGet($fax_id): \Dropbox\Sign\Model\FaxGetResponse ``` -List Fax Files +Get Fax -Returns list of fax files +Returns information about fax ### Example @@ -152,7 +151,8 @@ $faxApi = new Dropbox\Sign\Api\FaxApi($config); $faxId = "fa5c8a0b0f492d768749333ad6fcc214c111e967"; try { - $faxApi->getFaxFiles($faxId); + $result = $faxApi->getFaxById($faxId); + print_r($result); } catch (Dropbox\Sign\ApiException $e) { $error = $e->getResponseObject(); echo "Exception when calling Dropbox Sign API: " @@ -169,7 +169,7 @@ try { ### Return type -**\SplFileObject** +[**\Dropbox\Sign\Model\FaxGetResponse**](../Model/FaxGetResponse.md) ### Authorization @@ -178,16 +178,16 @@ try { ### HTTP request headers - **Content-Type**: Not defined -- **Accept**: `application/pdf`, `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) -## `listFaxes()` +## `faxList()` ```php -listFaxes($page, $page_size): \Dropbox\Sign\Model\FaxListResponse +faxList($page, $page_size): \Dropbox\Sign\Model\FaxListResponse ``` Lists Faxes @@ -225,8 +225,8 @@ try { |Name | Type | Description | Notes | | ------------- | ------------- | ------------- | ------------- | -| **page** | **int**| Page | | -| **page_size** | **int**| Page size | | +| **page** | **int**| Page | [optional] [default to 1] | +| **page_size** | **int**| Page size | [optional] [default to 20] | ### Return type @@ -245,10 +245,10 @@ try { [[Back to Model list]](../../README.md#models) [[Back to README]](../../README.md) -## `sendFax()` +## `faxSend()` ```php -sendFax($fax_send_request): \Dropbox\Sign\Model\FaxResponse +faxSend($fax_send_request): \Dropbox\Sign\Model\FaxGetResponse ``` Send Fax @@ -291,7 +291,7 @@ try { ### Return type -[**\Dropbox\Sign\Model\FaxResponse**](../Model/FaxResponse.md) +[**\Dropbox\Sign\Model\FaxGetResponse**](../Model/FaxGetResponse.md) ### Authorization @@ -299,7 +299,7 @@ try { ### HTTP request headers -- **Content-Type**: `application/json` +- **Content-Type**: `application/json`, `multipart/form-data` - **Accept**: `application/json` [[Back to top]](#) [[Back to API list]](../../README.md#endpoints) diff --git a/sdks/node/docs/model/SubFile.md b/sdks/php/docs/Model/FaxGetResponse.md similarity index 51% rename from sdks/node/docs/model/SubFile.md rename to sdks/php/docs/Model/FaxGetResponse.md index b08f3ed5d..59bea7dc3 100644 --- a/sdks/node/docs/model/SubFile.md +++ b/sdks/php/docs/Model/FaxGetResponse.md @@ -1,11 +1,12 @@ -# # SubFile +# # FaxGetResponse + -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 ''] | +| `fax`*_required_ | [```\Dropbox\Sign\Model\FaxResponse```](FaxResponse.md) | | | +| `warnings` | [```\Dropbox\Sign\Model\WarningResponse[]```](WarningResponse.md) | A list of warnings. | | [[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/sdks/php/docs/Model/FaxListResponse.md b/sdks/php/docs/Model/FaxListResponse.md index b5ddd64cc..5ccdafc91 100644 --- a/sdks/php/docs/Model/FaxListResponse.md +++ b/sdks/php/docs/Model/FaxListResponse.md @@ -6,7 +6,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -| `faxes`*_required_ | [```\Dropbox\Sign\Model\FaxResponseFax[]```](FaxResponseFax.md) | | | +| `faxes`*_required_ | [```\Dropbox\Sign\Model\FaxResponse[]```](FaxResponse.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 index d3d209603..cf0275cd1 100644 --- a/sdks/php/docs/Model/FaxResponse.md +++ b/sdks/php/docs/Model/FaxResponse.md @@ -6,7 +6,15 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -| `fax`*_required_ | [```\Dropbox\Sign\Model\FaxResponseFax```](FaxResponseFax.md) | | | -| `warnings` | [```\Dropbox\Sign\Model\WarningResponse[]```](WarningResponse.md) | A list of warnings. | | +| `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\FaxResponseTransmission[]```](FaxResponseTransmission.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/FaxResponseFax.md b/sdks/php/docs/Model/FaxResponseFax.md deleted file mode 100644 index 8bfbaf7a6..000000000 --- a/sdks/php/docs/Model/FaxResponseFax.md +++ /dev/null @@ -1,20 +0,0 @@ -# # 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/FaxResponseTransmission.md similarity index 94% rename from sdks/php/docs/Model/FaxResponseFaxTransmission.md rename to sdks/php/docs/Model/FaxResponseTransmission.md index 03e592c48..504d2aa1e 100644 --- a/sdks/php/docs/Model/FaxResponseFaxTransmission.md +++ b/sdks/php/docs/Model/FaxResponseTransmission.md @@ -1,4 +1,4 @@ -# # FaxResponseFaxTransmission +# # FaxResponseTransmission diff --git a/sdks/php/docs/Model/FaxSendRequest.md b/sdks/php/docs/Model/FaxSendRequest.md index b23542ea8..762a7eba3 100644 --- a/sdks/php/docs/Model/FaxSendRequest.md +++ b/sdks/php/docs/Model/FaxSendRequest.md @@ -6,12 +6,11 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -| `to` | ```string``` | Fax Send To Recipient | | +| `to`*_required_ | ```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 | | +| `files` | ```\SplFileObject[]``` | Fax File to Send | | +| `file_urls` | ```string[]``` | Fax File URL to Send | | +| `test_mode` | ```bool``` | API Test Mode Setting | [default to false] | | `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 | | diff --git a/sdks/php/src/Api/FaxApi.php b/sdks/php/src/Api/FaxApi.php index bcd4ad6a4..0ae0cf38d 100644 --- a/sdks/php/src/Api/FaxApi.php +++ b/sdks/php/src/Api/FaxApi.php @@ -68,20 +68,21 @@ class FaxApi * @var string[] * */ public const contentTypes = [ - 'deleteFax' => [ + 'faxDelete' => [ 'application/json', ], - 'getFaxById' => [ + 'faxFiles' => [ 'application/json', ], - 'getFaxFiles' => [ + 'faxGet' => [ 'application/json', ], - 'listFaxes' => [ + 'faxList' => [ 'application/json', ], - 'sendFax' => [ + 'faxSend' => [ 'application/json', + 'multipart/form-data', ], ]; @@ -142,7 +143,7 @@ public function getResponse() } /** - * Operation deleteFax + * Operation faxDelete * * Delete Fax * @@ -151,27 +152,27 @@ public function getResponse() * @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) + public function faxDelete(string $fax_id) { - $this->deleteFaxWithHttpInfo($fax_id); + $this->faxDeleteWithHttpInfo($fax_id); } /** - * Operation deleteFaxWithHttpInfo + * Operation faxDeleteWithHttpInfo * * 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 + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['faxDelete'] 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 + * @deprecated Prefer to use ::faxDelete. This method will eventually become unavailable */ - public function deleteFaxWithHttpInfo(string $fax_id, string $contentType = self::contentTypes['deleteFax'][0]) + public function faxDeleteWithHttpInfo(string $fax_id, string $contentType = self::contentTypes['faxDelete'][0]) { - $request = $this->deleteFaxRequest($fax_id, $contentType); + $request = $this->faxDeleteRequest($fax_id, $contentType); try { $options = $this->createHttpClientOption(); @@ -221,20 +222,20 @@ public function deleteFaxWithHttpInfo(string $fax_id, string $contentType = self } /** - * Operation deleteFaxAsync + * Operation faxDeleteAsync * * 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 + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['faxDelete'] 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 + * @deprecated Prefer to use ::faxDelete. This method will eventually become unavailable */ - public function deleteFaxAsync(string $fax_id, string $contentType = self::contentTypes['deleteFax'][0]) + public function faxDeleteAsync(string $fax_id, string $contentType = self::contentTypes['faxDelete'][0]) { - return $this->deleteFaxAsyncWithHttpInfo($fax_id, $contentType) + return $this->faxDeleteAsyncWithHttpInfo($fax_id, $contentType) ->then( function ($response) { return $response[0]; @@ -243,21 +244,21 @@ function ($response) { } /** - * Operation deleteFaxAsyncWithHttpInfo + * Operation faxDeleteAsyncWithHttpInfo * * 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 + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['faxDelete'] 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 + * @deprecated Prefer to use ::faxDelete. This method will eventually become unavailable */ - public function deleteFaxAsyncWithHttpInfo(string $fax_id, string $contentType = self::contentTypes['deleteFax'][0]) + public function faxDeleteAsyncWithHttpInfo(string $fax_id, string $contentType = self::contentTypes['faxDelete'][0]) { $returnType = ''; - $request = $this->deleteFaxRequest($fax_id, $contentType); + $request = $this->faxDeleteRequest($fax_id, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -283,21 +284,21 @@ function ($exception) { } /** - * Create request for operation 'deleteFax' + * Create request for operation 'faxDelete' * * @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 + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['faxDelete'] to see the possible values for this operation * * @return Request * @throws InvalidArgumentException - * @deprecated Prefer to use ::deleteFax. This method will eventually become unavailable + * @deprecated Prefer to use ::faxDelete. This method will eventually become unavailable */ - public function deleteFaxRequest(string $fax_id, string $contentType = self::contentTypes['deleteFax'][0]) + public function faxDeleteRequest(string $fax_id, string $contentType = self::contentTypes['faxDelete'][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' + 'Missing the required parameter $fax_id when calling faxDelete' ); } @@ -382,38 +383,38 @@ public function deleteFaxRequest(string $fax_id, string $contentType = self::con } /** - * Operation getFaxById + * Operation faxFiles * - * Get Fax + * List Fax Files * * @param string $fax_id Fax ID (required) * - * @return Model\FaxResponse + * @return SplFileObject * @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) + public function faxFiles(string $fax_id) { - list($response) = $this->getFaxByIdWithHttpInfo($fax_id); + list($response) = $this->faxFilesWithHttpInfo($fax_id); return $response; } /** - * Operation getFaxByIdWithHttpInfo + * Operation faxFilesWithHttpInfo * - * Get Fax + * List Fax Files * * @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 + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['faxFiles'] to see the possible values for this operation * - * @return array of Model\FaxResponse, HTTP status code, HTTP response headers (array of strings) + * @return array of \SplFileObject|\Dropbox\Sign\Model\ErrorResponse, 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 + * @deprecated Prefer to use ::faxFiles. This method will eventually become unavailable */ - public function getFaxByIdWithHttpInfo(string $fax_id, string $contentType = self::contentTypes['getFaxById'][0]) + public function faxFilesWithHttpInfo(string $fax_id, string $contentType = self::contentTypes['faxFiles'][0]) { - $request = $this->getFaxByIdRequest($fax_id, $contentType); + $request = $this->faxFilesRequest($fax_id, $contentType); try { $options = $this->createHttpClientOption(); @@ -462,11 +463,11 @@ public function getFaxByIdWithHttpInfo(string $fax_id, string $contentType = sel switch ($statusCode) { case 200: - if ('\Dropbox\Sign\Model\FaxResponse' === '\SplFileObject') { + if ('\SplFileObject' === '\SplFileObject') { $content = $response->getBody(); // stream goes to serializer } else { $content = (string)$response->getBody(); - if ('\Dropbox\Sign\Model\FaxResponse' !== 'string') { + if ('\SplFileObject' !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); } catch (JsonException $exception) { @@ -484,13 +485,13 @@ public function getFaxByIdWithHttpInfo(string $fax_id, string $contentType = sel } return [ - ObjectSerializer::deserialize($content, '\Dropbox\Sign\Model\FaxResponse', []), + ObjectSerializer::deserialize($content, '\SplFileObject', []), $response->getStatusCode(), $response->getHeaders(), ]; } - $returnType = '\Dropbox\Sign\Model\FaxResponse'; + $returnType = '\SplFileObject'; if ($returnType === '\SplFileObject') { $content = $response->getBody(); // stream goes to serializer } else { @@ -525,7 +526,7 @@ public function getFaxByIdWithHttpInfo(string $fax_id, string $contentType = sel case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\Dropbox\Sign\Model\FaxResponse', + '\SplFileObject', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -536,20 +537,20 @@ public function getFaxByIdWithHttpInfo(string $fax_id, string $contentType = sel } /** - * Operation getFaxByIdAsync + * Operation faxFilesAsync * - * Get Fax + * List Fax Files * * @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 + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['faxFiles'] 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 + * @deprecated Prefer to use ::faxFiles. This method will eventually become unavailable */ - public function getFaxByIdAsync(string $fax_id, string $contentType = self::contentTypes['getFaxById'][0]) + public function faxFilesAsync(string $fax_id, string $contentType = self::contentTypes['faxFiles'][0]) { - return $this->getFaxByIdAsyncWithHttpInfo($fax_id, $contentType) + return $this->faxFilesAsyncWithHttpInfo($fax_id, $contentType) ->then( function ($response) { return $response[0]; @@ -558,21 +559,21 @@ function ($response) { } /** - * Operation getFaxByIdAsyncWithHttpInfo + * Operation faxFilesAsyncWithHttpInfo * - * Get Fax + * List Fax Files * * @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 + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['faxFiles'] 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 + * @deprecated Prefer to use ::faxFiles. This method will eventually become unavailable */ - public function getFaxByIdAsyncWithHttpInfo(string $fax_id, string $contentType = self::contentTypes['getFaxById'][0]) + public function faxFilesAsyncWithHttpInfo(string $fax_id, string $contentType = self::contentTypes['faxFiles'][0]) { - $returnType = '\Dropbox\Sign\Model\FaxResponse'; - $request = $this->getFaxByIdRequest($fax_id, $contentType); + $returnType = '\SplFileObject'; + $request = $this->faxFilesRequest($fax_id, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -611,25 +612,25 @@ function ($exception) { } /** - * Create request for operation 'getFaxById' + * Create request for operation 'faxFiles' * * @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 + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['faxFiles'] to see the possible values for this operation * * @return Request * @throws InvalidArgumentException - * @deprecated Prefer to use ::getFaxById. This method will eventually become unavailable + * @deprecated Prefer to use ::faxFiles. This method will eventually become unavailable */ - public function getFaxByIdRequest(string $fax_id, string $contentType = self::contentTypes['getFaxById'][0]) + public function faxFilesRequest(string $fax_id, string $contentType = self::contentTypes['faxFiles'][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' + 'Missing the required parameter $fax_id when calling faxFiles' ); } - $resourcePath = '/fax/{fax_id}'; + $resourcePath = '/fax/files/{fax_id}'; $formParams = []; $queryParams = []; $headerParams = []; @@ -646,7 +647,7 @@ public function getFaxByIdRequest(string $fax_id, string $contentType = self::co } $headers = $this->headerSelector->selectHeaders( - $multipart ? ['multipart/form-data'] : ['application/json'], + $multipart ? ['multipart/form-data'] : ['application/pdf', 'application/json'], $contentType, $multipart ); @@ -710,38 +711,38 @@ public function getFaxByIdRequest(string $fax_id, string $contentType = self::co } /** - * Operation getFaxFiles + * Operation faxGet * - * List Fax Files + * Get Fax * * @param string $fax_id Fax ID (required) * - * @return SplFileObject + * @return Model\FaxGetResponse * @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) + public function faxGet(string $fax_id) { - list($response) = $this->getFaxFilesWithHttpInfo($fax_id); + list($response) = $this->faxGetWithHttpInfo($fax_id); return $response; } /** - * Operation getFaxFilesWithHttpInfo + * Operation faxGetWithHttpInfo * - * List Fax Files + * Get Fax * * @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 + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['faxGet'] to see the possible values for this operation * - * @return array of \SplFileObject|\Dropbox\Sign\Model\ErrorResponse, HTTP status code, HTTP response headers (array of strings) + * @return array of Model\FaxGetResponse, 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 + * @deprecated Prefer to use ::faxGet. This method will eventually become unavailable */ - public function getFaxFilesWithHttpInfo(string $fax_id, string $contentType = self::contentTypes['getFaxFiles'][0]) + public function faxGetWithHttpInfo(string $fax_id, string $contentType = self::contentTypes['faxGet'][0]) { - $request = $this->getFaxFilesRequest($fax_id, $contentType); + $request = $this->faxGetRequest($fax_id, $contentType); try { $options = $this->createHttpClientOption(); @@ -790,11 +791,11 @@ public function getFaxFilesWithHttpInfo(string $fax_id, string $contentType = se switch ($statusCode) { case 200: - if ('\SplFileObject' === '\SplFileObject') { + if ('\Dropbox\Sign\Model\FaxGetResponse' === '\SplFileObject') { $content = $response->getBody(); // stream goes to serializer } else { $content = (string)$response->getBody(); - if ('\SplFileObject' !== 'string') { + if ('\Dropbox\Sign\Model\FaxGetResponse' !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); } catch (JsonException $exception) { @@ -812,13 +813,13 @@ public function getFaxFilesWithHttpInfo(string $fax_id, string $contentType = se } return [ - ObjectSerializer::deserialize($content, '\SplFileObject', []), + ObjectSerializer::deserialize($content, '\Dropbox\Sign\Model\FaxGetResponse', []), $response->getStatusCode(), $response->getHeaders(), ]; } - $returnType = '\SplFileObject'; + $returnType = '\Dropbox\Sign\Model\FaxGetResponse'; if ($returnType === '\SplFileObject') { $content = $response->getBody(); // stream goes to serializer } else { @@ -853,7 +854,7 @@ public function getFaxFilesWithHttpInfo(string $fax_id, string $contentType = se case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\SplFileObject', + '\Dropbox\Sign\Model\FaxGetResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -864,20 +865,20 @@ public function getFaxFilesWithHttpInfo(string $fax_id, string $contentType = se } /** - * Operation getFaxFilesAsync + * Operation faxGetAsync * - * List Fax Files + * Get Fax * * @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 + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['faxGet'] 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 + * @deprecated Prefer to use ::faxGet. This method will eventually become unavailable */ - public function getFaxFilesAsync(string $fax_id, string $contentType = self::contentTypes['getFaxFiles'][0]) + public function faxGetAsync(string $fax_id, string $contentType = self::contentTypes['faxGet'][0]) { - return $this->getFaxFilesAsyncWithHttpInfo($fax_id, $contentType) + return $this->faxGetAsyncWithHttpInfo($fax_id, $contentType) ->then( function ($response) { return $response[0]; @@ -886,21 +887,21 @@ function ($response) { } /** - * Operation getFaxFilesAsyncWithHttpInfo + * Operation faxGetAsyncWithHttpInfo * - * List Fax Files + * Get Fax * * @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 + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['faxGet'] 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 + * @deprecated Prefer to use ::faxGet. This method will eventually become unavailable */ - public function getFaxFilesAsyncWithHttpInfo(string $fax_id, string $contentType = self::contentTypes['getFaxFiles'][0]) + public function faxGetAsyncWithHttpInfo(string $fax_id, string $contentType = self::contentTypes['faxGet'][0]) { - $returnType = '\SplFileObject'; - $request = $this->getFaxFilesRequest($fax_id, $contentType); + $returnType = '\Dropbox\Sign\Model\FaxGetResponse'; + $request = $this->faxGetRequest($fax_id, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -939,25 +940,25 @@ function ($exception) { } /** - * Create request for operation 'getFaxFiles' + * Create request for operation 'faxGet' * * @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 + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['faxGet'] to see the possible values for this operation * * @return Request * @throws InvalidArgumentException - * @deprecated Prefer to use ::getFaxFiles. This method will eventually become unavailable + * @deprecated Prefer to use ::faxGet. This method will eventually become unavailable */ - public function getFaxFilesRequest(string $fax_id, string $contentType = self::contentTypes['getFaxFiles'][0]) + public function faxGetRequest(string $fax_id, string $contentType = self::contentTypes['faxGet'][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' + 'Missing the required parameter $fax_id when calling faxGet' ); } - $resourcePath = '/fax/files/{fax_id}'; + $resourcePath = '/fax/{fax_id}'; $formParams = []; $queryParams = []; $headerParams = []; @@ -974,7 +975,7 @@ public function getFaxFilesRequest(string $fax_id, string $contentType = self::c } $headers = $this->headerSelector->selectHeaders( - $multipart ? ['multipart/form-data'] : ['application/pdf', 'application/json'], + $multipart ? ['multipart/form-data'] : ['application/json'], $contentType, $multipart ); @@ -1038,40 +1039,40 @@ public function getFaxFilesRequest(string $fax_id, string $contentType = self::c } /** - * Operation listFaxes + * Operation faxList * * Lists Faxes * - * @param int $page Page (required) - * @param int $page_size Page size (required) + * @param int $page Page (optional, default to 1) + * @param int $page_size Page size (optional, default to 20) * * @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) + public function faxList(int $page = 1, int $page_size = 20) { - list($response) = $this->listFaxesWithHttpInfo($page, $page_size); + list($response) = $this->faxListWithHttpInfo($page, $page_size); return $response; } /** - * Operation listFaxesWithHttpInfo + * Operation faxListWithHttpInfo * * 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 + * @param int $page Page (optional, default to 1) + * @param int $page_size Page size (optional, default to 20) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['faxList'] 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 + * @deprecated Prefer to use ::faxList. This method will eventually become unavailable */ - public function listFaxesWithHttpInfo(int $page, int $page_size, string $contentType = self::contentTypes['listFaxes'][0]) + public function faxListWithHttpInfo(int $page = 1, int $page_size = 20, string $contentType = self::contentTypes['faxList'][0]) { - $request = $this->listFaxesRequest($page, $page_size, $contentType); + $request = $this->faxListRequest($page, $page_size, $contentType); try { $options = $this->createHttpClientOption(); @@ -1194,21 +1195,21 @@ public function listFaxesWithHttpInfo(int $page, int $page_size, string $content } /** - * Operation listFaxesAsync + * Operation faxListAsync * * 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 + * @param int $page Page (optional, default to 1) + * @param int $page_size Page size (optional, default to 20) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['faxList'] 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 + * @deprecated Prefer to use ::faxList. This method will eventually become unavailable */ - public function listFaxesAsync(int $page, int $page_size, string $contentType = self::contentTypes['listFaxes'][0]) + public function faxListAsync(int $page = 1, int $page_size = 20, string $contentType = self::contentTypes['faxList'][0]) { - return $this->listFaxesAsyncWithHttpInfo($page, $page_size, $contentType) + return $this->faxListAsyncWithHttpInfo($page, $page_size, $contentType) ->then( function ($response) { return $response[0]; @@ -1217,22 +1218,22 @@ function ($response) { } /** - * Operation listFaxesAsyncWithHttpInfo + * Operation faxListAsyncWithHttpInfo * * 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 + * @param int $page Page (optional, default to 1) + * @param int $page_size Page size (optional, default to 20) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['faxList'] 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 + * @deprecated Prefer to use ::faxList. This method will eventually become unavailable */ - public function listFaxesAsyncWithHttpInfo(int $page, int $page_size, string $contentType = self::contentTypes['listFaxes'][0]) + public function faxListAsyncWithHttpInfo(int $page = 1, int $page_size = 20, string $contentType = self::contentTypes['faxList'][0]) { $returnType = '\Dropbox\Sign\Model\FaxListResponse'; - $request = $this->listFaxesRequest($page, $page_size, $contentType); + $request = $this->faxListRequest($page, $page_size, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -1271,39 +1272,27 @@ function ($exception) { } /** - * Create request for operation 'listFaxes' + * Create request for operation 'faxList' * - * @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 + * @param int $page Page (optional, default to 1) + * @param int $page_size Page size (optional, default to 20) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['faxList'] to see the possible values for this operation * * @return Request * @throws InvalidArgumentException - * @deprecated Prefer to use ::listFaxes. This method will eventually become unavailable + * @deprecated Prefer to use ::faxList. This method will eventually become unavailable */ - public function listFaxesRequest(int $page, int $page_size, string $contentType = self::contentTypes['listFaxes'][0]) + public function faxListRequest(int $page = 1, int $page_size = 20, string $contentType = self::contentTypes['faxList'][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.'); + if ($page !== null && $page < 1) { + throw new InvalidArgumentException('invalid value for "$page" when calling FaxApi.faxList, 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 !== null && $page_size > 100) { + throw new InvalidArgumentException('invalid value for "$page_size" when calling FaxApi.faxList, 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.'); + if ($page_size !== null && $page_size < 1) { + throw new InvalidArgumentException('invalid value for "$page_size" when calling FaxApi.faxList, must be bigger than or equal to 1.'); } $resourcePath = '/fax/list'; @@ -1320,7 +1309,7 @@ public function listFaxesRequest(int $page, int $page_size, string $contentType 'integer', // openApiType 'form', // style true, // explode - true // required + false // required ) ?? []); // query params $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( @@ -1329,7 +1318,7 @@ public function listFaxesRequest(int $page, int $page_size, string $contentType 'integer', // openApiType 'form', // style true, // explode - true // required + false // required ) ?? []); $headers = $this->headerSelector->selectHeaders( @@ -1397,38 +1386,38 @@ public function listFaxesRequest(int $page, int $page_size, string $contentType } /** - * Operation sendFax + * Operation faxSend * * Send Fax * * @param Model\FaxSendRequest $fax_send_request fax_send_request (required) * - * @return Model\FaxResponse + * @return Model\FaxGetResponse * @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) + public function faxSend(Model\FaxSendRequest $fax_send_request) { - list($response) = $this->sendFaxWithHttpInfo($fax_send_request); + list($response) = $this->faxSendWithHttpInfo($fax_send_request); return $response; } /** - * Operation sendFaxWithHttpInfo + * Operation faxSendWithHttpInfo * * 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 + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['faxSend'] to see the possible values for this operation * - * @return array of Model\FaxResponse, HTTP status code, HTTP response headers (array of strings) + * @return array of Model\FaxGetResponse, 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 + * @deprecated Prefer to use ::faxSend. This method will eventually become unavailable */ - public function sendFaxWithHttpInfo(Model\FaxSendRequest $fax_send_request, string $contentType = self::contentTypes['sendFax'][0]) + public function faxSendWithHttpInfo(Model\FaxSendRequest $fax_send_request, string $contentType = self::contentTypes['faxSend'][0]) { - $request = $this->sendFaxRequest($fax_send_request, $contentType); + $request = $this->faxSendRequest($fax_send_request, $contentType); try { $options = $this->createHttpClientOption(); @@ -1477,11 +1466,11 @@ public function sendFaxWithHttpInfo(Model\FaxSendRequest $fax_send_request, stri switch ($statusCode) { case 200: - if ('\Dropbox\Sign\Model\FaxResponse' === '\SplFileObject') { + if ('\Dropbox\Sign\Model\FaxGetResponse' === '\SplFileObject') { $content = $response->getBody(); // stream goes to serializer } else { $content = (string)$response->getBody(); - if ('\Dropbox\Sign\Model\FaxResponse' !== 'string') { + if ('\Dropbox\Sign\Model\FaxGetResponse' !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); } catch (JsonException $exception) { @@ -1499,13 +1488,13 @@ public function sendFaxWithHttpInfo(Model\FaxSendRequest $fax_send_request, stri } return [ - ObjectSerializer::deserialize($content, '\Dropbox\Sign\Model\FaxResponse', []), + ObjectSerializer::deserialize($content, '\Dropbox\Sign\Model\FaxGetResponse', []), $response->getStatusCode(), $response->getHeaders(), ]; } - $returnType = '\Dropbox\Sign\Model\FaxResponse'; + $returnType = '\Dropbox\Sign\Model\FaxGetResponse'; if ($returnType === '\SplFileObject') { $content = $response->getBody(); // stream goes to serializer } else { @@ -1540,7 +1529,7 @@ public function sendFaxWithHttpInfo(Model\FaxSendRequest $fax_send_request, stri case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\Dropbox\Sign\Model\FaxResponse', + '\Dropbox\Sign\Model\FaxGetResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -1551,20 +1540,20 @@ public function sendFaxWithHttpInfo(Model\FaxSendRequest $fax_send_request, stri } /** - * Operation sendFaxAsync + * Operation faxSendAsync * * 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 + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['faxSend'] 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 + * @deprecated Prefer to use ::faxSend. This method will eventually become unavailable */ - public function sendFaxAsync(Model\FaxSendRequest $fax_send_request, string $contentType = self::contentTypes['sendFax'][0]) + public function faxSendAsync(Model\FaxSendRequest $fax_send_request, string $contentType = self::contentTypes['faxSend'][0]) { - return $this->sendFaxAsyncWithHttpInfo($fax_send_request, $contentType) + return $this->faxSendAsyncWithHttpInfo($fax_send_request, $contentType) ->then( function ($response) { return $response[0]; @@ -1573,21 +1562,21 @@ function ($response) { } /** - * Operation sendFaxAsyncWithHttpInfo + * Operation faxSendAsyncWithHttpInfo * * 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 + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['faxSend'] 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 + * @deprecated Prefer to use ::faxSend. This method will eventually become unavailable */ - public function sendFaxAsyncWithHttpInfo(Model\FaxSendRequest $fax_send_request, string $contentType = self::contentTypes['sendFax'][0]) + public function faxSendAsyncWithHttpInfo(Model\FaxSendRequest $fax_send_request, string $contentType = self::contentTypes['faxSend'][0]) { - $returnType = '\Dropbox\Sign\Model\FaxResponse'; - $request = $this->sendFaxRequest($fax_send_request, $contentType); + $returnType = '\Dropbox\Sign\Model\FaxGetResponse'; + $request = $this->faxSendRequest($fax_send_request, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -1626,21 +1615,21 @@ function ($exception) { } /** - * Create request for operation 'sendFax' + * Create request for operation 'faxSend' * * @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 + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['faxSend'] to see the possible values for this operation * * @return Request * @throws InvalidArgumentException - * @deprecated Prefer to use ::sendFax. This method will eventually become unavailable + * @deprecated Prefer to use ::faxSend. This method will eventually become unavailable */ - public function sendFaxRequest(Model\FaxSendRequest $fax_send_request, string $contentType = self::contentTypes['sendFax'][0]) + public function faxSendRequest(Model\FaxSendRequest $fax_send_request, string $contentType = self::contentTypes['faxSend'][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' + 'Missing the required parameter $fax_send_request when calling faxSend' ); } diff --git a/sdks/php/src/Model/SubFile.php b/sdks/php/src/Model/FaxGetResponse.php similarity index 80% rename from sdks/php/src/Model/SubFile.php rename to sdks/php/src/Model/FaxGetResponse.php index 82ed726b6..232943492 100644 --- a/sdks/php/src/Model/SubFile.php +++ b/sdks/php/src/Model/FaxGetResponse.php @@ -1,6 +1,6 @@ */ -class SubFile implements ModelInterface, ArrayAccess, JsonSerializable +class FaxGetResponse implements ModelInterface, ArrayAccess, JsonSerializable { public const DISCRIMINATOR = null; @@ -50,7 +49,7 @@ class SubFile implements ModelInterface, ArrayAccess, JsonSerializable * * @var string */ - protected static $openAPIModelName = 'SubFile'; + protected static $openAPIModelName = 'FaxGetResponse'; /** * Array of property to type mappings. Used for (de)serialization @@ -58,7 +57,8 @@ class SubFile implements ModelInterface, ArrayAccess, JsonSerializable * @var string[] */ protected static $openAPITypes = [ - 'name' => 'string', + 'fax' => '\Dropbox\Sign\Model\FaxResponse', + 'warnings' => '\Dropbox\Sign\Model\WarningResponse[]', ]; /** @@ -69,7 +69,8 @@ class SubFile implements ModelInterface, ArrayAccess, JsonSerializable * @psalm-var array */ protected static $openAPIFormats = [ - 'name' => null, + 'fax' => null, + 'warnings' => null, ]; /** @@ -78,7 +79,8 @@ class SubFile implements ModelInterface, ArrayAccess, JsonSerializable * @var bool[] */ protected static array $openAPINullables = [ - 'name' => false, + 'fax' => false, + 'warnings' => false, ]; /** @@ -159,7 +161,8 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $attributeMap = [ - 'name' => 'name', + 'fax' => 'fax', + 'warnings' => 'warnings', ]; /** @@ -168,7 +171,8 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $setters = [ - 'name' => 'setName', + 'fax' => 'setFax', + 'warnings' => 'setWarnings', ]; /** @@ -177,7 +181,8 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $getters = [ - 'name' => 'getName', + 'fax' => 'getFax', + 'warnings' => 'getWarnings', ]; /** @@ -236,13 +241,14 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->setIfExists('name', $data ?? [], ''); + $this->setIfExists('fax', $data ?? [], null); + $this->setIfExists('warnings', $data ?? [], null); } /** * @deprecated use ::init() */ - public static function fromArray(array $data): SubFile + public static function fromArray(array $data): FaxGetResponse { return self::init($data); } @@ -250,12 +256,12 @@ public static function fromArray(array $data): SubFile /** * Attempt to instantiate and hydrate a new instance of this class */ - public static function init(array $data): SubFile + public static function init(array $data): FaxGetResponse { - /** @var SubFile */ + /** @var FaxGetResponse */ return ObjectSerializer::deserialize( $data, - SubFile::class, + FaxGetResponse::class, ); } @@ -282,7 +288,12 @@ private function setIfExists(string $variableName, array $fields, $defaultValue) */ public function listInvalidProperties() { - return []; + $invalidProperties = []; + + if ($this->container['fax'] === null) { + $invalidProperties[] = "'fax' can't be null"; + } + return $invalidProperties; } /** @@ -297,28 +308,55 @@ public function valid() } /** - * Gets name + * Gets fax + * + * @return FaxResponse + */ + public function getFax() + { + return $this->container['fax']; + } + + /** + * Sets fax + * + * @param FaxResponse $fax fax + * + * @return self + */ + public function setFax(FaxResponse $fax) + { + if (is_null($fax)) { + throw new InvalidArgumentException('non-nullable fax cannot be null'); + } + $this->container['fax'] = $fax; + + return $this; + } + + /** + * Gets warnings * - * @return string|null + * @return WarningResponse[]|null */ - public function getName() + public function getWarnings() { - return $this->container['name']; + return $this->container['warnings']; } /** - * Sets name + * Sets warnings * - * @param string|null $name Actual physical uploaded file name that is derived during upload. Not settable parameter. + * @param WarningResponse[]|null $warnings a list of warnings * * @return self */ - public function setName(?string $name) + public function setWarnings(?array $warnings) { - if (is_null($name)) { - throw new InvalidArgumentException('non-nullable name cannot be null'); + if (is_null($warnings)) { + throw new InvalidArgumentException('non-nullable warnings cannot be null'); } - $this->container['name'] = $name; + $this->container['warnings'] = $warnings; return $this; } diff --git a/sdks/php/src/Model/FaxListResponse.php b/sdks/php/src/Model/FaxListResponse.php index ae3b71be4..21e89d342 100644 --- a/sdks/php/src/Model/FaxListResponse.php +++ b/sdks/php/src/Model/FaxListResponse.php @@ -57,7 +57,7 @@ class FaxListResponse implements ModelInterface, ArrayAccess, JsonSerializable * @var string[] */ protected static $openAPITypes = [ - 'faxes' => '\Dropbox\Sign\Model\FaxResponseFax[]', + 'faxes' => '\Dropbox\Sign\Model\FaxResponse[]', 'list_info' => '\Dropbox\Sign\Model\ListInfoResponse', ]; @@ -313,7 +313,7 @@ public function valid() /** * Gets faxes * - * @return FaxResponseFax[] + * @return FaxResponse[] */ public function getFaxes() { @@ -323,7 +323,7 @@ public function getFaxes() /** * Sets faxes * - * @param FaxResponseFax[] $faxes faxes + * @param FaxResponse[] $faxes faxes * * @return self */ diff --git a/sdks/php/src/Model/FaxResponse.php b/sdks/php/src/Model/FaxResponse.php index a74e6e363..9cec78a71 100644 --- a/sdks/php/src/Model/FaxResponse.php +++ b/sdks/php/src/Model/FaxResponse.php @@ -57,8 +57,16 @@ class FaxResponse implements ModelInterface, ArrayAccess, JsonSerializable * @var string[] */ protected static $openAPITypes = [ - 'fax' => '\Dropbox\Sign\Model\FaxResponseFax', - 'warnings' => '\Dropbox\Sign\Model\WarningResponse[]', + 'fax_id' => 'string', + 'title' => 'string', + 'original_title' => 'string', + 'subject' => 'string', + 'message' => 'string', + 'metadata' => 'array', + 'created_at' => 'int', + 'from' => 'string', + 'transmissions' => '\Dropbox\Sign\Model\FaxResponseTransmission[]', + 'files_url' => 'string', ]; /** @@ -69,8 +77,16 @@ class FaxResponse implements ModelInterface, ArrayAccess, JsonSerializable * @psalm-var array */ protected static $openAPIFormats = [ - 'fax' => null, - 'warnings' => null, + 'fax_id' => null, + 'title' => null, + 'original_title' => null, + 'subject' => null, + 'message' => null, + 'metadata' => null, + 'created_at' => null, + 'from' => null, + 'transmissions' => null, + 'files_url' => null, ]; /** @@ -79,8 +95,16 @@ class FaxResponse implements ModelInterface, ArrayAccess, JsonSerializable * @var bool[] */ protected static array $openAPINullables = [ - 'fax' => false, - 'warnings' => false, + 'fax_id' => false, + 'title' => false, + 'original_title' => false, + 'subject' => false, + 'message' => false, + 'metadata' => false, + 'created_at' => false, + 'from' => false, + 'transmissions' => false, + 'files_url' => false, ]; /** @@ -161,8 +185,16 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $attributeMap = [ - 'fax' => 'fax', - 'warnings' => 'warnings', + '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', ]; /** @@ -171,8 +203,16 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $setters = [ - 'fax' => 'setFax', - 'warnings' => 'setWarnings', + 'fax_id' => 'setFaxId', + 'title' => 'setTitle', + 'original_title' => 'setOriginalTitle', + 'subject' => 'setSubject', + 'message' => 'setMessage', + 'metadata' => 'setMetadata', + 'created_at' => 'setCreatedAt', + 'from' => 'setFrom', + 'transmissions' => 'setTransmissions', + 'files_url' => 'setFilesUrl', ]; /** @@ -181,8 +221,16 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $getters = [ - 'fax' => 'getFax', - 'warnings' => 'getWarnings', + 'fax_id' => 'getFaxId', + 'title' => 'getTitle', + 'original_title' => 'getOriginalTitle', + 'subject' => 'getSubject', + 'message' => 'getMessage', + 'metadata' => 'getMetadata', + 'created_at' => 'getCreatedAt', + 'from' => 'getFrom', + 'transmissions' => 'getTransmissions', + 'files_url' => 'getFilesUrl', ]; /** @@ -241,8 +289,16 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->setIfExists('fax', $data ?? [], null); - $this->setIfExists('warnings', $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); } /** @@ -288,12 +344,7 @@ private function setIfExists(string $variableName, array $fields, $defaultValue) */ public function listInvalidProperties() { - $invalidProperties = []; - - if ($this->container['fax'] === null) { - $invalidProperties[] = "'fax' can't be null"; - } - return $invalidProperties; + return []; } /** @@ -308,55 +359,271 @@ public function valid() } /** - * Gets fax + * 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 FaxResponseFax + * @return FaxResponseTransmission[]|null */ - public function getFax() + public function getTransmissions() { - return $this->container['fax']; + return $this->container['transmissions']; } /** - * Sets fax + * Sets transmissions * - * @param FaxResponseFax $fax fax + * @param FaxResponseTransmission[]|null $transmissions Fax Transmissions List * * @return self */ - public function setFax(FaxResponseFax $fax) + public function setTransmissions(?array $transmissions) { - if (is_null($fax)) { - throw new InvalidArgumentException('non-nullable fax cannot be null'); + if (is_null($transmissions)) { + throw new InvalidArgumentException('non-nullable transmissions cannot be null'); } - $this->container['fax'] = $fax; + $this->container['transmissions'] = $transmissions; return $this; } /** - * Gets warnings + * Gets files_url * - * @return WarningResponse[]|null + * @return string|null */ - public function getWarnings() + public function getFilesUrl() { - return $this->container['warnings']; + return $this->container['files_url']; } /** - * Sets warnings + * Sets files_url * - * @param WarningResponse[]|null $warnings a list of warnings + * @param string|null $files_url Fax Files URL * * @return self */ - public function setWarnings(?array $warnings) + public function setFilesUrl(?string $files_url) { - if (is_null($warnings)) { - throw new InvalidArgumentException('non-nullable warnings cannot be null'); + if (is_null($files_url)) { + throw new InvalidArgumentException('non-nullable files_url cannot be null'); } - $this->container['warnings'] = $warnings; + $this->container['files_url'] = $files_url; return $this; } diff --git a/sdks/php/src/Model/FaxResponseFax.php b/sdks/php/src/Model/FaxResponseFax.php deleted file mode 100644 index d5acfb2e9..000000000 --- a/sdks/php/src/Model/FaxResponseFax.php +++ /dev/null @@ -1,717 +0,0 @@ - - */ -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/FaxResponseTransmission.php similarity index 96% rename from sdks/php/src/Model/FaxResponseFaxTransmission.php rename to sdks/php/src/Model/FaxResponseTransmission.php index a7b00e08b..f55d0d658 100644 --- a/sdks/php/src/Model/FaxResponseFaxTransmission.php +++ b/sdks/php/src/Model/FaxResponseTransmission.php @@ -1,6 +1,6 @@ */ -class FaxResponseFaxTransmission implements ModelInterface, ArrayAccess, JsonSerializable +class FaxResponseTransmission implements ModelInterface, ArrayAccess, JsonSerializable { public const DISCRIMINATOR = null; @@ -49,7 +49,7 @@ class FaxResponseFaxTransmission implements ModelInterface, ArrayAccess, JsonSer * * @var string */ - protected static $openAPIModelName = 'FaxResponseFaxTransmission'; + protected static $openAPIModelName = 'FaxResponseTransmission'; /** * Array of property to type mappings. Used for (de)serialization @@ -262,7 +262,7 @@ public function __construct(array $data = null) /** * @deprecated use ::init() */ - public static function fromArray(array $data): FaxResponseFaxTransmission + public static function fromArray(array $data): FaxResponseTransmission { return self::init($data); } @@ -270,12 +270,12 @@ public static function fromArray(array $data): FaxResponseFaxTransmission /** * Attempt to instantiate and hydrate a new instance of this class */ - public static function init(array $data): FaxResponseFaxTransmission + public static function init(array $data): FaxResponseTransmission { - /** @var FaxResponseFaxTransmission */ + /** @var FaxResponseTransmission */ return ObjectSerializer::deserialize( $data, - FaxResponseFaxTransmission::class, + FaxResponseTransmission::class, ); } diff --git a/sdks/php/src/Model/FaxSendRequest.php b/sdks/php/src/Model/FaxSendRequest.php index c11c2fc6a..33d206b0f 100644 --- a/sdks/php/src/Model/FaxSendRequest.php +++ b/sdks/php/src/Model/FaxSendRequest.php @@ -32,6 +32,7 @@ use InvalidArgumentException; use JsonSerializable; use ReturnTypeWillChange; +use SplFileObject; /** * FaxSendRequest Class Doc Comment @@ -59,9 +60,8 @@ class FaxSendRequest implements ModelInterface, ArrayAccess, JsonSerializable protected static $openAPITypes = [ 'to' => 'string', 'from' => 'string', - 'file' => '\Dropbox\Sign\Model\SubFile[]', - 'file_url' => 'string[]', - 'file_url_names' => 'string[]', + 'files' => '\SplFileObject[]', + 'file_urls' => 'string[]', 'test_mode' => 'bool', 'cover_page_to' => 'string', 'cover_page_from' => 'string', @@ -79,9 +79,8 @@ class FaxSendRequest implements ModelInterface, ArrayAccess, JsonSerializable protected static $openAPIFormats = [ 'to' => null, 'from' => null, - 'file' => null, - 'file_url' => null, - 'file_url_names' => null, + 'files' => 'binary', + 'file_urls' => null, 'test_mode' => null, 'cover_page_to' => null, 'cover_page_from' => null, @@ -96,15 +95,14 @@ class FaxSendRequest implements ModelInterface, ArrayAccess, JsonSerializable */ protected static array $openAPINullables = [ 'to' => false, - 'from' => true, - 'file' => false, - 'file_url' => false, - 'file_url_names' => false, + 'from' => false, + 'files' => false, + 'file_urls' => false, 'test_mode' => false, - 'cover_page_to' => true, - 'cover_page_from' => true, - 'cover_page_message' => true, - 'title' => true, + 'cover_page_to' => false, + 'cover_page_from' => false, + 'cover_page_message' => false, + 'title' => false, ]; /** @@ -187,9 +185,8 @@ public function isNullableSetToNull(string $property): bool protected static $attributeMap = [ 'to' => 'to', 'from' => 'from', - 'file' => 'file', - 'file_url' => 'file_url', - 'file_url_names' => 'file_url_names', + 'files' => 'files', + 'file_urls' => 'file_urls', 'test_mode' => 'test_mode', 'cover_page_to' => 'cover_page_to', 'cover_page_from' => 'cover_page_from', @@ -205,9 +202,8 @@ public function isNullableSetToNull(string $property): bool protected static $setters = [ 'to' => 'setTo', 'from' => 'setFrom', - 'file' => 'setFile', - 'file_url' => 'setFileUrl', - 'file_url_names' => 'setFileUrlNames', + 'files' => 'setFiles', + 'file_urls' => 'setFileUrls', 'test_mode' => 'setTestMode', 'cover_page_to' => 'setCoverPageTo', 'cover_page_from' => 'setCoverPageFrom', @@ -223,9 +219,8 @@ public function isNullableSetToNull(string $property): bool protected static $getters = [ 'to' => 'getTo', 'from' => 'getFrom', - 'file' => 'getFile', - 'file_url' => 'getFileUrl', - 'file_url_names' => 'getFileUrlNames', + 'files' => 'getFiles', + 'file_urls' => 'getFileUrls', 'test_mode' => 'getTestMode', 'cover_page_to' => 'getCoverPageTo', 'cover_page_from' => 'getCoverPageFrom', @@ -291,10 +286,9 @@ 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('files', $data ?? [], null); + $this->setIfExists('file_urls', $data ?? [], null); + $this->setIfExists('test_mode', $data ?? [], false); $this->setIfExists('cover_page_to', $data ?? [], null); $this->setIfExists('cover_page_from', $data ?? [], null); $this->setIfExists('cover_page_message', $data ?? [], null); @@ -344,7 +338,12 @@ private function setIfExists(string $variableName, array $fields, $defaultValue) */ public function listInvalidProperties() { - return []; + $invalidProperties = []; + + if ($this->container['to'] === null) { + $invalidProperties[] = "'to' can't be null"; + } + return $invalidProperties; } /** @@ -361,7 +360,7 @@ public function valid() /** * Gets to * - * @return string|null + * @return string */ public function getTo() { @@ -371,11 +370,11 @@ public function getTo() /** * Sets to * - * @param string|null $to Fax Send To Recipient + * @param string $to Fax Send To Recipient * * @return self */ - public function setTo(?string $to) + public function setTo(string $to) { if (is_null($to)) { throw new InvalidArgumentException('non-nullable to cannot be null'); @@ -405,14 +404,7 @@ public function getFrom() 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); - } + throw new InvalidArgumentException('non-nullable from cannot be null'); } $this->container['from'] = $from; @@ -420,82 +412,55 @@ public function setFrom(?string $from) } /** - * Gets file + * Gets files * - * @return SubFile[]|null + * @return SplFileObject[]|null */ - public function getFile() + public function getFiles() { - return $this->container['file']; + return $this->container['files']; } /** - * Sets file + * Sets files * - * @param SubFile[]|null $file Fax File to Send + * @param SplFileObject[]|null $files Fax File to Send * * @return self */ - public function setFile(?array $file) + public function setFiles(?array $files) { - if (is_null($file)) { - throw new InvalidArgumentException('non-nullable file cannot be null'); + if (is_null($files)) { + throw new InvalidArgumentException('non-nullable files cannot be null'); } - $this->container['file'] = $file; + $this->container['files'] = $files; return $this; } /** - * Gets file_url + * Gets file_urls * * @return string[]|null */ - public function getFileUrl() + public function getFileUrls() { - return $this->container['file_url']; + return $this->container['file_urls']; } /** - * Sets file_url + * Sets file_urls * - * @param string[]|null $file_url Fax File URL to Send + * @param string[]|null $file_urls Fax File URL to Send * * @return self */ - public function setFileUrl(?array $file_url) + public function setFileUrls(?array $file_urls) { - if (is_null($file_url)) { - throw new InvalidArgumentException('non-nullable file_url cannot be null'); + if (is_null($file_urls)) { + throw new InvalidArgumentException('non-nullable file_urls 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; + $this->container['file_urls'] = $file_urls; return $this; } @@ -547,14 +512,7 @@ public function getCoverPageTo() 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); - } + throw new InvalidArgumentException('non-nullable cover_page_to cannot be null'); } $this->container['cover_page_to'] = $cover_page_to; @@ -581,14 +539,7 @@ public function getCoverPageFrom() 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); - } + throw new InvalidArgumentException('non-nullable cover_page_from cannot be null'); } $this->container['cover_page_from'] = $cover_page_from; @@ -615,14 +566,7 @@ public function getCoverPageMessage() 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); - } + throw new InvalidArgumentException('non-nullable cover_page_message cannot be null'); } $this->container['cover_page_message'] = $cover_page_message; @@ -649,14 +593,7 @@ public function getTitle() 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); - } + throw new InvalidArgumentException('non-nullable title cannot be null'); } $this->container['title'] = $title; diff --git a/sdks/python/README.md b/sdks/python/README.md index f6a2d1adb..c97fbdfd9 100644 --- a/sdks/python/README.md +++ b/sdks/python/README.md @@ -115,11 +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| +|```FaxApi``` | [```fax_delete```](docs/FaxApi.md#fax_delete) | ```DELETE /fax/{fax_id}``` | Delete Fax| +```FaxApi``` | [```fax_files```](docs/FaxApi.md#fax_files) | ```GET /fax/files/{fax_id}``` | List Fax Files| +```FaxApi``` | [```fax_get```](docs/FaxApi.md#fax_get) | ```GET /fax/{fax_id}``` | Get Fax| +```FaxApi``` | [```fax_list```](docs/FaxApi.md#fax_list) | ```GET /fax/list``` | Lists Faxes| +```FaxApi``` | [```fax_send```](docs/FaxApi.md#fax_send) | ```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| @@ -209,6 +209,7 @@ Class | Method | HTTP request | Description - [EventCallbackRequest](docs/EventCallbackRequest.md) - [EventCallbackRequestEvent](docs/EventCallbackRequestEvent.md) - [EventCallbackRequestEventMetadata](docs/EventCallbackRequestEventMetadata.md) + - [FaxGetResponse](docs/FaxGetResponse.md) - [FaxLineAddUserRequest](docs/FaxLineAddUserRequest.md) - [FaxLineAreaCodeGetCountryEnum](docs/FaxLineAreaCodeGetCountryEnum.md) - [FaxLineAreaCodeGetProvinceEnum](docs/FaxLineAreaCodeGetProvinceEnum.md) @@ -222,8 +223,7 @@ Class | Method | HTTP request | Description - [FaxLineResponseFaxLine](docs/FaxLineResponseFaxLine.md) - [FaxListResponse](docs/FaxListResponse.md) - [FaxResponse](docs/FaxResponse.md) - - [FaxResponseFax](docs/FaxResponseFax.md) - - [FaxResponseFaxTransmission](docs/FaxResponseFaxTransmission.md) + - [FaxResponseTransmission](docs/FaxResponseTransmission.md) - [FaxSendRequest](docs/FaxSendRequest.md) - [FileResponse](docs/FileResponse.md) - [FileResponseDataUri](docs/FileResponseDataUri.md) @@ -269,7 +269,6 @@ 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 index c241ea626..a0e778fec 100644 --- a/sdks/python/docs/FaxApi.md +++ b/sdks/python/docs/FaxApi.md @@ -4,15 +4,15 @@ 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| +|[```fax_delete```](FaxApi.md#fax_delete) | ```DELETE /fax/{fax_id}``` | Delete Fax| +|[```fax_files```](FaxApi.md#fax_files) | ```GET /fax/files/{fax_id}``` | List Fax Files| +|[```fax_get```](FaxApi.md#fax_get) | ```GET /fax/{fax_id}``` | Get Fax| +|[```fax_list```](FaxApi.md#fax_list) | ```GET /fax/list``` | Lists Faxes| +|[```fax_send```](FaxApi.md#fax_send) | ```POST /fax/send``` | Send Fax| -# ```delete_fax``` -> ```delete_fax(fax_id)``` +# ```fax_delete``` +> ```fax_delete(fax_id)``` Delete Fax @@ -65,17 +65,17 @@ void (empty response body) | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | successful operation | * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
| +**204** | 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)``` +# ```fax_files``` +> ```io.IOBase fax_files(fax_id)``` -Get Fax +List Fax Files -Returns information about fax +Returns list of fax files ### Example @@ -84,7 +84,7 @@ Returns information about fax ```python from pprint import pprint -from dropbox_sign import ApiClient, ApiException, Configuration, apis +from dropbox_sign import ApiClient, ApiException, Configuration, apis, models configuration = Configuration( # Configure HTTP basic authorization: api_key @@ -94,11 +94,10 @@ configuration = Configuration( with ApiClient(configuration) as api_client: fax_api = apis.FaxApi(api_client) - faxId = "fa5c8a0b0f492d768749333ad6fcc214c111e967" + fax_id = "fa5c8a0b0f492d768749333ad6fcc214c111e967" try: - response = fax_api.get_fax_by_id(client_id) - pprint(response) + fax_api.get_fax_files(fax_id) except ApiException as e: print("Exception when calling Dropbox Sign API: %s\n" % e) @@ -112,7 +111,7 @@ with ApiClient(configuration) as api_client: ### Return type -[**FaxResponse**](FaxResponse.md) +**io.IOBase** ### Authorization @@ -121,7 +120,7 @@ with ApiClient(configuration) as api_client: ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json + - **Accept**: application/pdf, application/json ### HTTP response details @@ -132,12 +131,12 @@ with ApiClient(configuration) as api_client: [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) -# ```get_fax_files``` -> ```io.IOBase get_fax_files(fax_id)``` +# ```fax_get``` +> ```FaxGetResponse fax_get(fax_id)``` -List Fax Files +Get Fax -Returns list of fax files +Returns information about fax ### Example @@ -146,7 +145,7 @@ Returns list of fax files ```python from pprint import pprint -from dropbox_sign import ApiClient, ApiException, Configuration, apis, models +from dropbox_sign import ApiClient, ApiException, Configuration, apis configuration = Configuration( # Configure HTTP basic authorization: api_key @@ -156,10 +155,11 @@ configuration = Configuration( with ApiClient(configuration) as api_client: fax_api = apis.FaxApi(api_client) - fax_id = "fa5c8a0b0f492d768749333ad6fcc214c111e967" + faxId = "fa5c8a0b0f492d768749333ad6fcc214c111e967" try: - fax_api.get_fax_files(fax_id) + 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) @@ -173,7 +173,7 @@ with ApiClient(configuration) as api_client: ### Return type -**io.IOBase** +[**FaxGetResponse**](FaxGetResponse.md) ### Authorization @@ -182,7 +182,7 @@ with ApiClient(configuration) as api_client: ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/pdf, application/json + - **Accept**: application/json ### HTTP response details @@ -193,8 +193,8 @@ with ApiClient(configuration) as api_client: [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) -# ```list_faxes``` -> ```FaxListResponse list_faxes(page, page_size)``` +# ```fax_list``` +> ```FaxListResponse fax_list()``` Lists Faxes @@ -235,8 +235,8 @@ with ApiClient(configuration) as api_client: ### Parameters | Name | Type | Description | Notes | | ---- | ---- | ----------- | ----- | -| `page` | **int** | Page | | -| `page_size` | **int** | Page size | | +| `page` | **int** | Page | [optional][default to 1] | +| `page_size` | **int** | Page size | [optional][default to 20] | ### Return type @@ -260,8 +260,8 @@ with ApiClient(configuration) as api_client: [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) -# ```send_fax``` -> ```FaxResponse send_fax(fax_send_request)``` +# ```fax_send``` +> ```FaxGetResponse fax_send(fax_send_request)``` Send Fax @@ -305,7 +305,7 @@ with ApiClient(configuration) as api_client: ### Return type -[**FaxResponse**](FaxResponse.md) +[**FaxGetResponse**](FaxGetResponse.md) ### Authorization @@ -313,7 +313,7 @@ with ApiClient(configuration) as api_client: ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: application/json, multipart/form-data - **Accept**: application/json ### HTTP response details diff --git a/sdks/python/docs/SubFile.md b/sdks/python/docs/FaxGetResponse.md similarity index 59% rename from sdks/python/docs/SubFile.md rename to sdks/python/docs/FaxGetResponse.md index dee439a9e..02b92d68d 100644 --- a/sdks/python/docs/SubFile.md +++ b/sdks/python/docs/FaxGetResponse.md @@ -1,11 +1,12 @@ -# SubFile +# FaxGetResponse + -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 ''] | +| `fax`*_required_ | [```FaxResponse```](FaxResponse.md) | | | +| `warnings` | [```List[WarningResponse]```](WarningResponse.md) | A list of warnings. | | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/sdks/python/docs/FaxListResponse.md b/sdks/python/docs/FaxListResponse.md index 20fc27fcf..e57c1881e 100644 --- a/sdks/python/docs/FaxListResponse.md +++ b/sdks/python/docs/FaxListResponse.md @@ -5,7 +5,7 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -| `faxes`*_required_ | [```List[FaxResponseFax]```](FaxResponseFax.md) | | | +| `faxes`*_required_ | [```List[FaxResponse]```](FaxResponse.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 index c7427201d..b3a292e67 100644 --- a/sdks/python/docs/FaxResponse.md +++ b/sdks/python/docs/FaxResponse.md @@ -5,8 +5,16 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -| `fax`*_required_ | [```FaxResponseFax```](FaxResponseFax.md) | | | -| `warnings` | [```List[WarningResponse]```](WarningResponse.md) | A list of warnings. | | +| `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[FaxResponseTransmission]```](FaxResponseTransmission.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/FaxResponseFax.md b/sdks/python/docs/FaxResponseFax.md deleted file mode 100644 index ead4553a9..000000000 --- a/sdks/python/docs/FaxResponseFax.md +++ /dev/null @@ -1,20 +0,0 @@ -# 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/FaxResponseTransmission.md similarity index 94% rename from sdks/python/docs/FaxResponseFaxTransmission.md rename to sdks/python/docs/FaxResponseTransmission.md index ce8f0c4e7..4966932ea 100644 --- a/sdks/python/docs/FaxResponseFaxTransmission.md +++ b/sdks/python/docs/FaxResponseTransmission.md @@ -1,4 +1,4 @@ -# FaxResponseFaxTransmission +# FaxResponseTransmission diff --git a/sdks/python/docs/FaxSendRequest.md b/sdks/python/docs/FaxSendRequest.md index a991978bc..3e7b18eb9 100644 --- a/sdks/python/docs/FaxSendRequest.md +++ b/sdks/python/docs/FaxSendRequest.md @@ -5,12 +5,11 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -| `to` | ```str``` | Fax Send To Recipient | | +| `to`*_required_ | ```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 | | +| `files` | ```List[io.IOBase]``` | Fax File to Send | | +| `file_urls` | ```List[str]``` | Fax File URL to Send | | +| `test_mode` | ```bool``` | API Test Mode Setting | [default to False] | | `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 | | diff --git a/sdks/python/dropbox_sign/__init__.py b/sdks/python/dropbox_sign/__init__.py index 26736b94b..c37a24fc1 100644 --- a/sdks/python/dropbox_sign/__init__.py +++ b/sdks/python/dropbox_sign/__init__.py @@ -80,6 +80,7 @@ from dropbox_sign.models.event_callback_request_event_metadata import ( EventCallbackRequestEventMetadata, ) +from dropbox_sign.models.fax_get_response import FaxGetResponse from dropbox_sign.models.fax_line_add_user_request import FaxLineAddUserRequest from dropbox_sign.models.fax_line_area_code_get_country_enum import ( FaxLineAreaCodeGetCountryEnum, @@ -101,8 +102,7 @@ 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_response_transmission import FaxResponseTransmission 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 @@ -204,7 +204,6 @@ 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/fax_api.py b/sdks/python/dropbox_sign/api/fax_api.py index fbc5cb023..3e49a160a 100644 --- a/sdks/python/dropbox_sign/api/fax_api.py +++ b/sdks/python/dropbox_sign/api/fax_api.py @@ -18,10 +18,10 @@ from typing_extensions import Annotated from pydantic import Field, StrictBytes, StrictStr -from typing import Union +from typing import Optional, Union from typing_extensions import Annotated +from dropbox_sign.models.fax_get_response import FaxGetResponse 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 @@ -43,7 +43,7 @@ def __init__(self, api_client=None) -> None: self.api_client = api_client @validate_call - def delete_fax( + def fax_delete( self, fax_id: Annotated[StrictStr, Field(description="Fax ID")], _request_timeout: Union[ @@ -86,7 +86,7 @@ def delete_fax( :return: Returns the result object. """ # noqa: E501 - _param = self._delete_fax_serialize( + _param = self._fax_delete_serialize( fax_id=fax_id, _request_auth=_request_auth, _content_type=_content_type, @@ -95,7 +95,7 @@ def delete_fax( ) _response_types_map: Dict[str, Optional[str]] = { - "200": None, + "204": None, "4XX": "ErrorResponse", } response_data = self.api_client.call_api( @@ -108,7 +108,7 @@ def delete_fax( ).data @validate_call - def delete_fax_with_http_info( + def fax_delete_with_http_info( self, fax_id: Annotated[StrictStr, Field(description="Fax ID")], _request_timeout: Union[ @@ -151,7 +151,7 @@ def delete_fax_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._delete_fax_serialize( + _param = self._fax_delete_serialize( fax_id=fax_id, _request_auth=_request_auth, _content_type=_content_type, @@ -160,7 +160,7 @@ def delete_fax_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "200": None, + "204": None, "4XX": "ErrorResponse", } response_data = self.api_client.call_api( @@ -173,7 +173,7 @@ def delete_fax_with_http_info( ) @validate_call - def delete_fax_without_preload_content( + def fax_delete_without_preload_content( self, fax_id: Annotated[StrictStr, Field(description="Fax ID")], _request_timeout: Union[ @@ -216,7 +216,7 @@ def delete_fax_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._delete_fax_serialize( + _param = self._fax_delete_serialize( fax_id=fax_id, _request_auth=_request_auth, _content_type=_content_type, @@ -225,7 +225,7 @@ def delete_fax_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "200": None, + "204": None, "4XX": "ErrorResponse", } response_data = self.api_client.call_api( @@ -233,7 +233,7 @@ def delete_fax_without_preload_content( ) return response_data.response - def _delete_fax_serialize( + def _fax_delete_serialize( self, fax_id, _request_auth, @@ -286,7 +286,7 @@ def _delete_fax_serialize( ) @validate_call - def get_fax_by_id( + def fax_files( self, fax_id: Annotated[StrictStr, Field(description="Fax ID")], _request_timeout: Union[ @@ -300,10 +300,10 @@ def get_fax_by_id( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> FaxResponse: - """Get Fax + ) -> io.IOBase: + """List Fax Files - Returns information about fax + Returns list of fax files :param fax_id: Fax ID (required) :type fax_id: str @@ -329,7 +329,7 @@ def get_fax_by_id( :return: Returns the result object. """ # noqa: E501 - _param = self._get_fax_by_id_serialize( + _param = self._fax_files_serialize( fax_id=fax_id, _request_auth=_request_auth, _content_type=_content_type, @@ -338,7 +338,7 @@ def get_fax_by_id( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "FaxResponse", + "200": "io.IOBase", "4XX": "ErrorResponse", } response_data = self.api_client.call_api( @@ -351,7 +351,7 @@ def get_fax_by_id( ).data @validate_call - def get_fax_by_id_with_http_info( + def fax_files_with_http_info( self, fax_id: Annotated[StrictStr, Field(description="Fax ID")], _request_timeout: Union[ @@ -365,10 +365,10 @@ def get_fax_by_id_with_http_info( _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 + ) -> ApiResponse[io.IOBase]: + """List Fax Files - Returns information about fax + Returns list of fax files :param fax_id: Fax ID (required) :type fax_id: str @@ -394,7 +394,7 @@ def get_fax_by_id_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._get_fax_by_id_serialize( + _param = self._fax_files_serialize( fax_id=fax_id, _request_auth=_request_auth, _content_type=_content_type, @@ -403,7 +403,7 @@ def get_fax_by_id_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "FaxResponse", + "200": "io.IOBase", "4XX": "ErrorResponse", } response_data = self.api_client.call_api( @@ -416,7 +416,7 @@ def get_fax_by_id_with_http_info( ) @validate_call - def get_fax_by_id_without_preload_content( + def fax_files_without_preload_content( self, fax_id: Annotated[StrictStr, Field(description="Fax ID")], _request_timeout: Union[ @@ -431,9 +431,9 @@ def get_fax_by_id_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """Get Fax + """List Fax Files - Returns information about fax + Returns list of fax files :param fax_id: Fax ID (required) :type fax_id: str @@ -459,7 +459,7 @@ def get_fax_by_id_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._get_fax_by_id_serialize( + _param = self._fax_files_serialize( fax_id=fax_id, _request_auth=_request_auth, _content_type=_content_type, @@ -468,7 +468,7 @@ def get_fax_by_id_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "FaxResponse", + "200": "io.IOBase", "4XX": "ErrorResponse", } response_data = self.api_client.call_api( @@ -476,7 +476,7 @@ def get_fax_by_id_without_preload_content( ) return response_data.response - def _get_fax_by_id_serialize( + def _fax_files_serialize( self, fax_id, _request_auth, @@ -507,7 +507,7 @@ def _get_fax_by_id_serialize( # set the HTTP header `Accept` if "Accept" not in _header_params: _header_params["Accept"] = self.api_client.select_header_accept( - ["application/json"] + ["application/pdf", "application/json"] ) # authentication setting @@ -515,7 +515,7 @@ def _get_fax_by_id_serialize( return self.api_client.param_serialize( method="GET", - resource_path="/fax/{fax_id}", + resource_path="/fax/files/{fax_id}", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -529,7 +529,7 @@ def _get_fax_by_id_serialize( ) @validate_call - def get_fax_files( + def fax_get( self, fax_id: Annotated[StrictStr, Field(description="Fax ID")], _request_timeout: Union[ @@ -543,10 +543,10 @@ def get_fax_files( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> io.IOBase: - """List Fax Files + ) -> FaxGetResponse: + """Get Fax - Returns list of fax files + Returns information about fax :param fax_id: Fax ID (required) :type fax_id: str @@ -572,7 +572,7 @@ def get_fax_files( :return: Returns the result object. """ # noqa: E501 - _param = self._get_fax_files_serialize( + _param = self._fax_get_serialize( fax_id=fax_id, _request_auth=_request_auth, _content_type=_content_type, @@ -581,7 +581,7 @@ def get_fax_files( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "io.IOBase", + "200": "FaxGetResponse", "4XX": "ErrorResponse", } response_data = self.api_client.call_api( @@ -594,7 +594,7 @@ def get_fax_files( ).data @validate_call - def get_fax_files_with_http_info( + def fax_get_with_http_info( self, fax_id: Annotated[StrictStr, Field(description="Fax ID")], _request_timeout: Union[ @@ -608,10 +608,10 @@ def get_fax_files_with_http_info( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[io.IOBase]: - """List Fax Files + ) -> ApiResponse[FaxGetResponse]: + """Get Fax - Returns list of fax files + Returns information about fax :param fax_id: Fax ID (required) :type fax_id: str @@ -637,7 +637,7 @@ def get_fax_files_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._get_fax_files_serialize( + _param = self._fax_get_serialize( fax_id=fax_id, _request_auth=_request_auth, _content_type=_content_type, @@ -646,7 +646,7 @@ def get_fax_files_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "io.IOBase", + "200": "FaxGetResponse", "4XX": "ErrorResponse", } response_data = self.api_client.call_api( @@ -659,7 +659,7 @@ def get_fax_files_with_http_info( ) @validate_call - def get_fax_files_without_preload_content( + def fax_get_without_preload_content( self, fax_id: Annotated[StrictStr, Field(description="Fax ID")], _request_timeout: Union[ @@ -674,9 +674,9 @@ def get_fax_files_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """List Fax Files + """Get Fax - Returns list of fax files + Returns information about fax :param fax_id: Fax ID (required) :type fax_id: str @@ -702,7 +702,7 @@ def get_fax_files_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._get_fax_files_serialize( + _param = self._fax_get_serialize( fax_id=fax_id, _request_auth=_request_auth, _content_type=_content_type, @@ -711,7 +711,7 @@ def get_fax_files_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "io.IOBase", + "200": "FaxGetResponse", "4XX": "ErrorResponse", } response_data = self.api_client.call_api( @@ -719,7 +719,7 @@ def get_fax_files_without_preload_content( ) return response_data.response - def _get_fax_files_serialize( + def _fax_get_serialize( self, fax_id, _request_auth, @@ -750,7 +750,7 @@ def _get_fax_files_serialize( # set the HTTP header `Accept` if "Accept" not in _header_params: _header_params["Accept"] = self.api_client.select_header_accept( - ["application/pdf", "application/json"] + ["application/json"] ) # authentication setting @@ -758,7 +758,7 @@ def _get_fax_files_serialize( return self.api_client.param_serialize( method="GET", - resource_path="/fax/files/{fax_id}", + resource_path="/fax/{fax_id}", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -772,12 +772,16 @@ def _get_fax_files_serialize( ) @validate_call - def list_faxes( + def fax_list( self, - page: Annotated[int, Field(strict=True, ge=1, description="Page")], + page: Annotated[ + Optional[Annotated[int, Field(strict=True, ge=1)]], + Field(description="Page"), + ] = None, page_size: Annotated[ - int, Field(le=100, strict=True, ge=1, description="Page size") - ], + Optional[Annotated[int, Field(le=100, strict=True, ge=1)]], + Field(description="Page size"), + ] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -794,9 +798,9 @@ def list_faxes( Returns properties of multiple faxes - :param page: Page (required) + :param page: Page :type page: int - :param page_size: Page size (required) + :param page_size: Page size :type page_size: int :param _request_timeout: timeout setting for this request. If one number provided, it will be total request @@ -820,7 +824,7 @@ def list_faxes( :return: Returns the result object. """ # noqa: E501 - _param = self._list_faxes_serialize( + _param = self._fax_list_serialize( page=page, page_size=page_size, _request_auth=_request_auth, @@ -843,12 +847,16 @@ def list_faxes( ).data @validate_call - def list_faxes_with_http_info( + def fax_list_with_http_info( self, - page: Annotated[int, Field(strict=True, ge=1, description="Page")], + page: Annotated[ + Optional[Annotated[int, Field(strict=True, ge=1)]], + Field(description="Page"), + ] = None, page_size: Annotated[ - int, Field(le=100, strict=True, ge=1, description="Page size") - ], + Optional[Annotated[int, Field(le=100, strict=True, ge=1)]], + Field(description="Page size"), + ] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -865,9 +873,9 @@ def list_faxes_with_http_info( Returns properties of multiple faxes - :param page: Page (required) + :param page: Page :type page: int - :param page_size: Page size (required) + :param page_size: Page size :type page_size: int :param _request_timeout: timeout setting for this request. If one number provided, it will be total request @@ -891,7 +899,7 @@ def list_faxes_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._list_faxes_serialize( + _param = self._fax_list_serialize( page=page, page_size=page_size, _request_auth=_request_auth, @@ -914,12 +922,16 @@ def list_faxes_with_http_info( ) @validate_call - def list_faxes_without_preload_content( + def fax_list_without_preload_content( self, - page: Annotated[int, Field(strict=True, ge=1, description="Page")], + page: Annotated[ + Optional[Annotated[int, Field(strict=True, ge=1)]], + Field(description="Page"), + ] = None, page_size: Annotated[ - int, Field(le=100, strict=True, ge=1, description="Page size") - ], + Optional[Annotated[int, Field(le=100, strict=True, ge=1)]], + Field(description="Page size"), + ] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -936,9 +948,9 @@ def list_faxes_without_preload_content( Returns properties of multiple faxes - :param page: Page (required) + :param page: Page :type page: int - :param page_size: Page size (required) + :param page_size: Page size :type page_size: int :param _request_timeout: timeout setting for this request. If one number provided, it will be total request @@ -962,7 +974,7 @@ def list_faxes_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._list_faxes_serialize( + _param = self._fax_list_serialize( page=page, page_size=page_size, _request_auth=_request_auth, @@ -980,7 +992,7 @@ def list_faxes_without_preload_content( ) return response_data.response - def _list_faxes_serialize( + def _fax_list_serialize( self, page, page_size, @@ -1040,7 +1052,7 @@ def _list_faxes_serialize( ) @validate_call - def send_fax( + def fax_send( self, fax_send_request: FaxSendRequest, _request_timeout: Union[ @@ -1054,7 +1066,7 @@ def send_fax( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> FaxResponse: + ) -> FaxGetResponse: """Send Fax Action to prepare and send a fax @@ -1083,7 +1095,7 @@ def send_fax( :return: Returns the result object. """ # noqa: E501 - _param = self._send_fax_serialize( + _param = self._fax_send_serialize( fax_send_request=fax_send_request, _request_auth=_request_auth, _content_type=_content_type, @@ -1092,7 +1104,7 @@ def send_fax( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "FaxResponse", + "200": "FaxGetResponse", "4XX": "ErrorResponse", } response_data = self.api_client.call_api( @@ -1105,7 +1117,7 @@ def send_fax( ).data @validate_call - def send_fax_with_http_info( + def fax_send_with_http_info( self, fax_send_request: FaxSendRequest, _request_timeout: Union[ @@ -1119,7 +1131,7 @@ def send_fax_with_http_info( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[FaxResponse]: + ) -> ApiResponse[FaxGetResponse]: """Send Fax Action to prepare and send a fax @@ -1148,7 +1160,7 @@ def send_fax_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._send_fax_serialize( + _param = self._fax_send_serialize( fax_send_request=fax_send_request, _request_auth=_request_auth, _content_type=_content_type, @@ -1157,7 +1169,7 @@ def send_fax_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "FaxResponse", + "200": "FaxGetResponse", "4XX": "ErrorResponse", } response_data = self.api_client.call_api( @@ -1170,7 +1182,7 @@ def send_fax_with_http_info( ) @validate_call - def send_fax_without_preload_content( + def fax_send_without_preload_content( self, fax_send_request: FaxSendRequest, _request_timeout: Union[ @@ -1213,7 +1225,7 @@ def send_fax_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._send_fax_serialize( + _param = self._fax_send_serialize( fax_send_request=fax_send_request, _request_auth=_request_auth, _content_type=_content_type, @@ -1222,7 +1234,7 @@ def send_fax_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "FaxResponse", + "200": "FaxGetResponse", "4XX": "ErrorResponse", } response_data = self.api_client.call_api( @@ -1230,7 +1242,7 @@ def send_fax_without_preload_content( ) return response_data.response - def _send_fax_serialize( + def _fax_send_serialize( self, fax_send_request, _request_auth, @@ -1291,7 +1303,7 @@ def _send_fax_serialize( _header_params["Content-Type"] = _content_type else: _default_content_type = self.api_client.select_header_content_type( - ["application/json"] + ["application/json", "multipart/form-data"] ) if _default_content_type is not None: _header_params["Content-Type"] = _default_content_type diff --git a/sdks/python/dropbox_sign/models/__init__.py b/sdks/python/dropbox_sign/models/__init__.py index 7143671f8..97af4020e 100644 --- a/sdks/python/dropbox_sign/models/__init__.py +++ b/sdks/python/dropbox_sign/models/__init__.py @@ -63,6 +63,7 @@ from dropbox_sign.models.event_callback_request_event_metadata import ( EventCallbackRequestEventMetadata, ) +from dropbox_sign.models.fax_get_response import FaxGetResponse from dropbox_sign.models.fax_line_add_user_request import FaxLineAddUserRequest from dropbox_sign.models.fax_line_area_code_get_country_enum import ( FaxLineAreaCodeGetCountryEnum, @@ -84,8 +85,7 @@ 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_response_transmission import FaxResponseTransmission 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 @@ -187,7 +187,6 @@ 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_get_response.py b/sdks/python/dropbox_sign/models/fax_get_response.py new file mode 100644 index 000000000..8c2b2249f --- /dev/null +++ b/sdks/python/dropbox_sign/models/fax_get_response.py @@ -0,0 +1,151 @@ +# coding: utf-8 + +""" + Dropbox Sign API + + Dropbox Sign v3 API + + The version of the OpenAPI document: 3.0.0 + Contact: apisupport@hellosign.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field +from typing import Any, ClassVar, Dict, List, Optional +from dropbox_sign.models.fax_response import FaxResponse +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 FaxGetResponse(BaseModel): + """ + FaxGetResponse + """ # noqa: E501 + + fax: FaxResponse + warnings: Optional[List[WarningResponse]] = Field( + default=None, description="A list of warnings." + ) + __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 FaxGetResponse 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 each item in warnings (list) + _items = [] + if self.warnings: + for _item_warnings in self.warnings: + if _item_warnings: + _items.append(_item_warnings.to_dict()) + _dict["warnings"] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of FaxGetResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate( + { + "fax": ( + FaxResponse.from_dict(obj["fax"]) + if obj.get("fax") is not None + else None + ), + "warnings": ( + [WarningResponse.from_dict(_item) for _item in obj["warnings"]] + if obj.get("warnings") is not None + else None + ), + } + ) + return _obj + + @classmethod + def init(cls, data: Any) -> Self: + """ + Attempt to instantiate and hydrate a new instance of this class + """ + if isinstance(data, str): + data = json.loads(data) + + return cls.from_dict(data) + + @classmethod + def openapi_types(cls) -> Dict[str, str]: + return { + "fax": "(FaxResponse,)", + "warnings": "(List[WarningResponse],)", + } + + @classmethod + def openapi_type_is_array(cls, property_name: str) -> bool: + return property_name in [ + "warnings", + ] diff --git a/sdks/python/dropbox_sign/models/fax_list_response.py b/sdks/python/dropbox_sign/models/fax_list_response.py index d4a02d369..b62b406e1 100644 --- a/sdks/python/dropbox_sign/models/fax_list_response.py +++ b/sdks/python/dropbox_sign/models/fax_list_response.py @@ -20,7 +20,7 @@ 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.fax_response import FaxResponse from dropbox_sign.models.list_info_response import ListInfoResponse from typing import Optional, Set, Tuple from typing_extensions import Self @@ -34,7 +34,7 @@ class FaxListResponse(BaseModel): FaxListResponse """ # noqa: E501 - faxes: List[FaxResponseFax] + faxes: List[FaxResponse] list_info: ListInfoResponse __properties: ClassVar[List[str]] = ["faxes", "list_info"] @@ -112,7 +112,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: _obj = cls.model_validate( { "faxes": ( - [FaxResponseFax.from_dict(_item) for _item in obj["faxes"]] + [FaxResponse.from_dict(_item) for _item in obj["faxes"]] if obj.get("faxes") is not None else None ), @@ -138,7 +138,7 @@ def init(cls, data: Any) -> Self: @classmethod def openapi_types(cls) -> Dict[str, str]: return { - "faxes": "(List[FaxResponseFax],)", + "faxes": "(List[FaxResponse],)", "list_info": "(ListInfoResponse,)", } diff --git a/sdks/python/dropbox_sign/models/fax_response.py b/sdks/python/dropbox_sign/models/fax_response.py index cc3870ddc..05934c810 100644 --- a/sdks/python/dropbox_sign/models/fax_response.py +++ b/sdks/python/dropbox_sign/models/fax_response.py @@ -18,10 +18,9 @@ import re # noqa: F401 import json -from pydantic import BaseModel, ConfigDict, Field +from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr 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 dropbox_sign.models.fax_response_transmission import FaxResponseTransmission from typing import Optional, Set, Tuple from typing_extensions import Self import io @@ -34,11 +33,36 @@ class FaxResponse(BaseModel): FaxResponse """ # noqa: E501 - fax: FaxResponseFax - warnings: Optional[List[WarningResponse]] = Field( - default=None, description="A list of warnings." + 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" ) - __properties: ClassVar[List[str]] = ["fax", "warnings"] + 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[FaxResponseTransmission]] = 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, @@ -90,16 +114,13 @@ def to_dict(self, excluded_fields: Set[str] = None) -> Dict[str, Any]: 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 each item in warnings (list) + # override the default output from pydantic by calling `to_dict()` of each item in transmissions (list) _items = [] - if self.warnings: - for _item_warnings in self.warnings: - if _item_warnings: - _items.append(_item_warnings.to_dict()) - _dict["warnings"] = _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 @@ -113,16 +134,23 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: _obj = cls.model_validate( { - "fax": ( - FaxResponseFax.from_dict(obj["fax"]) - if obj.get("fax") is not None - else None - ), - "warnings": ( - [WarningResponse.from_dict(_item) for _item in obj["warnings"]] - if obj.get("warnings") is not None + "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": ( + [ + FaxResponseTransmission.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 @@ -140,12 +168,20 @@ def init(cls, data: Any) -> Self: @classmethod def openapi_types(cls) -> Dict[str, str]: return { - "fax": "(FaxResponseFax,)", - "warnings": "(List[WarningResponse],)", + "fax_id": "(str,)", + "title": "(str,)", + "original_title": "(str,)", + "subject": "(str,)", + "message": "(str,)", + "metadata": "(object,)", + "created_at": "(int,)", + "var_from": "(str,)", + "transmissions": "(List[FaxResponseTransmission],)", + "files_url": "(str,)", } @classmethod def openapi_type_is_array(cls, property_name: str) -> bool: return property_name in [ - "warnings", + "transmissions", ] diff --git a/sdks/python/dropbox_sign/models/fax_response_transmission.py b/sdks/python/dropbox_sign/models/fax_response_transmission.py new file mode 100644 index 000000000..34a1088b1 --- /dev/null +++ b/sdks/python/dropbox_sign/models/fax_response_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 FaxResponseTransmission(BaseModel): + """ + FaxResponseTransmission + """ # 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 FaxResponseTransmission 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 FaxResponseTransmission 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 index c4c9e7b6f..97b01ab62 100644 --- a/sdks/python/dropbox_sign/models/fax_send_request.py +++ b/sdks/python/dropbox_sign/models/fax_send_request.py @@ -18,9 +18,8 @@ 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 pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictBytes, StrictStr +from typing import Any, ClassVar, Dict, List, Optional, Union from typing import Optional, Set, Tuple from typing_extensions import Self import io @@ -33,21 +32,20 @@ class FaxSendRequest(BaseModel): FaxSendRequest """ # noqa: E501 - to: Optional[StrictStr] = Field(default=None, description="Fax Send To Recipient") + to: StrictStr = Field(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" + files: Optional[List[Union[StrictBytes, StrictStr, io.IOBase]]] = Field( + default=None, description="Fax File to Send" ) - file_url_names: Optional[List[StrictStr]] = Field( - default=None, description="Fax File URL Names" + file_urls: Optional[List[StrictStr]] = Field( + default=None, description="Fax File URL to Send" ) test_mode: Optional[StrictBool] = Field( - default=None, description="API Test Mode Setting" + default=False, description="API Test Mode Setting" ) cover_page_to: Optional[StrictStr] = Field( default=None, description="Fax Cover Page for Recipient" @@ -62,9 +60,8 @@ class FaxSendRequest(BaseModel): __properties: ClassVar[List[str]] = [ "to", "from", - "file", - "file_url", - "file_url_names", + "files", + "file_urls", "test_mode", "cover_page_to", "cover_page_from", @@ -122,13 +119,6 @@ def to_dict(self, excluded_fields: Set[str] = None) -> Dict[str, Any]: 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 @@ -144,14 +134,11 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: { "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 + "files": obj.get("files"), + "file_urls": obj.get("file_urls"), + "test_mode": ( + obj.get("test_mode") if obj.get("test_mode") is not None else False ), - "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"), @@ -175,9 +162,8 @@ 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],)", + "files": "(List[io.IOBase],)", + "file_urls": "(List[str],)", "test_mode": "(bool,)", "cover_page_to": "(str,)", "cover_page_from": "(str,)", @@ -188,7 +174,6 @@ def openapi_types(cls) -> Dict[str, str]: @classmethod def openapi_type_is_array(cls, property_name: str) -> bool: return property_name in [ - "file", - "file_url", - "file_url_names", + "files", + "file_urls", ] diff --git a/sdks/ruby/README.md b/sdks/ruby/README.md index 8d301c752..c64b20c98 100644 --- a/sdks/ruby/README.md +++ b/sdks/ruby/README.md @@ -121,11 +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::FaxApi* | [**fax_delete**](docs/FaxApi.md#fax_delete) | **DELETE** /fax/{fax_id} | Delete Fax | +|*Dropbox::Sign::FaxApi* | [**fax_files**](docs/FaxApi.md#fax_files) | **GET** /fax/files/{fax_id} | List Fax Files | +|*Dropbox::Sign::FaxApi* | [**fax_get**](docs/FaxApi.md#fax_get) | **GET** /fax/{fax_id} | Get Fax | +|*Dropbox::Sign::FaxApi* | [**fax_list**](docs/FaxApi.md#fax_list) | **GET** /fax/list | Lists Faxes | +|*Dropbox::Sign::FaxApi* | [**fax_send**](docs/FaxApi.md#fax_send) | **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 | @@ -215,6 +215,7 @@ All URIs are relative to *https://api.hellosign.com/v3* - [Dropbox::Sign::EventCallbackRequest](docs/EventCallbackRequest.md) - [Dropbox::Sign::EventCallbackRequestEvent](docs/EventCallbackRequestEvent.md) - [Dropbox::Sign::EventCallbackRequestEventMetadata](docs/EventCallbackRequestEventMetadata.md) + - [Dropbox::Sign::FaxGetResponse](docs/FaxGetResponse.md) - [Dropbox::Sign::FaxLineAddUserRequest](docs/FaxLineAddUserRequest.md) - [Dropbox::Sign::FaxLineAreaCodeGetCountryEnum](docs/FaxLineAreaCodeGetCountryEnum.md) - [Dropbox::Sign::FaxLineAreaCodeGetProvinceEnum](docs/FaxLineAreaCodeGetProvinceEnum.md) @@ -228,8 +229,7 @@ All URIs are relative to *https://api.hellosign.com/v3* - [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::FaxResponseTransmission](docs/FaxResponseTransmission.md) - [Dropbox::Sign::FaxSendRequest](docs/FaxSendRequest.md) - [Dropbox::Sign::FileResponse](docs/FileResponse.md) - [Dropbox::Sign::FileResponseDataUri](docs/FileResponseDataUri.md) @@ -275,7 +275,6 @@ 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 index 40d5ea6f2..cd1a5da31 100644 --- a/sdks/ruby/docs/FaxApi.md +++ b/sdks/ruby/docs/FaxApi.md @@ -4,16 +4,16 @@ 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 | +| [`fax_delete`](FaxApi.md#fax_delete) | **DELETE** `/fax/{fax_id}` | Delete Fax | +| [`fax_files`](FaxApi.md#fax_files) | **GET** `/fax/files/{fax_id}` | List Fax Files | +| [`fax_get`](FaxApi.md#fax_get) | **GET** `/fax/{fax_id}` | Get Fax | +| [`fax_list`](FaxApi.md#fax_list) | **GET** `/fax/list` | Lists Faxes | +| [`fax_send`](FaxApi.md#fax_send) | **POST** `/fax/send` | Send Fax | -## `delete_fax` +## `fax_delete` -> `delete_fax(fax_id)` +> `fax_delete(fax_id)` Delete Fax @@ -39,21 +39,21 @@ end ``` -#### Using the `delete_fax_with_http_info` variant +#### Using the `fax_delete_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)` +> ` fax_delete_with_http_info(fax_id)` ```ruby begin # Delete Fax - data, status_code, headers = api_instance.delete_fax_with_http_info(fax_id) + data, status_code, headers = api_instance.fax_delete_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}" + puts "Error when calling FaxApi->fax_delete_with_http_info: #{e}" end ``` @@ -77,13 +77,13 @@ nil (empty response body) - **Accept**: application/json -## `get_fax_by_id` +## `fax_files` -> ` get_fax_by_id(fax_id)` +> `File fax_files(fax_id)` -Get Fax +List Fax Files -Returns information about fax +Returns list of fax files ### Examples @@ -97,10 +97,10 @@ end fax_api = Dropbox::Sign::FaxApi.new -fax_id = "fa5c8a0b0f492d768749333ad6fcc214c111e967" +faxId = "fa5c8a0b0f492d768749333ad6fcc214c111e967" begin - result = fax_api.get_fax_by_id(fax_id) + result = fax_api.get_fax_files(data) p result rescue Dropbox::Sign::ApiError => e puts "Exception when calling Dropbox Sign API: #{e}" @@ -108,21 +108,21 @@ end ``` -#### Using the `get_fax_by_id_with_http_info` variant +#### Using the `fax_files_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)` +> ` fax_files_with_http_info(fax_id)` ```ruby begin - # Get Fax - data, status_code, headers = api_instance.get_fax_by_id_with_http_info(fax_id) + # List Fax Files + data, status_code, headers = api_instance.fax_files_with_http_info(fax_id) p status_code # => 2xx p headers # => { ... } - p data # => + p data # => File rescue Dropbox::Sign::ApiError => e - puts "Error when calling FaxApi->get_fax_by_id_with_http_info: #{e}" + puts "Error when calling FaxApi->fax_files_with_http_info: #{e}" end ``` @@ -134,7 +134,7 @@ end ### Return type -[**FaxResponse**](FaxResponse.md) +**File** ### Authorization @@ -143,16 +143,16 @@ end ### HTTP request headers - **Content-Type**: Not defined -- **Accept**: application/json +- **Accept**: application/pdf, application/json -## `get_fax_files` +## `fax_get` -> `File get_fax_files(fax_id)` +> ` fax_get(fax_id)` -List Fax Files +Get Fax -Returns list of fax files +Returns information about fax ### Examples @@ -166,10 +166,10 @@ end fax_api = Dropbox::Sign::FaxApi.new -faxId = "fa5c8a0b0f492d768749333ad6fcc214c111e967" +fax_id = "fa5c8a0b0f492d768749333ad6fcc214c111e967" begin - result = fax_api.get_fax_files(data) + result = fax_api.get_fax_by_id(fax_id) p result rescue Dropbox::Sign::ApiError => e puts "Exception when calling Dropbox Sign API: #{e}" @@ -177,21 +177,21 @@ end ``` -#### Using the `get_fax_files_with_http_info` variant +#### Using the `fax_get_with_http_info` variant This returns an Array which contains the response data, status code and headers. -> ` get_fax_files_with_http_info(fax_id)` +> `, Integer, Hash)> fax_get_with_http_info(fax_id)` ```ruby begin - # List Fax Files - data, status_code, headers = api_instance.get_fax_files_with_http_info(fax_id) + # Get Fax + data, status_code, headers = api_instance.fax_get_with_http_info(fax_id) p status_code # => 2xx p headers # => { ... } - p data # => File + p data # => rescue Dropbox::Sign::ApiError => e - puts "Error when calling FaxApi->get_fax_files_with_http_info: #{e}" + puts "Error when calling FaxApi->fax_get_with_http_info: #{e}" end ``` @@ -203,7 +203,7 @@ end ### Return type -**File** +[**FaxGetResponse**](FaxGetResponse.md) ### Authorization @@ -212,12 +212,12 @@ end ### HTTP request headers - **Content-Type**: Not defined -- **Accept**: application/pdf, application/json +- **Accept**: application/json -## `list_faxes` +## `fax_list` -> ` list_faxes(page, page_size)` +> ` fax_list(opts)` Lists Faxes @@ -247,21 +247,21 @@ end ``` -#### Using the `list_faxes_with_http_info` variant +#### Using the `fax_list_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)` +> `, Integer, Hash)> fax_list_with_http_info(opts)` ```ruby begin # Lists Faxes - data, status_code, headers = api_instance.list_faxes_with_http_info(page, page_size) + data, status_code, headers = api_instance.fax_list_with_http_info(opts) p status_code # => 2xx p headers # => { ... } p data # => rescue Dropbox::Sign::ApiError => e - puts "Error when calling FaxApi->list_faxes_with_http_info: #{e}" + puts "Error when calling FaxApi->fax_list_with_http_info: #{e}" end ``` @@ -269,8 +269,8 @@ end | Name | Type | Description | Notes | | ---- | ---- | ----------- | ----- | -| `page` | **Integer** | Page | | -| `page_size` | **Integer** | Page size | | +| `page` | **Integer** | Page | [optional][default to 1] | +| `page_size` | **Integer** | Page size | [optional][default to 20] | ### Return type @@ -286,9 +286,9 @@ end - **Accept**: application/json -## `send_fax` +## `fax_send` -> ` send_fax(fax_send_request)` +> ` fax_send(fax_send_request)` Send Fax @@ -319,21 +319,21 @@ end ``` -#### Using the `send_fax_with_http_info` variant +#### Using the `fax_send_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)` +> `, Integer, Hash)> fax_send_with_http_info(fax_send_request)` ```ruby begin # Send Fax - data, status_code, headers = api_instance.send_fax_with_http_info(fax_send_request) + data, status_code, headers = api_instance.fax_send_with_http_info(fax_send_request) p status_code # => 2xx p headers # => { ... } - p data # => + p data # => rescue Dropbox::Sign::ApiError => e - puts "Error when calling FaxApi->send_fax_with_http_info: #{e}" + puts "Error when calling FaxApi->fax_send_with_http_info: #{e}" end ``` @@ -345,7 +345,7 @@ end ### Return type -[**FaxResponse**](FaxResponse.md) +[**FaxGetResponse**](FaxGetResponse.md) ### Authorization @@ -353,6 +353,6 @@ end ### HTTP request headers -- **Content-Type**: application/json +- **Content-Type**: application/json, multipart/form-data - **Accept**: application/json diff --git a/sdks/ruby/docs/FaxGetResponse.md b/sdks/ruby/docs/FaxGetResponse.md new file mode 100644 index 000000000..397322654 --- /dev/null +++ b/sdks/ruby/docs/FaxGetResponse.md @@ -0,0 +1,11 @@ +# Dropbox::Sign::FaxGetResponse + + + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| `fax`*_required_ | [```FaxResponse```](FaxResponse.md) | | | +| `warnings` | [```Array```](WarningResponse.md) | A list of warnings. | | + diff --git a/sdks/ruby/docs/FaxListResponse.md b/sdks/ruby/docs/FaxListResponse.md index 4bf183a3b..4ad86e488 100644 --- a/sdks/ruby/docs/FaxListResponse.md +++ b/sdks/ruby/docs/FaxListResponse.md @@ -6,6 +6,6 @@ | Name | Type | Description | Notes | | ---- | ---- | ----------- | ----- | -| `faxes`*_required_ | [```Array```](FaxResponseFax.md) | | | +| `faxes`*_required_ | [```Array```](FaxResponse.md) | | | | `list_info`*_required_ | [```ListInfoResponse```](ListInfoResponse.md) | | | diff --git a/sdks/ruby/docs/FaxResponse.md b/sdks/ruby/docs/FaxResponse.md index 08055442d..63627c8c4 100644 --- a/sdks/ruby/docs/FaxResponse.md +++ b/sdks/ruby/docs/FaxResponse.md @@ -6,6 +6,14 @@ | Name | Type | Description | Notes | | ---- | ---- | ----------- | ----- | -| `fax`*_required_ | [```FaxResponseFax```](FaxResponseFax.md) | | | -| `warnings` | [```Array```](WarningResponse.md) | A list of warnings. | | +| `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```](FaxResponseTransmission.md) | Fax Transmissions List | | +| `files_url` | ```String``` | Fax Files URL | | diff --git a/sdks/ruby/docs/FaxResponseFax.md b/sdks/ruby/docs/FaxResponseFax.md deleted file mode 100644 index 08ec38b8a..000000000 --- a/sdks/ruby/docs/FaxResponseFax.md +++ /dev/null @@ -1,19 +0,0 @@ -# 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/FaxResponseTransmission.md similarity index 89% rename from sdks/ruby/docs/FaxResponseFaxTransmission.md rename to sdks/ruby/docs/FaxResponseTransmission.md index f721eeda7..ba3cfd96d 100644 --- a/sdks/ruby/docs/FaxResponseFaxTransmission.md +++ b/sdks/ruby/docs/FaxResponseTransmission.md @@ -1,4 +1,4 @@ -# Dropbox::Sign::FaxResponseFaxTransmission +# Dropbox::Sign::FaxResponseTransmission diff --git a/sdks/ruby/docs/FaxSendRequest.md b/sdks/ruby/docs/FaxSendRequest.md index f85def315..84896dda8 100644 --- a/sdks/ruby/docs/FaxSendRequest.md +++ b/sdks/ruby/docs/FaxSendRequest.md @@ -6,12 +6,11 @@ | Name | Type | Description | Notes | | ---- | ---- | ----------- | ----- | -| `to` | ```String``` | Fax Send To Recipient | | +| `to`*_required_ | ```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 | | +| `files` | ```Array``` | Fax File to Send | | +| `file_urls` | ```Array``` | Fax File URL to Send | | +| `test_mode` | ```Boolean``` | API Test Mode Setting | [default to false] | | `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 | | diff --git a/sdks/ruby/docs/SubFile.md b/sdks/ruby/docs/SubFile.md deleted file mode 100644 index 58478622e..000000000 --- a/sdks/ruby/docs/SubFile.md +++ /dev/null @@ -1,10 +0,0 @@ -# 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 e3d924cb0..0921573f8 100644 --- a/sdks/ruby/lib/dropbox-sign.rb +++ b/sdks/ruby/lib/dropbox-sign.rb @@ -51,6 +51,7 @@ require 'dropbox-sign/models/event_callback_request' require 'dropbox-sign/models/event_callback_request_event' require 'dropbox-sign/models/event_callback_request_event_metadata' +require 'dropbox-sign/models/fax_get_response' require 'dropbox-sign/models/fax_line_add_user_request' require 'dropbox-sign/models/fax_line_area_code_get_country_enum' require 'dropbox-sign/models/fax_line_area_code_get_province_enum' @@ -64,8 +65,7 @@ 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_response_transmission' require 'dropbox-sign/models/fax_send_request' require 'dropbox-sign/models/file_response' require 'dropbox-sign/models/file_response_data_uri' @@ -100,7 +100,6 @@ 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' diff --git a/sdks/ruby/lib/dropbox-sign/api/fax_api.rb b/sdks/ruby/lib/dropbox-sign/api/fax_api.rb index a7a8e4f76..17fca7916 100644 --- a/sdks/ruby/lib/dropbox-sign/api/fax_api.rb +++ b/sdks/ruby/lib/dropbox-sign/api/fax_api.rb @@ -27,8 +27,8 @@ def initialize(api_client = ApiClient.default) # @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) + def fax_delete(fax_id, opts = {}) + fax_delete_with_http_info(fax_id, opts) nil end @@ -37,13 +37,13 @@ def delete_fax(fax_id, opts = {}) # @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 = {}) + def fax_delete_with_http_info(fax_id, opts = {}) if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: FaxApi.delete_fax ...' + @api_client.config.logger.debug 'Calling API: FaxApi.fax_delete ...' 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" + fail ArgumentError, "Missing the required parameter 'fax_id' when calling FaxApi.fax_delete" end # resource path local_var_path = '/fax/{fax_id}'.sub('{' + 'fax_id' + '}', CGI.escape(fax_id.to_s)) @@ -69,7 +69,7 @@ def delete_fax_with_http_info(fax_id, opts = {}) auth_names = opts[:debug_auth_names] || ['api_key'] new_options = opts.merge( - :operation => :"FaxApi.delete_fax", + :operation => :"FaxApi.fax_delete", :header_params => header_params, :query_params => query_params, :form_params => form_params, @@ -84,36 +84,36 @@ def delete_fax_with_http_info(fax_id, opts = {}) 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}" + @api_client.config.logger.debug "API called: FaxApi#fax_delete\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end - # Get Fax - # Returns information about fax + # List Fax Files + # Returns list of fax files # @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) + # @return [File] + def fax_files(fax_id, opts = {}) + data, _status_code, _headers = fax_files_with_http_info(fax_id, opts) data end - # Get Fax - # Returns information about fax + # List Fax Files + # Returns list of fax files # @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 = {}) + # @return [Array<(File, Integer, Hash)>] File data, response status code and response headers + def fax_files_with_http_info(fax_id, opts = {}) if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: FaxApi.get_fax_by_id ...' + @api_client.config.logger.debug 'Calling API: FaxApi.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_by_id" + fail ArgumentError, "Missing the required parameter 'fax_id' when calling FaxApi.fax_files" end # resource path - local_var_path = '/fax/{fax_id}'.sub('{' + 'fax_id' + '}', CGI.escape(fax_id.to_s)) + local_var_path = '/fax/files/{fax_id}'.sub('{' + 'fax_id' + '}', CGI.escape(fax_id.to_s)) # query parameters query_params = opts[:query_params] || {} @@ -121,7 +121,7 @@ def get_fax_by_id_with_http_info(fax_id, opts = {}) # 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'] + header_params['Accept'] = @api_client.select_header_accept(['application/pdf', 'application/json']) unless header_params['Accept'] post_body = {} form_params = opts[:form_params] || {} @@ -130,13 +130,13 @@ def get_fax_by_id_with_http_info(fax_id, opts = {}) post_body = opts[:debug_body] # return_type - return_type = opts[:debug_return_type] || 'FaxResponse' + return_type = opts[:debug_return_type] || 'File' # auth_names auth_names = opts[:debug_auth_names] || ['api_key'] new_options = opts.merge( - :operation => :"FaxApi.get_fax_by_id", + :operation => :"FaxApi.fax_files", :header_params => header_params, :query_params => query_params, :form_params => form_params, @@ -151,7 +151,7 @@ def get_fax_by_id_with_http_info(fax_id, opts = {}) if e.code === 200 body = @api_client.convert_to_type( JSON.parse("[#{e.response_body}]", :symbolize_names => true)[0], - "Dropbox::Sign::FaxResponse" + "Dropbox::Sign::File" ) fail ApiError.new(:code => e.code, @@ -178,36 +178,36 @@ def get_fax_by_id_with_http_info(fax_id, opts = {}) 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}" + @api_client.config.logger.debug "API called: FaxApi#fax_files\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end - # List Fax Files - # Returns list of fax files + # Get Fax + # Returns information about fax # @param fax_id [String] Fax ID # @param [Hash] opts the optional parameters - # @return [File] - def get_fax_files(fax_id, opts = {}) - data, _status_code, _headers = get_fax_files_with_http_info(fax_id, opts) + # @return [FaxGetResponse] + def fax_get(fax_id, opts = {}) + data, _status_code, _headers = fax_get_with_http_info(fax_id, opts) data end - # List Fax Files - # Returns list of fax files + # Get Fax + # Returns information about fax # @param fax_id [String] Fax ID # @param [Hash] opts the optional parameters - # @return [Array<(File, Integer, Hash)>] File data, response status code and response headers - def get_fax_files_with_http_info(fax_id, opts = {}) + # @return [Array<(FaxGetResponse, Integer, Hash)>] FaxGetResponse data, response status code and response headers + def fax_get_with_http_info(fax_id, opts = {}) if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: FaxApi.get_fax_files ...' + @api_client.config.logger.debug 'Calling API: FaxApi.fax_get ...' 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" + fail ArgumentError, "Missing the required parameter 'fax_id' when calling FaxApi.fax_get" end # resource path - local_var_path = '/fax/files/{fax_id}'.sub('{' + 'fax_id' + '}', CGI.escape(fax_id.to_s)) + local_var_path = '/fax/{fax_id}'.sub('{' + 'fax_id' + '}', CGI.escape(fax_id.to_s)) # query parameters query_params = opts[:query_params] || {} @@ -215,7 +215,7 @@ def get_fax_files_with_http_info(fax_id, opts = {}) # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/pdf', 'application/json']) unless header_params['Accept'] + header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] post_body = {} form_params = opts[:form_params] || {} @@ -224,13 +224,13 @@ def get_fax_files_with_http_info(fax_id, opts = {}) post_body = opts[:debug_body] # return_type - return_type = opts[:debug_return_type] || 'File' + return_type = opts[:debug_return_type] || 'FaxGetResponse' # auth_names auth_names = opts[:debug_auth_names] || ['api_key'] new_options = opts.merge( - :operation => :"FaxApi.get_fax_files", + :operation => :"FaxApi.fax_get", :header_params => header_params, :query_params => query_params, :form_params => form_params, @@ -245,7 +245,7 @@ def get_fax_files_with_http_info(fax_id, opts = {}) if e.code === 200 body = @api_client.convert_to_type( JSON.parse("[#{e.response_body}]", :symbolize_names => true)[0], - "Dropbox::Sign::File" + "Dropbox::Sign::FaxGetResponse" ) fail ApiError.new(:code => e.code, @@ -272,50 +272,42 @@ def get_fax_files_with_http_info(fax_id, opts = {}) 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}" + @api_client.config.logger.debug "API called: FaxApi#fax_get\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 + # @option opts [Integer] :page Page (default to 1) + # @option opts [Integer] :page_size Page size (default to 20) # @return [FaxListResponse] - def list_faxes(page, page_size, opts = {}) - data, _status_code, _headers = list_faxes_with_http_info(page, page_size, opts) + def fax_list(opts = {}) + data, _status_code, _headers = fax_list_with_http_info(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 + # @option opts [Integer] :page Page (default to 1) + # @option opts [Integer] :page_size Page size (default to 20) # @return [Array<(FaxListResponse, Integer, Hash)>] FaxListResponse data, response status code and response headers - def list_faxes_with_http_info(page, page_size, opts = {}) + def fax_list_with_http_info(opts = {}) if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: FaxApi.list_faxes ...' + @api_client.config.logger.debug 'Calling API: FaxApi.fax_list ...' 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.' + if @api_client.config.client_side_validation && !opts[:'page'].nil? && opts[:'page'] < 1 + fail ArgumentError, 'invalid value for "opts[:"page"]" when calling FaxApi.fax_list, 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.' + if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] > 100 + fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling FaxApi.fax_list, 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.' + if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] < 1 + fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling FaxApi.fax_list, must be greater than or equal to 1.' end # resource path @@ -323,8 +315,8 @@ def list_faxes_with_http_info(page, page_size, opts = {}) # query parameters query_params = opts[:query_params] || {} - query_params[:'page'] = page - query_params[:'page_size'] = page_size + query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil? + query_params[:'page_size'] = opts[:'page_size'] if !opts[:'page_size'].nil? # header parameters header_params = opts[:header_params] || {} @@ -344,7 +336,7 @@ def list_faxes_with_http_info(page, page_size, opts = {}) auth_names = opts[:debug_auth_names] || ['api_key'] new_options = opts.merge( - :operation => :"FaxApi.list_faxes", + :operation => :"FaxApi.fax_list", :header_params => header_params, :query_params => query_params, :form_params => form_params, @@ -386,7 +378,7 @@ def list_faxes_with_http_info(page, page_size, opts = {}) 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}" + @api_client.config.logger.debug "API called: FaxApi#fax_list\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end @@ -395,9 +387,9 @@ def list_faxes_with_http_info(page, page_size, opts = {}) # 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) + # @return [FaxGetResponse] + def fax_send(fax_send_request, opts = {}) + data, _status_code, _headers = fax_send_with_http_info(fax_send_request, opts) data end @@ -405,14 +397,14 @@ def send_fax(fax_send_request, opts = {}) # 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 = {}) + # @return [Array<(FaxGetResponse, Integer, Hash)>] FaxGetResponse data, response status code and response headers + def fax_send_with_http_info(fax_send_request, opts = {}) if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: FaxApi.send_fax ...' + @api_client.config.logger.debug 'Calling API: FaxApi.fax_send ...' 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" + fail ArgumentError, "Missing the required parameter 'fax_send_request' when calling FaxApi.fax_send" end # resource path local_var_path = '/fax/send' @@ -425,7 +417,7 @@ def send_fax_with_http_info(fax_send_request, opts = {}) # 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']) + content_type = @api_client.select_header_content_type(['application/json', 'multipart/form-data']) if !content_type.nil? header_params['Content-Type'] = content_type end @@ -447,13 +439,13 @@ def send_fax_with_http_info(fax_send_request, opts = {}) end # return_type - return_type = opts[:debug_return_type] || 'FaxResponse' + return_type = opts[:debug_return_type] || 'FaxGetResponse' # auth_names auth_names = opts[:debug_auth_names] || ['api_key'] new_options = opts.merge( - :operation => :"FaxApi.send_fax", + :operation => :"FaxApi.fax_send", :header_params => header_params, :query_params => query_params, :form_params => form_params, @@ -468,7 +460,7 @@ def send_fax_with_http_info(fax_send_request, opts = {}) if e.code === 200 body = @api_client.convert_to_type( JSON.parse("[#{e.response_body}]", :symbolize_names => true)[0], - "Dropbox::Sign::FaxResponse" + "Dropbox::Sign::FaxGetResponse" ) fail ApiError.new(:code => e.code, @@ -495,7 +487,7 @@ def send_fax_with_http_info(fax_send_request, opts = {}) 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}" + @api_client.config.logger.debug "API called: FaxApi#fax_send\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end diff --git a/sdks/ruby/lib/dropbox-sign/models/sub_file.rb b/sdks/ruby/lib/dropbox-sign/models/fax_get_response.rb similarity index 86% rename from sdks/ruby/lib/dropbox-sign/models/sub_file.rb rename to sdks/ruby/lib/dropbox-sign/models/fax_get_response.rb index fc3fff631..a774af3b6 100644 --- a/sdks/ruby/lib/dropbox-sign/models/sub_file.rb +++ b/sdks/ruby/lib/dropbox-sign/models/fax_get_response.rb @@ -17,16 +17,19 @@ 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 + class FaxGetResponse + # @return [FaxResponse] + attr_accessor :fax + + # A list of warnings. + # @return [Array] + attr_accessor :warnings # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { - :'name' => :'name' + :'fax' => :'fax', + :'warnings' => :'warnings' } end @@ -38,7 +41,8 @@ def self.acceptable_attributes # Attribute type mapping. def self.openapi_types { - :'name' => :'String' + :'fax' => :'FaxResponse', + :'warnings' => :'Array' } end @@ -65,33 +69,37 @@ def self.merged_nullable # Attempt to instantiate and hydrate a new instance of this class # @param [Object] data Data to be converted - # @return [SubFile] + # @return [FaxGetResponse] def self.init(data) ApiClient.default.convert_to_type( data, - "SubFile" - ) || SubFile.new + "FaxGetResponse" + ) || FaxGetResponse.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" + fail ArgumentError, "The input argument (attributes) must be a hash in `Dropbox::Sign::FaxGetResponse` 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 + fail ArgumentError, "`#{k}` is not a valid attribute in `Dropbox::Sign::FaxGetResponse`. 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 = '' + if attributes.key?(:'fax') + self.fax = attributes[:'fax'] + end + + if attributes.key?(:'warnings') + if (value = attributes[:'warnings']).is_a?(Array) + self.warnings = value + end end end @@ -99,12 +107,17 @@ def initialize(attributes = {}) # @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 @@ -113,7 +126,8 @@ def valid? def ==(o) return true if self.equal?(o) self.class == o.class && - name == o.name + fax == o.fax && + warnings == o.warnings end # @see the `==` method @@ -125,7 +139,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [name].hash + [fax, warnings].hash end # Builds the object from hash diff --git a/sdks/ruby/lib/dropbox-sign/models/fax_list_response.rb b/sdks/ruby/lib/dropbox-sign/models/fax_list_response.rb index 0d6ffcf86..a06e7fe82 100644 --- a/sdks/ruby/lib/dropbox-sign/models/fax_list_response.rb +++ b/sdks/ruby/lib/dropbox-sign/models/fax_list_response.rb @@ -18,7 +18,7 @@ module Dropbox module Dropbox::Sign class FaxListResponse - # @return [Array] + # @return [Array] attr_accessor :faxes # @return [ListInfoResponse] @@ -40,7 +40,7 @@ def self.acceptable_attributes # Attribute type mapping. def self.openapi_types { - :'faxes' => :'Array', + :'faxes' => :'Array', :'list_info' => :'ListInfoResponse' } end diff --git a/sdks/ruby/lib/dropbox-sign/models/fax_response.rb b/sdks/ruby/lib/dropbox-sign/models/fax_response.rb index 3668befc3..c4070e076 100644 --- a/sdks/ruby/lib/dropbox-sign/models/fax_response.rb +++ b/sdks/ruby/lib/dropbox-sign/models/fax_response.rb @@ -18,18 +18,59 @@ module Dropbox module Dropbox::Sign class FaxResponse - # @return [FaxResponseFax] - attr_accessor :fax + # Fax ID + # @return [String] + attr_accessor :fax_id - # A list of warnings. - # @return [Array] - attr_accessor :warnings + # 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' => :'fax', - :'warnings' => :'warnings' + :'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 @@ -41,8 +82,16 @@ def self.acceptable_attributes # Attribute type mapping. def self.openapi_types { - :'fax' => :'FaxResponseFax', - :'warnings' => :'Array' + :'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 @@ -92,32 +141,59 @@ def initialize(attributes = {}) h[k.to_sym] = v } - if attributes.key?(:'fax') - self.fax = attributes[:'fax'] + 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?(:'warnings') - if (value = attributes[:'warnings']).is_a?(Array) - self.warnings = value + 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 - 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 @@ -126,8 +202,16 @@ def valid? def ==(o) return true if self.equal?(o) self.class == o.class && - fax == o.fax && - warnings == o.warnings + 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 @@ -139,7 +223,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [fax, warnings].hash + [fax_id, title, original_title, subject, message, metadata, created_at, from, transmissions, files_url].hash end # Builds the object from hash diff --git a/sdks/ruby/lib/dropbox-sign/models/fax_response_fax.rb b/sdks/ruby/lib/dropbox-sign/models/fax_response_fax.rb deleted file mode 100644 index 565d0203e..000000000 --- a/sdks/ruby/lib/dropbox-sign/models/fax_response_fax.rb +++ /dev/null @@ -1,347 +0,0 @@ -=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_transmission.rb similarity index 95% rename from sdks/ruby/lib/dropbox-sign/models/fax_response_fax_transmission.rb rename to sdks/ruby/lib/dropbox-sign/models/fax_response_transmission.rb index a02278699..98b6f77d3 100644 --- a/sdks/ruby/lib/dropbox-sign/models/fax_response_fax_transmission.rb +++ b/sdks/ruby/lib/dropbox-sign/models/fax_response_transmission.rb @@ -17,7 +17,7 @@ module Dropbox end module Dropbox::Sign - class FaxResponseFaxTransmission + class FaxResponseTransmission # Fax Transmission Recipient # @return [String] attr_accessor :recipient @@ -82,25 +82,25 @@ def self.merged_nullable # Attempt to instantiate and hydrate a new instance of this class # @param [Object] data Data to be converted - # @return [FaxResponseFaxTransmission] + # @return [FaxResponseTransmission] def self.init(data) ApiClient.default.convert_to_type( data, - "FaxResponseFaxTransmission" - ) || FaxResponseFaxTransmission.new + "FaxResponseTransmission" + ) || FaxResponseTransmission.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" + fail ArgumentError, "The input argument (attributes) must be a hash in `Dropbox::Sign::FaxResponseTransmission` 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 + fail ArgumentError, "`#{k}` is not a valid attribute in `Dropbox::Sign::FaxResponseTransmission`. 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 } diff --git a/sdks/ruby/lib/dropbox-sign/models/fax_send_request.rb b/sdks/ruby/lib/dropbox-sign/models/fax_send_request.rb index c3256c744..1a4393330 100644 --- a/sdks/ruby/lib/dropbox-sign/models/fax_send_request.rb +++ b/sdks/ruby/lib/dropbox-sign/models/fax_send_request.rb @@ -23,39 +23,35 @@ class FaxSendRequest attr_accessor :to # Fax Send From Sender (used only with fax number) - # @return [String, nil] + # @return [String] attr_accessor :from # Fax File to Send - # @return [Array] - attr_accessor :file + # @return [Array] + attr_accessor :files # Fax File URL to Send # @return [Array] - attr_accessor :file_url - - # Fax File URL Names - # @return [Array] - attr_accessor :file_url_names + attr_accessor :file_urls # API Test Mode Setting # @return [Boolean] attr_accessor :test_mode # Fax Cover Page for Recipient - # @return [String, nil] + # @return [String] attr_accessor :cover_page_to # Fax Cover Page for Sender - # @return [String, nil] + # @return [String] attr_accessor :cover_page_from # Fax Cover Page Message - # @return [String, nil] + # @return [String] attr_accessor :cover_page_message # Fax Title - # @return [String, nil] + # @return [String] attr_accessor :title # Attribute mapping from ruby-style variable name to JSON key. @@ -63,9 +59,8 @@ def self.attribute_map { :'to' => :'to', :'from' => :'from', - :'file' => :'file', - :'file_url' => :'file_url', - :'file_url_names' => :'file_url_names', + :'files' => :'files', + :'file_urls' => :'file_urls', :'test_mode' => :'test_mode', :'cover_page_to' => :'cover_page_to', :'cover_page_from' => :'cover_page_from', @@ -84,9 +79,8 @@ def self.openapi_types { :'to' => :'String', :'from' => :'String', - :'file' => :'Array', - :'file_url' => :'Array', - :'file_url_names' => :'Array', + :'files' => :'Array', + :'file_urls' => :'Array', :'test_mode' => :'Boolean', :'cover_page_to' => :'String', :'cover_page_from' => :'String', @@ -98,11 +92,6 @@ def self.openapi_types # List of attributes with nullable: true def self.openapi_nullable Set.new([ - :'from', - :'cover_page_to', - :'cover_page_from', - :'cover_page_message', - :'title' ]) end @@ -154,26 +143,22 @@ def initialize(attributes = {}) self.from = attributes[:'from'] end - if attributes.key?(:'file') - if (value = attributes[:'file']).is_a?(Array) - self.file = value + if attributes.key?(:'files') + if (value = attributes[:'files']).is_a?(Array) + self.files = 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 + if attributes.key?(:'file_urls') + if (value = attributes[:'file_urls']).is_a?(Array) + self.file_urls = value end end if attributes.key?(:'test_mode') self.test_mode = attributes[:'test_mode'] + else + self.test_mode = false end if attributes.key?(:'cover_page_to') @@ -197,12 +182,17 @@ def initialize(attributes = {}) # @return Array for valid properties with the reasons def list_invalid_properties invalid_properties = Array.new + if @to.nil? + invalid_properties.push('invalid value for "to", to 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 @to.nil? true end @@ -213,9 +203,8 @@ def ==(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 && + files == o.files && + file_urls == o.file_urls && test_mode == o.test_mode && cover_page_to == o.cover_page_to && cover_page_from == o.cover_page_from && @@ -232,7 +221,7 @@ def eql?(o) # 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 + [to, from, files, file_urls, test_mode, cover_page_to, cover_page_from, cover_page_message, title].hash end # Builds the object from hash From 603d67b0a42270ffde22f4e13488343a328c3b21 Mon Sep 17 00:00:00 2001 From: Maksud Aghayev Date: Fri, 4 Oct 2024 02:00:59 -0700 Subject: [PATCH 03/11] Examples fixing --- examples/FaxDelete.cs | 2 +- examples/FaxDelete.java | 4 ++-- examples/FaxDelete.js | 3 +-- examples/FaxDelete.php | 4 ++-- examples/FaxDelete.py | 2 +- examples/FaxDelete.rb | 2 +- examples/FaxDelete.ts | 2 +- examples/FaxFiles.cs | 6 +++++- examples/FaxFiles.java | 5 +++-- examples/FaxFiles.js | 5 +++-- examples/FaxFiles.php | 3 ++- examples/FaxFiles.py | 3 ++- examples/FaxFiles.rb | 4 ++-- examples/FaxFiles.sh | 5 +++-- examples/FaxFiles.ts | 5 +++-- examples/FaxGet.cs | 2 +- examples/FaxGet.java | 2 +- examples/FaxGet.js | 2 +- examples/FaxGet.php | 2 +- examples/FaxGet.py | 4 ++-- examples/FaxGet.rb | 2 +- examples/FaxGet.ts | 2 +- examples/FaxList.cs | 2 +- examples/FaxList.java | 2 +- examples/FaxList.js | 2 +- examples/FaxList.php | 2 +- examples/FaxList.py | 2 +- examples/FaxList.rb | 2 +- examples/FaxList.ts | 2 +- examples/FaxSend.cs | 29 +++++++++++++++++++---------- examples/FaxSend.java | 15 +++++++++++---- examples/FaxSend.js | 34 +++++++++++++++++++++++++++++++--- examples/FaxSend.php | 14 ++++++++++---- examples/FaxSend.py | 14 ++++++++++---- examples/FaxSend.rb | 14 ++++++++++---- examples/FaxSend.sh | 10 ++++++++-- examples/FaxSend.ts | 36 ++++++++++++++++++++++++++++++++---- 37 files changed, 178 insertions(+), 73 deletions(-) diff --git a/examples/FaxDelete.cs b/examples/FaxDelete.cs index b9ad35465..88a6ed074 100644 --- a/examples/FaxDelete.cs +++ b/examples/FaxDelete.cs @@ -16,7 +16,7 @@ public static void Main() try { - faxApi.DeleteFax("[FAX_NUMBER]"); + faxApi.FaxDelete("fa5c8a0b0f492d768749333ad6fcc214c111e967"); } catch (ApiException e) { diff --git a/examples/FaxDelete.java b/examples/FaxDelete.java index 55eda6b65..794b74d94 100644 --- a/examples/FaxDelete.java +++ b/examples/FaxDelete.java @@ -11,10 +11,10 @@ public static void main(String[] args) { var apiClient = Configuration.getDefaultApiClient() .setApiKey("YOUR_API_KEY"); - var faxAPi = new FaxApi(apiClient); + var faxApi = new FaxApi(apiClient); try { - faxAPi.deleteFax("[FAX_NUMBER]"); + faxApi.faxDelete("fa5c8a0b0f492d768749333ad6fcc214c111e967"); } catch (ApiException e) { System.err.println("Status code: " + e.getCode()); System.err.println("Reason: " + e.getResponseBody()); diff --git a/examples/FaxDelete.js b/examples/FaxDelete.js index 0eeb87049..38492bd21 100644 --- a/examples/FaxDelete.js +++ b/examples/FaxDelete.js @@ -5,8 +5,7 @@ const faxApi = new DropboxSign.FaxApi(); // Configure HTTP basic authorization: api_key faxApi.username = "YOUR_API_KEY"; - -const result = faxApi.deleteFax("[FAX_NUMBER]"); +const result = faxApi.faxDelete("fa5c8a0b0f492d768749333ad6fcc214c111e967"); result.catch(error => { console.log("Exception when calling Dropbox Sign API:"); diff --git a/examples/FaxDelete.php b/examples/FaxDelete.php index 9ccd95d1a..a5c62f5e9 100644 --- a/examples/FaxDelete.php +++ b/examples/FaxDelete.php @@ -7,10 +7,10 @@ // Configure HTTP basic authorization: api_key $config->setUsername("YOUR_API_KEY"); -$faxDelete = new Dropbox\Sign\Api\FaxApi($config); +$faxApi = new Dropbox\Sign\Api\FaxApi($config); try { - $faxDelete->deleteFax("[FAX_NUMBER]"); + $faxApi->faxDelete("fa5c8a0b0f492d768749333ad6fcc214c111e967"); } catch (Dropbox\Sign\ApiException $e) { $error = $e->getResponseObject(); echo "Exception when calling Dropbox Sign API: " diff --git a/examples/FaxDelete.py b/examples/FaxDelete.py index 9edbe2a39..adf2a5da8 100644 --- a/examples/FaxDelete.py +++ b/examples/FaxDelete.py @@ -11,6 +11,6 @@ fax_api = apis.FaxApi(api_client) try: - fax_api.delete_fax("[FAX_NUMBER]") + fax_api.fax_delete("fa5c8a0b0f492d768749333ad6fcc214c111e967") except ApiException as e: print("Exception when calling Dropbox Sign API: %s\n" % e) diff --git a/examples/FaxDelete.rb b/examples/FaxDelete.rb index 7e2ebb155..f68be3440 100644 --- a/examples/FaxDelete.rb +++ b/examples/FaxDelete.rb @@ -8,7 +8,7 @@ fax_api = Dropbox::Sign::FaxApi.new begin - fax_api.delete_fax("[FAX_NUMBER]") + fax_api.fax_delete("fa5c8a0b0f492d768749333ad6fcc214c111e967") rescue Dropbox::Sign::ApiError => e puts "Exception when calling Dropbox Sign API: #{e}" end diff --git a/examples/FaxDelete.ts b/examples/FaxDelete.ts index aeb2a2088..38492bd21 100644 --- a/examples/FaxDelete.ts +++ b/examples/FaxDelete.ts @@ -5,7 +5,7 @@ const faxApi = new DropboxSign.FaxApi(); // Configure HTTP basic authorization: api_key faxApi.username = "YOUR_API_KEY"; -const result = faxApi.deleteFax("[FAX_NUMBER]"); +const result = faxApi.faxDelete("fa5c8a0b0f492d768749333ad6fcc214c111e967"); result.catch(error => { console.log("Exception when calling Dropbox Sign API:"); diff --git a/examples/FaxFiles.cs b/examples/FaxFiles.cs index 44d267685..fbaf4166e 100644 --- a/examples/FaxFiles.cs +++ b/examples/FaxFiles.cs @@ -18,7 +18,11 @@ public static void Main() try { - faxApi.GetFaxFiles(faxId); + var result = faxApi.FaxFiles(faxId); + var fileStream = File.Create("file_response.pdf"); + result.Seek(0, SeekOrigin.Begin); + result.CopyTo(fileStream); + fileStream.Close(); } catch (ApiException e) { diff --git a/examples/FaxFiles.java b/examples/FaxFiles.java index 57733a233..bd6dcc5df 100644 --- a/examples/FaxFiles.java +++ b/examples/FaxFiles.java @@ -4,7 +4,7 @@ import com.dropbox.sign.auth.*; import com.dropbox.sign.model.*; -import java.util.List; +import java.io.File; public class Example { public static void main(String[] args) { @@ -16,7 +16,8 @@ public static void main(String[] args) { var faxId = "fa5c8a0b0f492d768749333ad6fcc214c111e967"; try { - faxApi.getFaxFiles(faxId); + File result = faxApi.faxFiles(faxId); + result.renameTo(new File("file_response.pdf"));; } catch (ApiException e) { System.err.println("Status code: " + e.getCode()); System.err.println("Reason: " + e.getResponseBody()); diff --git a/examples/FaxFiles.js b/examples/FaxFiles.js index 3e5e14d7d..d7390cf60 100644 --- a/examples/FaxFiles.js +++ b/examples/FaxFiles.js @@ -1,4 +1,5 @@ import * as DropboxSign from "@dropbox/sign"; +import * as fs from 'fs'; const faxApi = new DropboxSign.FaxApi(); @@ -7,9 +8,9 @@ faxApi.username = "YOUR_API_KEY"; const faxId = "fa5c8a0b0f492d768749333ad6fcc214c111e967"; -const result = faxApi.getFaxFiles(faxId); +const result = faxApi.faxFiles(faxId); result.then(response => { - console.log(response.body); + fs.createWriteStream('file_response.pdf').write(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 index 301bcdcb9..d543eea9c 100644 --- a/examples/FaxFiles.php +++ b/examples/FaxFiles.php @@ -12,7 +12,8 @@ $faxId = "fa5c8a0b0f492d768749333ad6fcc214c111e967"; try { - $faxApi->getFaxFiles($faxId); + $result = $faxApi->faxFiles($faxId); + copy($result->getRealPath(), __DIR__ . '/file_response.pdf'); } catch (Dropbox\Sign\ApiException $e) { $error = $e->getResponseObject(); echo "Exception when calling Dropbox Sign API: " diff --git a/examples/FaxFiles.py b/examples/FaxFiles.py index aaddadc05..110a0f7b5 100644 --- a/examples/FaxFiles.py +++ b/examples/FaxFiles.py @@ -13,6 +13,7 @@ fax_id = "fa5c8a0b0f492d768749333ad6fcc214c111e967" try: - fax_api.get_fax_files(fax_id) + response = fax_api.fax_files(fax_id) + open("file_response.pdf", "wb").write(response.read()) except ApiException as e: print("Exception when calling Dropbox Sign API: %s\n" % e) diff --git a/examples/FaxFiles.rb b/examples/FaxFiles.rb index 3c5ee18de..d867387ad 100644 --- a/examples/FaxFiles.rb +++ b/examples/FaxFiles.rb @@ -10,8 +10,8 @@ faxId = "fa5c8a0b0f492d768749333ad6fcc214c111e967"; begin - result = fax_api.get_fax_files(data) - p result + file_bin = fax_api.fax_files(data) + FileUtils.cp(file_bin.path, "path/to/file.pdf") rescue Dropbox::Sign::ApiError => e puts "Exception when calling Dropbox Sign API: #{e}" end diff --git a/examples/FaxFiles.sh b/examples/FaxFiles.sh index 427a5cda3..02f04e4a1 100644 --- a/examples/FaxFiles.sh +++ b/examples/FaxFiles.sh @@ -1,2 +1,3 @@ -curl -X POST 'https://api.hellosign.com/v3/fax/files/{fax_id}' \ - -u 'YOUR_API_KEY:' +curl -X GET 'https://api.hellosign.com/v3/fax/files/{fax_id}' \ + -u 'YOUR_API_KEY:' \ + --output downloaded_document.pdf \ No newline at end of file diff --git a/examples/FaxFiles.ts b/examples/FaxFiles.ts index 3e5e14d7d..d7390cf60 100644 --- a/examples/FaxFiles.ts +++ b/examples/FaxFiles.ts @@ -1,4 +1,5 @@ import * as DropboxSign from "@dropbox/sign"; +import * as fs from 'fs'; const faxApi = new DropboxSign.FaxApi(); @@ -7,9 +8,9 @@ faxApi.username = "YOUR_API_KEY"; const faxId = "fa5c8a0b0f492d768749333ad6fcc214c111e967"; -const result = faxApi.getFaxFiles(faxId); +const result = faxApi.faxFiles(faxId); result.then(response => { - console.log(response.body); + fs.createWriteStream('file_response.pdf').write(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 index b698b5846..6396e0c34 100644 --- a/examples/FaxGet.cs +++ b/examples/FaxGet.cs @@ -18,7 +18,7 @@ public static void Main() try { - var result = faxApi.GetFaxById(faxId); + var result = faxApi.FaxGet(faxId); Console.WriteLine(result); } catch (ApiException e) diff --git a/examples/FaxGet.java b/examples/FaxGet.java index f4abb0683..a9cc433df 100644 --- a/examples/FaxGet.java +++ b/examples/FaxGet.java @@ -14,7 +14,7 @@ public static void main(String[] args) { var faxId = "fa5c8a0b0f492d768749333ad6fcc214c111e967"; try { - FaxGetResponse result = faxApi.getFaxById(faxId); + FaxGetResponse result = faxApi.faxGet(faxId); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling AccountApi#accountCreate"); diff --git a/examples/FaxGet.js b/examples/FaxGet.js index 3b18e0b35..8a1dbbfda 100644 --- a/examples/FaxGet.js +++ b/examples/FaxGet.js @@ -7,7 +7,7 @@ faxApi.username = "YOUR_API_KEY"; const faxId = "fa5c8a0b0f492d768749333ad6fcc214c111e967" -const result = faxApi.getFaxById(faxId); +const result = faxApi.faxGet(faxId); result.then(response => { console.log(response.body); }).catch(error => { diff --git a/examples/FaxGet.php b/examples/FaxGet.php index 919f2486b..43b7a1f3e 100644 --- a/examples/FaxGet.php +++ b/examples/FaxGet.php @@ -12,7 +12,7 @@ $faxId = "fa5c8a0b0f492d768749333ad6fcc214c111e967"; try { - $result = $faxApi->getFaxById($faxId); + $result = $faxApi->faxGet($faxId); print_r($result); } catch (Dropbox\Sign\ApiException $e) { $error = $e->getResponseObject(); diff --git a/examples/FaxGet.py b/examples/FaxGet.py index ada81e29f..c56656833 100644 --- a/examples/FaxGet.py +++ b/examples/FaxGet.py @@ -10,10 +10,10 @@ with ApiClient(configuration) as api_client: fax_api = apis.FaxApi(api_client) - faxId = "fa5c8a0b0f492d768749333ad6fcc214c111e967" + fax_id = "fa5c8a0b0f492d768749333ad6fcc214c111e967" try: - response = fax_api.get_fax_by_id(client_id) + response = fax_api.fax_get(fax_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 index 5b19344dd..64dc1c057 100644 --- a/examples/FaxGet.rb +++ b/examples/FaxGet.rb @@ -10,7 +10,7 @@ fax_id = "fa5c8a0b0f492d768749333ad6fcc214c111e967" begin - result = fax_api.get_fax_by_id(fax_id) + result = fax_api.fax_get(fax_id) p result rescue Dropbox::Sign::ApiError => e puts "Exception when calling Dropbox Sign API: #{e}" diff --git a/examples/FaxGet.ts b/examples/FaxGet.ts index 061b92ab4..793f6e5d3 100644 --- a/examples/FaxGet.ts +++ b/examples/FaxGet.ts @@ -7,7 +7,7 @@ faxApi.username = "YOUR_API_KEY"; const faxId = "fa5c8a0b0f492d768749333ad6fcc214c111e967" -const result = faxApi.getFaxById(faxId); +const result = faxApi.faxGet(faxId); result.then(response => { console.log(response.body); }).catch(error => { diff --git a/examples/FaxList.cs b/examples/FaxList.cs index a8670c9e3..f87d9b8f2 100644 --- a/examples/FaxList.cs +++ b/examples/FaxList.cs @@ -19,7 +19,7 @@ public static void Main() try { - var result = faxApi.ListFaxes(page, pageSize); + var result = faxApi.FaxList(page, pageSize); Console.WriteLine(result); } catch (ApiException e) diff --git a/examples/FaxList.java b/examples/FaxList.java index 8f9b3858f..042bb7107 100644 --- a/examples/FaxList.java +++ b/examples/FaxList.java @@ -15,7 +15,7 @@ public static void main(String[] args) { var pageSize = 2; try { - FaxListResponse result = faxApi.listFaxes(page, pageSize); + FaxListResponse result = faxApi.faxList(page, pageSize); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling AccountApi#accountCreate"); diff --git a/examples/FaxList.js b/examples/FaxList.js index 593791683..385f44779 100644 --- a/examples/FaxList.js +++ b/examples/FaxList.js @@ -8,7 +8,7 @@ faxApi.username = "YOUR_API_KEY"; const page = 1; const pageSize = 2; -const result = faxApi.listFaxes(page, pageSize); +const result = faxApi.faxList(page, pageSize); result.then(response => { console.log(response.body); }).catch(error => { diff --git a/examples/FaxList.php b/examples/FaxList.php index 48cb361dc..d2a513c21 100644 --- a/examples/FaxList.php +++ b/examples/FaxList.php @@ -13,7 +13,7 @@ $pageSize = 2; try { - $result = $faxApi->listFaxes($page, $pageSize); + $result = $faxApi->faxList($page, $pageSize); print_r($result); } catch (Dropbox\Sign\ApiException $e) { $error = $e->getResponseObject(); diff --git a/examples/FaxList.py b/examples/FaxList.py index 8cb2e10b3..6b71f79b6 100644 --- a/examples/FaxList.py +++ b/examples/FaxList.py @@ -14,7 +14,7 @@ page_size = 2 try: - response = fax_api.list_faxes( + response = fax_api.fax_list( page=page, page_size=page_size, ) diff --git a/examples/FaxList.rb b/examples/FaxList.rb index 8d0c2c21a..3f37a71ea 100644 --- a/examples/FaxList.rb +++ b/examples/FaxList.rb @@ -11,7 +11,7 @@ page_size = 2 begin - result = fax_api.list_faxes({ page: page, page_size: page_size }) + result = fax_api.fax_list({ page: page, page_size: page_size }) p result rescue Dropbox::Sign::ApiError => e puts "Exception when calling Dropbox Sign API: #{e}" diff --git a/examples/FaxList.ts b/examples/FaxList.ts index 593791683..385f44779 100644 --- a/examples/FaxList.ts +++ b/examples/FaxList.ts @@ -8,7 +8,7 @@ faxApi.username = "YOUR_API_KEY"; const page = 1; const pageSize = 2; -const result = faxApi.listFaxes(page, pageSize); +const result = faxApi.faxList(page, pageSize); result.then(response => { console.log(response.body); }).catch(error => { diff --git a/examples/FaxSend.cs b/examples/FaxSend.cs index e33c7e8b5..c4d4dca55 100644 --- a/examples/FaxSend.cs +++ b/examples/FaxSend.cs @@ -14,20 +14,29 @@ public static void Main() 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!" + var files = new List { + new FileStream( + "./example_fax.pdf", + FileMode.Open, + FileAccess.Read, + FileShare.Read + ) + }; + + var data = new FaxSendRequest( + files: files, + testMode: true, + to: "16690000001", + from: "16690000000", + coverPageTo: "Jill Fax", + coverPageMessage: "I'm sending you a fax!", + coverPageFrom: "Faxer Faxerson", + title: "This is what the fax is about!", ); try { - var result = faxApi.FaxCreate(data); + var result = faxApi.FaxSend(data); Console.WriteLine(result); } catch (ApiException e) diff --git a/examples/FaxSend.java b/examples/FaxSend.java index 69594b4a8..fdb0c838f 100644 --- a/examples/FaxSend.java +++ b/examples/FaxSend.java @@ -13,12 +13,19 @@ public static void main(String[] args) { var faxApi = new FaxApi(apiClient); - var data = new FaxCreateRequest() - .areaCode(209) - .country("US"); + + var data = new FaxSendRequest() + .addFilesItem(new File("example_fax.pdf")) + .testMode(true) + .to("16690000001") + .from("16690000000") + .coverPageTo("Jill Fax") + .coverPageMessage("I'm sending you a fax!") + .coverPageFrom("Faxer Faxerson") + .title("This is what the fax is about!"); try { - FaxCreateResponse result = faxApi.faxCreate(data); + FaxCreateResponse result = faxApi.faxSend(data); System.out.println(result); } catch (ApiException e) { System.err.println("Status code: " + e.getCode()); diff --git a/examples/FaxSend.js b/examples/FaxSend.js index f2b7f441e..d03526c0f 100644 --- a/examples/FaxSend.js +++ b/examples/FaxSend.js @@ -1,16 +1,44 @@ import * as DropboxSign from "@dropbox/sign"; +import * as fs from 'fs'; const faxApi = new DropboxSign.FaxApi(); // Configure HTTP basic authorization: api_key faxApi.username = "YOUR_API_KEY"; +// Upload a local file +const file = fs.createReadStream("example_signature_request.pdf"); + +// or, upload from buffer +const fileBuffer = { + value: fs.readFileSync("example_signature_request.pdf"), + options: { + filename: "example_signature_request.pdf", + contentType: "application/pdf", + }, +}; + +// or, upload from buffer alternative +const fileBufferAlt = { + value: Buffer.from("abc-123"), + options: { + filename: "txt-sample.txt", + contentType: "text/plain", + }, +}; + const data = { - areaCode: 209, - country: "US", + files: [ file, fileBuffer, fileBufferAlt ], + testMode: true, + to: "16690000001", + from: "16690000000", + coverPageTo: "Jill Fax", + coverPageMessage: "I'm sending you a fax!", + coverPageFrom: "Faxer Faxerson", + title: "This is what the fax is about!", }; -const result = faxApi.faxCreate(data); +const result = faxApi.faxSend(data); result.then(response => { console.log(response.body); }).catch(error => { diff --git a/examples/FaxSend.php b/examples/FaxSend.php index afab877bc..6ca0dd78a 100644 --- a/examples/FaxSend.php +++ b/examples/FaxSend.php @@ -9,12 +9,18 @@ $faxApi = new Dropbox\Sign\Api\FaxApi($config); -$data = new Dropbox\Sign\Model\FaxCreateRequest(); -$data->setAreaCode(209) - ->setCountry("US"); +$data = new Dropbox\Sign\Model\FaxSendRequest(); +$data->setFiles([new SplFileObject(__DIR__ . "/example_signature_request.pdf")]) + ->setTestMode(true) + ->setTo("16690000001") + ->setFrom("16690000000") + ->setCoverPageTo("Jill Fax") + ->setCoverPageMessage("I'm sending you a fax!") + ->setCoverPageFrom("Faxer Faxerson") + ->setTitle("This is what the fax is about!"); try { - $result = $faxApi->faxCreate($data); + $result = $faxApi->faxSend($data); print_r($result); } catch (Dropbox\Sign\ApiException $e) { $error = $e->getResponseObject(); diff --git a/examples/FaxSend.py b/examples/FaxSend.py index 829105113..63589d997 100644 --- a/examples/FaxSend.py +++ b/examples/FaxSend.py @@ -10,13 +10,19 @@ with ApiClient(configuration) as api_client: fax_api = apis.FaxApi(api_client) - data = models.FaxCreateRequest( - area_code=209, - country="US", + data = models.FaxSendRequest( + files=[open("example_signature_request.pdf", "rb")], + test_mode=True, + 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: - response = fax_api.fax_create(data) + response = fax_api.fax_send(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 index 1d46dd797..7736d6e93 100644 --- a/examples/FaxSend.rb +++ b/examples/FaxSend.rb @@ -7,12 +7,18 @@ fax_api = Dropbox::Sign::FaxApi.new -data = Dropbox::Sign::FaxCreateRequest.new -data.area_code = 209 -data.country = "US" +data = Dropbox::Sign::FaxSendRequest.new +data.files = [File.new("example_signature_request.pdf", "r")] +data.test_mode = true +data.to = "16690000001" +data.from = "16690000000" +data.cover_page_to = "Jill Fax" +data.cover_page_message = "I'm sending you a fax!" +data.cover_page_from = "Faxer Faxerson" +data.title = "This is what the fax is about!" begin - result = fax_api.fax_create(data) + result = fax_api.fax_send(data) p result rescue Dropbox::Sign::ApiError => e puts "Exception when calling Dropbox Sign API: #{e}" diff --git a/examples/FaxSend.sh b/examples/FaxSend.sh index 212b8b46d..61e1ce418 100644 --- a/examples/FaxSend.sh +++ b/examples/FaxSend.sh @@ -1,4 +1,10 @@ curl -X POST 'https://api.hellosign.com/v3/fax/send' \ -u 'YOUR_API_KEY:' \ - -F 'area_code=209' \ - -F 'country=US' + -F 'files[0]=@mutual-NDA-example.pdf' \ + -F 'test_mode=1' \ + -F 'to=16690000001' \ + -F 'from=16690000000' \ + -F 'cover_page_to=Jill Fax' \ + -F 'cover_page_message=I sent you a fax!' \ + -F 'cover_page_from=Faxer Faxerson' \ + -F 'title=This is what the fax is about!' \ No newline at end of file diff --git a/examples/FaxSend.ts b/examples/FaxSend.ts index 61d54476e..e27fea292 100644 --- a/examples/FaxSend.ts +++ b/examples/FaxSend.ts @@ -1,16 +1,44 @@ import * as DropboxSign from "@dropbox/sign"; +import * as fs from 'fs'; const faxApi = new DropboxSign.FaxApi(); // Configure HTTP basic authorization: api_key faxApi.username = "YOUR_API_KEY"; -const data: DropboxSign.FaxCreateRequest = { - areaCode: 209, - country: "US", +// Upload a local file +const file = fs.createReadStream("example_signature_request.pdf"); + +// or, upload from buffer +const fileBuffer: DropboxSign.RequestDetailedFile = { + value: fs.readFileSync("example_signature_request.pdf"), + options: { + filename: "example_signature_request.pdf", + contentType: "application/pdf", + }, +}; + +// or, upload from buffer alternative +const fileBufferAlt: DropboxSign.RequestDetailedFile = { + value: Buffer.from("abc-123"), + options: { + filename: "txt-sample.txt", + contentType: "text/plain", + }, +}; + +const data: DropboxSign.FaxSendRequest = { + files: [ file, fileBuffer, fileBufferAlt ], + testMode: true, + to: "16690000001", + from: "16690000000", + coverPageTo: "Jill Fax", + coverPageMessage: "I'm sending you a fax!", + coverPageFrom: "Faxer Faxerson", + title: "This is what the fax is about!", }; -const result = faxApi.faxCreate(data); +const result = faxApi.faxSend(data); result.then(response => { console.log(response.body); }).catch(error => { From e0b050a9a9f4779ead24433f6d9dba57af481247 Mon Sep 17 00:00:00 2001 From: Maksud Aghayev Date: Fri, 4 Oct 2024 02:03:48 -0700 Subject: [PATCH 04/11] Examples fixing 1 --- examples/json/FaxGetResponseExample.json | 2 +- examples/json/FaxListResponseExample.json | 2 +- examples/json/FaxSendRequestExample.json | 12 ++++++------ 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/examples/json/FaxGetResponseExample.json b/examples/json/FaxGetResponseExample.json index 590eaca52..7bb712c8a 100644 --- a/examples/json/FaxGetResponseExample.json +++ b/examples/json/FaxGetResponseExample.json @@ -16,6 +16,6 @@ "status_code": "success" } ], - "files_url": "" + "files_url": "https://api.hellosign.com/v3/fax/files/2b388914e3ae3b738bd4e2ee2850c677e6dc53d2", } } \ No newline at end of file diff --git a/examples/json/FaxListResponseExample.json b/examples/json/FaxListResponseExample.json index b1176d486..c7ab4f3ae 100644 --- a/examples/json/FaxListResponseExample.json +++ b/examples/json/FaxListResponseExample.json @@ -23,7 +23,7 @@ "status_code": "success" } ], - "files_url": "" + "files_url": "https://api.hellosign.com/v3/fax/files/2b388914e3ae3b738bd4e2ee2850c677e6dc53d2", } ] } diff --git a/examples/json/FaxSendRequestExample.json b/examples/json/FaxSendRequestExample.json index b873f81d8..d0cf8ad8b 100644 --- a/examples/json/FaxSendRequestExample.json +++ b/examples/json/FaxSendRequestExample.json @@ -1,10 +1,10 @@ { - "file": "", - "file_url[0]": "", - "file_url_names[0]": "File name for a file in URL", - "test_mode": "1", - "to": 16690000001, - "from": 16690000000, + "file_url": [ + "https://api.hellosign.com/v3/fax/files/2b388914e3ae3b738bd4e2ee2850c677e6dc53d2" + ], + "test_mode": "true", + "to": "16690000001", + "from": "16690000000", "cover_page_to": "Jill Fax", "cover_page_message": "I'm sending you a fax!", "cover_page_from": "Faxer Faxerson", From f3523093f8ad4e94b4c1dc9eda24e8dee0b8a473 Mon Sep 17 00:00:00 2001 From: Maksud Aghayev Date: Fri, 4 Oct 2024 02:04:00 -0700 Subject: [PATCH 05/11] Transalations --- translations/en.yaml | 34 +++++++++++++++------------------- 1 file changed, 15 insertions(+), 19 deletions(-) diff --git a/translations/en.yaml b/translations/en.yaml index 0a45d831d..cee56a77c 100644 --- a/translations/en.yaml +++ b/translations/en.yaml @@ -153,21 +153,21 @@ "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 +"FaxGetResponseExample::SUMMARY": Fax Response +"FaxResponse::FAX_ID": Fax ID +"FaxResponse::TITLE": Fax Title +"FaxResponse::ORIGINAL_TITLE": Fax Original Title +"FaxResponse::SUBJECT": Fax Subject +"FaxResponse::MESSAGE": Fax Message +"FaxResponse::METADATA": Fax Metadata +"FaxResponse::CREATED_AT": Fax Created At Timestamp +"FaxResponse::FROM": Fax Sender Email +"FaxResponse::TRANSMISSIONS": Fax Transmissions List +"FaxResponse::FILES_URL": Fax Files URL +"Sub::FaxResponseTransmission::RECIPIENT": Fax Transmission Recipient +"Sub::FaxResponseTransmission::SENDER": Fax Transmission Sender +"Sub::FaxResponseTransmission::STATUS_CODE": Fax Transmission Status Code +"Sub::FaxResponseTransmission::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. @@ -969,10 +969,6 @@ **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 From 213a9810c0d9448f3e8dc596444c00dd180b398b Mon Sep 17 00:00:00 2001 From: Maksud Aghayev Date: Fri, 4 Oct 2024 02:04:13 -0700 Subject: [PATCH 06/11] OpenAPI specs --- openapi-raw.yaml | 114 +++++++++++++++++++++++------------------------ openapi-sdk.yaml | 84 +++++++++++++++++----------------- openapi.yaml | 84 +++++++++++++++++----------------- 3 files changed, 135 insertions(+), 147 deletions(-) diff --git a/openapi-raw.yaml b/openapi-raw.yaml index f53d38a4d..e6dd84ea6 100644 --- a/openapi-raw.yaml +++ b/openapi-raw.yaml @@ -1409,7 +1409,7 @@ paths: - Fax summary: '_t__FaxGet::SUMMARY' description: '_t__FaxGet::DESCRIPTION' - operationId: getFaxById + operationId: faxGet parameters: - name: fax_id @@ -1432,10 +1432,10 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/FaxResponse' + $ref: '#/components/schemas/FaxGetResponse' examples: default_example: - $ref: '#/components/examples/FaxResponseExample' + $ref: '#/components/examples/FaxGetResponseExample' 4XX: description: failed_operation content: @@ -1453,6 +1453,8 @@ paths: $ref: '#/components/examples/Error403ResponseExample' 404_example: $ref: '#/components/examples/Error404ResponseExample' + 429_example: + $ref: '#/components/examples/Error429ResponseExample' 4XX_example: $ref: '#/components/examples/Error4XXResponseExample' security: @@ -1508,7 +1510,7 @@ paths: - Fax summary: '_t__FaxDelete::SUMMARY' description: '_t__FaxDelete::DESCRIPTION' - operationId: deleteFax + operationId: faxDelete parameters: - name: fax_id @@ -1519,7 +1521,7 @@ paths: type: string example: fa5c8a0b0f492d768749333ad6fcc214c111e967 responses: - '200': + '204': description: 'successful operation' headers: X-RateLimit-Limit: @@ -1528,8 +1530,6 @@ paths: $ref: '#/components/headers/X-RateLimit-Remaining' X-Ratelimit-Reset: $ref: '#/components/headers/X-Ratelimit-Reset' - content: - application/json: { } 4XX: description: failed_operation content: @@ -1547,6 +1547,8 @@ paths: $ref: '#/components/examples/Error403ResponseExample' 404_example: $ref: '#/components/examples/Error404ResponseExample' + 429_example: + $ref: '#/components/examples/Error429ResponseExample' 4XX_example: $ref: '#/components/examples/Error4XXResponseExample' security: @@ -1603,7 +1605,7 @@ paths: - Fax summary: '_t__FaxFiles::SUMMARY' description: '_t__FaxFiles::DESCRIPTION' - operationId: getFaxFiles + operationId: faxFiles parameters: - name: fax_id @@ -1645,6 +1647,10 @@ paths: $ref: '#/components/examples/Error403ResponseExample' 404_example: $ref: '#/components/examples/Error404ResponseExample' + 410_example: + $ref: '#/components/examples/Error410ResponseExample' + 429_example: + $ref: '#/components/examples/Error429ResponseExample' 4XX_example: $ref: '#/components/examples/Error4XXResponseExample' security: @@ -2498,24 +2504,24 @@ paths: - Fax summary: '_t__FaxList::SUMMARY' description: '_t__FaxList::DESCRIPTION' - operationId: listFaxes + operationId: faxList parameters: - name: page in: query description: '_t__FaxList::PAGE' - required: true schema: type: integer + default: 1 minimum: 1 example: 1 - name: page_size in: query description: '_t__FaxList::PAGE_SIZE' - required: true schema: type: integer + default: 20 maximum: 100 minimum: 1 example: 20 @@ -2609,7 +2615,7 @@ paths: - Fax summary: '_t__FaxSend::SUMMARY' description: '_t__FaxSend::DESCRIPTION' - operationId: sendFax + operationId: faxSend requestBody: required: true content: @@ -2619,6 +2625,9 @@ paths: examples: default_example: $ref: '#/components/examples/FaxSendRequestExample' + multipart/form-data: + schema: + $ref: '#/components/schemas/FaxSendRequest' responses: '200': description: 'successful operation' @@ -2632,10 +2641,10 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/FaxResponse' + $ref: '#/components/schemas/FaxGetResponse' examples: default_example: - $ref: '#/components/examples/FaxResponseExample' + $ref: '#/components/examples/FaxGetResponseExample' 4XX: description: failed_operation content: @@ -2653,6 +2662,8 @@ paths: $ref: '#/components/examples/Error403ResponseExample' 404_example: $ref: '#/components/examples/Error404ResponseExample' + 429_example: + $ref: '#/components/examples/Error429ResponseExample' 4XX_example: $ref: '#/components/examples/Error4XXResponseExample' security: @@ -7755,6 +7766,8 @@ components: format: email type: object FaxSendRequest: + required: + - to properties: to: description: '_t__FaxSend::TO' @@ -7764,46 +7777,37 @@ components: description: '_t__FaxSend::FROM' type: string example: sender@example.com - nullable: true - file: + files: 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' + format: binary + file_urls: + description: '_t__FaxSend::FILE_URL' type: array items: type: string test_mode: description: '_t__FaxSend::TEST_MODE' type: boolean - example: false + default: 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: @@ -8507,14 +8511,6 @@ 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 @@ -10165,12 +10161,12 @@ components: error: $ref: '#/components/schemas/ErrorResponseError' type: object - FaxResponse: + FaxGetResponse: required: - fax properties: fax: - $ref: '#/components/schemas/FaxResponseFax' + $ref: '#/components/schemas/FaxResponse' warnings: description: '_t__WarningResponse::LIST_DESCRIPTION' type: array @@ -10221,7 +10217,7 @@ components: faxes: type: array items: - $ref: '#/components/schemas/FaxResponseFax' + $ref: '#/components/schemas/FaxResponse' list_info: $ref: '#/components/schemas/ListInfoResponse' type: object @@ -10569,39 +10565,39 @@ components: description: '_t__ErrorResponseError::ERROR_NAME' type: string type: object - FaxResponseFax: + FaxResponse: properties: fax_id: - description: '_t__FaxResponseFax::FAX_ID' + description: '_t__FaxResponse::FAX_ID' type: string title: - description: '_t__FaxResponseFax::TITLE' + description: '_t__FaxResponse::TITLE' type: string original_title: - description: '_t__FaxResponseFax::ORIGINAL_TITLE' + description: '_t__FaxResponse::ORIGINAL_TITLE' type: string subject: - description: '_t__FaxResponseFax::SUBJECT' + description: '_t__FaxResponse::SUBJECT' type: string message: - description: '_t__FaxResponseFax::MESSAGE' + description: '_t__FaxResponse::MESSAGE' type: string metadata: - description: '_t__FaxResponseFax::METADATA' + description: '_t__FaxResponse::METADATA' type: object created_at: - description: '_t__FaxResponseFax::CREATED_AT' + description: '_t__FaxResponse::CREATED_AT' type: integer from: - description: '_t__FaxResponseFax::FROM' + description: '_t__FaxResponse::FROM' type: string transmissions: - description: '_t__FaxResponseFax::TRANSMISSIONS' + description: '_t__FaxResponse::TRANSMISSIONS' type: array items: - $ref: '#/components/schemas/FaxResponseFaxTransmission' + $ref: '#/components/schemas/FaxResponseTransmission' files_url: - description: '_t__FaxResponseFax::FILES_URL' + description: '_t__FaxResponse::FILES_URL' type: string type: object x-internal-class: true @@ -10622,19 +10618,19 @@ components: $ref: '#/components/schemas/AccountResponse' type: object x-internal-class: true - FaxResponseFaxTransmission: + FaxResponseTransmission: properties: recipient: - description: '_t__FaxResponseFaxTransmission::RECIPIENT' + description: '_t__Sub::FaxResponseTransmission::RECIPIENT' type: string sender: - description: '_t__FaxResponseFaxTransmission::SENDER' + description: '_t__Sub::FaxResponseTransmission::SENDER' type: string status_code: - description: '_t__FaxResponseFaxTransmission::STATUS_CODE' + description: '_t__Sub::FaxResponseTransmission::STATUS_CODE' type: string sent_at: - description: '_t__FaxResponseFaxTransmission::SENT_AT' + description: '_t__Sub::FaxResponseTransmission::SENT_AT' type: integer type: object x-internal-class: true @@ -12514,10 +12510,10 @@ components: summary: '_t__Error::4XX' value: $ref: examples/json/Error4XXResponseExample.json - FaxResponseExample: - summary: '_t__FaxResponseExample::SUMMARY' + FaxGetResponseExample: + summary: '_t__FaxGetResponseExample::SUMMARY' value: - $ref: examples/json/FaxResponseExample.json + $ref: examples/json/FaxGetResponseExample.json FaxLineResponseExample: summary: '_t__FaxLineResponseExample::SUMMARY' value: diff --git a/openapi-sdk.yaml b/openapi-sdk.yaml index b64e1e696..40f15c9eb 100644 --- a/openapi-sdk.yaml +++ b/openapi-sdk.yaml @@ -1415,7 +1415,7 @@ paths: - Fax summary: 'Get Fax' description: 'Returns information about fax' - operationId: getFaxById + operationId: faxGet parameters: - name: fax_id @@ -1438,10 +1438,10 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/FaxResponse' + $ref: '#/components/schemas/FaxGetResponse' examples: default_example: - $ref: '#/components/examples/FaxResponseExample' + $ref: '#/components/examples/FaxGetResponseExample' 4XX: description: failed_operation content: @@ -1459,6 +1459,8 @@ paths: $ref: '#/components/examples/Error403ResponseExample' 404_example: $ref: '#/components/examples/Error404ResponseExample' + 429_example: + $ref: '#/components/examples/Error429ResponseExample' 4XX_example: $ref: '#/components/examples/Error4XXResponseExample' security: @@ -1514,7 +1516,7 @@ paths: - Fax summary: 'Delete Fax' description: 'Deletes the specified Fax from the system.' - operationId: deleteFax + operationId: faxDelete parameters: - name: fax_id @@ -1525,7 +1527,7 @@ paths: type: string example: fa5c8a0b0f492d768749333ad6fcc214c111e967 responses: - 200: + 204: description: 'successful operation' headers: X-RateLimit-Limit: @@ -1534,8 +1536,6 @@ paths: $ref: '#/components/headers/X-RateLimit-Remaining' X-Ratelimit-Reset: $ref: '#/components/headers/X-Ratelimit-Reset' - content: - application/json: {} 4XX: description: failed_operation content: @@ -1553,6 +1553,8 @@ paths: $ref: '#/components/examples/Error403ResponseExample' 404_example: $ref: '#/components/examples/Error404ResponseExample' + 429_example: + $ref: '#/components/examples/Error429ResponseExample' 4XX_example: $ref: '#/components/examples/Error4XXResponseExample' security: @@ -1609,7 +1611,7 @@ paths: - Fax summary: 'List Fax Files' description: 'Returns list of fax files' - operationId: getFaxFiles + operationId: faxFiles parameters: - name: fax_id @@ -1651,6 +1653,10 @@ paths: $ref: '#/components/examples/Error403ResponseExample' 404_example: $ref: '#/components/examples/Error404ResponseExample' + 410_example: + $ref: '#/components/examples/Error410ResponseExample' + 429_example: + $ref: '#/components/examples/Error429ResponseExample' 4XX_example: $ref: '#/components/examples/Error4XXResponseExample' security: @@ -2504,24 +2510,24 @@ paths: - Fax summary: 'Lists Faxes' description: 'Returns properties of multiple faxes' - operationId: listFaxes + operationId: faxList parameters: - name: page in: query description: Page - required: true schema: type: integer + default: 1 minimum: 1 example: 1 - name: page_size in: query description: 'Page size' - required: true schema: type: integer + default: 20 maximum: 100 minimum: 1 example: 20 @@ -2615,7 +2621,7 @@ paths: - Fax summary: 'Send Fax' description: 'Action to prepare and send a fax' - operationId: sendFax + operationId: faxSend requestBody: required: true content: @@ -2625,6 +2631,9 @@ paths: examples: default_example: $ref: '#/components/examples/FaxSendRequestExample' + multipart/form-data: + schema: + $ref: '#/components/schemas/FaxSendRequest' responses: 200: description: 'successful operation' @@ -2638,10 +2647,10 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/FaxResponse' + $ref: '#/components/schemas/FaxGetResponse' examples: default_example: - $ref: '#/components/examples/FaxResponseExample' + $ref: '#/components/examples/FaxGetResponseExample' 4XX: description: failed_operation content: @@ -2659,6 +2668,8 @@ paths: $ref: '#/components/examples/Error403ResponseExample' 404_example: $ref: '#/components/examples/Error404ResponseExample' + 429_example: + $ref: '#/components/examples/Error429ResponseExample' 4XX_example: $ref: '#/components/examples/Error4XXResponseExample' security: @@ -7849,6 +7860,8 @@ components: format: email type: object FaxSendRequest: + required: + - to properties: to: description: 'Fax Send To Recipient' @@ -7858,46 +7871,37 @@ components: description: 'Fax Send From Sender (used only with fax number)' type: string example: sender@example.com - nullable: true - file: + files: 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' + format: binary + file_urls: + description: 'Fax File URL to Send' type: array items: type: string test_mode: description: 'API Test Mode Setting' type: boolean - example: false + default: 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: @@ -8806,14 +8810,6 @@ 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 @@ -10773,12 +10769,12 @@ components: error: $ref: '#/components/schemas/ErrorResponseError' type: object - FaxResponse: + FaxGetResponse: required: - fax properties: fax: - $ref: '#/components/schemas/FaxResponseFax' + $ref: '#/components/schemas/FaxResponse' warnings: description: 'A list of warnings.' type: array @@ -10829,7 +10825,7 @@ components: faxes: type: array items: - $ref: '#/components/schemas/FaxResponseFax' + $ref: '#/components/schemas/FaxResponse' list_info: $ref: '#/components/schemas/ListInfoResponse' type: object @@ -11177,7 +11173,7 @@ components: description: 'Name of the error.' type: string type: object - FaxResponseFax: + FaxResponse: properties: fax_id: description: 'Fax ID' @@ -11207,7 +11203,7 @@ components: description: 'Fax Transmissions List' type: array items: - $ref: '#/components/schemas/FaxResponseFaxTransmission' + $ref: '#/components/schemas/FaxResponseTransmission' files_url: description: 'Fax Files URL' type: string @@ -11230,7 +11226,7 @@ components: $ref: '#/components/schemas/AccountResponse' type: object x-internal-class: true - FaxResponseFaxTransmission: + FaxResponseTransmission: properties: recipient: description: 'Fax Transmission Recipient' @@ -13306,10 +13302,10 @@ components: summary: 'Error 4XX failed_operation' value: $ref: examples/json/Error4XXResponseExample.json - FaxResponseExample: + FaxGetResponseExample: summary: 'Fax Response' value: - $ref: examples/json/FaxResponseExample.json + $ref: examples/json/FaxGetResponseExample.json FaxLineResponseExample: summary: 'Sample Fax Line Response' value: diff --git a/openapi.yaml b/openapi.yaml index d803bcc07..65f6ba644 100644 --- a/openapi.yaml +++ b/openapi.yaml @@ -1415,7 +1415,7 @@ paths: - Fax summary: 'Get Fax' description: 'Returns information about fax' - operationId: getFaxById + operationId: faxGet parameters: - name: fax_id @@ -1438,10 +1438,10 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/FaxResponse' + $ref: '#/components/schemas/FaxGetResponse' examples: default_example: - $ref: '#/components/examples/FaxResponseExample' + $ref: '#/components/examples/FaxGetResponseExample' 4XX: description: failed_operation content: @@ -1459,6 +1459,8 @@ paths: $ref: '#/components/examples/Error403ResponseExample' 404_example: $ref: '#/components/examples/Error404ResponseExample' + 429_example: + $ref: '#/components/examples/Error429ResponseExample' 4XX_example: $ref: '#/components/examples/Error4XXResponseExample' security: @@ -1514,7 +1516,7 @@ paths: - Fax summary: 'Delete Fax' description: 'Deletes the specified Fax from the system.' - operationId: deleteFax + operationId: faxDelete parameters: - name: fax_id @@ -1525,7 +1527,7 @@ paths: type: string example: fa5c8a0b0f492d768749333ad6fcc214c111e967 responses: - 200: + 204: description: 'successful operation' headers: X-RateLimit-Limit: @@ -1534,8 +1536,6 @@ paths: $ref: '#/components/headers/X-RateLimit-Remaining' X-Ratelimit-Reset: $ref: '#/components/headers/X-Ratelimit-Reset' - content: - application/json: {} 4XX: description: failed_operation content: @@ -1553,6 +1553,8 @@ paths: $ref: '#/components/examples/Error403ResponseExample' 404_example: $ref: '#/components/examples/Error404ResponseExample' + 429_example: + $ref: '#/components/examples/Error429ResponseExample' 4XX_example: $ref: '#/components/examples/Error4XXResponseExample' security: @@ -1609,7 +1611,7 @@ paths: - Fax summary: 'List Fax Files' description: 'Returns list of fax files' - operationId: getFaxFiles + operationId: faxFiles parameters: - name: fax_id @@ -1651,6 +1653,10 @@ paths: $ref: '#/components/examples/Error403ResponseExample' 404_example: $ref: '#/components/examples/Error404ResponseExample' + 410_example: + $ref: '#/components/examples/Error410ResponseExample' + 429_example: + $ref: '#/components/examples/Error429ResponseExample' 4XX_example: $ref: '#/components/examples/Error4XXResponseExample' security: @@ -2504,24 +2510,24 @@ paths: - Fax summary: 'Lists Faxes' description: 'Returns properties of multiple faxes' - operationId: listFaxes + operationId: faxList parameters: - name: page in: query description: Page - required: true schema: type: integer + default: 1 minimum: 1 example: 1 - name: page_size in: query description: 'Page size' - required: true schema: type: integer + default: 20 maximum: 100 minimum: 1 example: 20 @@ -2615,7 +2621,7 @@ paths: - Fax summary: 'Send Fax' description: 'Action to prepare and send a fax' - operationId: sendFax + operationId: faxSend requestBody: required: true content: @@ -2625,6 +2631,9 @@ paths: examples: default_example: $ref: '#/components/examples/FaxSendRequestExample' + multipart/form-data: + schema: + $ref: '#/components/schemas/FaxSendRequest' responses: 200: description: 'successful operation' @@ -2638,10 +2647,10 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/FaxResponse' + $ref: '#/components/schemas/FaxGetResponse' examples: default_example: - $ref: '#/components/examples/FaxResponseExample' + $ref: '#/components/examples/FaxGetResponseExample' 4XX: description: failed_operation content: @@ -2659,6 +2668,8 @@ paths: $ref: '#/components/examples/Error403ResponseExample' 404_example: $ref: '#/components/examples/Error404ResponseExample' + 429_example: + $ref: '#/components/examples/Error429ResponseExample' 4XX_example: $ref: '#/components/examples/Error4XXResponseExample' security: @@ -7849,6 +7860,8 @@ components: format: email type: object FaxSendRequest: + required: + - to properties: to: description: 'Fax Send To Recipient' @@ -7858,46 +7871,37 @@ components: description: 'Fax Send From Sender (used only with fax number)' type: string example: sender@example.com - nullable: true - file: + files: 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' + format: binary + file_urls: + description: 'Fax File URL to Send' type: array items: type: string test_mode: description: 'API Test Mode Setting' type: boolean - example: false + default: 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: @@ -8784,14 +8788,6 @@ 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 @@ -10751,12 +10747,12 @@ components: error: $ref: '#/components/schemas/ErrorResponseError' type: object - FaxResponse: + FaxGetResponse: required: - fax properties: fax: - $ref: '#/components/schemas/FaxResponseFax' + $ref: '#/components/schemas/FaxResponse' warnings: description: 'A list of warnings.' type: array @@ -10807,7 +10803,7 @@ components: faxes: type: array items: - $ref: '#/components/schemas/FaxResponseFax' + $ref: '#/components/schemas/FaxResponse' list_info: $ref: '#/components/schemas/ListInfoResponse' type: object @@ -11155,7 +11151,7 @@ components: description: 'Name of the error.' type: string type: object - FaxResponseFax: + FaxResponse: properties: fax_id: description: 'Fax ID' @@ -11185,7 +11181,7 @@ components: description: 'Fax Transmissions List' type: array items: - $ref: '#/components/schemas/FaxResponseFaxTransmission' + $ref: '#/components/schemas/FaxResponseTransmission' files_url: description: 'Fax Files URL' type: string @@ -11208,7 +11204,7 @@ components: $ref: '#/components/schemas/AccountResponse' type: object x-internal-class: true - FaxResponseFaxTransmission: + FaxResponseTransmission: properties: recipient: description: 'Fax Transmission Recipient' @@ -13284,10 +13280,10 @@ components: summary: 'Error 4XX failed_operation' value: $ref: examples/json/Error4XXResponseExample.json - FaxResponseExample: + FaxGetResponseExample: summary: 'Fax Response' value: - $ref: examples/json/FaxResponseExample.json + $ref: examples/json/FaxGetResponseExample.json FaxLineResponseExample: summary: 'Sample Fax Line Response' value: From 97cfa7e4df353806fc1af40c8f34c25420cb590c Mon Sep 17 00:00:00 2001 From: Maksud Aghayev Date: Mon, 7 Oct 2024 21:12:42 -0700 Subject: [PATCH 07/11] Building SDKs --- examples/FaxSend.py | 1 - sdks/dotnet/docs/FaxApi.md | 41 ++++++++++------ sdks/java-v1/docs/FaxApi.md | 26 ++++++---- sdks/java-v2/docs/FaxApi.md | 26 ++++++---- sdks/node/docs/api/FaxApi.md | 92 +++++++++++++++++++++++++++++------- sdks/php/docs/Api/FaxApi.md | 25 ++++++---- sdks/python/docs/FaxApi.md | 24 ++++++---- sdks/ruby/docs/FaxApi.md | 24 ++++++---- 8 files changed, 182 insertions(+), 77 deletions(-) diff --git a/examples/FaxSend.py b/examples/FaxSend.py index 63589d997..5e5f92658 100644 --- a/examples/FaxSend.py +++ b/examples/FaxSend.py @@ -14,7 +14,6 @@ files=[open("example_signature_request.pdf", "rb")], test_mode=True, to="16690000001", - from="16690000000", cover_page_to="Jill Fax", cover_page_message="I'm sending you a fax!", cover_page_from="Faxer Faxerson", diff --git a/sdks/dotnet/docs/FaxApi.md b/sdks/dotnet/docs/FaxApi.md index 96412aeec..287b1e8d8 100644 --- a/sdks/dotnet/docs/FaxApi.md +++ b/sdks/dotnet/docs/FaxApi.md @@ -38,7 +38,7 @@ public class Example try { - faxApi.DeleteFax("[FAX_NUMBER]"); + faxApi.FaxDelete("fa5c8a0b0f492d768749333ad6fcc214c111e967"); } catch (ApiException e) { @@ -126,7 +126,11 @@ public class Example try { - faxApi.GetFaxFiles(faxId); + var result = faxApi.FaxFiles(faxId); + var fileStream = File.Create("file_response.pdf"); + result.Seek(0, SeekOrigin.Begin); + result.CopyTo(fileStream); + fileStream.Close(); } catch (ApiException e) { @@ -217,7 +221,7 @@ public class Example try { - var result = faxApi.GetFaxById(faxId); + var result = faxApi.FaxGet(faxId); Console.WriteLine(result); } catch (ApiException e) @@ -310,7 +314,7 @@ public class Example try { - var result = faxApi.ListFaxes(page, pageSize); + var result = faxApi.FaxList(page, pageSize); Console.WriteLine(result); } catch (ApiException e) @@ -399,20 +403,29 @@ public class Example 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!" + var files = new List { + new FileStream( + "./example_fax.pdf", + FileMode.Open, + FileAccess.Read, + FileShare.Read + ) + }; + + var data = new FaxSendRequest( + files: files, + testMode: true, + to: "16690000001", + from: "16690000000", + coverPageTo: "Jill Fax", + coverPageMessage: "I'm sending you a fax!", + coverPageFrom: "Faxer Faxerson", + title: "This is what the fax is about!", ); try { - var result = faxApi.FaxCreate(data); + var result = faxApi.FaxSend(data); Console.WriteLine(result); } catch (ApiException e) diff --git a/sdks/java-v1/docs/FaxApi.md b/sdks/java-v1/docs/FaxApi.md index 1799fb847..597b6bd41 100644 --- a/sdks/java-v1/docs/FaxApi.md +++ b/sdks/java-v1/docs/FaxApi.md @@ -39,7 +39,7 @@ public class Example { var faxApi = new FaxApi(apiClient); try { - faxApi.deleteFax("[FAX_NUMBER]"); + faxApi.faxDelete("fa5c8a0b0f492d768749333ad6fcc214c111e967"); } catch (ApiException e) { System.err.println("Status code: " + e.getCode()); System.err.println("Reason: " + e.getResponseBody()); @@ -95,7 +95,7 @@ import com.dropbox.sign.api.*; import com.dropbox.sign.auth.*; import com.dropbox.sign.model.*; -import java.util.List; +import java.io.File; public class Example { public static void main(String[] args) { @@ -107,7 +107,8 @@ public class Example { var faxId = "fa5c8a0b0f492d768749333ad6fcc214c111e967"; try { - faxApi.getFaxFiles(faxId); + File result = faxApi.faxFiles(faxId); + result.renameTo(new File("file_response.pdf"));; } catch (ApiException e) { System.err.println("Status code: " + e.getCode()); System.err.println("Reason: " + e.getResponseBody()); @@ -173,7 +174,7 @@ public class Example { var faxId = "fa5c8a0b0f492d768749333ad6fcc214c111e967"; try { - FaxGetResponse result = faxApi.getFaxById(faxId); + FaxGetResponse result = faxApi.faxGet(faxId); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling AccountApi#accountCreate"); @@ -242,7 +243,7 @@ public class Example { var pageSize = 2; try { - FaxListResponse result = faxApi.listFaxes(page, pageSize); + FaxListResponse result = faxApi.faxList(page, pageSize); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling AccountApi#accountCreate"); @@ -310,12 +311,19 @@ public class Example { var faxApi = new FaxApi(apiClient); - var data = new FaxCreateRequest() - .areaCode(209) - .country("US"); + + var data = new FaxSendRequest() + .addFilesItem(new File("example_fax.pdf")) + .testMode(true) + .to("16690000001") + .from("16690000000") + .coverPageTo("Jill Fax") + .coverPageMessage("I'm sending you a fax!") + .coverPageFrom("Faxer Faxerson") + .title("This is what the fax is about!"); try { - FaxCreateResponse result = faxApi.faxCreate(data); + FaxCreateResponse result = faxApi.faxSend(data); System.out.println(result); } catch (ApiException e) { System.err.println("Status code: " + e.getCode()); diff --git a/sdks/java-v2/docs/FaxApi.md b/sdks/java-v2/docs/FaxApi.md index 1799fb847..597b6bd41 100644 --- a/sdks/java-v2/docs/FaxApi.md +++ b/sdks/java-v2/docs/FaxApi.md @@ -39,7 +39,7 @@ public class Example { var faxApi = new FaxApi(apiClient); try { - faxApi.deleteFax("[FAX_NUMBER]"); + faxApi.faxDelete("fa5c8a0b0f492d768749333ad6fcc214c111e967"); } catch (ApiException e) { System.err.println("Status code: " + e.getCode()); System.err.println("Reason: " + e.getResponseBody()); @@ -95,7 +95,7 @@ import com.dropbox.sign.api.*; import com.dropbox.sign.auth.*; import com.dropbox.sign.model.*; -import java.util.List; +import java.io.File; public class Example { public static void main(String[] args) { @@ -107,7 +107,8 @@ public class Example { var faxId = "fa5c8a0b0f492d768749333ad6fcc214c111e967"; try { - faxApi.getFaxFiles(faxId); + File result = faxApi.faxFiles(faxId); + result.renameTo(new File("file_response.pdf"));; } catch (ApiException e) { System.err.println("Status code: " + e.getCode()); System.err.println("Reason: " + e.getResponseBody()); @@ -173,7 +174,7 @@ public class Example { var faxId = "fa5c8a0b0f492d768749333ad6fcc214c111e967"; try { - FaxGetResponse result = faxApi.getFaxById(faxId); + FaxGetResponse result = faxApi.faxGet(faxId); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling AccountApi#accountCreate"); @@ -242,7 +243,7 @@ public class Example { var pageSize = 2; try { - FaxListResponse result = faxApi.listFaxes(page, pageSize); + FaxListResponse result = faxApi.faxList(page, pageSize); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling AccountApi#accountCreate"); @@ -310,12 +311,19 @@ public class Example { var faxApi = new FaxApi(apiClient); - var data = new FaxCreateRequest() - .areaCode(209) - .country("US"); + + var data = new FaxSendRequest() + .addFilesItem(new File("example_fax.pdf")) + .testMode(true) + .to("16690000001") + .from("16690000000") + .coverPageTo("Jill Fax") + .coverPageMessage("I'm sending you a fax!") + .coverPageFrom("Faxer Faxerson") + .title("This is what the fax is about!"); try { - FaxCreateResponse result = faxApi.faxCreate(data); + FaxCreateResponse result = faxApi.faxSend(data); System.out.println(result); } catch (ApiException e) { System.err.println("Status code: " + e.getCode()); diff --git a/sdks/node/docs/api/FaxApi.md b/sdks/node/docs/api/FaxApi.md index fb529b8f6..608a0c77b 100644 --- a/sdks/node/docs/api/FaxApi.md +++ b/sdks/node/docs/api/FaxApi.md @@ -31,7 +31,7 @@ const faxApi = new DropboxSign.FaxApi(); // Configure HTTP basic authorization: api_key faxApi.username = "YOUR_API_KEY"; -const result = faxApi.deleteFax("[FAX_NUMBER]"); +const result = faxApi.faxDelete("fa5c8a0b0f492d768749333ad6fcc214c111e967"); result.catch(error => { console.log("Exception when calling Dropbox Sign API:"); @@ -50,7 +50,7 @@ const faxApi = new DropboxSign.FaxApi(); // Configure HTTP basic authorization: api_key faxApi.username = "YOUR_API_KEY"; -const result = faxApi.deleteFax("[FAX_NUMBER]"); +const result = faxApi.faxDelete("fa5c8a0b0f492d768749333ad6fcc214c111e967"); result.catch(error => { console.log("Exception when calling Dropbox Sign API:"); @@ -96,6 +96,7 @@ Returns list of fax files ```typescript import * as DropboxSign from "@dropbox/sign"; +import * as fs from 'fs'; const faxApi = new DropboxSign.FaxApi(); @@ -104,9 +105,9 @@ faxApi.username = "YOUR_API_KEY"; const faxId = "fa5c8a0b0f492d768749333ad6fcc214c111e967"; -const result = faxApi.getFaxFiles(faxId); +const result = faxApi.faxFiles(faxId); result.then(response => { - console.log(response.body); + fs.createWriteStream('file_response.pdf').write(response.body); }).catch(error => { console.log("Exception when calling Dropbox Sign API:"); console.log(error.body); @@ -118,6 +119,7 @@ result.then(response => { ```javascript import * as DropboxSign from "@dropbox/sign"; +import * as fs from 'fs'; const faxApi = new DropboxSign.FaxApi(); @@ -126,9 +128,9 @@ faxApi.username = "YOUR_API_KEY"; const faxId = "fa5c8a0b0f492d768749333ad6fcc214c111e967"; -const result = faxApi.getFaxFiles(faxId); +const result = faxApi.faxFiles(faxId); result.then(response => { - console.log(response.body); + fs.createWriteStream('file_response.pdf').write(response.body); }).catch(error => { console.log("Exception when calling Dropbox Sign API:"); console.log(error.body); @@ -181,7 +183,7 @@ faxApi.username = "YOUR_API_KEY"; const faxId = "fa5c8a0b0f492d768749333ad6fcc214c111e967" -const result = faxApi.getFaxById(faxId); +const result = faxApi.faxGet(faxId); result.then(response => { console.log(response.body); }).catch(error => { @@ -203,7 +205,7 @@ faxApi.username = "YOUR_API_KEY"; const faxId = "fa5c8a0b0f492d768749333ad6fcc214c111e967" -const result = faxApi.getFaxById(faxId); +const result = faxApi.faxGet(faxId); result.then(response => { console.log(response.body); }).catch(error => { @@ -259,7 +261,7 @@ faxApi.username = "YOUR_API_KEY"; const page = 1; const pageSize = 2; -const result = faxApi.listFaxes(page, pageSize); +const result = faxApi.faxList(page, pageSize); result.then(response => { console.log(response.body); }).catch(error => { @@ -282,7 +284,7 @@ faxApi.username = "YOUR_API_KEY"; const page = 1; const pageSize = 2; -const result = faxApi.listFaxes(page, pageSize); +const result = faxApi.faxList(page, pageSize); result.then(response => { console.log(response.body); }).catch(error => { @@ -330,18 +332,46 @@ Action to prepare and send a fax ```typescript import * as DropboxSign from "@dropbox/sign"; +import * as fs from 'fs'; const faxApi = new DropboxSign.FaxApi(); // Configure HTTP basic authorization: api_key faxApi.username = "YOUR_API_KEY"; -const data: DropboxSign.FaxCreateRequest = { - areaCode: 209, - country: "US", +// Upload a local file +const file = fs.createReadStream("example_signature_request.pdf"); + +// or, upload from buffer +const fileBuffer: DropboxSign.RequestDetailedFile = { + value: fs.readFileSync("example_signature_request.pdf"), + options: { + filename: "example_signature_request.pdf", + contentType: "application/pdf", + }, +}; + +// or, upload from buffer alternative +const fileBufferAlt: DropboxSign.RequestDetailedFile = { + value: Buffer.from("abc-123"), + options: { + filename: "txt-sample.txt", + contentType: "text/plain", + }, +}; + +const data: DropboxSign.FaxSendRequest = { + files: [ file, fileBuffer, fileBufferAlt ], + testMode: true, + to: "16690000001", + from: "16690000000", + coverPageTo: "Jill Fax", + coverPageMessage: "I'm sending you a fax!", + coverPageFrom: "Faxer Faxerson", + title: "This is what the fax is about!", }; -const result = faxApi.faxCreate(data); +const result = faxApi.faxSend(data); result.then(response => { console.log(response.body); }).catch(error => { @@ -355,18 +385,46 @@ result.then(response => { ```javascript import * as DropboxSign from "@dropbox/sign"; +import * as fs from 'fs'; const faxApi = new DropboxSign.FaxApi(); // Configure HTTP basic authorization: api_key faxApi.username = "YOUR_API_KEY"; +// Upload a local file +const file = fs.createReadStream("example_signature_request.pdf"); + +// or, upload from buffer +const fileBuffer = { + value: fs.readFileSync("example_signature_request.pdf"), + options: { + filename: "example_signature_request.pdf", + contentType: "application/pdf", + }, +}; + +// or, upload from buffer alternative +const fileBufferAlt = { + value: Buffer.from("abc-123"), + options: { + filename: "txt-sample.txt", + contentType: "text/plain", + }, +}; + const data = { - areaCode: 209, - country: "US", + files: [ file, fileBuffer, fileBufferAlt ], + testMode: true, + to: "16690000001", + from: "16690000000", + coverPageTo: "Jill Fax", + coverPageMessage: "I'm sending you a fax!", + coverPageFrom: "Faxer Faxerson", + title: "This is what the fax is about!", }; -const result = faxApi.faxCreate(data); +const result = faxApi.faxSend(data); result.then(response => { console.log(response.body); }).catch(error => { diff --git a/sdks/php/docs/Api/FaxApi.md b/sdks/php/docs/Api/FaxApi.md index 048cfe610..0e02679ea 100644 --- a/sdks/php/docs/Api/FaxApi.md +++ b/sdks/php/docs/Api/FaxApi.md @@ -32,10 +32,10 @@ $config = Dropbox\Sign\Configuration::getDefaultConfiguration(); // Configure HTTP basic authorization: api_key $config->setUsername("YOUR_API_KEY"); -$faxDelete = new Dropbox\Sign\Api\FaxApi($config); +$faxApi = new Dropbox\Sign\Api\FaxApi($config); try { - $faxDelete->deleteFax("[FAX_NUMBER]"); + $faxApi->faxDelete("fa5c8a0b0f492d768749333ad6fcc214c111e967"); } catch (Dropbox\Sign\ApiException $e) { $error = $e->getResponseObject(); echo "Exception when calling Dropbox Sign API: " @@ -93,7 +93,8 @@ $faxApi = new Dropbox\Sign\Api\FaxApi($config); $faxId = "fa5c8a0b0f492d768749333ad6fcc214c111e967"; try { - $faxApi->getFaxFiles($faxId); + $result = $faxApi->faxFiles($faxId); + copy($result->getRealPath(), __DIR__ . '/file_response.pdf'); } catch (Dropbox\Sign\ApiException $e) { $error = $e->getResponseObject(); echo "Exception when calling Dropbox Sign API: " @@ -151,7 +152,7 @@ $faxApi = new Dropbox\Sign\Api\FaxApi($config); $faxId = "fa5c8a0b0f492d768749333ad6fcc214c111e967"; try { - $result = $faxApi->getFaxById($faxId); + $result = $faxApi->faxGet($faxId); print_r($result); } catch (Dropbox\Sign\ApiException $e) { $error = $e->getResponseObject(); @@ -211,7 +212,7 @@ $page = 1; $pageSize = 2; try { - $result = $faxApi->listFaxes($page, $pageSize); + $result = $faxApi->faxList($page, $pageSize); print_r($result); } catch (Dropbox\Sign\ApiException $e) { $error = $e->getResponseObject(); @@ -268,12 +269,18 @@ $config->setUsername("YOUR_API_KEY"); $faxApi = new Dropbox\Sign\Api\FaxApi($config); -$data = new Dropbox\Sign\Model\FaxCreateRequest(); -$data->setAreaCode(209) - ->setCountry("US"); +$data = new Dropbox\Sign\Model\FaxSendRequest(); +$data->setFiles([new SplFileObject(__DIR__ . "/example_signature_request.pdf")]) + ->setTestMode(true) + ->setTo("16690000001") + ->setFrom("16690000000") + ->setCoverPageTo("Jill Fax") + ->setCoverPageMessage("I'm sending you a fax!") + ->setCoverPageFrom("Faxer Faxerson") + ->setTitle("This is what the fax is about!"); try { - $result = $faxApi->faxCreate($data); + $result = $faxApi->faxSend($data); print_r($result); } catch (Dropbox\Sign\ApiException $e) { $error = $e->getResponseObject(); diff --git a/sdks/python/docs/FaxApi.md b/sdks/python/docs/FaxApi.md index a0e778fec..1b4130ed4 100644 --- a/sdks/python/docs/FaxApi.md +++ b/sdks/python/docs/FaxApi.md @@ -36,7 +36,7 @@ with ApiClient(configuration) as api_client: fax_api = apis.FaxApi(api_client) try: - fax_api.delete_fax("[FAX_NUMBER]") + fax_api.fax_delete("fa5c8a0b0f492d768749333ad6fcc214c111e967") except ApiException as e: print("Exception when calling Dropbox Sign API: %s\n" % e) @@ -97,7 +97,8 @@ with ApiClient(configuration) as api_client: fax_id = "fa5c8a0b0f492d768749333ad6fcc214c111e967" try: - fax_api.get_fax_files(fax_id) + response = fax_api.fax_files(fax_id) + open("file_response.pdf", "wb").write(response.read()) except ApiException as e: print("Exception when calling Dropbox Sign API: %s\n" % e) @@ -155,10 +156,10 @@ configuration = Configuration( with ApiClient(configuration) as api_client: fax_api = apis.FaxApi(api_client) - faxId = "fa5c8a0b0f492d768749333ad6fcc214c111e967" + fax_id = "fa5c8a0b0f492d768749333ad6fcc214c111e967" try: - response = fax_api.get_fax_by_id(client_id) + response = fax_api.fax_get(fax_id) pprint(response) except ApiException as e: print("Exception when calling Dropbox Sign API: %s\n" % e) @@ -221,7 +222,7 @@ with ApiClient(configuration) as api_client: page_size = 2 try: - response = fax_api.list_faxes( + response = fax_api.fax_list( page=page, page_size=page_size, ) @@ -284,13 +285,18 @@ configuration = Configuration( with ApiClient(configuration) as api_client: fax_api = apis.FaxApi(api_client) - data = models.FaxCreateRequest( - area_code=209, - country="US", + data = models.FaxSendRequest( + files=[open("example_signature_request.pdf", "rb")], + test_mode=True, + to="16690000001", + 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: - response = fax_api.fax_create(data) + response = fax_api.fax_send(data) pprint(response) except ApiException as e: print("Exception when calling Dropbox Sign API: %s\n" % e) diff --git a/sdks/ruby/docs/FaxApi.md b/sdks/ruby/docs/FaxApi.md index cd1a5da31..5eeed37d3 100644 --- a/sdks/ruby/docs/FaxApi.md +++ b/sdks/ruby/docs/FaxApi.md @@ -32,7 +32,7 @@ end fax_api = Dropbox::Sign::FaxApi.new begin - fax_api.delete_fax("[FAX_NUMBER]") + fax_api.fax_delete("fa5c8a0b0f492d768749333ad6fcc214c111e967") rescue Dropbox::Sign::ApiError => e puts "Exception when calling Dropbox Sign API: #{e}" end @@ -100,8 +100,8 @@ fax_api = Dropbox::Sign::FaxApi.new faxId = "fa5c8a0b0f492d768749333ad6fcc214c111e967" begin - result = fax_api.get_fax_files(data) - p result + file_bin = fax_api.fax_files(data) + FileUtils.cp(file_bin.path, "path/to/file.pdf") rescue Dropbox::Sign::ApiError => e puts "Exception when calling Dropbox Sign API: #{e}" end @@ -169,7 +169,7 @@ fax_api = Dropbox::Sign::FaxApi.new fax_id = "fa5c8a0b0f492d768749333ad6fcc214c111e967" begin - result = fax_api.get_fax_by_id(fax_id) + result = fax_api.fax_get(fax_id) p result rescue Dropbox::Sign::ApiError => e puts "Exception when calling Dropbox Sign API: #{e}" @@ -239,7 +239,7 @@ page = 1 page_size = 2 begin - result = fax_api.list_faxes({ page: page, page_size: page_size }) + result = fax_api.fax_list({ page: page, page_size: page_size }) p result rescue Dropbox::Sign::ApiError => e puts "Exception when calling Dropbox Sign API: #{e}" @@ -306,12 +306,18 @@ end fax_api = Dropbox::Sign::FaxApi.new -data = Dropbox::Sign::FaxCreateRequest.new -data.area_code = 209 -data.country = "US" +data = Dropbox::Sign::FaxSendRequest.new +data.files = [File.new("example_signature_request.pdf", "r")] +data.test_mode = true +data.to = "16690000001" +data.from = "16690000000" +data.cover_page_to = "Jill Fax" +data.cover_page_message = "I'm sending you a fax!" +data.cover_page_from = "Faxer Faxerson" +data.title = "This is what the fax is about!" begin - result = fax_api.fax_create(data) + result = fax_api.fax_send(data) p result rescue Dropbox::Sign::ApiError => e puts "Exception when calling Dropbox Sign API: #{e}" From e3f1cb2f885fd0d14a705573f3d473769277ff94 Mon Sep 17 00:00:00 2001 From: Maksud Aghayev Date: Mon, 7 Oct 2024 22:38:17 -0700 Subject: [PATCH 08/11] Adding test fixtures for Fax --- test_fixtures/FaxGetResponse.json | 23 ++++++++++++++++++++++ test_fixtures/FaxListResponse.json | 31 ++++++++++++++++++++++++++++++ test_fixtures/FaxSendRequest.json | 13 +++++++++++++ test_fixtures/FaxSendResponse.json | 16 +++++++++++++++ 4 files changed, 83 insertions(+) create mode 100644 test_fixtures/FaxGetResponse.json create mode 100644 test_fixtures/FaxListResponse.json create mode 100644 test_fixtures/FaxSendRequest.json create mode 100644 test_fixtures/FaxSendResponse.json diff --git a/test_fixtures/FaxGetResponse.json b/test_fixtures/FaxGetResponse.json new file mode 100644 index 000000000..e6fcb202f --- /dev/null +++ b/test_fixtures/FaxGetResponse.json @@ -0,0 +1,23 @@ +{ + "default": { + "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": "https://api.hellosign.com/v3/fax/files/2b388914e3ae3b738bd4e2ee2850c677e6dc53d2", + } + } +} diff --git a/test_fixtures/FaxListResponse.json b/test_fixtures/FaxListResponse.json new file mode 100644 index 000000000..07bd76392 --- /dev/null +++ b/test_fixtures/FaxListResponse.json @@ -0,0 +1,31 @@ +{ + "default": { + "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": "https://api.hellosign.com/v3/fax/files/2b388914e3ae3b738bd4e2ee2850c677e6dc53d2", + } + ] + } +} diff --git a/test_fixtures/FaxSendRequest.json b/test_fixtures/FaxSendRequest.json new file mode 100644 index 000000000..1be39148f --- /dev/null +++ b/test_fixtures/FaxSendRequest.json @@ -0,0 +1,13 @@ +{ + "default": { + "file_url": [ + "https://api.hellosign.com/v3/fax/files/2b388914e3ae3b738bd4e2ee2850c677e6dc53d2" + ], + "test_mode": "true", + "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!" +} diff --git a/test_fixtures/FaxSendResponse.json b/test_fixtures/FaxSendResponse.json new file mode 100644 index 000000000..b1f8909e1 --- /dev/null +++ b/test_fixtures/FaxSendResponse.json @@ -0,0 +1,16 @@ +{ + "default": { + "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": [], + "files_url": "https://api.hellosign.com/v3/fax/files/2b388914e3ae3b738bd4e2ee2850c677e6dc53d2" + } + } +} From 4428a5775d94f0e9bfd36ceb44f9f9ede99e543e Mon Sep 17 00:00:00 2001 From: Maksud Aghayev Date: Wed, 16 Oct 2024 23:58:25 -0700 Subject: [PATCH 09/11] Renaming FaxSend request parameters+SDK build --- examples/FaxSend.cs | 4 +- examples/FaxSend.java | 4 +- examples/FaxSend.js | 4 +- examples/FaxSend.php | 4 +- examples/FaxSend.py | 3 +- examples/FaxSend.rb | 4 +- examples/FaxSend.sh | 4 +- examples/FaxSend.ts | 4 +- examples/json/FaxSendRequestExample.json | 4 +- openapi-raw.yaml | 37 ++++-- openapi-sdk.yaml | 33 ++++-- openapi.yaml | 33 ++++-- sdks/dotnet/docs/FaxApi.md | 4 +- sdks/dotnet/docs/FaxResponse.md | 2 +- sdks/dotnet/docs/FaxSendRequest.md | 2 +- .../src/Dropbox.Sign/Model/FaxResponse.cs | 96 +++++++++++----- .../Model/FaxResponseTransmission.cs | 80 ++++++++++--- .../src/Dropbox.Sign/Model/FaxSendRequest.cs | 60 +++++----- sdks/java-v1/docs/FaxApi.md | 4 +- sdks/java-v1/docs/FaxResponse.md | 20 ++-- sdks/java-v1/docs/FaxResponseTransmission.md | 17 ++- sdks/java-v1/docs/FaxSendRequest.md | 4 +- .../com/dropbox/sign/model/FaxResponse.java | 88 +++++++++------ .../sign/model/FaxResponseTransmission.java | 55 ++++++++- .../dropbox/sign/model/FaxSendRequest.java | 106 +++++++++--------- sdks/java-v2/docs/FaxApi.md | 4 +- sdks/java-v2/docs/FaxResponse.md | 20 ++-- sdks/java-v2/docs/FaxResponseTransmission.md | 17 ++- sdks/java-v2/docs/FaxSendRequest.md | 4 +- .../com/dropbox/sign/model/FaxResponse.java | 80 +++++++------ .../sign/model/FaxResponseTransmission.java | 55 ++++++++- .../dropbox/sign/model/FaxSendRequest.java | 102 ++++++++--------- sdks/node/dist/api.js | 26 ++++- sdks/node/docs/api/FaxApi.md | 8 +- sdks/node/docs/model/FaxResponse.md | 20 ++-- sdks/node/docs/model/FaxSendRequest.md | 4 +- sdks/node/model/faxResponse.ts | 22 ++-- sdks/node/model/faxResponseTransmission.ts | 17 ++- sdks/node/model/faxSendRequest.ts | 12 +- sdks/node/model/index.ts | 2 + sdks/node/types/model/faxResponse.d.ts | 22 ++-- .../types/model/faxResponseTransmission.d.ts | 14 ++- sdks/node/types/model/faxSendRequest.d.ts | 4 +- sdks/php/docs/Api/FaxApi.md | 4 +- sdks/php/docs/Model/FaxResponse.md | 20 ++-- sdks/php/docs/Model/FaxSendRequest.md | 4 +- sdks/php/src/Model/FaxResponse.php | 96 ++++++++++------ .../php/src/Model/FaxResponseTransmission.php | 51 ++++++++- sdks/php/src/Model/FaxSendRequest.php | 68 +++++------ sdks/python/docs/FaxApi.md | 3 +- sdks/python/docs/FaxResponse.md | 20 ++-- sdks/python/docs/FaxSendRequest.md | 4 +- .../dropbox_sign/models/fax_response.py | 32 +++--- .../models/fax_response_transmission.py | 25 ++++- .../dropbox_sign/models/fax_send_request.py | 20 ++-- sdks/ruby/docs/FaxApi.md | 4 +- sdks/ruby/docs/FaxResponse.md | 20 ++-- sdks/ruby/docs/FaxSendRequest.md | 4 +- .../lib/dropbox-sign/models/fax_response.rb | 58 +++++++++- .../models/fax_response_transmission.rb | 34 ++++++ .../dropbox-sign/models/fax_send_request.rb | 32 +++--- translations/en.yaml | 4 +- 62 files changed, 1074 insertions(+), 538 deletions(-) diff --git a/examples/FaxSend.cs b/examples/FaxSend.cs index c4d4dca55..8e72a4f93 100644 --- a/examples/FaxSend.cs +++ b/examples/FaxSend.cs @@ -26,8 +26,8 @@ public static void Main() var data = new FaxSendRequest( files: files, testMode: true, - to: "16690000001", - from: "16690000000", + recipient: "16690000001", + sender: "16690000000", coverPageTo: "Jill Fax", coverPageMessage: "I'm sending you a fax!", coverPageFrom: "Faxer Faxerson", diff --git a/examples/FaxSend.java b/examples/FaxSend.java index fdb0c838f..4e764da83 100644 --- a/examples/FaxSend.java +++ b/examples/FaxSend.java @@ -17,8 +17,8 @@ public static void main(String[] args) { var data = new FaxSendRequest() .addFilesItem(new File("example_fax.pdf")) .testMode(true) - .to("16690000001") - .from("16690000000") + .recipient("16690000001") + .sender("16690000000") .coverPageTo("Jill Fax") .coverPageMessage("I'm sending you a fax!") .coverPageFrom("Faxer Faxerson") diff --git a/examples/FaxSend.js b/examples/FaxSend.js index d03526c0f..4b0eef2da 100644 --- a/examples/FaxSend.js +++ b/examples/FaxSend.js @@ -30,8 +30,8 @@ const fileBufferAlt = { const data = { files: [ file, fileBuffer, fileBufferAlt ], testMode: true, - to: "16690000001", - from: "16690000000", + recipient: "16690000001", + sender: "16690000000", coverPageTo: "Jill Fax", coverPageMessage: "I'm sending you a fax!", coverPageFrom: "Faxer Faxerson", diff --git a/examples/FaxSend.php b/examples/FaxSend.php index 6ca0dd78a..2dd42d386 100644 --- a/examples/FaxSend.php +++ b/examples/FaxSend.php @@ -12,8 +12,8 @@ $data = new Dropbox\Sign\Model\FaxSendRequest(); $data->setFiles([new SplFileObject(__DIR__ . "/example_signature_request.pdf")]) ->setTestMode(true) - ->setTo("16690000001") - ->setFrom("16690000000") + ->setRecipient("16690000001") + ->setSender("16690000000") ->setCoverPageTo("Jill Fax") ->setCoverPageMessage("I'm sending you a fax!") ->setCoverPageFrom("Faxer Faxerson") diff --git a/examples/FaxSend.py b/examples/FaxSend.py index 5e5f92658..c24d6ada7 100644 --- a/examples/FaxSend.py +++ b/examples/FaxSend.py @@ -13,7 +13,8 @@ data = models.FaxSendRequest( files=[open("example_signature_request.pdf", "rb")], test_mode=True, - to="16690000001", + recipient="16690000001", + sender="16690000000", cover_page_to="Jill Fax", cover_page_message="I'm sending you a fax!", cover_page_from="Faxer Faxerson", diff --git a/examples/FaxSend.rb b/examples/FaxSend.rb index 7736d6e93..c37cbbd10 100644 --- a/examples/FaxSend.rb +++ b/examples/FaxSend.rb @@ -10,8 +10,8 @@ data = Dropbox::Sign::FaxSendRequest.new data.files = [File.new("example_signature_request.pdf", "r")] data.test_mode = true -data.to = "16690000001" -data.from = "16690000000" +data.recipient = "16690000001" +data.sender = "16690000000" data.cover_page_to = "Jill Fax" data.cover_page_message = "I'm sending you a fax!" data.cover_page_from = "Faxer Faxerson" diff --git a/examples/FaxSend.sh b/examples/FaxSend.sh index 61e1ce418..7ab64cb31 100644 --- a/examples/FaxSend.sh +++ b/examples/FaxSend.sh @@ -2,8 +2,8 @@ curl -X POST 'https://api.hellosign.com/v3/fax/send' \ -u 'YOUR_API_KEY:' \ -F 'files[0]=@mutual-NDA-example.pdf' \ -F 'test_mode=1' \ - -F 'to=16690000001' \ - -F 'from=16690000000' \ + -F 'recipient=16690000001' \ + -F 'sender=16690000000' \ -F 'cover_page_to=Jill Fax' \ -F 'cover_page_message=I sent you a fax!' \ -F 'cover_page_from=Faxer Faxerson' \ diff --git a/examples/FaxSend.ts b/examples/FaxSend.ts index e27fea292..2f3f6e25d 100644 --- a/examples/FaxSend.ts +++ b/examples/FaxSend.ts @@ -30,8 +30,8 @@ const fileBufferAlt: DropboxSign.RequestDetailedFile = { const data: DropboxSign.FaxSendRequest = { files: [ file, fileBuffer, fileBufferAlt ], testMode: true, - to: "16690000001", - from: "16690000000", + recipient: "16690000001", + sender: "16690000000", coverPageTo: "Jill Fax", coverPageMessage: "I'm sending you a fax!", coverPageFrom: "Faxer Faxerson", diff --git a/examples/json/FaxSendRequestExample.json b/examples/json/FaxSendRequestExample.json index d0cf8ad8b..fe7e68820 100644 --- a/examples/json/FaxSendRequestExample.json +++ b/examples/json/FaxSendRequestExample.json @@ -3,8 +3,8 @@ "https://api.hellosign.com/v3/fax/files/2b388914e3ae3b738bd4e2ee2850c677e6dc53d2" ], "test_mode": "true", - "to": "16690000001", - "from": "16690000000", + "recipient": "16690000001", + "sender": "16690000000", "cover_page_to": "Jill Fax", "cover_page_message": "I'm sending you a fax!", "cover_page_from": "Faxer Faxerson", diff --git a/openapi-raw.yaml b/openapi-raw.yaml index b984b1b2d..eaac00a0e 100644 --- a/openapi-raw.yaml +++ b/openapi-raw.yaml @@ -2514,7 +2514,7 @@ paths: type: integer default: 1 minimum: 1 - example: 1 + example: 1 - name: page_size in: query @@ -2524,7 +2524,7 @@ paths: default: 20 maximum: 100 minimum: 1 - example: 20 + example: 20 responses: '200': description: 'successful operation' @@ -2557,8 +2557,6 @@ paths: $ref: '#/components/examples/Error402ResponseExample' 403_example: $ref: '#/components/examples/Error403ResponseExample' - 404_example: - $ref: '#/components/examples/Error404ResponseExample' 4XX_example: $ref: '#/components/examples/Error4XXResponseExample' security: @@ -7767,14 +7765,14 @@ components: type: object FaxSendRequest: required: - - to + - recipient properties: - to: - description: '_t__FaxSend::TO' + recipient: + description: '_t__FaxSend::RECIPIENT' type: string example: recipient@example.com - from: - description: '_t__FaxSend::FROM' + sender: + description: '_t__FaxSend::SENDER' type: string example: sender@example.com files: @@ -10566,6 +10564,17 @@ components: type: string type: object FaxResponse: + required: + - fax_id + - title + - original_title + - subject + - message + - metadata + - created_at + - from + - transmissions + - files_url properties: fax_id: description: '_t__FaxResponse::FAX_ID' @@ -10585,6 +10594,7 @@ components: metadata: description: '_t__FaxResponse::METADATA' type: object + additionalProperties: { } created_at: description: '_t__FaxResponse::CREATED_AT' type: integer @@ -10629,6 +10639,15 @@ components: status_code: description: '_t__Sub::FaxResponseTransmission::STATUS_CODE' type: string + enum: + - success + - transmitting + - error_could_not_fax + - error_unknown + - error_busy + - error_no_answer + - error_disconnected + - error_bad_destination sent_at: description: '_t__Sub::FaxResponseTransmission::SENT_AT' type: integer diff --git a/openapi-sdk.yaml b/openapi-sdk.yaml index 7f71d18bc..0375da836 100644 --- a/openapi-sdk.yaml +++ b/openapi-sdk.yaml @@ -2520,7 +2520,7 @@ paths: type: integer default: 1 minimum: 1 - example: 1 + example: 1 - name: page_size in: query @@ -2530,7 +2530,7 @@ paths: default: 20 maximum: 100 minimum: 1 - example: 20 + example: 20 responses: 200: description: 'successful operation' @@ -2563,8 +2563,6 @@ paths: $ref: '#/components/examples/Error402ResponseExample' 403_example: $ref: '#/components/examples/Error403ResponseExample' - 404_example: - $ref: '#/components/examples/Error404ResponseExample' 4XX_example: $ref: '#/components/examples/Error4XXResponseExample' security: @@ -7861,13 +7859,13 @@ components: type: object FaxSendRequest: required: - - to + - recipient properties: - to: + recipient: description: 'Fax Send To Recipient' type: string example: recipient@example.com - from: + sender: description: 'Fax Send From Sender (used only with fax number)' type: string example: sender@example.com @@ -11174,6 +11172,17 @@ components: type: string type: object FaxResponse: + required: + - fax_id + - title + - original_title + - subject + - message + - metadata + - created_at + - from + - transmissions + - files_url properties: fax_id: description: 'Fax ID' @@ -11193,6 +11202,7 @@ components: metadata: description: 'Fax Metadata' type: object + additionalProperties: {} created_at: description: 'Fax Created At Timestamp' type: integer @@ -11237,6 +11247,15 @@ components: status_code: description: 'Fax Transmission Status Code' type: string + enum: + - success + - transmitting + - error_could_not_fax + - error_unknown + - error_busy + - error_no_answer + - error_disconnected + - error_bad_destination sent_at: description: 'Fax Transmission Sent Timestamp' type: integer diff --git a/openapi.yaml b/openapi.yaml index 5c12c2f09..5e18435c3 100644 --- a/openapi.yaml +++ b/openapi.yaml @@ -2520,7 +2520,7 @@ paths: type: integer default: 1 minimum: 1 - example: 1 + example: 1 - name: page_size in: query @@ -2530,7 +2530,7 @@ paths: default: 20 maximum: 100 minimum: 1 - example: 20 + example: 20 responses: 200: description: 'successful operation' @@ -2563,8 +2563,6 @@ paths: $ref: '#/components/examples/Error402ResponseExample' 403_example: $ref: '#/components/examples/Error403ResponseExample' - 404_example: - $ref: '#/components/examples/Error404ResponseExample' 4XX_example: $ref: '#/components/examples/Error4XXResponseExample' security: @@ -7861,13 +7859,13 @@ components: type: object FaxSendRequest: required: - - to + - recipient properties: - to: + recipient: description: 'Fax Send To Recipient' type: string example: recipient@example.com - from: + sender: description: 'Fax Send From Sender (used only with fax number)' type: string example: sender@example.com @@ -11152,6 +11150,17 @@ components: type: string type: object FaxResponse: + required: + - fax_id + - title + - original_title + - subject + - message + - metadata + - created_at + - from + - transmissions + - files_url properties: fax_id: description: 'Fax ID' @@ -11171,6 +11180,7 @@ components: metadata: description: 'Fax Metadata' type: object + additionalProperties: {} created_at: description: 'Fax Created At Timestamp' type: integer @@ -11215,6 +11225,15 @@ components: status_code: description: 'Fax Transmission Status Code' type: string + enum: + - success + - transmitting + - error_could_not_fax + - error_unknown + - error_busy + - error_no_answer + - error_disconnected + - error_bad_destination sent_at: description: 'Fax Transmission Sent Timestamp' type: integer diff --git a/sdks/dotnet/docs/FaxApi.md b/sdks/dotnet/docs/FaxApi.md index 287b1e8d8..303d4eff9 100644 --- a/sdks/dotnet/docs/FaxApi.md +++ b/sdks/dotnet/docs/FaxApi.md @@ -415,8 +415,8 @@ public class Example var data = new FaxSendRequest( files: files, testMode: true, - to: "16690000001", - from: "16690000000", + recipient: "16690000001", + sender: "16690000000", coverPageTo: "Jill Fax", coverPageMessage: "I'm sending you a fax!", coverPageFrom: "Faxer Faxerson", diff --git a/sdks/dotnet/docs/FaxResponse.md b/sdks/dotnet/docs/FaxResponse.md index 2dbfb3444..611c1ed68 100644 --- a/sdks/dotnet/docs/FaxResponse.md +++ b/sdks/dotnet/docs/FaxResponse.md @@ -4,7 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**FaxId** | **string** | Fax ID | [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<FaxResponseTransmission>**](FaxResponseTransmission.md) | Fax Transmissions List | [optional] **FilesUrl** | **string** | Fax Files URL | [optional] +**FaxId** | **string** | Fax ID | **Title** | **string** | Fax Title | **OriginalTitle** | **string** | Fax Original Title | **Subject** | **string** | Fax Subject | **Message** | **string** | Fax Message | **Metadata** | **Dictionary<string, Object>** | Fax Metadata | **CreatedAt** | **int** | Fax Created At Timestamp | **From** | **string** | Fax Sender Email | **Transmissions** | [**List<FaxResponseTransmission>**](FaxResponseTransmission.md) | Fax Transmissions List | **FilesUrl** | **string** | 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/dotnet/docs/FaxSendRequest.md b/sdks/dotnet/docs/FaxSendRequest.md index 558880a8a..b02d7f0b8 100644 --- a/sdks/dotnet/docs/FaxSendRequest.md +++ b/sdks/dotnet/docs/FaxSendRequest.md @@ -4,7 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**To** | **string** | Fax Send To Recipient | **From** | **string** | Fax Send From Sender (used only with fax number) | [optional] **Files** | **List<System.IO.Stream>** | Fax File to Send | [optional] **FileUrls** | **List<string>** | Fax File URL to Send | [optional] **TestMode** | **bool** | API Test Mode Setting | [optional] [default to false]**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] +**Recipient** | **string** | Fax Send To Recipient | **Sender** | **string** | Fax Send From Sender (used only with fax number) | [optional] **Files** | **List<System.IO.Stream>** | Fax File to Send | [optional] **FileUrls** | **List<string>** | Fax File URL to Send | [optional] **TestMode** | **bool** | API Test Mode Setting | [optional] [default to false]**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/src/Dropbox.Sign/Model/FaxResponse.cs b/sdks/dotnet/src/Dropbox.Sign/Model/FaxResponse.cs index 814a1bb47..78172232e 100644 --- a/sdks/dotnet/src/Dropbox.Sign/Model/FaxResponse.cs +++ b/sdks/dotnet/src/Dropbox.Sign/Model/FaxResponse.cs @@ -41,28 +41,73 @@ protected FaxResponse() { } /// /// 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 FaxResponse(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)) + /// Fax ID (required). + /// Fax Title (required). + /// Fax Original Title (required). + /// Fax Subject (required). + /// Fax Message (required). + /// Fax Metadata (required). + /// Fax Created At Timestamp (required). + /// Fax Sender Email (required). + /// Fax Transmissions List (required). + /// Fax Files URL (required). + public FaxResponse(string faxId = default(string), string title = default(string), string originalTitle = default(string), string subject = default(string), string message = default(string), Dictionary metadata = default(Dictionary), int createdAt = default(int), string from = default(string), List transmissions = default(List), string filesUrl = default(string)) { + // to ensure "faxId" is required (not null) + if (faxId == null) + { + throw new ArgumentNullException("faxId is a required property for FaxResponse and cannot be null"); + } this.FaxId = faxId; + // to ensure "title" is required (not null) + if (title == null) + { + throw new ArgumentNullException("title is a required property for FaxResponse and cannot be null"); + } this.Title = title; + // to ensure "originalTitle" is required (not null) + if (originalTitle == null) + { + throw new ArgumentNullException("originalTitle is a required property for FaxResponse and cannot be null"); + } this.OriginalTitle = originalTitle; + // to ensure "subject" is required (not null) + if (subject == null) + { + throw new ArgumentNullException("subject is a required property for FaxResponse and cannot be null"); + } this.Subject = subject; + // to ensure "message" is required (not null) + if (message == null) + { + throw new ArgumentNullException("message is a required property for FaxResponse and cannot be null"); + } this.Message = message; + // to ensure "metadata" is required (not null) + if (metadata == null) + { + throw new ArgumentNullException("metadata is a required property for FaxResponse and cannot be null"); + } this.Metadata = metadata; this.CreatedAt = createdAt; + // to ensure "from" is required (not null) + if (from == null) + { + throw new ArgumentNullException("from is a required property for FaxResponse and cannot be null"); + } this.From = from; + // to ensure "transmissions" is required (not null) + if (transmissions == null) + { + throw new ArgumentNullException("transmissions is a required property for FaxResponse and cannot be null"); + } this.Transmissions = transmissions; + // to ensure "filesUrl" is required (not null) + if (filesUrl == null) + { + throw new ArgumentNullException("filesUrl is a required property for FaxResponse and cannot be null"); + } this.FilesUrl = filesUrl; } @@ -86,70 +131,70 @@ public static FaxResponse Init(string jsonData) /// Fax ID ///
/// Fax ID - [DataMember(Name = "fax_id", EmitDefaultValue = true)] + [DataMember(Name = "fax_id", IsRequired = true, EmitDefaultValue = true)] public string FaxId { get; set; } /// /// Fax Title /// /// Fax Title - [DataMember(Name = "title", EmitDefaultValue = true)] + [DataMember(Name = "title", IsRequired = true, EmitDefaultValue = true)] public string Title { get; set; } /// /// Fax Original Title /// /// Fax Original Title - [DataMember(Name = "original_title", EmitDefaultValue = true)] + [DataMember(Name = "original_title", IsRequired = true, EmitDefaultValue = true)] public string OriginalTitle { get; set; } /// /// Fax Subject /// /// Fax Subject - [DataMember(Name = "subject", EmitDefaultValue = true)] + [DataMember(Name = "subject", IsRequired = true, EmitDefaultValue = true)] public string Subject { get; set; } /// /// Fax Message /// /// Fax Message - [DataMember(Name = "message", EmitDefaultValue = true)] + [DataMember(Name = "message", IsRequired = true, EmitDefaultValue = true)] public string Message { get; set; } /// /// Fax Metadata /// /// Fax Metadata - [DataMember(Name = "metadata", EmitDefaultValue = true)] - public Object Metadata { get; set; } + [DataMember(Name = "metadata", IsRequired = true, EmitDefaultValue = true)] + public Dictionary Metadata { get; set; } /// /// Fax Created At Timestamp /// /// Fax Created At Timestamp - [DataMember(Name = "created_at", EmitDefaultValue = true)] + [DataMember(Name = "created_at", IsRequired = true, EmitDefaultValue = true)] public int CreatedAt { get; set; } /// /// Fax Sender Email /// /// Fax Sender Email - [DataMember(Name = "from", EmitDefaultValue = true)] + [DataMember(Name = "from", IsRequired = true, EmitDefaultValue = true)] public string From { get; set; } /// /// Fax Transmissions List /// /// Fax Transmissions List - [DataMember(Name = "transmissions", EmitDefaultValue = true)] + [DataMember(Name = "transmissions", IsRequired = true, EmitDefaultValue = true)] public List Transmissions { get; set; } /// /// Fax Files URL /// /// Fax Files URL - [DataMember(Name = "files_url", EmitDefaultValue = true)] + [DataMember(Name = "files_url", IsRequired = true, EmitDefaultValue = true)] public string FilesUrl { get; set; } /// @@ -232,8 +277,9 @@ public bool Equals(FaxResponse input) ) && ( this.Metadata == input.Metadata || - (this.Metadata != null && - this.Metadata.Equals(input.Metadata)) + this.Metadata != null && + input.Metadata != null && + this.Metadata.SequenceEqual(input.Metadata) ) && ( this.CreatedAt == input.CreatedAt || @@ -358,7 +404,7 @@ public List GetOpenApiTypes() { Name = "metadata", Property = "Metadata", - Type = "Object", + Type = "Dictionary", Value = Metadata, }); types.Add(new OpenApiType() diff --git a/sdks/dotnet/src/Dropbox.Sign/Model/FaxResponseTransmission.cs b/sdks/dotnet/src/Dropbox.Sign/Model/FaxResponseTransmission.cs index ae2938fd0..ac028b282 100644 --- a/sdks/dotnet/src/Dropbox.Sign/Model/FaxResponseTransmission.cs +++ b/sdks/dotnet/src/Dropbox.Sign/Model/FaxResponseTransmission.cs @@ -33,6 +33,69 @@ namespace Dropbox.Sign.Model [JsonObject(ItemNullValueHandling = NullValueHandling.Ignore)] public partial class FaxResponseTransmission : IEquatable, IValidatableObject { + /// + /// Fax Transmission Status Code + /// + /// Fax Transmission Status Code + [JsonConverter(typeof(StringEnumConverter))] + public enum StatusCodeEnum + { + /// + /// Enum Success for value: success + /// + [EnumMember(Value = "success")] + Success = 1, + + /// + /// Enum Transmitting for value: transmitting + /// + [EnumMember(Value = "transmitting")] + Transmitting = 2, + + /// + /// Enum ErrorCouldNotFax for value: error_could_not_fax + /// + [EnumMember(Value = "error_could_not_fax")] + ErrorCouldNotFax = 3, + + /// + /// Enum ErrorUnknown for value: error_unknown + /// + [EnumMember(Value = "error_unknown")] + ErrorUnknown = 4, + + /// + /// Enum ErrorBusy for value: error_busy + /// + [EnumMember(Value = "error_busy")] + ErrorBusy = 5, + + /// + /// Enum ErrorNoAnswer for value: error_no_answer + /// + [EnumMember(Value = "error_no_answer")] + ErrorNoAnswer = 6, + + /// + /// Enum ErrorDisconnected for value: error_disconnected + /// + [EnumMember(Value = "error_disconnected")] + ErrorDisconnected = 7, + + /// + /// Enum ErrorBadDestination for value: error_bad_destination + /// + [EnumMember(Value = "error_bad_destination")] + ErrorBadDestination = 8 + } + + + /// + /// Fax Transmission Status Code + /// + /// Fax Transmission Status Code + [DataMember(Name = "status_code", EmitDefaultValue = true)] + public StatusCodeEnum? StatusCode { get; set; } /// /// Initializes a new instance of the class. /// @@ -45,7 +108,7 @@ protected FaxResponseTransmission() { } /// Fax Transmission Sender. /// Fax Transmission Status Code. /// Fax Transmission Sent Timestamp. - public FaxResponseTransmission(string recipient = default(string), string sender = default(string), string statusCode = default(string), int sentAt = default(int)) + public FaxResponseTransmission(string recipient = default(string), string sender = default(string), StatusCodeEnum? statusCode = default(StatusCodeEnum?), int sentAt = default(int)) { this.Recipient = recipient; @@ -84,13 +147,6 @@ public static FaxResponseTransmission Init(string jsonData) [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 /// @@ -157,8 +213,7 @@ public bool Equals(FaxResponseTransmission input) ) && ( this.StatusCode == input.StatusCode || - (this.StatusCode != null && - this.StatusCode.Equals(input.StatusCode)) + this.StatusCode.Equals(input.StatusCode) ) && ( this.SentAt == input.SentAt || @@ -183,10 +238,7 @@ public override int GetHashCode() { hashCode = (hashCode * 59) + this.Sender.GetHashCode(); } - if (this.StatusCode != null) - { - hashCode = (hashCode * 59) + this.StatusCode.GetHashCode(); - } + hashCode = (hashCode * 59) + this.StatusCode.GetHashCode(); hashCode = (hashCode * 59) + this.SentAt.GetHashCode(); return hashCode; } diff --git a/sdks/dotnet/src/Dropbox.Sign/Model/FaxSendRequest.cs b/sdks/dotnet/src/Dropbox.Sign/Model/FaxSendRequest.cs index 04a2053fa..e4d42e6d4 100644 --- a/sdks/dotnet/src/Dropbox.Sign/Model/FaxSendRequest.cs +++ b/sdks/dotnet/src/Dropbox.Sign/Model/FaxSendRequest.cs @@ -41,8 +41,8 @@ protected FaxSendRequest() { } /// /// Initializes a new instance of the class. /// - /// Fax Send To Recipient (required). - /// Fax Send From Sender (used only with fax number). + /// Fax Send To Recipient (required). + /// Fax Send From Sender (used only with fax number). /// Fax File to Send. /// Fax File URL to Send. /// API Test Mode Setting (default to false). @@ -50,16 +50,16 @@ protected FaxSendRequest() { } /// Fax Cover Page for Sender. /// Fax Cover Page Message. /// Fax Title. - public FaxSendRequest(string to = default(string), string from = default(string), List files = default(List), List fileUrls = default(List), bool testMode = false, string coverPageTo = default(string), string coverPageFrom = default(string), string coverPageMessage = default(string), string title = default(string)) + public FaxSendRequest(string recipient = default(string), string sender = default(string), List files = default(List), List fileUrls = default(List), bool testMode = false, string coverPageTo = default(string), string coverPageFrom = default(string), string coverPageMessage = default(string), string title = default(string)) { - // to ensure "to" is required (not null) - if (to == null) + // to ensure "recipient" is required (not null) + if (recipient == null) { - throw new ArgumentNullException("to is a required property for FaxSendRequest and cannot be null"); + throw new ArgumentNullException("recipient is a required property for FaxSendRequest and cannot be null"); } - this.To = to; - this.From = from; + this.Recipient = recipient; + this.Sender = sender; this.Files = files; this.FileUrls = fileUrls; this.TestMode = testMode; @@ -90,16 +90,16 @@ public static FaxSendRequest Init(string jsonData) /// /// Fax Send To Recipient /// recipient@example.com - [DataMember(Name = "to", IsRequired = true, EmitDefaultValue = true)] - public string To { get; set; } + [DataMember(Name = "recipient", IsRequired = true, EmitDefaultValue = true)] + public string Recipient { 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; } + [DataMember(Name = "sender", EmitDefaultValue = true)] + public string Sender { get; set; } /// /// Fax File to Send @@ -162,8 +162,8 @@ 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(" Recipient: ").Append(Recipient).Append("\n"); + sb.Append(" Sender: ").Append(Sender).Append("\n"); sb.Append(" Files: ").Append(Files).Append("\n"); sb.Append(" FileUrls: ").Append(FileUrls).Append("\n"); sb.Append(" TestMode: ").Append(TestMode).Append("\n"); @@ -207,14 +207,14 @@ public bool Equals(FaxSendRequest input) } return ( - this.To == input.To || - (this.To != null && - this.To.Equals(input.To)) + this.Recipient == input.Recipient || + (this.Recipient != null && + this.Recipient.Equals(input.Recipient)) ) && ( - this.From == input.From || - (this.From != null && - this.From.Equals(input.From)) + this.Sender == input.Sender || + (this.Sender != null && + this.Sender.Equals(input.Sender)) ) && ( this.Files == input.Files || @@ -263,13 +263,13 @@ public override int GetHashCode() unchecked // Overflow is fine, just wrap { int hashCode = 41; - if (this.To != null) + if (this.Recipient != null) { - hashCode = (hashCode * 59) + this.To.GetHashCode(); + hashCode = (hashCode * 59) + this.Recipient.GetHashCode(); } - if (this.From != null) + if (this.Sender != null) { - hashCode = (hashCode * 59) + this.From.GetHashCode(); + hashCode = (hashCode * 59) + this.Sender.GetHashCode(); } if (this.Files != null) { @@ -314,17 +314,17 @@ public List GetOpenApiTypes() var types = new List(); types.Add(new OpenApiType() { - Name = "to", - Property = "To", + Name = "recipient", + Property = "Recipient", Type = "string", - Value = To, + Value = Recipient, }); types.Add(new OpenApiType() { - Name = "from", - Property = "From", + Name = "sender", + Property = "Sender", Type = "string", - Value = From, + Value = Sender, }); types.Add(new OpenApiType() { diff --git a/sdks/java-v1/docs/FaxApi.md b/sdks/java-v1/docs/FaxApi.md index 597b6bd41..a3d9baef9 100644 --- a/sdks/java-v1/docs/FaxApi.md +++ b/sdks/java-v1/docs/FaxApi.md @@ -315,8 +315,8 @@ public class Example { var data = new FaxSendRequest() .addFilesItem(new File("example_fax.pdf")) .testMode(true) - .to("16690000001") - .from("16690000000") + .recipient("16690000001") + .sender("16690000000") .coverPageTo("Jill Fax") .coverPageMessage("I'm sending you a fax!") .coverPageFrom("Faxer Faxerson") diff --git a/sdks/java-v1/docs/FaxResponse.md b/sdks/java-v1/docs/FaxResponse.md index 6fe6fc0f3..a523916a6 100644 --- a/sdks/java-v1/docs/FaxResponse.md +++ b/sdks/java-v1/docs/FaxResponse.md @@ -8,16 +8,16 @@ | 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```](FaxResponseTransmission.md) | Fax Transmissions List | | -| `filesUrl` | ```String``` | Fax Files URL | | +| `faxId`*_required_ | ```String``` | Fax ID | | +| `title`*_required_ | ```String``` | Fax Title | | +| `originalTitle`*_required_ | ```String``` | Fax Original Title | | +| `subject`*_required_ | ```String``` | Fax Subject | | +| `message`*_required_ | ```String``` | Fax Message | | +| `metadata`*_required_ | ```Map``` | Fax Metadata | | +| `createdAt`*_required_ | ```Integer``` | Fax Created At Timestamp | | +| `from`*_required_ | ```String``` | Fax Sender Email | | +| `transmissions`*_required_ | [```List```](FaxResponseTransmission.md) | Fax Transmissions List | | +| `filesUrl`*_required_ | ```String``` | Fax Files URL | | diff --git a/sdks/java-v1/docs/FaxResponseTransmission.md b/sdks/java-v1/docs/FaxResponseTransmission.md index bb3a77d85..5fe4a4ab7 100644 --- a/sdks/java-v1/docs/FaxResponseTransmission.md +++ b/sdks/java-v1/docs/FaxResponseTransmission.md @@ -10,8 +10,23 @@ |------------ | ------------- | ------------- | -------------| | `recipient` | ```String``` | Fax Transmission Recipient | | | `sender` | ```String``` | Fax Transmission Sender | | -| `statusCode` | ```String``` | Fax Transmission Status Code | | +| `statusCode` | [```StatusCodeEnum```](#StatusCodeEnum) | Fax Transmission Status Code | | | `sentAt` | ```Integer``` | Fax Transmission Sent Timestamp | | +## Enum: StatusCodeEnum + +| Name | Value | +---- | ----- +| SUCCESS | "success" | +| TRANSMITTING | "transmitting" | +| ERROR_COULD_NOT_FAX | "error_could_not_fax" | +| ERROR_UNKNOWN | "error_unknown" | +| ERROR_BUSY | "error_busy" | +| ERROR_NO_ANSWER | "error_no_answer" | +| ERROR_DISCONNECTED | "error_disconnected" | +| ERROR_BAD_DESTINATION | "error_bad_destination" | + + + diff --git a/sdks/java-v1/docs/FaxSendRequest.md b/sdks/java-v1/docs/FaxSendRequest.md index cd3959fde..5b939a0af 100644 --- a/sdks/java-v1/docs/FaxSendRequest.md +++ b/sdks/java-v1/docs/FaxSendRequest.md @@ -8,8 +8,8 @@ | Name | Type | Description | Notes | |------------ | ------------- | ------------- | -------------| -| `to`*_required_ | ```String``` | Fax Send To Recipient | | -| `from` | ```String``` | Fax Send From Sender (used only with fax number) | | +| `recipient`*_required_ | ```String``` | Fax Send To Recipient | | +| `sender` | ```String``` | Fax Send From Sender (used only with fax number) | | | `files` | ```List``` | Fax File to Send | | | `fileUrls` | ```List``` | Fax File URL to Send | | | `testMode` | ```Boolean``` | API Test Mode Setting | | diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/model/FaxResponse.java b/sdks/java-v1/src/main/java/com/dropbox/sign/model/FaxResponse.java index 3c8b7c968..11f469adf 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/model/FaxResponse.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/model/FaxResponse.java @@ -59,7 +59,7 @@ public class FaxResponse { private String message; public static final String JSON_PROPERTY_METADATA = "metadata"; - private Object metadata; + private Map metadata = new HashMap<>(); public static final String JSON_PROPERTY_CREATED_AT = "created_at"; private Integer createdAt; @@ -68,7 +68,7 @@ public class FaxResponse { private String from; public static final String JSON_PROPERTY_TRANSMISSIONS = "transmissions"; - private List transmissions = null; + private List transmissions = new ArrayList<>(); public static final String JSON_PROPERTY_FILES_URL = "files_url"; private String filesUrl; @@ -99,14 +99,15 @@ public FaxResponse faxId(String faxId) { * * @return faxId */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_FAX_ID) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_FAX_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) public String getFaxId() { return faxId; } @JsonProperty(JSON_PROPERTY_FAX_ID) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) public void setFaxId(String faxId) { this.faxId = faxId; } @@ -121,14 +122,15 @@ public FaxResponse title(String title) { * * @return title */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_TITLE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_TITLE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) public String getTitle() { return title; } @JsonProperty(JSON_PROPERTY_TITLE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) public void setTitle(String title) { this.title = title; } @@ -143,14 +145,15 @@ public FaxResponse originalTitle(String originalTitle) { * * @return originalTitle */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ORIGINAL_TITLE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_ORIGINAL_TITLE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) public String getOriginalTitle() { return originalTitle; } @JsonProperty(JSON_PROPERTY_ORIGINAL_TITLE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) public void setOriginalTitle(String originalTitle) { this.originalTitle = originalTitle; } @@ -165,14 +168,15 @@ public FaxResponse subject(String subject) { * * @return subject */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_SUBJECT) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_SUBJECT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) public String getSubject() { return subject; } @JsonProperty(JSON_PROPERTY_SUBJECT) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) public void setSubject(String subject) { this.subject = subject; } @@ -187,37 +191,47 @@ public FaxResponse message(String message) { * * @return message */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_MESSAGE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_MESSAGE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) public String getMessage() { return message; } @JsonProperty(JSON_PROPERTY_MESSAGE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) public void setMessage(String message) { this.message = message; } - public FaxResponse metadata(Object metadata) { + public FaxResponse metadata(Map metadata) { this.metadata = metadata; return this; } + public FaxResponse putMetadataItem(String key, Object metadataItem) { + if (this.metadata == null) { + this.metadata = new HashMap<>(); + } + this.metadata.put(key, metadataItem); + return this; + } + /** * Fax Metadata * * @return metadata */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_METADATA) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Object getMetadata() { + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_METADATA) + @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.ALWAYS) + public Map getMetadata() { return metadata; } @JsonProperty(JSON_PROPERTY_METADATA) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setMetadata(Object metadata) { + @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.ALWAYS) + public void setMetadata(Map metadata) { this.metadata = metadata; } @@ -231,14 +245,15 @@ public FaxResponse createdAt(Integer createdAt) { * * @return createdAt */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_CREATED_AT) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_CREATED_AT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) public Integer getCreatedAt() { return createdAt; } @JsonProperty(JSON_PROPERTY_CREATED_AT) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) public void setCreatedAt(Integer createdAt) { this.createdAt = createdAt; } @@ -253,14 +268,15 @@ public FaxResponse from(String from) { * * @return from */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_FROM) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_FROM) + @JsonInclude(value = JsonInclude.Include.ALWAYS) public String getFrom() { return from; } @JsonProperty(JSON_PROPERTY_FROM) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) public void setFrom(String from) { this.from = from; } @@ -283,14 +299,15 @@ public FaxResponse addTransmissionsItem(FaxResponseTransmission transmissionsIte * * @return transmissions */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_TRANSMISSIONS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_TRANSMISSIONS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) public List getTransmissions() { return transmissions; } @JsonProperty(JSON_PROPERTY_TRANSMISSIONS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) public void setTransmissions(List transmissions) { this.transmissions = transmissions; } @@ -305,14 +322,15 @@ public FaxResponse filesUrl(String filesUrl) { * * @return filesUrl */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_FILES_URL) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_FILES_URL) + @JsonInclude(value = JsonInclude.Include.ALWAYS) public String getFilesUrl() { return filesUrl; } @JsonProperty(JSON_PROPERTY_FILES_URL) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) public void setFilesUrl(String filesUrl) { this.filesUrl = filesUrl; } diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/model/FaxResponseTransmission.java b/sdks/java-v1/src/main/java/com/dropbox/sign/model/FaxResponseTransmission.java index 05954e5f7..4e6f60e5b 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/model/FaxResponseTransmission.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/model/FaxResponseTransmission.java @@ -14,10 +14,12 @@ import com.dropbox.sign.ApiException; import com.dropbox.sign.JSON; +import com.fasterxml.jackson.annotation.JsonCreator; 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.annotation.JsonValue; import com.fasterxml.jackson.databind.ObjectMapper; import java.util.HashMap; import java.util.Map; @@ -41,8 +43,53 @@ public class FaxResponseTransmission { public static final String JSON_PROPERTY_SENDER = "sender"; private String sender; + /** Fax Transmission Status Code */ + public enum StatusCodeEnum { + SUCCESS("success"), + + TRANSMITTING("transmitting"), + + ERROR_COULD_NOT_FAX("error_could_not_fax"), + + ERROR_UNKNOWN("error_unknown"), + + ERROR_BUSY("error_busy"), + + ERROR_NO_ANSWER("error_no_answer"), + + ERROR_DISCONNECTED("error_disconnected"), + + ERROR_BAD_DESTINATION("error_bad_destination"); + + private String value; + + StatusCodeEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static StatusCodeEnum fromValue(String value) { + for (StatusCodeEnum b : StatusCodeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } + public static final String JSON_PROPERTY_STATUS_CODE = "status_code"; - private String statusCode; + private StatusCodeEnum statusCode; public static final String JSON_PROPERTY_SENT_AT = "sent_at"; private Integer sentAt; @@ -108,7 +155,7 @@ public void setSender(String sender) { this.sender = sender; } - public FaxResponseTransmission statusCode(String statusCode) { + public FaxResponseTransmission statusCode(StatusCodeEnum statusCode) { this.statusCode = statusCode; return this; } @@ -120,13 +167,13 @@ public FaxResponseTransmission statusCode(String statusCode) { */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_STATUS_CODE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getStatusCode() { + public StatusCodeEnum getStatusCode() { return statusCode; } @JsonProperty(JSON_PROPERTY_STATUS_CODE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setStatusCode(String statusCode) { + public void setStatusCode(StatusCodeEnum statusCode) { this.statusCode = statusCode; } 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 index 6e1d4c74b..571ba92f8 100644 --- 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 @@ -28,8 +28,8 @@ /** FaxSendRequest */ @JsonPropertyOrder({ - FaxSendRequest.JSON_PROPERTY_TO, - FaxSendRequest.JSON_PROPERTY_FROM, + FaxSendRequest.JSON_PROPERTY_RECIPIENT, + FaxSendRequest.JSON_PROPERTY_SENDER, FaxSendRequest.JSON_PROPERTY_FILES, FaxSendRequest.JSON_PROPERTY_FILE_URLS, FaxSendRequest.JSON_PROPERTY_TEST_MODE, @@ -43,11 +43,11 @@ 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_RECIPIENT = "recipient"; + private String recipient; - public static final String JSON_PROPERTY_FROM = "from"; - private String from; + public static final String JSON_PROPERTY_SENDER = "sender"; + private String sender; public static final String JSON_PROPERTY_FILES = "files"; private List files = null; @@ -86,49 +86,49 @@ public static FaxSendRequest init(HashMap data) throws Exception { .readValue(new ObjectMapper().writeValueAsString(data), FaxSendRequest.class); } - public FaxSendRequest to(String to) { - this.to = to; + public FaxSendRequest recipient(String recipient) { + this.recipient = recipient; return this; } /** * Fax Send To Recipient * - * @return to + * @return recipient */ @javax.annotation.Nonnull - @JsonProperty(JSON_PROPERTY_TO) + @JsonProperty(JSON_PROPERTY_RECIPIENT) @JsonInclude(value = JsonInclude.Include.ALWAYS) - public String getTo() { - return to; + public String getRecipient() { + return recipient; } - @JsonProperty(JSON_PROPERTY_TO) + @JsonProperty(JSON_PROPERTY_RECIPIENT) @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setTo(String to) { - this.to = to; + public void setRecipient(String recipient) { + this.recipient = recipient; } - public FaxSendRequest from(String from) { - this.from = from; + public FaxSendRequest sender(String sender) { + this.sender = sender; return this; } /** * Fax Send From Sender (used only with fax number) * - * @return from + * @return sender */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_FROM) + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_SENDER) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getFrom() { - return from; + public String getSender() { + return sender; } - @JsonProperty(JSON_PROPERTY_FROM) + @JsonProperty(JSON_PROPERTY_SENDER) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setFrom(String from) { - this.from = from; + public void setSender(String sender) { + this.sender = sender; } public FaxSendRequest files(List files) { @@ -311,8 +311,8 @@ public boolean equals(Object o) { return false; } FaxSendRequest faxSendRequest = (FaxSendRequest) o; - return Objects.equals(this.to, faxSendRequest.to) - && Objects.equals(this.from, faxSendRequest.from) + return Objects.equals(this.recipient, faxSendRequest.recipient) + && Objects.equals(this.sender, faxSendRequest.sender) && Objects.equals(this.files, faxSendRequest.files) && Objects.equals(this.fileUrls, faxSendRequest.fileUrls) && Objects.equals(this.testMode, faxSendRequest.testMode) @@ -325,8 +325,8 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( - to, - from, + recipient, + sender, files, fileUrls, testMode, @@ -340,8 +340,8 @@ public int hashCode() { 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(" recipient: ").append(toIndentedString(recipient)).append("\n"); + sb.append(" sender: ").append(toIndentedString(sender)).append("\n"); sb.append(" files: ").append(toIndentedString(files)).append("\n"); sb.append(" fileUrls: ").append(toIndentedString(fileUrls)).append("\n"); sb.append(" testMode: ").append(toIndentedString(testMode)).append("\n"); @@ -357,40 +357,42 @@ public Map createFormData() throws ApiException { Map map = new HashMap<>(); boolean fileTypeFound = false; try { - if (to != null) { - if (isFileTypeOrListOfFiles(to)) { + if (recipient != null) { + if (isFileTypeOrListOfFiles(recipient)) { 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)); + 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("to", JSON.getDefault().getMapper().writeValueAsString(to)); + map.put( + "recipient", + JSON.getDefault().getMapper().writeValueAsString(recipient)); } } - if (from != null) { - if (isFileTypeOrListOfFiles(from)) { + if (sender != null) { + if (isFileTypeOrListOfFiles(sender)) { 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)); + 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("from", JSON.getDefault().getMapper().writeValueAsString(from)); + map.put("sender", JSON.getDefault().getMapper().writeValueAsString(sender)); } } if (files != null) { diff --git a/sdks/java-v2/docs/FaxApi.md b/sdks/java-v2/docs/FaxApi.md index 597b6bd41..a3d9baef9 100644 --- a/sdks/java-v2/docs/FaxApi.md +++ b/sdks/java-v2/docs/FaxApi.md @@ -315,8 +315,8 @@ public class Example { var data = new FaxSendRequest() .addFilesItem(new File("example_fax.pdf")) .testMode(true) - .to("16690000001") - .from("16690000000") + .recipient("16690000001") + .sender("16690000000") .coverPageTo("Jill Fax") .coverPageMessage("I'm sending you a fax!") .coverPageFrom("Faxer Faxerson") diff --git a/sdks/java-v2/docs/FaxResponse.md b/sdks/java-v2/docs/FaxResponse.md index 6fe6fc0f3..a523916a6 100644 --- a/sdks/java-v2/docs/FaxResponse.md +++ b/sdks/java-v2/docs/FaxResponse.md @@ -8,16 +8,16 @@ | 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```](FaxResponseTransmission.md) | Fax Transmissions List | | -| `filesUrl` | ```String``` | Fax Files URL | | +| `faxId`*_required_ | ```String``` | Fax ID | | +| `title`*_required_ | ```String``` | Fax Title | | +| `originalTitle`*_required_ | ```String``` | Fax Original Title | | +| `subject`*_required_ | ```String``` | Fax Subject | | +| `message`*_required_ | ```String``` | Fax Message | | +| `metadata`*_required_ | ```Map``` | Fax Metadata | | +| `createdAt`*_required_ | ```Integer``` | Fax Created At Timestamp | | +| `from`*_required_ | ```String``` | Fax Sender Email | | +| `transmissions`*_required_ | [```List```](FaxResponseTransmission.md) | Fax Transmissions List | | +| `filesUrl`*_required_ | ```String``` | Fax Files URL | | diff --git a/sdks/java-v2/docs/FaxResponseTransmission.md b/sdks/java-v2/docs/FaxResponseTransmission.md index bb3a77d85..5fe4a4ab7 100644 --- a/sdks/java-v2/docs/FaxResponseTransmission.md +++ b/sdks/java-v2/docs/FaxResponseTransmission.md @@ -10,8 +10,23 @@ |------------ | ------------- | ------------- | -------------| | `recipient` | ```String``` | Fax Transmission Recipient | | | `sender` | ```String``` | Fax Transmission Sender | | -| `statusCode` | ```String``` | Fax Transmission Status Code | | +| `statusCode` | [```StatusCodeEnum```](#StatusCodeEnum) | Fax Transmission Status Code | | | `sentAt` | ```Integer``` | Fax Transmission Sent Timestamp | | +## Enum: StatusCodeEnum + +| Name | Value | +---- | ----- +| SUCCESS | "success" | +| TRANSMITTING | "transmitting" | +| ERROR_COULD_NOT_FAX | "error_could_not_fax" | +| ERROR_UNKNOWN | "error_unknown" | +| ERROR_BUSY | "error_busy" | +| ERROR_NO_ANSWER | "error_no_answer" | +| ERROR_DISCONNECTED | "error_disconnected" | +| ERROR_BAD_DESTINATION | "error_bad_destination" | + + + diff --git a/sdks/java-v2/docs/FaxSendRequest.md b/sdks/java-v2/docs/FaxSendRequest.md index cd3959fde..5b939a0af 100644 --- a/sdks/java-v2/docs/FaxSendRequest.md +++ b/sdks/java-v2/docs/FaxSendRequest.md @@ -8,8 +8,8 @@ | Name | Type | Description | Notes | |------------ | ------------- | ------------- | -------------| -| `to`*_required_ | ```String``` | Fax Send To Recipient | | -| `from` | ```String``` | Fax Send From Sender (used only with fax number) | | +| `recipient`*_required_ | ```String``` | Fax Send To Recipient | | +| `sender` | ```String``` | Fax Send From Sender (used only with fax number) | | | `files` | ```List``` | Fax File to Send | | | `fileUrls` | ```List``` | Fax File URL to Send | | | `testMode` | ```Boolean``` | API Test Mode Setting | | diff --git a/sdks/java-v2/src/main/java/com/dropbox/sign/model/FaxResponse.java b/sdks/java-v2/src/main/java/com/dropbox/sign/model/FaxResponse.java index d1c1c6637..c09489751 100644 --- a/sdks/java-v2/src/main/java/com/dropbox/sign/model/FaxResponse.java +++ b/sdks/java-v2/src/main/java/com/dropbox/sign/model/FaxResponse.java @@ -24,7 +24,9 @@ import com.fasterxml.jackson.annotation.JsonValue; import java.util.ArrayList; import java.util.Arrays; +import java.util.HashMap; import java.util.List; +import java.util.Map; import com.fasterxml.jackson.annotation.JsonPropertyOrder; import com.dropbox.sign.JSON; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; @@ -66,7 +68,7 @@ public class FaxResponse { private String message; public static final String JSON_PROPERTY_METADATA = "metadata"; - private Object metadata; + private Map metadata = new HashMap<>(); public static final String JSON_PROPERTY_CREATED_AT = "created_at"; private Integer createdAt; @@ -75,7 +77,7 @@ public class FaxResponse { private String from; public static final String JSON_PROPERTY_TRANSMISSIONS = "transmissions"; - private List transmissions = null; + private List transmissions = new ArrayList<>(); public static final String JSON_PROPERTY_FILES_URL = "files_url"; private String filesUrl; @@ -107,9 +109,9 @@ public FaxResponse faxId(String faxId) { * Fax ID * @return faxId */ - @jakarta.annotation.Nullable + @jakarta.annotation.Nonnull @JsonProperty(JSON_PROPERTY_FAX_ID) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) public String getFaxId() { return faxId; @@ -117,7 +119,7 @@ public String getFaxId() { @JsonProperty(JSON_PROPERTY_FAX_ID) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) public void setFaxId(String faxId) { this.faxId = faxId; } @@ -132,9 +134,9 @@ public FaxResponse title(String title) { * Fax Title * @return title */ - @jakarta.annotation.Nullable + @jakarta.annotation.Nonnull @JsonProperty(JSON_PROPERTY_TITLE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) public String getTitle() { return title; @@ -142,7 +144,7 @@ public String getTitle() { @JsonProperty(JSON_PROPERTY_TITLE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) public void setTitle(String title) { this.title = title; } @@ -157,9 +159,9 @@ public FaxResponse originalTitle(String originalTitle) { * Fax Original Title * @return originalTitle */ - @jakarta.annotation.Nullable + @jakarta.annotation.Nonnull @JsonProperty(JSON_PROPERTY_ORIGINAL_TITLE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) public String getOriginalTitle() { return originalTitle; @@ -167,7 +169,7 @@ public String getOriginalTitle() { @JsonProperty(JSON_PROPERTY_ORIGINAL_TITLE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) public void setOriginalTitle(String originalTitle) { this.originalTitle = originalTitle; } @@ -182,9 +184,9 @@ public FaxResponse subject(String subject) { * Fax Subject * @return subject */ - @jakarta.annotation.Nullable + @jakarta.annotation.Nonnull @JsonProperty(JSON_PROPERTY_SUBJECT) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) public String getSubject() { return subject; @@ -192,7 +194,7 @@ public String getSubject() { @JsonProperty(JSON_PROPERTY_SUBJECT) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) public void setSubject(String subject) { this.subject = subject; } @@ -207,9 +209,9 @@ public FaxResponse message(String message) { * Fax Message * @return message */ - @jakarta.annotation.Nullable + @jakarta.annotation.Nonnull @JsonProperty(JSON_PROPERTY_MESSAGE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) public String getMessage() { return message; @@ -217,33 +219,41 @@ public String getMessage() { @JsonProperty(JSON_PROPERTY_MESSAGE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) public void setMessage(String message) { this.message = message; } - public FaxResponse metadata(Object metadata) { + public FaxResponse metadata(Map metadata) { this.metadata = metadata; return this; } + public FaxResponse putMetadataItem(String key, Object metadataItem) { + if (this.metadata == null) { + this.metadata = new HashMap<>(); + } + this.metadata.put(key, metadataItem); + return this; + } + /** * Fax Metadata * @return metadata */ - @jakarta.annotation.Nullable + @jakarta.annotation.Nonnull @JsonProperty(JSON_PROPERTY_METADATA) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.ALWAYS) - public Object getMetadata() { + public Map getMetadata() { return metadata; } @JsonProperty(JSON_PROPERTY_METADATA) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setMetadata(Object metadata) { + @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.ALWAYS) + public void setMetadata(Map metadata) { this.metadata = metadata; } @@ -257,9 +267,9 @@ public FaxResponse createdAt(Integer createdAt) { * Fax Created At Timestamp * @return createdAt */ - @jakarta.annotation.Nullable + @jakarta.annotation.Nonnull @JsonProperty(JSON_PROPERTY_CREATED_AT) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) public Integer getCreatedAt() { return createdAt; @@ -267,7 +277,7 @@ public Integer getCreatedAt() { @JsonProperty(JSON_PROPERTY_CREATED_AT) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) public void setCreatedAt(Integer createdAt) { this.createdAt = createdAt; } @@ -282,9 +292,9 @@ public FaxResponse from(String from) { * Fax Sender Email * @return from */ - @jakarta.annotation.Nullable + @jakarta.annotation.Nonnull @JsonProperty(JSON_PROPERTY_FROM) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) public String getFrom() { return from; @@ -292,7 +302,7 @@ public String getFrom() { @JsonProperty(JSON_PROPERTY_FROM) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) public void setFrom(String from) { this.from = from; } @@ -315,9 +325,9 @@ public FaxResponse addTransmissionsItem(FaxResponseTransmission transmissionsIte * Fax Transmissions List * @return transmissions */ - @jakarta.annotation.Nullable + @jakarta.annotation.Nonnull @JsonProperty(JSON_PROPERTY_TRANSMISSIONS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) public List getTransmissions() { return transmissions; @@ -325,7 +335,7 @@ public List getTransmissions() { @JsonProperty(JSON_PROPERTY_TRANSMISSIONS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) public void setTransmissions(List transmissions) { this.transmissions = transmissions; } @@ -340,9 +350,9 @@ public FaxResponse filesUrl(String filesUrl) { * Fax Files URL * @return filesUrl */ - @jakarta.annotation.Nullable + @jakarta.annotation.Nonnull @JsonProperty(JSON_PROPERTY_FILES_URL) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) public String getFilesUrl() { return filesUrl; @@ -350,7 +360,7 @@ public String getFilesUrl() { @JsonProperty(JSON_PROPERTY_FILES_URL) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) public void setFilesUrl(String filesUrl) { this.filesUrl = filesUrl; } diff --git a/sdks/java-v2/src/main/java/com/dropbox/sign/model/FaxResponseTransmission.java b/sdks/java-v2/src/main/java/com/dropbox/sign/model/FaxResponseTransmission.java index aa83487de..b65c94b46 100644 --- a/sdks/java-v2/src/main/java/com/dropbox/sign/model/FaxResponseTransmission.java +++ b/sdks/java-v2/src/main/java/com/dropbox/sign/model/FaxResponseTransmission.java @@ -47,8 +47,55 @@ public class FaxResponseTransmission { public static final String JSON_PROPERTY_SENDER = "sender"; private String sender; + /** + * Fax Transmission Status Code + */ + public enum StatusCodeEnum { + SUCCESS("success"), + + TRANSMITTING("transmitting"), + + ERROR_COULD_NOT_FAX("error_could_not_fax"), + + ERROR_UNKNOWN("error_unknown"), + + ERROR_BUSY("error_busy"), + + ERROR_NO_ANSWER("error_no_answer"), + + ERROR_DISCONNECTED("error_disconnected"), + + ERROR_BAD_DESTINATION("error_bad_destination"); + + private String value; + + StatusCodeEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static StatusCodeEnum fromValue(String value) { + for (StatusCodeEnum b : StatusCodeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } + public static final String JSON_PROPERTY_STATUS_CODE = "status_code"; - private String statusCode; + private StatusCodeEnum statusCode; public static final String JSON_PROPERTY_SENT_AT = "sent_at"; private Integer sentAt; @@ -121,7 +168,7 @@ public void setSender(String sender) { } - public FaxResponseTransmission statusCode(String statusCode) { + public FaxResponseTransmission statusCode(StatusCodeEnum statusCode) { this.statusCode = statusCode; return this; } @@ -134,14 +181,14 @@ public FaxResponseTransmission statusCode(String statusCode) { @JsonProperty(JSON_PROPERTY_STATUS_CODE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getStatusCode() { + public StatusCodeEnum getStatusCode() { return statusCode; } @JsonProperty(JSON_PROPERTY_STATUS_CODE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setStatusCode(String statusCode) { + public void setStatusCode(StatusCodeEnum statusCode) { this.statusCode = statusCode; } 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 index 1da568838..bb4a6e8a1 100644 --- 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 @@ -36,8 +36,8 @@ * FaxSendRequest */ @JsonPropertyOrder({ - FaxSendRequest.JSON_PROPERTY_TO, - FaxSendRequest.JSON_PROPERTY_FROM, + FaxSendRequest.JSON_PROPERTY_RECIPIENT, + FaxSendRequest.JSON_PROPERTY_SENDER, FaxSendRequest.JSON_PROPERTY_FILES, FaxSendRequest.JSON_PROPERTY_FILE_URLS, FaxSendRequest.JSON_PROPERTY_TEST_MODE, @@ -49,11 +49,11 @@ @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_RECIPIENT = "recipient"; + private String recipient; - public static final String JSON_PROPERTY_FROM = "from"; - private String from; + public static final String JSON_PROPERTY_SENDER = "sender"; + private String sender; public static final String JSON_PROPERTY_FILES = "files"; private List files = null; @@ -94,53 +94,53 @@ static public FaxSendRequest init(HashMap data) throws Exception { ); } - public FaxSendRequest to(String to) { - this.to = to; + public FaxSendRequest recipient(String recipient) { + this.recipient = recipient; return this; } /** * Fax Send To Recipient - * @return to + * @return recipient */ @jakarta.annotation.Nonnull - @JsonProperty(JSON_PROPERTY_TO) + @JsonProperty(JSON_PROPERTY_RECIPIENT) @JsonInclude(value = JsonInclude.Include.ALWAYS) - public String getTo() { - return to; + public String getRecipient() { + return recipient; } - @JsonProperty(JSON_PROPERTY_TO) + @JsonProperty(JSON_PROPERTY_RECIPIENT) @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setTo(String to) { - this.to = to; + public void setRecipient(String recipient) { + this.recipient = recipient; } - public FaxSendRequest from(String from) { - this.from = from; + public FaxSendRequest sender(String sender) { + this.sender = sender; return this; } /** * Fax Send From Sender (used only with fax number) - * @return from + * @return sender */ @jakarta.annotation.Nullable - @JsonProperty(JSON_PROPERTY_FROM) + @JsonProperty(JSON_PROPERTY_SENDER) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getFrom() { - return from; + public String getSender() { + return sender; } - @JsonProperty(JSON_PROPERTY_FROM) + @JsonProperty(JSON_PROPERTY_SENDER) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setFrom(String from) { - this.from = from; + public void setSender(String sender) { + this.sender = sender; } @@ -347,8 +347,8 @@ public boolean equals(Object o) { return false; } FaxSendRequest faxSendRequest = (FaxSendRequest) o; - return Objects.equals(this.to, faxSendRequest.to) && - Objects.equals(this.from, faxSendRequest.from) && + return Objects.equals(this.recipient, faxSendRequest.recipient) && + Objects.equals(this.sender, faxSendRequest.sender) && Objects.equals(this.files, faxSendRequest.files) && Objects.equals(this.fileUrls, faxSendRequest.fileUrls) && Objects.equals(this.testMode, faxSendRequest.testMode) && @@ -360,15 +360,15 @@ public boolean equals(Object o) { @Override public int hashCode() { - return Objects.hash(to, from, files, fileUrls, testMode, coverPageTo, coverPageFrom, coverPageMessage, title); + return Objects.hash(recipient, sender, files, fileUrls, 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(" recipient: ").append(toIndentedString(recipient)).append("\n"); + sb.append(" sender: ").append(toIndentedString(sender)).append("\n"); sb.append(" files: ").append(toIndentedString(files)).append("\n"); sb.append(" fileUrls: ").append(toIndentedString(fileUrls)).append("\n"); sb.append(" testMode: ").append(toIndentedString(testMode)).append("\n"); @@ -384,42 +384,42 @@ public Map createFormData() throws ApiException { Map map = new HashMap<>(); boolean fileTypeFound = false; try { - if (to != null) { - if (isFileTypeOrListOfFiles(to)) { + if (recipient != null) { + if (isFileTypeOrListOfFiles(recipient)) { 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)); + 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("to", JSON.getDefault().getMapper().writeValueAsString(to)); + map.put("recipient", JSON.getDefault().getMapper().writeValueAsString(recipient)); } } - if (from != null) { - if (isFileTypeOrListOfFiles(from)) { + if (sender != null) { + if (isFileTypeOrListOfFiles(sender)) { 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)); + 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("from", JSON.getDefault().getMapper().writeValueAsString(from)); + map.put("sender", JSON.getDefault().getMapper().writeValueAsString(sender)); } } if (files != null) { diff --git a/sdks/node/dist/api.js b/sdks/node/dist/api.js index a5f227ca1..ac8aa4fde 100644 --- a/sdks/node/dist/api.js +++ b/sdks/node/dist/api.js @@ -18093,7 +18093,7 @@ FaxResponse.attributeTypeMap = [ { name: "metadata", baseName: "metadata", - type: "object" + type: "{ [key: string]: any; }" }, { name: "createdAt", @@ -18142,7 +18142,7 @@ FaxResponseTransmission.attributeTypeMap = [ { name: "statusCode", baseName: "status_code", - type: "string" + type: "FaxResponseTransmission.StatusCodeEnum" }, { name: "sentAt", @@ -18150,6 +18150,19 @@ FaxResponseTransmission.attributeTypeMap = [ type: "number" } ]; +((FaxResponseTransmission2) => { + let StatusCodeEnum; + ((StatusCodeEnum2) => { + StatusCodeEnum2["Success"] = "success"; + StatusCodeEnum2["Transmitting"] = "transmitting"; + StatusCodeEnum2["ErrorCouldNotFax"] = "error_could_not_fax"; + StatusCodeEnum2["ErrorUnknown"] = "error_unknown"; + StatusCodeEnum2["ErrorBusy"] = "error_busy"; + StatusCodeEnum2["ErrorNoAnswer"] = "error_no_answer"; + StatusCodeEnum2["ErrorDisconnected"] = "error_disconnected"; + StatusCodeEnum2["ErrorBadDestination"] = "error_bad_destination"; + })(StatusCodeEnum = FaxResponseTransmission2.StatusCodeEnum || (FaxResponseTransmission2.StatusCodeEnum = {})); +})(FaxResponseTransmission || (FaxResponseTransmission = {})); // model/faxSendRequest.ts var _FaxSendRequest = class { @@ -18167,13 +18180,13 @@ var FaxSendRequest = _FaxSendRequest; FaxSendRequest.discriminator = void 0; FaxSendRequest.attributeTypeMap = [ { - name: "to", - baseName: "to", + name: "recipient", + baseName: "recipient", type: "string" }, { - name: "from", - baseName: "from", + name: "sender", + baseName: "sender", type: "string" }, { @@ -24626,6 +24639,7 @@ var enumsMap = { FaxLineAreaCodeGetProvinceEnum, FaxLineAreaCodeGetStateEnum, "FaxLineCreateRequest.CountryEnum": FaxLineCreateRequest.CountryEnum, + "FaxResponseTransmission.StatusCodeEnum": FaxResponseTransmission.StatusCodeEnum, "ReportCreateRequest.ReportTypeEnum": ReportCreateRequest.ReportTypeEnum, "ReportResponse.ReportTypeEnum": ReportResponse.ReportTypeEnum, SignatureRequestResponseCustomFieldTypeEnum, diff --git a/sdks/node/docs/api/FaxApi.md b/sdks/node/docs/api/FaxApi.md index 608a0c77b..84ccc7b39 100644 --- a/sdks/node/docs/api/FaxApi.md +++ b/sdks/node/docs/api/FaxApi.md @@ -363,8 +363,8 @@ const fileBufferAlt: DropboxSign.RequestDetailedFile = { const data: DropboxSign.FaxSendRequest = { files: [ file, fileBuffer, fileBufferAlt ], testMode: true, - to: "16690000001", - from: "16690000000", + recipient: "16690000001", + sender: "16690000000", coverPageTo: "Jill Fax", coverPageMessage: "I'm sending you a fax!", coverPageFrom: "Faxer Faxerson", @@ -416,8 +416,8 @@ const fileBufferAlt = { const data = { files: [ file, fileBuffer, fileBufferAlt ], testMode: true, - to: "16690000001", - from: "16690000000", + recipient: "16690000001", + sender: "16690000000", coverPageTo: "Jill Fax", coverPageMessage: "I'm sending you a fax!", coverPageFrom: "Faxer Faxerson", diff --git a/sdks/node/docs/model/FaxResponse.md b/sdks/node/docs/model/FaxResponse.md index d4d1ed889..9cfc5d481 100644 --- a/sdks/node/docs/model/FaxResponse.md +++ b/sdks/node/docs/model/FaxResponse.md @@ -6,15 +6,15 @@ 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```](FaxResponseTransmission.md) | Fax Transmissions List | | -| `filesUrl` | ```string``` | Fax Files URL | | +| `faxId`*_required_ | ```string``` | Fax ID | | +| `title`*_required_ | ```string``` | Fax Title | | +| `originalTitle`*_required_ | ```string``` | Fax Original Title | | +| `subject`*_required_ | ```string``` | Fax Subject | | +| `message`*_required_ | ```string``` | Fax Message | | +| `metadata`*_required_ | ```{ [key: string]: any; }``` | Fax Metadata | | +| `createdAt`*_required_ | ```number``` | Fax Created At Timestamp | | +| `from`*_required_ | ```string``` | Fax Sender Email | | +| `transmissions`*_required_ | [```Array```](FaxResponseTransmission.md) | Fax Transmissions List | | +| `filesUrl`*_required_ | ```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/FaxSendRequest.md b/sdks/node/docs/model/FaxSendRequest.md index a5f0e5fec..72ebb6fb0 100644 --- a/sdks/node/docs/model/FaxSendRequest.md +++ b/sdks/node/docs/model/FaxSendRequest.md @@ -6,8 +6,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -| `to`*_required_ | ```string``` | Fax Send To Recipient | | -| `from` | ```string``` | Fax Send From Sender (used only with fax number) | | +| `recipient`*_required_ | ```string``` | Fax Send To Recipient | | +| `sender` | ```string``` | Fax Send From Sender (used only with fax number) | | | `files` | ```Array``` | Fax File to Send | | | `fileUrls` | ```Array``` | Fax File URL to Send | | | `testMode` | ```boolean``` | API Test Mode Setting | [default to false] | diff --git a/sdks/node/model/faxResponse.ts b/sdks/node/model/faxResponse.ts index f97c6fc4f..01c6c5849 100644 --- a/sdks/node/model/faxResponse.ts +++ b/sdks/node/model/faxResponse.ts @@ -29,43 +29,43 @@ export class FaxResponse { /** * Fax ID */ - "faxId"?: string; + "faxId": string; /** * Fax Title */ - "title"?: string; + "title": string; /** * Fax Original Title */ - "originalTitle"?: string; + "originalTitle": string; /** * Fax Subject */ - "subject"?: string; + "subject": string; /** * Fax Message */ - "message"?: string; + "message": string; /** * Fax Metadata */ - "metadata"?: object; + "metadata": { [key: string]: any }; /** * Fax Created At Timestamp */ - "createdAt"?: number; + "createdAt": number; /** * Fax Sender Email */ - "from"?: string; + "from": string; /** * Fax Transmissions List */ - "transmissions"?: Array; + "transmissions": Array; /** * Fax Files URL */ - "filesUrl"?: string; + "filesUrl": string; static discriminator: string | undefined = undefined; @@ -98,7 +98,7 @@ export class FaxResponse { { name: "metadata", baseName: "metadata", - type: "object", + type: "{ [key: string]: any; }", }, { name: "createdAt", diff --git a/sdks/node/model/faxResponseTransmission.ts b/sdks/node/model/faxResponseTransmission.ts index 9247d7208..e5e1e3973 100644 --- a/sdks/node/model/faxResponseTransmission.ts +++ b/sdks/node/model/faxResponseTransmission.ts @@ -36,7 +36,7 @@ export class FaxResponseTransmission { /** * Fax Transmission Status Code */ - "statusCode"?: string; + "statusCode"?: FaxResponseTransmission.StatusCodeEnum; /** * Fax Transmission Sent Timestamp */ @@ -58,7 +58,7 @@ export class FaxResponseTransmission { { name: "statusCode", baseName: "status_code", - type: "string", + type: "FaxResponseTransmission.StatusCodeEnum", }, { name: "sentAt", @@ -76,3 +76,16 @@ export class FaxResponseTransmission { return ObjectSerializer.deserialize(data, "FaxResponseTransmission"); } } + +export namespace FaxResponseTransmission { + export enum StatusCodeEnum { + Success = "success", + Transmitting = "transmitting", + ErrorCouldNotFax = "error_could_not_fax", + ErrorUnknown = "error_unknown", + ErrorBusy = "error_busy", + ErrorNoAnswer = "error_no_answer", + ErrorDisconnected = "error_disconnected", + ErrorBadDestination = "error_bad_destination", + } +} diff --git a/sdks/node/model/faxSendRequest.ts b/sdks/node/model/faxSendRequest.ts index 0cafc2f47..11ee71ef4 100644 --- a/sdks/node/model/faxSendRequest.ts +++ b/sdks/node/model/faxSendRequest.ts @@ -28,11 +28,11 @@ export class FaxSendRequest { /** * Fax Send To Recipient */ - "to": string; + "recipient": string; /** * Fax Send From Sender (used only with fax number) */ - "from"?: string; + "sender"?: string; /** * Fax File to Send */ @@ -66,13 +66,13 @@ export class FaxSendRequest { static attributeTypeMap: AttributeTypeMap = [ { - name: "to", - baseName: "to", + name: "recipient", + baseName: "recipient", type: "string", }, { - name: "from", - baseName: "from", + name: "sender", + baseName: "sender", type: "string", }, { diff --git a/sdks/node/model/index.ts b/sdks/node/model/index.ts index b61b497b5..7813c02fc 100644 --- a/sdks/node/model/index.ts +++ b/sdks/node/model/index.ts @@ -208,6 +208,8 @@ export let enumsMap: { [index: string]: any } = { FaxLineAreaCodeGetProvinceEnum: FaxLineAreaCodeGetProvinceEnum, FaxLineAreaCodeGetStateEnum: FaxLineAreaCodeGetStateEnum, "FaxLineCreateRequest.CountryEnum": FaxLineCreateRequest.CountryEnum, + "FaxResponseTransmission.StatusCodeEnum": + FaxResponseTransmission.StatusCodeEnum, "ReportCreateRequest.ReportTypeEnum": ReportCreateRequest.ReportTypeEnum, "ReportResponse.ReportTypeEnum": ReportResponse.ReportTypeEnum, SignatureRequestResponseCustomFieldTypeEnum: diff --git a/sdks/node/types/model/faxResponse.d.ts b/sdks/node/types/model/faxResponse.d.ts index c4542ff6b..826153a45 100644 --- a/sdks/node/types/model/faxResponse.d.ts +++ b/sdks/node/types/model/faxResponse.d.ts @@ -1,16 +1,18 @@ import { AttributeTypeMap } from "./"; import { FaxResponseTransmission } from "./faxResponseTransmission"; export declare class FaxResponse { - "faxId"?: string; - "title"?: string; - "originalTitle"?: string; - "subject"?: string; - "message"?: string; - "metadata"?: object; - "createdAt"?: number; - "from"?: string; - "transmissions"?: Array; - "filesUrl"?: string; + "faxId": string; + "title": string; + "originalTitle": string; + "subject": string; + "message": string; + "metadata": { + [key: string]: any; + }; + "createdAt": number; + "from": string; + "transmissions": Array; + "filesUrl": string; static discriminator: string | undefined; static attributeTypeMap: AttributeTypeMap; static getAttributeTypeMap(): AttributeTypeMap; diff --git a/sdks/node/types/model/faxResponseTransmission.d.ts b/sdks/node/types/model/faxResponseTransmission.d.ts index 2c29f3588..b5f150482 100644 --- a/sdks/node/types/model/faxResponseTransmission.d.ts +++ b/sdks/node/types/model/faxResponseTransmission.d.ts @@ -2,10 +2,22 @@ import { AttributeTypeMap } from "./"; export declare class FaxResponseTransmission { "recipient"?: string; "sender"?: string; - "statusCode"?: string; + "statusCode"?: FaxResponseTransmission.StatusCodeEnum; "sentAt"?: number; static discriminator: string | undefined; static attributeTypeMap: AttributeTypeMap; static getAttributeTypeMap(): AttributeTypeMap; static init(data: any): FaxResponseTransmission; } +export declare namespace FaxResponseTransmission { + enum StatusCodeEnum { + Success = "success", + Transmitting = "transmitting", + ErrorCouldNotFax = "error_could_not_fax", + ErrorUnknown = "error_unknown", + ErrorBusy = "error_busy", + ErrorNoAnswer = "error_no_answer", + ErrorDisconnected = "error_disconnected", + ErrorBadDestination = "error_bad_destination" + } +} diff --git a/sdks/node/types/model/faxSendRequest.d.ts b/sdks/node/types/model/faxSendRequest.d.ts index 24035d908..95454724e 100644 --- a/sdks/node/types/model/faxSendRequest.d.ts +++ b/sdks/node/types/model/faxSendRequest.d.ts @@ -1,7 +1,7 @@ import { AttributeTypeMap, RequestFile } from "./"; export declare class FaxSendRequest { - "to": string; - "from"?: string; + "recipient": string; + "sender"?: string; "files"?: Array; "fileUrls"?: Array; "testMode"?: boolean; diff --git a/sdks/php/docs/Api/FaxApi.md b/sdks/php/docs/Api/FaxApi.md index 0e02679ea..8b68458c6 100644 --- a/sdks/php/docs/Api/FaxApi.md +++ b/sdks/php/docs/Api/FaxApi.md @@ -272,8 +272,8 @@ $faxApi = new Dropbox\Sign\Api\FaxApi($config); $data = new Dropbox\Sign\Model\FaxSendRequest(); $data->setFiles([new SplFileObject(__DIR__ . "/example_signature_request.pdf")]) ->setTestMode(true) - ->setTo("16690000001") - ->setFrom("16690000000") + ->setRecipient("16690000001") + ->setSender("16690000000") ->setCoverPageTo("Jill Fax") ->setCoverPageMessage("I'm sending you a fax!") ->setCoverPageFrom("Faxer Faxerson") diff --git a/sdks/php/docs/Model/FaxResponse.md b/sdks/php/docs/Model/FaxResponse.md index cf0275cd1..6f6becf5c 100644 --- a/sdks/php/docs/Model/FaxResponse.md +++ b/sdks/php/docs/Model/FaxResponse.md @@ -6,15 +6,15 @@ 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\FaxResponseTransmission[]```](FaxResponseTransmission.md) | Fax Transmissions List | | -| `files_url` | ```string``` | Fax Files URL | | +| `fax_id`*_required_ | ```string``` | Fax ID | | +| `title`*_required_ | ```string``` | Fax Title | | +| `original_title`*_required_ | ```string``` | Fax Original Title | | +| `subject`*_required_ | ```string``` | Fax Subject | | +| `message`*_required_ | ```string``` | Fax Message | | +| `metadata`*_required_ | ```array``` | Fax Metadata | | +| `created_at`*_required_ | ```int``` | Fax Created At Timestamp | | +| `from`*_required_ | ```string``` | Fax Sender Email | | +| `transmissions`*_required_ | [```\Dropbox\Sign\Model\FaxResponseTransmission[]```](FaxResponseTransmission.md) | Fax Transmissions List | | +| `files_url`*_required_ | ```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/FaxSendRequest.md b/sdks/php/docs/Model/FaxSendRequest.md index 762a7eba3..dcbf730c4 100644 --- a/sdks/php/docs/Model/FaxSendRequest.md +++ b/sdks/php/docs/Model/FaxSendRequest.md @@ -6,8 +6,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -| `to`*_required_ | ```string``` | Fax Send To Recipient | | -| `from` | ```string``` | Fax Send From Sender (used only with fax number) | | +| `recipient`*_required_ | ```string``` | Fax Send To Recipient | | +| `sender` | ```string``` | Fax Send From Sender (used only with fax number) | | | `files` | ```\SplFileObject[]``` | Fax File to Send | | | `file_urls` | ```string[]``` | Fax File URL to Send | | | `test_mode` | ```bool``` | API Test Mode Setting | [default to false] | diff --git a/sdks/php/src/Model/FaxResponse.php b/sdks/php/src/Model/FaxResponse.php index 9cec78a71..b539a3a28 100644 --- a/sdks/php/src/Model/FaxResponse.php +++ b/sdks/php/src/Model/FaxResponse.php @@ -62,7 +62,7 @@ class FaxResponse implements ModelInterface, ArrayAccess, JsonSerializable 'original_title' => 'string', 'subject' => 'string', 'message' => 'string', - 'metadata' => 'array', + 'metadata' => 'array', 'created_at' => 'int', 'from' => 'string', 'transmissions' => '\Dropbox\Sign\Model\FaxResponseTransmission[]', @@ -344,7 +344,39 @@ private function setIfExists(string $variableName, array $fields, $defaultValue) */ public function listInvalidProperties() { - return []; + $invalidProperties = []; + + if ($this->container['fax_id'] === null) { + $invalidProperties[] = "'fax_id' can't be null"; + } + if ($this->container['title'] === null) { + $invalidProperties[] = "'title' can't be null"; + } + if ($this->container['original_title'] === null) { + $invalidProperties[] = "'original_title' can't be null"; + } + if ($this->container['subject'] === null) { + $invalidProperties[] = "'subject' can't be null"; + } + if ($this->container['message'] === null) { + $invalidProperties[] = "'message' can't be null"; + } + if ($this->container['metadata'] === null) { + $invalidProperties[] = "'metadata' can't be null"; + } + if ($this->container['created_at'] === null) { + $invalidProperties[] = "'created_at' can't be null"; + } + if ($this->container['from'] === null) { + $invalidProperties[] = "'from' can't be null"; + } + if ($this->container['transmissions'] === null) { + $invalidProperties[] = "'transmissions' can't be null"; + } + if ($this->container['files_url'] === null) { + $invalidProperties[] = "'files_url' can't be null"; + } + return $invalidProperties; } /** @@ -361,7 +393,7 @@ public function valid() /** * Gets fax_id * - * @return string|null + * @return string */ public function getFaxId() { @@ -371,11 +403,11 @@ public function getFaxId() /** * Sets fax_id * - * @param string|null $fax_id Fax ID + * @param string $fax_id Fax ID * * @return self */ - public function setFaxId(?string $fax_id) + public function setFaxId(string $fax_id) { if (is_null($fax_id)) { throw new InvalidArgumentException('non-nullable fax_id cannot be null'); @@ -388,7 +420,7 @@ public function setFaxId(?string $fax_id) /** * Gets title * - * @return string|null + * @return string */ public function getTitle() { @@ -398,11 +430,11 @@ public function getTitle() /** * Sets title * - * @param string|null $title Fax Title + * @param string $title Fax Title * * @return self */ - public function setTitle(?string $title) + public function setTitle(string $title) { if (is_null($title)) { throw new InvalidArgumentException('non-nullable title cannot be null'); @@ -415,7 +447,7 @@ public function setTitle(?string $title) /** * Gets original_title * - * @return string|null + * @return string */ public function getOriginalTitle() { @@ -425,11 +457,11 @@ public function getOriginalTitle() /** * Sets original_title * - * @param string|null $original_title Fax Original Title + * @param string $original_title Fax Original Title * * @return self */ - public function setOriginalTitle(?string $original_title) + public function setOriginalTitle(string $original_title) { if (is_null($original_title)) { throw new InvalidArgumentException('non-nullable original_title cannot be null'); @@ -442,7 +474,7 @@ public function setOriginalTitle(?string $original_title) /** * Gets subject * - * @return string|null + * @return string */ public function getSubject() { @@ -452,11 +484,11 @@ public function getSubject() /** * Sets subject * - * @param string|null $subject Fax Subject + * @param string $subject Fax Subject * * @return self */ - public function setSubject(?string $subject) + public function setSubject(string $subject) { if (is_null($subject)) { throw new InvalidArgumentException('non-nullable subject cannot be null'); @@ -469,7 +501,7 @@ public function setSubject(?string $subject) /** * Gets message * - * @return string|null + * @return string */ public function getMessage() { @@ -479,11 +511,11 @@ public function getMessage() /** * Sets message * - * @param string|null $message Fax Message + * @param string $message Fax Message * * @return self */ - public function setMessage(?string $message) + public function setMessage(string $message) { if (is_null($message)) { throw new InvalidArgumentException('non-nullable message cannot be null'); @@ -496,7 +528,7 @@ public function setMessage(?string $message) /** * Gets metadata * - * @return array|null + * @return array */ public function getMetadata() { @@ -506,11 +538,11 @@ public function getMetadata() /** * Sets metadata * - * @param array|null $metadata Fax Metadata + * @param array $metadata Fax Metadata * * @return self */ - public function setMetadata(?array $metadata) + public function setMetadata(array $metadata) { if (is_null($metadata)) { throw new InvalidArgumentException('non-nullable metadata cannot be null'); @@ -523,7 +555,7 @@ public function setMetadata(?array $metadata) /** * Gets created_at * - * @return int|null + * @return int */ public function getCreatedAt() { @@ -533,11 +565,11 @@ public function getCreatedAt() /** * Sets created_at * - * @param int|null $created_at Fax Created At Timestamp + * @param int $created_at Fax Created At Timestamp * * @return self */ - public function setCreatedAt(?int $created_at) + public function setCreatedAt(int $created_at) { if (is_null($created_at)) { throw new InvalidArgumentException('non-nullable created_at cannot be null'); @@ -550,7 +582,7 @@ public function setCreatedAt(?int $created_at) /** * Gets from * - * @return string|null + * @return string */ public function getFrom() { @@ -560,11 +592,11 @@ public function getFrom() /** * Sets from * - * @param string|null $from Fax Sender Email + * @param string $from Fax Sender Email * * @return self */ - public function setFrom(?string $from) + public function setFrom(string $from) { if (is_null($from)) { throw new InvalidArgumentException('non-nullable from cannot be null'); @@ -577,7 +609,7 @@ public function setFrom(?string $from) /** * Gets transmissions * - * @return FaxResponseTransmission[]|null + * @return FaxResponseTransmission[] */ public function getTransmissions() { @@ -587,11 +619,11 @@ public function getTransmissions() /** * Sets transmissions * - * @param FaxResponseTransmission[]|null $transmissions Fax Transmissions List + * @param FaxResponseTransmission[] $transmissions Fax Transmissions List * * @return self */ - public function setTransmissions(?array $transmissions) + public function setTransmissions(array $transmissions) { if (is_null($transmissions)) { throw new InvalidArgumentException('non-nullable transmissions cannot be null'); @@ -604,7 +636,7 @@ public function setTransmissions(?array $transmissions) /** * Gets files_url * - * @return string|null + * @return string */ public function getFilesUrl() { @@ -614,11 +646,11 @@ public function getFilesUrl() /** * Sets files_url * - * @param string|null $files_url Fax Files URL + * @param string $files_url Fax Files URL * * @return self */ - public function setFilesUrl(?string $files_url) + public function setFilesUrl(string $files_url) { if (is_null($files_url)) { throw new InvalidArgumentException('non-nullable files_url cannot be null'); diff --git a/sdks/php/src/Model/FaxResponseTransmission.php b/sdks/php/src/Model/FaxResponseTransmission.php index f55d0d658..ff2dc7471 100644 --- a/sdks/php/src/Model/FaxResponseTransmission.php +++ b/sdks/php/src/Model/FaxResponseTransmission.php @@ -238,6 +238,34 @@ public function getModelName() return self::$openAPIModelName; } + public const STATUS_CODE_SUCCESS = 'success'; + public const STATUS_CODE_TRANSMITTING = 'transmitting'; + public const STATUS_CODE_ERROR_COULD_NOT_FAX = 'error_could_not_fax'; + public const STATUS_CODE_ERROR_UNKNOWN = 'error_unknown'; + public const STATUS_CODE_ERROR_BUSY = 'error_busy'; + public const STATUS_CODE_ERROR_NO_ANSWER = 'error_no_answer'; + public const STATUS_CODE_ERROR_DISCONNECTED = 'error_disconnected'; + public const STATUS_CODE_ERROR_BAD_DESTINATION = 'error_bad_destination'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getStatusCodeAllowableValues() + { + return [ + self::STATUS_CODE_SUCCESS, + self::STATUS_CODE_TRANSMITTING, + self::STATUS_CODE_ERROR_COULD_NOT_FAX, + self::STATUS_CODE_ERROR_UNKNOWN, + self::STATUS_CODE_ERROR_BUSY, + self::STATUS_CODE_ERROR_NO_ANSWER, + self::STATUS_CODE_ERROR_DISCONNECTED, + self::STATUS_CODE_ERROR_BAD_DESTINATION, + ]; + } + /** * Associative array for storing property values * @@ -302,7 +330,18 @@ private function setIfExists(string $variableName, array $fields, $defaultValue) */ public function listInvalidProperties() { - return []; + $invalidProperties = []; + + $allowedValues = $this->getStatusCodeAllowableValues(); + if (!is_null($this->container['status_code']) && !in_array($this->container['status_code'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'status_code', must be one of '%s'", + $this->container['status_code'], + implode("', '", $allowedValues) + ); + } + + return $invalidProperties; } /** @@ -392,6 +431,16 @@ public function setStatusCode(?string $status_code) if (is_null($status_code)) { throw new InvalidArgumentException('non-nullable status_code cannot be null'); } + $allowedValues = $this->getStatusCodeAllowableValues(); + if (!in_array($status_code, $allowedValues, true)) { + throw new InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'status_code', must be one of '%s'", + $status_code, + implode("', '", $allowedValues) + ) + ); + } $this->container['status_code'] = $status_code; return $this; diff --git a/sdks/php/src/Model/FaxSendRequest.php b/sdks/php/src/Model/FaxSendRequest.php index 33d206b0f..d09573478 100644 --- a/sdks/php/src/Model/FaxSendRequest.php +++ b/sdks/php/src/Model/FaxSendRequest.php @@ -58,8 +58,8 @@ class FaxSendRequest implements ModelInterface, ArrayAccess, JsonSerializable * @var string[] */ protected static $openAPITypes = [ - 'to' => 'string', - 'from' => 'string', + 'recipient' => 'string', + 'sender' => 'string', 'files' => '\SplFileObject[]', 'file_urls' => 'string[]', 'test_mode' => 'bool', @@ -77,8 +77,8 @@ class FaxSendRequest implements ModelInterface, ArrayAccess, JsonSerializable * @psalm-var array */ protected static $openAPIFormats = [ - 'to' => null, - 'from' => null, + 'recipient' => null, + 'sender' => null, 'files' => 'binary', 'file_urls' => null, 'test_mode' => null, @@ -94,8 +94,8 @@ class FaxSendRequest implements ModelInterface, ArrayAccess, JsonSerializable * @var bool[] */ protected static array $openAPINullables = [ - 'to' => false, - 'from' => false, + 'recipient' => false, + 'sender' => false, 'files' => false, 'file_urls' => false, 'test_mode' => false, @@ -183,8 +183,8 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $attributeMap = [ - 'to' => 'to', - 'from' => 'from', + 'recipient' => 'recipient', + 'sender' => 'sender', 'files' => 'files', 'file_urls' => 'file_urls', 'test_mode' => 'test_mode', @@ -200,8 +200,8 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $setters = [ - 'to' => 'setTo', - 'from' => 'setFrom', + 'recipient' => 'setRecipient', + 'sender' => 'setSender', 'files' => 'setFiles', 'file_urls' => 'setFileUrls', 'test_mode' => 'setTestMode', @@ -217,8 +217,8 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $getters = [ - 'to' => 'getTo', - 'from' => 'getFrom', + 'recipient' => 'getRecipient', + 'sender' => 'getSender', 'files' => 'getFiles', 'file_urls' => 'getFileUrls', 'test_mode' => 'getTestMode', @@ -284,8 +284,8 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->setIfExists('to', $data ?? [], null); - $this->setIfExists('from', $data ?? [], null); + $this->setIfExists('recipient', $data ?? [], null); + $this->setIfExists('sender', $data ?? [], null); $this->setIfExists('files', $data ?? [], null); $this->setIfExists('file_urls', $data ?? [], null); $this->setIfExists('test_mode', $data ?? [], false); @@ -340,8 +340,8 @@ public function listInvalidProperties() { $invalidProperties = []; - if ($this->container['to'] === null) { - $invalidProperties[] = "'to' can't be null"; + if ($this->container['recipient'] === null) { + $invalidProperties[] = "'recipient' can't be null"; } return $invalidProperties; } @@ -358,55 +358,55 @@ public function valid() } /** - * Gets to + * Gets recipient * * @return string */ - public function getTo() + public function getRecipient() { - return $this->container['to']; + return $this->container['recipient']; } /** - * Sets to + * Sets recipient * - * @param string $to Fax Send To Recipient + * @param string $recipient Fax Send To Recipient * * @return self */ - public function setTo(string $to) + public function setRecipient(string $recipient) { - if (is_null($to)) { - throw new InvalidArgumentException('non-nullable to cannot be null'); + if (is_null($recipient)) { + throw new InvalidArgumentException('non-nullable recipient cannot be null'); } - $this->container['to'] = $to; + $this->container['recipient'] = $recipient; return $this; } /** - * Gets from + * Gets sender * * @return string|null */ - public function getFrom() + public function getSender() { - return $this->container['from']; + return $this->container['sender']; } /** - * Sets from + * Sets sender * - * @param string|null $from Fax Send From Sender (used only with fax number) + * @param string|null $sender Fax Send From Sender (used only with fax number) * * @return self */ - public function setFrom(?string $from) + public function setSender(?string $sender) { - if (is_null($from)) { - throw new InvalidArgumentException('non-nullable from cannot be null'); + if (is_null($sender)) { + throw new InvalidArgumentException('non-nullable sender cannot be null'); } - $this->container['from'] = $from; + $this->container['sender'] = $sender; return $this; } diff --git a/sdks/python/docs/FaxApi.md b/sdks/python/docs/FaxApi.md index 1b4130ed4..a0b2cbd12 100644 --- a/sdks/python/docs/FaxApi.md +++ b/sdks/python/docs/FaxApi.md @@ -288,7 +288,8 @@ with ApiClient(configuration) as api_client: data = models.FaxSendRequest( files=[open("example_signature_request.pdf", "rb")], test_mode=True, - to="16690000001", + recipient="16690000001", + sender="16690000000", cover_page_to="Jill Fax", cover_page_message="I'm sending you a fax!", cover_page_from="Faxer Faxerson", diff --git a/sdks/python/docs/FaxResponse.md b/sdks/python/docs/FaxResponse.md index b3a292e67..609963029 100644 --- a/sdks/python/docs/FaxResponse.md +++ b/sdks/python/docs/FaxResponse.md @@ -5,16 +5,16 @@ ## 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[FaxResponseTransmission]```](FaxResponseTransmission.md) | Fax Transmissions List | | -| `files_url` | ```str``` | Fax Files URL | | +| `fax_id`*_required_ | ```str``` | Fax ID | | +| `title`*_required_ | ```str``` | Fax Title | | +| `original_title`*_required_ | ```str``` | Fax Original Title | | +| `subject`*_required_ | ```str``` | Fax Subject | | +| `message`*_required_ | ```str``` | Fax Message | | +| `metadata`*_required_ | ```Dict[str, object]``` | Fax Metadata | | +| `created_at`*_required_ | ```int``` | Fax Created At Timestamp | | +| `var_from`*_required_ | ```str``` | Fax Sender Email | | +| `transmissions`*_required_ | [```List[FaxResponseTransmission]```](FaxResponseTransmission.md) | Fax Transmissions List | | +| `files_url`*_required_ | ```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/FaxSendRequest.md b/sdks/python/docs/FaxSendRequest.md index 3e7b18eb9..cdb4f49a0 100644 --- a/sdks/python/docs/FaxSendRequest.md +++ b/sdks/python/docs/FaxSendRequest.md @@ -5,8 +5,8 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -| `to`*_required_ | ```str``` | Fax Send To Recipient | | -| `var_from` | ```str``` | Fax Send From Sender (used only with fax number) | | +| `recipient`*_required_ | ```str``` | Fax Send To Recipient | | +| `sender` | ```str``` | Fax Send From Sender (used only with fax number) | | | `files` | ```List[io.IOBase]``` | Fax File to Send | | | `file_urls` | ```List[str]``` | Fax File URL to Send | | | `test_mode` | ```bool``` | API Test Mode Setting | [default to False] | diff --git a/sdks/python/dropbox_sign/models/fax_response.py b/sdks/python/dropbox_sign/models/fax_response.py index 05934c810..0232317eb 100644 --- a/sdks/python/dropbox_sign/models/fax_response.py +++ b/sdks/python/dropbox_sign/models/fax_response.py @@ -19,7 +19,7 @@ import json from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr -from typing import Any, ClassVar, Dict, List, Optional +from typing import Any, ClassVar, Dict, List from dropbox_sign.models.fax_response_transmission import FaxResponseTransmission from typing import Optional, Set, Tuple from typing_extensions import Self @@ -33,24 +33,18 @@ class FaxResponse(BaseModel): FaxResponse """ # 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" + fax_id: StrictStr = Field(description="Fax ID") + title: StrictStr = Field(description="Fax Title") + original_title: StrictStr = Field(description="Fax Original Title") + subject: StrictStr = Field(description="Fax Subject") + message: StrictStr = Field(description="Fax Message") + metadata: Dict[str, Any] = Field(description="Fax Metadata") + created_at: StrictInt = Field(description="Fax Created At Timestamp") + var_from: StrictStr = Field(description="Fax Sender Email", alias="from") + transmissions: List[FaxResponseTransmission] = Field( + description="Fax Transmissions List" ) - 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[FaxResponseTransmission]] = Field( - default=None, description="Fax Transmissions List" - ) - files_url: Optional[StrictStr] = Field(default=None, description="Fax Files URL") + files_url: StrictStr = Field(description="Fax Files URL") __properties: ClassVar[List[str]] = [ "fax_id", "title", @@ -173,7 +167,7 @@ def openapi_types(cls) -> Dict[str, str]: "original_title": "(str,)", "subject": "(str,)", "message": "(str,)", - "metadata": "(object,)", + "metadata": "(Dict[str, object],)", "created_at": "(int,)", "var_from": "(str,)", "transmissions": "(List[FaxResponseTransmission],)", diff --git a/sdks/python/dropbox_sign/models/fax_response_transmission.py b/sdks/python/dropbox_sign/models/fax_response_transmission.py index 34a1088b1..34e6f1fc7 100644 --- a/sdks/python/dropbox_sign/models/fax_response_transmission.py +++ b/sdks/python/dropbox_sign/models/fax_response_transmission.py @@ -18,7 +18,7 @@ import re # noqa: F401 import json -from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr +from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr, field_validator from typing import Any, ClassVar, Dict, List, Optional from typing import Optional, Set, Tuple from typing_extensions import Self @@ -51,6 +51,29 @@ class FaxResponseTransmission(BaseModel): "sent_at", ] + @field_validator("status_code") + def status_code_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set( + [ + "success", + "transmitting", + "error_could_not_fax", + "error_unknown", + "error_busy", + "error_no_answer", + "error_disconnected", + "error_bad_destination", + ] + ): + raise ValueError( + "must be one of enum values ('success', 'transmitting', 'error_could_not_fax', 'error_unknown', 'error_busy', 'error_no_answer', 'error_disconnected', 'error_bad_destination')" + ) + return value + model_config = ConfigDict( populate_by_name=True, validate_assignment=True, diff --git a/sdks/python/dropbox_sign/models/fax_send_request.py b/sdks/python/dropbox_sign/models/fax_send_request.py index 97b01ab62..9fe6c54a3 100644 --- a/sdks/python/dropbox_sign/models/fax_send_request.py +++ b/sdks/python/dropbox_sign/models/fax_send_request.py @@ -32,11 +32,9 @@ class FaxSendRequest(BaseModel): FaxSendRequest """ # noqa: E501 - to: StrictStr = Field(description="Fax Send To Recipient") - var_from: Optional[StrictStr] = Field( - default=None, - description="Fax Send From Sender (used only with fax number)", - alias="from", + recipient: StrictStr = Field(description="Fax Send To Recipient") + sender: Optional[StrictStr] = Field( + default=None, description="Fax Send From Sender (used only with fax number)" ) files: Optional[List[Union[StrictBytes, StrictStr, io.IOBase]]] = Field( default=None, description="Fax File to Send" @@ -58,8 +56,8 @@ class FaxSendRequest(BaseModel): ) title: Optional[StrictStr] = Field(default=None, description="Fax Title") __properties: ClassVar[List[str]] = [ - "to", - "from", + "recipient", + "sender", "files", "file_urls", "test_mode", @@ -132,8 +130,8 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: _obj = cls.model_validate( { - "to": obj.get("to"), - "from": obj.get("from"), + "recipient": obj.get("recipient"), + "sender": obj.get("sender"), "files": obj.get("files"), "file_urls": obj.get("file_urls"), "test_mode": ( @@ -160,8 +158,8 @@ def init(cls, data: Any) -> Self: @classmethod def openapi_types(cls) -> Dict[str, str]: return { - "to": "(str,)", - "var_from": "(str,)", + "recipient": "(str,)", + "sender": "(str,)", "files": "(List[io.IOBase],)", "file_urls": "(List[str],)", "test_mode": "(bool,)", diff --git a/sdks/ruby/docs/FaxApi.md b/sdks/ruby/docs/FaxApi.md index 5eeed37d3..23129b6d7 100644 --- a/sdks/ruby/docs/FaxApi.md +++ b/sdks/ruby/docs/FaxApi.md @@ -309,8 +309,8 @@ fax_api = Dropbox::Sign::FaxApi.new data = Dropbox::Sign::FaxSendRequest.new data.files = [File.new("example_signature_request.pdf", "r")] data.test_mode = true -data.to = "16690000001" -data.from = "16690000000" +data.recipient = "16690000001" +data.sender = "16690000000" data.cover_page_to = "Jill Fax" data.cover_page_message = "I'm sending you a fax!" data.cover_page_from = "Faxer Faxerson" diff --git a/sdks/ruby/docs/FaxResponse.md b/sdks/ruby/docs/FaxResponse.md index 63627c8c4..970494f56 100644 --- a/sdks/ruby/docs/FaxResponse.md +++ b/sdks/ruby/docs/FaxResponse.md @@ -6,14 +6,14 @@ | 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```](FaxResponseTransmission.md) | Fax Transmissions List | | -| `files_url` | ```String``` | Fax Files URL | | +| `fax_id`*_required_ | ```String``` | Fax ID | | +| `title`*_required_ | ```String``` | Fax Title | | +| `original_title`*_required_ | ```String``` | Fax Original Title | | +| `subject`*_required_ | ```String``` | Fax Subject | | +| `message`*_required_ | ```String``` | Fax Message | | +| `metadata`*_required_ | ```Hash``` | Fax Metadata | | +| `created_at`*_required_ | ```Integer``` | Fax Created At Timestamp | | +| `from`*_required_ | ```String``` | Fax Sender Email | | +| `transmissions`*_required_ | [```Array```](FaxResponseTransmission.md) | Fax Transmissions List | | +| `files_url`*_required_ | ```String``` | Fax Files URL | | diff --git a/sdks/ruby/docs/FaxSendRequest.md b/sdks/ruby/docs/FaxSendRequest.md index 84896dda8..6217af9f6 100644 --- a/sdks/ruby/docs/FaxSendRequest.md +++ b/sdks/ruby/docs/FaxSendRequest.md @@ -6,8 +6,8 @@ | Name | Type | Description | Notes | | ---- | ---- | ----------- | ----- | -| `to`*_required_ | ```String``` | Fax Send To Recipient | | -| `from` | ```String``` | Fax Send From Sender (used only with fax number) | | +| `recipient`*_required_ | ```String``` | Fax Send To Recipient | | +| `sender` | ```String``` | Fax Send From Sender (used only with fax number) | | | `files` | ```Array``` | Fax File to Send | | | `file_urls` | ```Array``` | Fax File URL to Send | | | `test_mode` | ```Boolean``` | API Test Mode Setting | [default to false] | diff --git a/sdks/ruby/lib/dropbox-sign/models/fax_response.rb b/sdks/ruby/lib/dropbox-sign/models/fax_response.rb index c4070e076..fdc1187bd 100644 --- a/sdks/ruby/lib/dropbox-sign/models/fax_response.rb +++ b/sdks/ruby/lib/dropbox-sign/models/fax_response.rb @@ -39,7 +39,7 @@ class FaxResponse attr_accessor :message # Fax Metadata - # @return [Object] + # @return [Hash] attr_accessor :metadata # Fax Created At Timestamp @@ -87,7 +87,7 @@ def self.openapi_types :'original_title' => :'String', :'subject' => :'String', :'message' => :'String', - :'metadata' => :'Object', + :'metadata' => :'Hash', :'created_at' => :'Integer', :'from' => :'String', :'transmissions' => :'Array', @@ -162,7 +162,9 @@ def initialize(attributes = {}) end if attributes.key?(:'metadata') - self.metadata = attributes[:'metadata'] + if (value = attributes[:'metadata']).is_a?(Hash) + self.metadata = value + end end if attributes.key?(:'created_at') @@ -188,12 +190,62 @@ def initialize(attributes = {}) # @return Array for valid properties with the reasons def list_invalid_properties invalid_properties = Array.new + if @fax_id.nil? + invalid_properties.push('invalid value for "fax_id", fax_id cannot be nil.') + end + + if @title.nil? + invalid_properties.push('invalid value for "title", title cannot be nil.') + end + + if @original_title.nil? + invalid_properties.push('invalid value for "original_title", original_title cannot be nil.') + end + + if @subject.nil? + invalid_properties.push('invalid value for "subject", subject cannot be nil.') + end + + if @message.nil? + invalid_properties.push('invalid value for "message", message cannot be nil.') + end + + if @metadata.nil? + invalid_properties.push('invalid value for "metadata", metadata cannot be nil.') + end + + if @created_at.nil? + invalid_properties.push('invalid value for "created_at", created_at cannot be nil.') + end + + if @from.nil? + invalid_properties.push('invalid value for "from", from cannot be nil.') + end + + if @transmissions.nil? + invalid_properties.push('invalid value for "transmissions", transmissions cannot be nil.') + end + + if @files_url.nil? + invalid_properties.push('invalid value for "files_url", files_url cannot be nil.') + end + invalid_properties end # Check to see if the all the properties in the model are valid # @return true if the model is valid def valid? + return false if @fax_id.nil? + return false if @title.nil? + return false if @original_title.nil? + return false if @subject.nil? + return false if @message.nil? + return false if @metadata.nil? + return false if @created_at.nil? + return false if @from.nil? + return false if @transmissions.nil? + return false if @files_url.nil? true end diff --git a/sdks/ruby/lib/dropbox-sign/models/fax_response_transmission.rb b/sdks/ruby/lib/dropbox-sign/models/fax_response_transmission.rb index 98b6f77d3..c680dbb6d 100644 --- a/sdks/ruby/lib/dropbox-sign/models/fax_response_transmission.rb +++ b/sdks/ruby/lib/dropbox-sign/models/fax_response_transmission.rb @@ -34,6 +34,28 @@ class FaxResponseTransmission # @return [Integer] attr_accessor :sent_at + class EnumAttributeValidator + attr_reader :datatype + attr_reader :allowable_values + + def initialize(datatype, allowable_values) + @allowable_values = allowable_values.map do |value| + case datatype.to_s + when /Integer/i + value.to_i + when /Float/i + value.to_f + else + value + end + end + end + + def valid?(value) + !value || allowable_values.include?(value) + end + end + # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { @@ -132,9 +154,21 @@ def list_invalid_properties # Check to see if the all the properties in the model are valid # @return true if the model is valid def valid? + status_code_validator = EnumAttributeValidator.new('String', ["success", "transmitting", "error_could_not_fax", "error_unknown", "error_busy", "error_no_answer", "error_disconnected", "error_bad_destination"]) + return false unless status_code_validator.valid?(@status_code) true end + # Custom attribute writer method checking allowed values (enum). + # @param [Object] status_code Object to be assigned + def status_code=(status_code) + validator = EnumAttributeValidator.new('String', ["success", "transmitting", "error_could_not_fax", "error_unknown", "error_busy", "error_no_answer", "error_disconnected", "error_bad_destination"]) + unless validator.valid?(status_code) + fail ArgumentError, "invalid value for \"status_code\", must be one of #{validator.allowable_values}." + end + @status_code = status_code + end + # Checks equality by comparing each attribute. # @param [Object] Object to be compared def ==(o) diff --git a/sdks/ruby/lib/dropbox-sign/models/fax_send_request.rb b/sdks/ruby/lib/dropbox-sign/models/fax_send_request.rb index 1a4393330..18616cee1 100644 --- a/sdks/ruby/lib/dropbox-sign/models/fax_send_request.rb +++ b/sdks/ruby/lib/dropbox-sign/models/fax_send_request.rb @@ -20,11 +20,11 @@ module Dropbox::Sign class FaxSendRequest # Fax Send To Recipient # @return [String] - attr_accessor :to + attr_accessor :recipient # Fax Send From Sender (used only with fax number) # @return [String] - attr_accessor :from + attr_accessor :sender # Fax File to Send # @return [Array] @@ -57,8 +57,8 @@ class FaxSendRequest # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { - :'to' => :'to', - :'from' => :'from', + :'recipient' => :'recipient', + :'sender' => :'sender', :'files' => :'files', :'file_urls' => :'file_urls', :'test_mode' => :'test_mode', @@ -77,8 +77,8 @@ def self.acceptable_attributes # Attribute type mapping. def self.openapi_types { - :'to' => :'String', - :'from' => :'String', + :'recipient' => :'String', + :'sender' => :'String', :'files' => :'Array', :'file_urls' => :'Array', :'test_mode' => :'Boolean', @@ -135,12 +135,12 @@ def initialize(attributes = {}) h[k.to_sym] = v } - if attributes.key?(:'to') - self.to = attributes[:'to'] + if attributes.key?(:'recipient') + self.recipient = attributes[:'recipient'] end - if attributes.key?(:'from') - self.from = attributes[:'from'] + if attributes.key?(:'sender') + self.sender = attributes[:'sender'] end if attributes.key?(:'files') @@ -182,8 +182,8 @@ def initialize(attributes = {}) # @return Array for valid properties with the reasons def list_invalid_properties invalid_properties = Array.new - if @to.nil? - invalid_properties.push('invalid value for "to", to cannot be nil.') + if @recipient.nil? + invalid_properties.push('invalid value for "recipient", recipient cannot be nil.') end invalid_properties @@ -192,7 +192,7 @@ def list_invalid_properties # Check to see if the all the properties in the model are valid # @return true if the model is valid def valid? - return false if @to.nil? + return false if @recipient.nil? true end @@ -201,8 +201,8 @@ def valid? def ==(o) return true if self.equal?(o) self.class == o.class && - to == o.to && - from == o.from && + recipient == o.recipient && + sender == o.sender && files == o.files && file_urls == o.file_urls && test_mode == o.test_mode && @@ -221,7 +221,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [to, from, files, file_urls, test_mode, cover_page_to, cover_page_from, cover_page_message, title].hash + [recipient, sender, files, file_urls, test_mode, cover_page_to, cover_page_from, cover_page_message, title].hash end # Builds the object from hash diff --git a/translations/en.yaml b/translations/en.yaml index c580ab835..52eb45d40 100644 --- a/translations/en.yaml +++ b/translations/en.yaml @@ -143,8 +143,8 @@ "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::RECIPIENT": Fax Send To Recipient +"FaxSend::SENDER": 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 From e913021f831a6c473685de35ce24ca0ed084a223 Mon Sep 17 00:00:00 2001 From: Maksud Aghayev Date: Fri, 18 Oct 2024 11:29:15 -0700 Subject: [PATCH 10/11] Changing from/to to sender/recipient --- examples/json/FaxGetResponseExample.json | 2 +- examples/json/FaxListResponseExample.json | 2 +- test_fixtures/FaxGetResponse.json | 2 +- test_fixtures/FaxListResponse.json | 2 +- test_fixtures/FaxSendRequest.json | 5 +++-- test_fixtures/FaxSendResponse.json | 2 +- translations/en.yaml | 2 +- 7 files changed, 9 insertions(+), 8 deletions(-) diff --git a/examples/json/FaxGetResponseExample.json b/examples/json/FaxGetResponseExample.json index 7bb712c8a..30475f119 100644 --- a/examples/json/FaxGetResponseExample.json +++ b/examples/json/FaxGetResponseExample.json @@ -7,7 +7,7 @@ "message": "example message", "metadata": [], "created_at": 1726774555, - "from": "me@dropboxsign.com", + "sender": "me@dropboxsign.com", "transmissions": [ { "recipient": "recipient@dropboxsign.com", diff --git a/examples/json/FaxListResponseExample.json b/examples/json/FaxListResponseExample.json index c7ab4f3ae..bf4f66bcc 100644 --- a/examples/json/FaxListResponseExample.json +++ b/examples/json/FaxListResponseExample.json @@ -14,7 +14,7 @@ "message": "example message", "metadata": [], "created_at": 1726774555, - "from": "me@dropboxsign.com", + "sender": "me@dropboxsign.com", "transmissions": [ { "recipient": "recipient@dropboxsign.com", diff --git a/test_fixtures/FaxGetResponse.json b/test_fixtures/FaxGetResponse.json index e6fcb202f..589271954 100644 --- a/test_fixtures/FaxGetResponse.json +++ b/test_fixtures/FaxGetResponse.json @@ -8,7 +8,7 @@ "message": "example message", "metadata": [], "created_at": 1726774555, - "from": "me@dropboxsign.com", + "sender": "me@dropboxsign.com", "transmissions": [ { "recipient": "recipient@dropboxsign.com", diff --git a/test_fixtures/FaxListResponse.json b/test_fixtures/FaxListResponse.json index 07bd76392..bfa69cdee 100644 --- a/test_fixtures/FaxListResponse.json +++ b/test_fixtures/FaxListResponse.json @@ -15,7 +15,7 @@ "message": "example message", "metadata": [], "created_at": 1726774555, - "from": "me@dropboxsign.com", + "sender": "me@dropboxsign.com", "transmissions": [ { "recipient": "recipient@dropboxsign.com", diff --git a/test_fixtures/FaxSendRequest.json b/test_fixtures/FaxSendRequest.json index 1be39148f..4c418cbe4 100644 --- a/test_fixtures/FaxSendRequest.json +++ b/test_fixtures/FaxSendRequest.json @@ -4,10 +4,11 @@ "https://api.hellosign.com/v3/fax/files/2b388914e3ae3b738bd4e2ee2850c677e6dc53d2" ], "test_mode": "true", - "to": "16690000001", - "from": "16690000000", + "recipient": "16690000001", + "sender": "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!" + } } diff --git a/test_fixtures/FaxSendResponse.json b/test_fixtures/FaxSendResponse.json index b1f8909e1..b651c7836 100644 --- a/test_fixtures/FaxSendResponse.json +++ b/test_fixtures/FaxSendResponse.json @@ -8,7 +8,7 @@ "message": "example message", "metadata": [ ], "created_at": 1726774555, - "from": "me@dropboxsign.com", + "sender": "me@dropboxsign.com", "transmissions": [], "files_url": "https://api.hellosign.com/v3/fax/files/2b388914e3ae3b738bd4e2ee2850c677e6dc53d2" } diff --git a/translations/en.yaml b/translations/en.yaml index a63156bcd..25716d9ee 100644 --- a/translations/en.yaml +++ b/translations/en.yaml @@ -161,7 +161,7 @@ "FaxResponse::MESSAGE": Fax Message "FaxResponse::METADATA": Fax Metadata "FaxResponse::CREATED_AT": Fax Created At Timestamp -"FaxResponse::FROM": Fax Sender Email +"FaxResponse::SENDER": Fax Sender Email "FaxResponse::TRANSMISSIONS": Fax Transmissions List "FaxResponse::FILES_URL": Fax Files URL "Sub::FaxResponseTransmission::RECIPIENT": Fax Transmission Recipient From d9e8c8c242c0273fad547c55c61521f074319d54 Mon Sep 17 00:00:00 2001 From: Maksud Aghayev Date: Fri, 18 Oct 2024 12:28:45 -0700 Subject: [PATCH 11/11] Rebuilding SDKs --- openapi-raw.yaml | 10 +- openapi-sdk.yaml | 8 +- openapi.yaml | 8 +- sdks/dotnet/docs/FaxResponse.md | 2 +- sdks/dotnet/docs/FaxResponseTransmission.md | 2 +- .../src/Dropbox.Sign/Model/FaxResponse.cs | 34 +++--- .../Model/FaxResponseTransmission.cs | 26 +++-- sdks/java-v1/docs/FaxResponse.md | 2 +- sdks/java-v1/docs/FaxResponseTransmission.md | 6 +- .../com/dropbox/sign/model/FaxResponse.java | 52 ++++----- .../sign/model/FaxResponseTransmission.java | 21 ++-- sdks/java-v2/docs/FaxResponse.md | 2 +- sdks/java-v2/docs/FaxResponseTransmission.md | 6 +- .../com/dropbox/sign/model/FaxResponse.java | 52 ++++----- .../sign/model/FaxResponseTransmission.java | 18 +-- sdks/node/dist/api.js | 104 +++++++++--------- sdks/node/docs/model/FaxResponse.md | 2 +- .../docs/model/FaxResponseTransmission.md | 6 +- sdks/node/model/faxResponse.ts | 6 +- sdks/node/model/faxResponseTransmission.ts | 6 +- sdks/node/types/model/faxResponse.d.ts | 2 +- .../types/model/faxResponseTransmission.d.ts | 6 +- sdks/php/docs/Model/FaxResponse.md | 2 +- .../php/docs/Model/FaxResponseTransmission.md | 6 +- sdks/php/src/Model/FaxResponse.php | 36 +++--- .../php/src/Model/FaxResponseTransmission.php | 27 +++-- sdks/python/docs/FaxResponse.md | 2 +- sdks/python/docs/FaxResponseTransmission.md | 6 +- .../dropbox_sign/models/fax_response.py | 8 +- .../models/fax_response_transmission.py | 15 +-- sdks/ruby/docs/FaxResponse.md | 2 +- sdks/ruby/docs/FaxResponseTransmission.md | 6 +- .../lib/dropbox-sign/models/fax_response.rb | 20 ++-- .../models/fax_response_transmission.rb | 15 +++ 34 files changed, 283 insertions(+), 243 deletions(-) diff --git a/openapi-raw.yaml b/openapi-raw.yaml index b75d60719..5489d3bd4 100644 --- a/openapi-raw.yaml +++ b/openapi-raw.yaml @@ -10648,7 +10648,7 @@ components: - message - metadata - created_at - - from + - sender - transmissions - files_url properties: @@ -10674,8 +10674,8 @@ components: created_at: description: '_t__FaxResponse::CREATED_AT' type: integer - from: - description: '_t__FaxResponse::FROM' + sender: + description: '_t__FaxResponse::SENDER' type: string transmissions: description: '_t__FaxResponse::TRANSMISSIONS' @@ -10710,6 +10710,10 @@ components: type: object x-internal-class: true FaxResponseTransmission: + required: + - recipient + - sender + - status_code properties: recipient: description: '_t__Sub::FaxResponseTransmission::RECIPIENT' diff --git a/openapi-sdk.yaml b/openapi-sdk.yaml index 8d339562c..db1c5b203 100644 --- a/openapi-sdk.yaml +++ b/openapi-sdk.yaml @@ -11256,7 +11256,7 @@ components: - message - metadata - created_at - - from + - sender - transmissions - files_url properties: @@ -11282,7 +11282,7 @@ components: created_at: description: 'Fax Created At Timestamp' type: integer - from: + sender: description: 'Fax Sender Email' type: string transmissions: @@ -11318,6 +11318,10 @@ components: type: object x-internal-class: true FaxResponseTransmission: + required: + - recipient + - sender + - status_code properties: recipient: description: 'Fax Transmission Recipient' diff --git a/openapi.yaml b/openapi.yaml index 5303bf326..4962a5d25 100644 --- a/openapi.yaml +++ b/openapi.yaml @@ -11234,7 +11234,7 @@ components: - message - metadata - created_at - - from + - sender - transmissions - files_url properties: @@ -11260,7 +11260,7 @@ components: created_at: description: 'Fax Created At Timestamp' type: integer - from: + sender: description: 'Fax Sender Email' type: string transmissions: @@ -11296,6 +11296,10 @@ components: type: object x-internal-class: true FaxResponseTransmission: + required: + - recipient + - sender + - status_code properties: recipient: description: 'Fax Transmission Recipient' diff --git a/sdks/dotnet/docs/FaxResponse.md b/sdks/dotnet/docs/FaxResponse.md index 611c1ed68..27a06144d 100644 --- a/sdks/dotnet/docs/FaxResponse.md +++ b/sdks/dotnet/docs/FaxResponse.md @@ -4,7 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**FaxId** | **string** | Fax ID | **Title** | **string** | Fax Title | **OriginalTitle** | **string** | Fax Original Title | **Subject** | **string** | Fax Subject | **Message** | **string** | Fax Message | **Metadata** | **Dictionary<string, Object>** | Fax Metadata | **CreatedAt** | **int** | Fax Created At Timestamp | **From** | **string** | Fax Sender Email | **Transmissions** | [**List<FaxResponseTransmission>**](FaxResponseTransmission.md) | Fax Transmissions List | **FilesUrl** | **string** | Fax Files URL | +**FaxId** | **string** | Fax ID | **Title** | **string** | Fax Title | **OriginalTitle** | **string** | Fax Original Title | **Subject** | **string** | Fax Subject | **Message** | **string** | Fax Message | **Metadata** | **Dictionary<string, Object>** | Fax Metadata | **CreatedAt** | **int** | Fax Created At Timestamp | **Sender** | **string** | Fax Sender Email | **Transmissions** | [**List<FaxResponseTransmission>**](FaxResponseTransmission.md) | Fax Transmissions List | **FilesUrl** | **string** | 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/dotnet/docs/FaxResponseTransmission.md b/sdks/dotnet/docs/FaxResponseTransmission.md index ed2878c46..c306b85d4 100644 --- a/sdks/dotnet/docs/FaxResponseTransmission.md +++ b/sdks/dotnet/docs/FaxResponseTransmission.md @@ -4,7 +4,7 @@ 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] +**Recipient** | **string** | Fax Transmission Recipient | **Sender** | **string** | Fax Transmission Sender | **StatusCode** | **string** | Fax Transmission Status Code | **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/src/Dropbox.Sign/Model/FaxResponse.cs b/sdks/dotnet/src/Dropbox.Sign/Model/FaxResponse.cs index 78172232e..60125d8e1 100644 --- a/sdks/dotnet/src/Dropbox.Sign/Model/FaxResponse.cs +++ b/sdks/dotnet/src/Dropbox.Sign/Model/FaxResponse.cs @@ -48,10 +48,10 @@ protected FaxResponse() { } /// Fax Message (required). /// Fax Metadata (required). /// Fax Created At Timestamp (required). - /// Fax Sender Email (required). + /// Fax Sender Email (required). /// Fax Transmissions List (required). /// Fax Files URL (required). - public FaxResponse(string faxId = default(string), string title = default(string), string originalTitle = default(string), string subject = default(string), string message = default(string), Dictionary metadata = default(Dictionary), int createdAt = default(int), string from = default(string), List transmissions = default(List), string filesUrl = default(string)) + public FaxResponse(string faxId = default(string), string title = default(string), string originalTitle = default(string), string subject = default(string), string message = default(string), Dictionary metadata = default(Dictionary), int createdAt = default(int), string sender = default(string), List transmissions = default(List), string filesUrl = default(string)) { // to ensure "faxId" is required (not null) @@ -91,12 +91,12 @@ protected FaxResponse() { } } this.Metadata = metadata; this.CreatedAt = createdAt; - // to ensure "from" is required (not null) - if (from == null) + // to ensure "sender" is required (not null) + if (sender == null) { - throw new ArgumentNullException("from is a required property for FaxResponse and cannot be null"); + throw new ArgumentNullException("sender is a required property for FaxResponse and cannot be null"); } - this.From = from; + this.Sender = sender; // to ensure "transmissions" is required (not null) if (transmissions == null) { @@ -180,8 +180,8 @@ public static FaxResponse Init(string jsonData) /// Fax Sender Email /// /// Fax Sender Email - [DataMember(Name = "from", IsRequired = true, EmitDefaultValue = true)] - public string From { get; set; } + [DataMember(Name = "sender", IsRequired = true, EmitDefaultValue = true)] + public string Sender { get; set; } /// /// Fax Transmissions List @@ -212,7 +212,7 @@ public override string ToString() 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(" Sender: ").Append(Sender).Append("\n"); sb.Append(" Transmissions: ").Append(Transmissions).Append("\n"); sb.Append(" FilesUrl: ").Append(FilesUrl).Append("\n"); sb.Append("}\n"); @@ -286,9 +286,9 @@ public bool Equals(FaxResponse input) this.CreatedAt.Equals(input.CreatedAt) ) && ( - this.From == input.From || - (this.From != null && - this.From.Equals(input.From)) + this.Sender == input.Sender || + (this.Sender != null && + this.Sender.Equals(input.Sender)) ) && ( this.Transmissions == input.Transmissions || @@ -337,9 +337,9 @@ public override int GetHashCode() hashCode = (hashCode * 59) + this.Metadata.GetHashCode(); } hashCode = (hashCode * 59) + this.CreatedAt.GetHashCode(); - if (this.From != null) + if (this.Sender != null) { - hashCode = (hashCode * 59) + this.From.GetHashCode(); + hashCode = (hashCode * 59) + this.Sender.GetHashCode(); } if (this.Transmissions != null) { @@ -416,10 +416,10 @@ public List GetOpenApiTypes() }); types.Add(new OpenApiType() { - Name = "from", - Property = "From", + Name = "sender", + Property = "Sender", Type = "string", - Value = From, + Value = Sender, }); types.Add(new OpenApiType() { diff --git a/sdks/dotnet/src/Dropbox.Sign/Model/FaxResponseTransmission.cs b/sdks/dotnet/src/Dropbox.Sign/Model/FaxResponseTransmission.cs index ac028b282..0e370714e 100644 --- a/sdks/dotnet/src/Dropbox.Sign/Model/FaxResponseTransmission.cs +++ b/sdks/dotnet/src/Dropbox.Sign/Model/FaxResponseTransmission.cs @@ -94,8 +94,8 @@ public enum StatusCodeEnum /// Fax Transmission Status Code /// /// Fax Transmission Status Code - [DataMember(Name = "status_code", EmitDefaultValue = true)] - public StatusCodeEnum? StatusCode { get; set; } + [DataMember(Name = "status_code", IsRequired = true, EmitDefaultValue = true)] + public StatusCodeEnum StatusCode { get; set; } /// /// Initializes a new instance of the class. /// @@ -104,14 +104,24 @@ protected FaxResponseTransmission() { } /// /// Initializes a new instance of the class. /// - /// Fax Transmission Recipient. - /// Fax Transmission Sender. - /// Fax Transmission Status Code. + /// Fax Transmission Recipient (required). + /// Fax Transmission Sender (required). + /// Fax Transmission Status Code (required). /// Fax Transmission Sent Timestamp. - public FaxResponseTransmission(string recipient = default(string), string sender = default(string), StatusCodeEnum? statusCode = default(StatusCodeEnum?), int sentAt = default(int)) + public FaxResponseTransmission(string recipient = default(string), string sender = default(string), StatusCodeEnum statusCode = default(StatusCodeEnum), int sentAt = default(int)) { + // to ensure "recipient" is required (not null) + if (recipient == null) + { + throw new ArgumentNullException("recipient is a required property for FaxResponseTransmission and cannot be null"); + } this.Recipient = recipient; + // to ensure "sender" is required (not null) + if (sender == null) + { + throw new ArgumentNullException("sender is a required property for FaxResponseTransmission and cannot be null"); + } this.Sender = sender; this.StatusCode = statusCode; this.SentAt = sentAt; @@ -137,14 +147,14 @@ public static FaxResponseTransmission Init(string jsonData) /// Fax Transmission Recipient ///
/// Fax Transmission Recipient - [DataMember(Name = "recipient", EmitDefaultValue = true)] + [DataMember(Name = "recipient", IsRequired = true, EmitDefaultValue = true)] public string Recipient { get; set; } /// /// Fax Transmission Sender /// /// Fax Transmission Sender - [DataMember(Name = "sender", EmitDefaultValue = true)] + [DataMember(Name = "sender", IsRequired = true, EmitDefaultValue = true)] public string Sender { get; set; } /// diff --git a/sdks/java-v1/docs/FaxResponse.md b/sdks/java-v1/docs/FaxResponse.md index a523916a6..77ec7eb10 100644 --- a/sdks/java-v1/docs/FaxResponse.md +++ b/sdks/java-v1/docs/FaxResponse.md @@ -15,7 +15,7 @@ | `message`*_required_ | ```String``` | Fax Message | | | `metadata`*_required_ | ```Map``` | Fax Metadata | | | `createdAt`*_required_ | ```Integer``` | Fax Created At Timestamp | | -| `from`*_required_ | ```String``` | Fax Sender Email | | +| `sender`*_required_ | ```String``` | Fax Sender Email | | | `transmissions`*_required_ | [```List```](FaxResponseTransmission.md) | Fax Transmissions List | | | `filesUrl`*_required_ | ```String``` | Fax Files URL | | diff --git a/sdks/java-v1/docs/FaxResponseTransmission.md b/sdks/java-v1/docs/FaxResponseTransmission.md index 5fe4a4ab7..09db223e9 100644 --- a/sdks/java-v1/docs/FaxResponseTransmission.md +++ b/sdks/java-v1/docs/FaxResponseTransmission.md @@ -8,9 +8,9 @@ | Name | Type | Description | Notes | |------------ | ------------- | ------------- | -------------| -| `recipient` | ```String``` | Fax Transmission Recipient | | -| `sender` | ```String``` | Fax Transmission Sender | | -| `statusCode` | [```StatusCodeEnum```](#StatusCodeEnum) | Fax Transmission Status Code | | +| `recipient`*_required_ | ```String``` | Fax Transmission Recipient | | +| `sender`*_required_ | ```String``` | Fax Transmission Sender | | +| `statusCode`*_required_ | [```StatusCodeEnum```](#StatusCodeEnum) | Fax Transmission Status Code | | | `sentAt` | ```Integer``` | Fax Transmission Sent Timestamp | | diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/model/FaxResponse.java b/sdks/java-v1/src/main/java/com/dropbox/sign/model/FaxResponse.java index 11f469adf..bbe2dcde4 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/model/FaxResponse.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/model/FaxResponse.java @@ -34,7 +34,7 @@ FaxResponse.JSON_PROPERTY_MESSAGE, FaxResponse.JSON_PROPERTY_METADATA, FaxResponse.JSON_PROPERTY_CREATED_AT, - FaxResponse.JSON_PROPERTY_FROM, + FaxResponse.JSON_PROPERTY_SENDER, FaxResponse.JSON_PROPERTY_TRANSMISSIONS, FaxResponse.JSON_PROPERTY_FILES_URL }) @@ -64,8 +64,8 @@ public class FaxResponse { 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_SENDER = "sender"; + private String sender; public static final String JSON_PROPERTY_TRANSMISSIONS = "transmissions"; private List transmissions = new ArrayList<>(); @@ -258,27 +258,27 @@ public void setCreatedAt(Integer createdAt) { this.createdAt = createdAt; } - public FaxResponse from(String from) { - this.from = from; + public FaxResponse sender(String sender) { + this.sender = sender; return this; } /** * Fax Sender Email * - * @return from + * @return sender */ @javax.annotation.Nonnull - @JsonProperty(JSON_PROPERTY_FROM) + @JsonProperty(JSON_PROPERTY_SENDER) @JsonInclude(value = JsonInclude.Include.ALWAYS) - public String getFrom() { - return from; + public String getSender() { + return sender; } - @JsonProperty(JSON_PROPERTY_FROM) + @JsonProperty(JSON_PROPERTY_SENDER) @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setFrom(String from) { - this.from = from; + public void setSender(String sender) { + this.sender = sender; } public FaxResponse transmissions(List transmissions) { @@ -352,7 +352,7 @@ public boolean equals(Object o) { && Objects.equals(this.message, faxResponse.message) && Objects.equals(this.metadata, faxResponse.metadata) && Objects.equals(this.createdAt, faxResponse.createdAt) - && Objects.equals(this.from, faxResponse.from) + && Objects.equals(this.sender, faxResponse.sender) && Objects.equals(this.transmissions, faxResponse.transmissions) && Objects.equals(this.filesUrl, faxResponse.filesUrl); } @@ -367,7 +367,7 @@ public int hashCode() { message, metadata, createdAt, - from, + sender, transmissions, filesUrl); } @@ -383,7 +383,7 @@ public String toString() { 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(" sender: ").append(toIndentedString(sender)).append("\n"); sb.append(" transmissions: ").append(toIndentedString(transmissions)).append("\n"); sb.append(" filesUrl: ").append(toIndentedString(filesUrl)).append("\n"); sb.append("}"); @@ -524,22 +524,22 @@ public Map createFormData() throws ApiException { JSON.getDefault().getMapper().writeValueAsString(createdAt)); } } - if (from != null) { - if (isFileTypeOrListOfFiles(from)) { + if (sender != null) { + if (isFileTypeOrListOfFiles(sender)) { 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)); + 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("from", JSON.getDefault().getMapper().writeValueAsString(from)); + map.put("sender", JSON.getDefault().getMapper().writeValueAsString(sender)); } } if (transmissions != null) { diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/model/FaxResponseTransmission.java b/sdks/java-v1/src/main/java/com/dropbox/sign/model/FaxResponseTransmission.java index 4e6f60e5b..8ab92887f 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/model/FaxResponseTransmission.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/model/FaxResponseTransmission.java @@ -121,14 +121,15 @@ public FaxResponseTransmission recipient(String recipient) { * * @return recipient */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_RECIPIENT) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_RECIPIENT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) public String getRecipient() { return recipient; } @JsonProperty(JSON_PROPERTY_RECIPIENT) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) public void setRecipient(String recipient) { this.recipient = recipient; } @@ -143,14 +144,15 @@ public FaxResponseTransmission sender(String sender) { * * @return sender */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_SENDER) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_SENDER) + @JsonInclude(value = JsonInclude.Include.ALWAYS) public String getSender() { return sender; } @JsonProperty(JSON_PROPERTY_SENDER) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) public void setSender(String sender) { this.sender = sender; } @@ -165,14 +167,15 @@ public FaxResponseTransmission statusCode(StatusCodeEnum statusCode) { * * @return statusCode */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_STATUS_CODE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_STATUS_CODE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) public StatusCodeEnum getStatusCode() { return statusCode; } @JsonProperty(JSON_PROPERTY_STATUS_CODE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) public void setStatusCode(StatusCodeEnum statusCode) { this.statusCode = statusCode; } diff --git a/sdks/java-v2/docs/FaxResponse.md b/sdks/java-v2/docs/FaxResponse.md index a523916a6..77ec7eb10 100644 --- a/sdks/java-v2/docs/FaxResponse.md +++ b/sdks/java-v2/docs/FaxResponse.md @@ -15,7 +15,7 @@ | `message`*_required_ | ```String``` | Fax Message | | | `metadata`*_required_ | ```Map``` | Fax Metadata | | | `createdAt`*_required_ | ```Integer``` | Fax Created At Timestamp | | -| `from`*_required_ | ```String``` | Fax Sender Email | | +| `sender`*_required_ | ```String``` | Fax Sender Email | | | `transmissions`*_required_ | [```List```](FaxResponseTransmission.md) | Fax Transmissions List | | | `filesUrl`*_required_ | ```String``` | Fax Files URL | | diff --git a/sdks/java-v2/docs/FaxResponseTransmission.md b/sdks/java-v2/docs/FaxResponseTransmission.md index 5fe4a4ab7..09db223e9 100644 --- a/sdks/java-v2/docs/FaxResponseTransmission.md +++ b/sdks/java-v2/docs/FaxResponseTransmission.md @@ -8,9 +8,9 @@ | Name | Type | Description | Notes | |------------ | ------------- | ------------- | -------------| -| `recipient` | ```String``` | Fax Transmission Recipient | | -| `sender` | ```String``` | Fax Transmission Sender | | -| `statusCode` | [```StatusCodeEnum```](#StatusCodeEnum) | Fax Transmission Status Code | | +| `recipient`*_required_ | ```String``` | Fax Transmission Recipient | | +| `sender`*_required_ | ```String``` | Fax Transmission Sender | | +| `statusCode`*_required_ | [```StatusCodeEnum```](#StatusCodeEnum) | Fax Transmission Status Code | | | `sentAt` | ```Integer``` | Fax Transmission Sent Timestamp | | diff --git a/sdks/java-v2/src/main/java/com/dropbox/sign/model/FaxResponse.java b/sdks/java-v2/src/main/java/com/dropbox/sign/model/FaxResponse.java index c09489751..35f4ffc6a 100644 --- a/sdks/java-v2/src/main/java/com/dropbox/sign/model/FaxResponse.java +++ b/sdks/java-v2/src/main/java/com/dropbox/sign/model/FaxResponse.java @@ -45,7 +45,7 @@ FaxResponse.JSON_PROPERTY_MESSAGE, FaxResponse.JSON_PROPERTY_METADATA, FaxResponse.JSON_PROPERTY_CREATED_AT, - FaxResponse.JSON_PROPERTY_FROM, + FaxResponse.JSON_PROPERTY_SENDER, FaxResponse.JSON_PROPERTY_TRANSMISSIONS, FaxResponse.JSON_PROPERTY_FILES_URL }) @@ -73,8 +73,8 @@ public class FaxResponse { 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_SENDER = "sender"; + private String sender; public static final String JSON_PROPERTY_TRANSMISSIONS = "transmissions"; private List transmissions = new ArrayList<>(); @@ -283,28 +283,28 @@ public void setCreatedAt(Integer createdAt) { } - public FaxResponse from(String from) { - this.from = from; + public FaxResponse sender(String sender) { + this.sender = sender; return this; } /** * Fax Sender Email - * @return from + * @return sender */ @jakarta.annotation.Nonnull - @JsonProperty(JSON_PROPERTY_FROM) + @JsonProperty(JSON_PROPERTY_SENDER) @JsonInclude(value = JsonInclude.Include.ALWAYS) - public String getFrom() { - return from; + public String getSender() { + return sender; } - @JsonProperty(JSON_PROPERTY_FROM) + @JsonProperty(JSON_PROPERTY_SENDER) @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setFrom(String from) { - this.from = from; + public void setSender(String sender) { + this.sender = sender; } @@ -385,14 +385,14 @@ public boolean equals(Object o) { Objects.equals(this.message, faxResponse.message) && Objects.equals(this.metadata, faxResponse.metadata) && Objects.equals(this.createdAt, faxResponse.createdAt) && - Objects.equals(this.from, faxResponse.from) && + Objects.equals(this.sender, faxResponse.sender) && Objects.equals(this.transmissions, faxResponse.transmissions) && Objects.equals(this.filesUrl, faxResponse.filesUrl); } @Override public int hashCode() { - return Objects.hash(faxId, title, originalTitle, subject, message, metadata, createdAt, from, transmissions, filesUrl); + return Objects.hash(faxId, title, originalTitle, subject, message, metadata, createdAt, sender, transmissions, filesUrl); } @Override @@ -406,7 +406,7 @@ public String toString() { 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(" sender: ").append(toIndentedString(sender)).append("\n"); sb.append(" transmissions: ").append(toIndentedString(transmissions)).append("\n"); sb.append(" filesUrl: ").append(toIndentedString(filesUrl)).append("\n"); sb.append("}"); @@ -550,23 +550,23 @@ public Map createFormData() throws ApiException { map.put("created_at", JSON.getDefault().getMapper().writeValueAsString(createdAt)); } } - if (from != null) { - if (isFileTypeOrListOfFiles(from)) { + if (sender != null) { + if (isFileTypeOrListOfFiles(sender)) { 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)); + 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("from", JSON.getDefault().getMapper().writeValueAsString(from)); + map.put("sender", JSON.getDefault().getMapper().writeValueAsString(sender)); } } if (transmissions != null) { diff --git a/sdks/java-v2/src/main/java/com/dropbox/sign/model/FaxResponseTransmission.java b/sdks/java-v2/src/main/java/com/dropbox/sign/model/FaxResponseTransmission.java index b65c94b46..dc7bb06a4 100644 --- a/sdks/java-v2/src/main/java/com/dropbox/sign/model/FaxResponseTransmission.java +++ b/sdks/java-v2/src/main/java/com/dropbox/sign/model/FaxResponseTransmission.java @@ -127,9 +127,9 @@ public FaxResponseTransmission recipient(String recipient) { * Fax Transmission Recipient * @return recipient */ - @jakarta.annotation.Nullable + @jakarta.annotation.Nonnull @JsonProperty(JSON_PROPERTY_RECIPIENT) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) public String getRecipient() { return recipient; @@ -137,7 +137,7 @@ public String getRecipient() { @JsonProperty(JSON_PROPERTY_RECIPIENT) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) public void setRecipient(String recipient) { this.recipient = recipient; } @@ -152,9 +152,9 @@ public FaxResponseTransmission sender(String sender) { * Fax Transmission Sender * @return sender */ - @jakarta.annotation.Nullable + @jakarta.annotation.Nonnull @JsonProperty(JSON_PROPERTY_SENDER) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) public String getSender() { return sender; @@ -162,7 +162,7 @@ public String getSender() { @JsonProperty(JSON_PROPERTY_SENDER) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) public void setSender(String sender) { this.sender = sender; } @@ -177,9 +177,9 @@ public FaxResponseTransmission statusCode(StatusCodeEnum statusCode) { * Fax Transmission Status Code * @return statusCode */ - @jakarta.annotation.Nullable + @jakarta.annotation.Nonnull @JsonProperty(JSON_PROPERTY_STATUS_CODE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) public StatusCodeEnum getStatusCode() { return statusCode; @@ -187,7 +187,7 @@ public StatusCodeEnum getStatusCode() { @JsonProperty(JSON_PROPERTY_STATUS_CODE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) public void setStatusCode(StatusCodeEnum statusCode) { this.statusCode = statusCode; } diff --git a/sdks/node/dist/api.js b/sdks/node/dist/api.js index 5040b0d60..74d7dd106 100644 --- a/sdks/node/dist/api.js +++ b/sdks/node/dist/api.js @@ -18101,8 +18101,8 @@ FaxResponse.attributeTypeMap = [ type: "number" }, { - name: "from", - baseName: "from", + name: "sender", + baseName: "sender", type: "string" }, { @@ -28123,7 +28123,7 @@ var OAuthApi = class { )) { return; } - if (handleErrorRangeResponse6( + if (handleErrorRangeResponse7( reject, error.response, "4XX", @@ -28226,7 +28226,7 @@ var OAuthApi = class { )) { return; } - if (handleErrorRangeResponse6( + if (handleErrorRangeResponse7( reject, error.response, "4XX", @@ -28267,7 +28267,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) { @@ -28422,7 +28422,7 @@ var ReportApi = class { )) { return; } - if (handleErrorRangeResponse7( + if (handleErrorRangeResponse8( reject, error.response, "4XX", @@ -28464,7 +28464,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) { @@ -28619,7 +28619,7 @@ var SignatureRequestApi = class { )) { return; } - if (handleErrorRangeResponse8( + if (handleErrorRangeResponse9( reject, error.response, "4XX", @@ -28734,7 +28734,7 @@ var SignatureRequestApi = class { )) { return; } - if (handleErrorRangeResponse8( + if (handleErrorRangeResponse9( reject, error.response, "4XX", @@ -28817,7 +28817,7 @@ var SignatureRequestApi = class { reject(error); return; } - if (handleErrorRangeResponse8( + if (handleErrorRangeResponse9( reject, error.response, "4XX", @@ -28931,7 +28931,7 @@ var SignatureRequestApi = class { )) { return; } - if (handleErrorRangeResponse8( + if (handleErrorRangeResponse9( reject, error.response, "4XX", @@ -29046,7 +29046,7 @@ var SignatureRequestApi = class { )) { return; } - if (handleErrorRangeResponse8( + if (handleErrorRangeResponse9( reject, error.response, "4XX", @@ -29148,7 +29148,7 @@ var SignatureRequestApi = class { )) { return; } - if (handleErrorRangeResponse8( + if (handleErrorRangeResponse9( reject, error.response, "4XX", @@ -29244,7 +29244,7 @@ var SignatureRequestApi = class { )) { return; } - if (handleErrorRangeResponse8( + if (handleErrorRangeResponse9( reject, error.response, "4XX", @@ -29346,7 +29346,7 @@ var SignatureRequestApi = class { )) { return; } - if (handleErrorRangeResponse8( + if (handleErrorRangeResponse9( reject, error.response, "4XX", @@ -29442,7 +29442,7 @@ var SignatureRequestApi = class { )) { return; } - if (handleErrorRangeResponse8( + if (handleErrorRangeResponse9( reject, error.response, "4XX", @@ -29555,7 +29555,7 @@ var SignatureRequestApi = class { )) { return; } - if (handleErrorRangeResponse8( + if (handleErrorRangeResponse9( reject, error.response, "4XX", @@ -29652,7 +29652,7 @@ var SignatureRequestApi = class { )) { return; } - if (handleErrorRangeResponse8( + if (handleErrorRangeResponse9( reject, error.response, "4XX", @@ -29775,7 +29775,7 @@ var SignatureRequestApi = class { )) { return; } - if (handleErrorRangeResponse8( + if (handleErrorRangeResponse9( reject, error.response, "4XX", @@ -29853,7 +29853,7 @@ var SignatureRequestApi = class { reject(error); return; } - if (handleErrorRangeResponse8( + if (handleErrorRangeResponse9( reject, error.response, "4XX", @@ -29967,7 +29967,7 @@ var SignatureRequestApi = class { )) { return; } - if (handleErrorRangeResponse8( + if (handleErrorRangeResponse9( reject, error.response, "4XX", @@ -30082,7 +30082,7 @@ var SignatureRequestApi = class { )) { return; } - if (handleErrorRangeResponse8( + if (handleErrorRangeResponse9( reject, error.response, "4XX", @@ -30205,7 +30205,7 @@ var SignatureRequestApi = class { )) { return; } - if (handleErrorRangeResponse8( + if (handleErrorRangeResponse9( reject, error.response, "4XX", @@ -30247,7 +30247,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) { @@ -30412,7 +30412,7 @@ var TeamApi = class { )) { return; } - if (handleErrorRangeResponse9( + if (handleErrorRangeResponse10( reject, error.response, "4XX", @@ -30522,7 +30522,7 @@ var TeamApi = class { )) { return; } - if (handleErrorRangeResponse9( + if (handleErrorRangeResponse10( reject, error.response, "4XX", @@ -30596,7 +30596,7 @@ var TeamApi = class { reject(error); return; } - if (handleErrorRangeResponse9( + if (handleErrorRangeResponse10( reject, error.response, "4XX", @@ -30683,7 +30683,7 @@ var TeamApi = class { )) { return; } - if (handleErrorRangeResponse9( + if (handleErrorRangeResponse10( reject, error.response, "4XX", @@ -30777,7 +30777,7 @@ var TeamApi = class { )) { return; } - if (handleErrorRangeResponse9( + if (handleErrorRangeResponse10( reject, error.response, "4XX", @@ -30872,7 +30872,7 @@ var TeamApi = class { )) { return; } - if (handleErrorRangeResponse9( + if (handleErrorRangeResponse10( reject, error.response, "4XX", @@ -30981,7 +30981,7 @@ var TeamApi = class { )) { return; } - if (handleErrorRangeResponse9( + if (handleErrorRangeResponse10( reject, error.response, "4XX", @@ -31095,7 +31095,7 @@ var TeamApi = class { )) { return; } - if (handleErrorRangeResponse9( + if (handleErrorRangeResponse10( reject, error.response, "4XX", @@ -31203,7 +31203,7 @@ var TeamApi = class { )) { return; } - if (handleErrorRangeResponse9( + if (handleErrorRangeResponse10( reject, error.response, "4XX", @@ -31314,7 +31314,7 @@ var TeamApi = class { )) { return; } - if (handleErrorRangeResponse9( + if (handleErrorRangeResponse10( reject, error.response, "4XX", @@ -31355,7 +31355,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) { @@ -31523,7 +31523,7 @@ var TemplateApi = class { )) { return; } - if (handleErrorRangeResponse10( + if (handleErrorRangeResponse11( reject, error.response, "4XX", @@ -31638,7 +31638,7 @@ var TemplateApi = class { )) { return; } - if (handleErrorRangeResponse10( + if (handleErrorRangeResponse11( reject, error.response, "4XX", @@ -31753,7 +31753,7 @@ var TemplateApi = class { )) { return; } - if (handleErrorRangeResponse10( + if (handleErrorRangeResponse11( reject, error.response, "4XX", @@ -31836,7 +31836,7 @@ var TemplateApi = class { reject(error); return; } - if (handleErrorRangeResponse10( + if (handleErrorRangeResponse11( reject, error.response, "4XX", @@ -31937,7 +31937,7 @@ var TemplateApi = class { )) { return; } - if (handleErrorRangeResponse10( + if (handleErrorRangeResponse11( reject, error.response, "4XX", @@ -32033,7 +32033,7 @@ var TemplateApi = class { )) { return; } - if (handleErrorRangeResponse10( + if (handleErrorRangeResponse11( reject, error.response, "4XX", @@ -32135,7 +32135,7 @@ var TemplateApi = class { )) { return; } - if (handleErrorRangeResponse10( + if (handleErrorRangeResponse11( reject, error.response, "4XX", @@ -32231,7 +32231,7 @@ var TemplateApi = class { )) { return; } - if (handleErrorRangeResponse10( + if (handleErrorRangeResponse11( reject, error.response, "4XX", @@ -32344,7 +32344,7 @@ var TemplateApi = class { )) { return; } - if (handleErrorRangeResponse10( + if (handleErrorRangeResponse11( reject, error.response, "4XX", @@ -32467,7 +32467,7 @@ var TemplateApi = class { )) { return; } - if (handleErrorRangeResponse10( + if (handleErrorRangeResponse11( reject, error.response, "4XX", @@ -32590,7 +32590,7 @@ var TemplateApi = class { )) { return; } - if (handleErrorRangeResponse10( + if (handleErrorRangeResponse11( reject, error.response, "4XX", @@ -32632,7 +32632,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) { @@ -32792,7 +32792,7 @@ var UnclaimedDraftApi = class { )) { return; } - if (handleErrorRangeResponse11( + if (handleErrorRangeResponse12( reject, error.response, "4XX", @@ -32907,7 +32907,7 @@ var UnclaimedDraftApi = class { )) { return; } - if (handleErrorRangeResponse11( + if (handleErrorRangeResponse12( reject, error.response, "4XX", @@ -33022,7 +33022,7 @@ var UnclaimedDraftApi = class { )) { return; } - if (handleErrorRangeResponse11( + if (handleErrorRangeResponse12( reject, error.response, "4XX", @@ -33145,7 +33145,7 @@ var UnclaimedDraftApi = class { )) { return; } - if (handleErrorRangeResponse11( + if (handleErrorRangeResponse12( reject, error.response, "4XX", @@ -33187,7 +33187,7 @@ function handleErrorCodeResponse12(reject, response, code, returnType) { reject(new HttpError(response, body, response.status)); return true; } -function handleErrorRangeResponse11(reject, response, code, returnType) { +function handleErrorRangeResponse12(reject, response, code, returnType) { let rangeCodeLeft = Number(code[0] + "00"); let rangeCodeRight = Number(code[0] + "99"); if (response.status >= rangeCodeLeft && response.status <= rangeCodeRight) { diff --git a/sdks/node/docs/model/FaxResponse.md b/sdks/node/docs/model/FaxResponse.md index 9cfc5d481..413a36b71 100644 --- a/sdks/node/docs/model/FaxResponse.md +++ b/sdks/node/docs/model/FaxResponse.md @@ -13,7 +13,7 @@ Name | Type | Description | Notes | `message`*_required_ | ```string``` | Fax Message | | | `metadata`*_required_ | ```{ [key: string]: any; }``` | Fax Metadata | | | `createdAt`*_required_ | ```number``` | Fax Created At Timestamp | | -| `from`*_required_ | ```string``` | Fax Sender Email | | +| `sender`*_required_ | ```string``` | Fax Sender Email | | | `transmissions`*_required_ | [```Array```](FaxResponseTransmission.md) | Fax Transmissions List | | | `filesUrl`*_required_ | ```string``` | Fax Files URL | | diff --git a/sdks/node/docs/model/FaxResponseTransmission.md b/sdks/node/docs/model/FaxResponseTransmission.md index b77f25f2c..c0d8491c0 100644 --- a/sdks/node/docs/model/FaxResponseTransmission.md +++ b/sdks/node/docs/model/FaxResponseTransmission.md @@ -6,9 +6,9 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -| `recipient` | ```string``` | Fax Transmission Recipient | | -| `sender` | ```string``` | Fax Transmission Sender | | -| `statusCode` | ```string``` | Fax Transmission Status Code | | +| `recipient`*_required_ | ```string``` | Fax Transmission Recipient | | +| `sender`*_required_ | ```string``` | Fax Transmission Sender | | +| `statusCode`*_required_ | ```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/model/faxResponse.ts b/sdks/node/model/faxResponse.ts index 01c6c5849..1697d212a 100644 --- a/sdks/node/model/faxResponse.ts +++ b/sdks/node/model/faxResponse.ts @@ -57,7 +57,7 @@ export class FaxResponse { /** * Fax Sender Email */ - "from": string; + "sender": string; /** * Fax Transmissions List */ @@ -106,8 +106,8 @@ export class FaxResponse { type: "number", }, { - name: "from", - baseName: "from", + name: "sender", + baseName: "sender", type: "string", }, { diff --git a/sdks/node/model/faxResponseTransmission.ts b/sdks/node/model/faxResponseTransmission.ts index e5e1e3973..f43034a9d 100644 --- a/sdks/node/model/faxResponseTransmission.ts +++ b/sdks/node/model/faxResponseTransmission.ts @@ -28,15 +28,15 @@ export class FaxResponseTransmission { /** * Fax Transmission Recipient */ - "recipient"?: string; + "recipient": string; /** * Fax Transmission Sender */ - "sender"?: string; + "sender": string; /** * Fax Transmission Status Code */ - "statusCode"?: FaxResponseTransmission.StatusCodeEnum; + "statusCode": FaxResponseTransmission.StatusCodeEnum; /** * Fax Transmission Sent Timestamp */ diff --git a/sdks/node/types/model/faxResponse.d.ts b/sdks/node/types/model/faxResponse.d.ts index 826153a45..6aa5f2d0a 100644 --- a/sdks/node/types/model/faxResponse.d.ts +++ b/sdks/node/types/model/faxResponse.d.ts @@ -10,7 +10,7 @@ export declare class FaxResponse { [key: string]: any; }; "createdAt": number; - "from": string; + "sender": string; "transmissions": Array; "filesUrl": string; static discriminator: string | undefined; diff --git a/sdks/node/types/model/faxResponseTransmission.d.ts b/sdks/node/types/model/faxResponseTransmission.d.ts index b5f150482..f1d587fc4 100644 --- a/sdks/node/types/model/faxResponseTransmission.d.ts +++ b/sdks/node/types/model/faxResponseTransmission.d.ts @@ -1,8 +1,8 @@ import { AttributeTypeMap } from "./"; export declare class FaxResponseTransmission { - "recipient"?: string; - "sender"?: string; - "statusCode"?: FaxResponseTransmission.StatusCodeEnum; + "recipient": string; + "sender": string; + "statusCode": FaxResponseTransmission.StatusCodeEnum; "sentAt"?: number; static discriminator: string | undefined; static attributeTypeMap: AttributeTypeMap; diff --git a/sdks/php/docs/Model/FaxResponse.md b/sdks/php/docs/Model/FaxResponse.md index 6f6becf5c..5ee5930ca 100644 --- a/sdks/php/docs/Model/FaxResponse.md +++ b/sdks/php/docs/Model/FaxResponse.md @@ -13,7 +13,7 @@ Name | Type | Description | Notes | `message`*_required_ | ```string``` | Fax Message | | | `metadata`*_required_ | ```array``` | Fax Metadata | | | `created_at`*_required_ | ```int``` | Fax Created At Timestamp | | -| `from`*_required_ | ```string``` | Fax Sender Email | | +| `sender`*_required_ | ```string``` | Fax Sender Email | | | `transmissions`*_required_ | [```\Dropbox\Sign\Model\FaxResponseTransmission[]```](FaxResponseTransmission.md) | Fax Transmissions List | | | `files_url`*_required_ | ```string``` | Fax Files URL | | diff --git a/sdks/php/docs/Model/FaxResponseTransmission.md b/sdks/php/docs/Model/FaxResponseTransmission.md index 504d2aa1e..421181a32 100644 --- a/sdks/php/docs/Model/FaxResponseTransmission.md +++ b/sdks/php/docs/Model/FaxResponseTransmission.md @@ -6,9 +6,9 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -| `recipient` | ```string``` | Fax Transmission Recipient | | -| `sender` | ```string``` | Fax Transmission Sender | | -| `status_code` | ```string``` | Fax Transmission Status Code | | +| `recipient`*_required_ | ```string``` | Fax Transmission Recipient | | +| `sender`*_required_ | ```string``` | Fax Transmission Sender | | +| `status_code`*_required_ | ```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/src/Model/FaxResponse.php b/sdks/php/src/Model/FaxResponse.php index b539a3a28..b60d54baa 100644 --- a/sdks/php/src/Model/FaxResponse.php +++ b/sdks/php/src/Model/FaxResponse.php @@ -64,7 +64,7 @@ class FaxResponse implements ModelInterface, ArrayAccess, JsonSerializable 'message' => 'string', 'metadata' => 'array', 'created_at' => 'int', - 'from' => 'string', + 'sender' => 'string', 'transmissions' => '\Dropbox\Sign\Model\FaxResponseTransmission[]', 'files_url' => 'string', ]; @@ -84,7 +84,7 @@ class FaxResponse implements ModelInterface, ArrayAccess, JsonSerializable 'message' => null, 'metadata' => null, 'created_at' => null, - 'from' => null, + 'sender' => null, 'transmissions' => null, 'files_url' => null, ]; @@ -102,7 +102,7 @@ class FaxResponse implements ModelInterface, ArrayAccess, JsonSerializable 'message' => false, 'metadata' => false, 'created_at' => false, - 'from' => false, + 'sender' => false, 'transmissions' => false, 'files_url' => false, ]; @@ -192,7 +192,7 @@ public function isNullableSetToNull(string $property): bool 'message' => 'message', 'metadata' => 'metadata', 'created_at' => 'created_at', - 'from' => 'from', + 'sender' => 'sender', 'transmissions' => 'transmissions', 'files_url' => 'files_url', ]; @@ -210,7 +210,7 @@ public function isNullableSetToNull(string $property): bool 'message' => 'setMessage', 'metadata' => 'setMetadata', 'created_at' => 'setCreatedAt', - 'from' => 'setFrom', + 'sender' => 'setSender', 'transmissions' => 'setTransmissions', 'files_url' => 'setFilesUrl', ]; @@ -228,7 +228,7 @@ public function isNullableSetToNull(string $property): bool 'message' => 'getMessage', 'metadata' => 'getMetadata', 'created_at' => 'getCreatedAt', - 'from' => 'getFrom', + 'sender' => 'getSender', 'transmissions' => 'getTransmissions', 'files_url' => 'getFilesUrl', ]; @@ -296,7 +296,7 @@ public function __construct(array $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('sender', $data ?? [], null); $this->setIfExists('transmissions', $data ?? [], null); $this->setIfExists('files_url', $data ?? [], null); } @@ -367,8 +367,8 @@ public function listInvalidProperties() if ($this->container['created_at'] === null) { $invalidProperties[] = "'created_at' can't be null"; } - if ($this->container['from'] === null) { - $invalidProperties[] = "'from' can't be null"; + if ($this->container['sender'] === null) { + $invalidProperties[] = "'sender' can't be null"; } if ($this->container['transmissions'] === null) { $invalidProperties[] = "'transmissions' can't be null"; @@ -580,28 +580,28 @@ public function setCreatedAt(int $created_at) } /** - * Gets from + * Gets sender * * @return string */ - public function getFrom() + public function getSender() { - return $this->container['from']; + return $this->container['sender']; } /** - * Sets from + * Sets sender * - * @param string $from Fax Sender Email + * @param string $sender Fax Sender Email * * @return self */ - public function setFrom(string $from) + public function setSender(string $sender) { - if (is_null($from)) { - throw new InvalidArgumentException('non-nullable from cannot be null'); + if (is_null($sender)) { + throw new InvalidArgumentException('non-nullable sender cannot be null'); } - $this->container['from'] = $from; + $this->container['sender'] = $sender; return $this; } diff --git a/sdks/php/src/Model/FaxResponseTransmission.php b/sdks/php/src/Model/FaxResponseTransmission.php index ff2dc7471..049c5b407 100644 --- a/sdks/php/src/Model/FaxResponseTransmission.php +++ b/sdks/php/src/Model/FaxResponseTransmission.php @@ -332,6 +332,15 @@ public function listInvalidProperties() { $invalidProperties = []; + if ($this->container['recipient'] === null) { + $invalidProperties[] = "'recipient' can't be null"; + } + if ($this->container['sender'] === null) { + $invalidProperties[] = "'sender' can't be null"; + } + if ($this->container['status_code'] === null) { + $invalidProperties[] = "'status_code' can't be null"; + } $allowedValues = $this->getStatusCodeAllowableValues(); if (!is_null($this->container['status_code']) && !in_array($this->container['status_code'], $allowedValues, true)) { $invalidProperties[] = sprintf( @@ -358,7 +367,7 @@ public function valid() /** * Gets recipient * - * @return string|null + * @return string */ public function getRecipient() { @@ -368,11 +377,11 @@ public function getRecipient() /** * Sets recipient * - * @param string|null $recipient Fax Transmission Recipient + * @param string $recipient Fax Transmission Recipient * * @return self */ - public function setRecipient(?string $recipient) + public function setRecipient(string $recipient) { if (is_null($recipient)) { throw new InvalidArgumentException('non-nullable recipient cannot be null'); @@ -385,7 +394,7 @@ public function setRecipient(?string $recipient) /** * Gets sender * - * @return string|null + * @return string */ public function getSender() { @@ -395,11 +404,11 @@ public function getSender() /** * Sets sender * - * @param string|null $sender Fax Transmission Sender + * @param string $sender Fax Transmission Sender * * @return self */ - public function setSender(?string $sender) + public function setSender(string $sender) { if (is_null($sender)) { throw new InvalidArgumentException('non-nullable sender cannot be null'); @@ -412,7 +421,7 @@ public function setSender(?string $sender) /** * Gets status_code * - * @return string|null + * @return string */ public function getStatusCode() { @@ -422,11 +431,11 @@ public function getStatusCode() /** * Sets status_code * - * @param string|null $status_code Fax Transmission Status Code + * @param string $status_code Fax Transmission Status Code * * @return self */ - public function setStatusCode(?string $status_code) + public function setStatusCode(string $status_code) { if (is_null($status_code)) { throw new InvalidArgumentException('non-nullable status_code cannot be null'); diff --git a/sdks/python/docs/FaxResponse.md b/sdks/python/docs/FaxResponse.md index 609963029..d531f5d0a 100644 --- a/sdks/python/docs/FaxResponse.md +++ b/sdks/python/docs/FaxResponse.md @@ -12,7 +12,7 @@ Name | Type | Description | Notes | `message`*_required_ | ```str``` | Fax Message | | | `metadata`*_required_ | ```Dict[str, object]``` | Fax Metadata | | | `created_at`*_required_ | ```int``` | Fax Created At Timestamp | | -| `var_from`*_required_ | ```str``` | Fax Sender Email | | +| `sender`*_required_ | ```str``` | Fax Sender Email | | | `transmissions`*_required_ | [```List[FaxResponseTransmission]```](FaxResponseTransmission.md) | Fax Transmissions List | | | `files_url`*_required_ | ```str``` | Fax Files URL | | diff --git a/sdks/python/docs/FaxResponseTransmission.md b/sdks/python/docs/FaxResponseTransmission.md index 4966932ea..9ba09c130 100644 --- a/sdks/python/docs/FaxResponseTransmission.md +++ b/sdks/python/docs/FaxResponseTransmission.md @@ -5,9 +5,9 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -| `recipient` | ```str``` | Fax Transmission Recipient | | -| `sender` | ```str``` | Fax Transmission Sender | | -| `status_code` | ```str``` | Fax Transmission Status Code | | +| `recipient`*_required_ | ```str``` | Fax Transmission Recipient | | +| `sender`*_required_ | ```str``` | Fax Transmission Sender | | +| `status_code`*_required_ | ```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/dropbox_sign/models/fax_response.py b/sdks/python/dropbox_sign/models/fax_response.py index 0232317eb..035993f12 100644 --- a/sdks/python/dropbox_sign/models/fax_response.py +++ b/sdks/python/dropbox_sign/models/fax_response.py @@ -40,7 +40,7 @@ class FaxResponse(BaseModel): message: StrictStr = Field(description="Fax Message") metadata: Dict[str, Any] = Field(description="Fax Metadata") created_at: StrictInt = Field(description="Fax Created At Timestamp") - var_from: StrictStr = Field(description="Fax Sender Email", alias="from") + sender: StrictStr = Field(description="Fax Sender Email") transmissions: List[FaxResponseTransmission] = Field( description="Fax Transmissions List" ) @@ -53,7 +53,7 @@ class FaxResponse(BaseModel): "message", "metadata", "created_at", - "from", + "sender", "transmissions", "files_url", ] @@ -135,7 +135,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "message": obj.get("message"), "metadata": obj.get("metadata"), "created_at": obj.get("created_at"), - "from": obj.get("from"), + "sender": obj.get("sender"), "transmissions": ( [ FaxResponseTransmission.from_dict(_item) @@ -169,7 +169,7 @@ def openapi_types(cls) -> Dict[str, str]: "message": "(str,)", "metadata": "(Dict[str, object],)", "created_at": "(int,)", - "var_from": "(str,)", + "sender": "(str,)", "transmissions": "(List[FaxResponseTransmission],)", "files_url": "(str,)", } diff --git a/sdks/python/dropbox_sign/models/fax_response_transmission.py b/sdks/python/dropbox_sign/models/fax_response_transmission.py index 34e6f1fc7..c34d2e9ae 100644 --- a/sdks/python/dropbox_sign/models/fax_response_transmission.py +++ b/sdks/python/dropbox_sign/models/fax_response_transmission.py @@ -32,15 +32,9 @@ class FaxResponseTransmission(BaseModel): FaxResponseTransmission """ # 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" - ) + recipient: StrictStr = Field(description="Fax Transmission Recipient") + sender: StrictStr = Field(description="Fax Transmission Sender") + status_code: StrictStr = Field(description="Fax Transmission Status Code") sent_at: Optional[StrictInt] = Field( default=None, description="Fax Transmission Sent Timestamp" ) @@ -54,9 +48,6 @@ class FaxResponseTransmission(BaseModel): @field_validator("status_code") def status_code_validate_enum(cls, value): """Validates the enum""" - if value is None: - return value - if value not in set( [ "success", diff --git a/sdks/ruby/docs/FaxResponse.md b/sdks/ruby/docs/FaxResponse.md index 970494f56..68c864bf3 100644 --- a/sdks/ruby/docs/FaxResponse.md +++ b/sdks/ruby/docs/FaxResponse.md @@ -13,7 +13,7 @@ | `message`*_required_ | ```String``` | Fax Message | | | `metadata`*_required_ | ```Hash``` | Fax Metadata | | | `created_at`*_required_ | ```Integer``` | Fax Created At Timestamp | | -| `from`*_required_ | ```String``` | Fax Sender Email | | +| `sender`*_required_ | ```String``` | Fax Sender Email | | | `transmissions`*_required_ | [```Array```](FaxResponseTransmission.md) | Fax Transmissions List | | | `files_url`*_required_ | ```String``` | Fax Files URL | | diff --git a/sdks/ruby/docs/FaxResponseTransmission.md b/sdks/ruby/docs/FaxResponseTransmission.md index ba3cfd96d..5ec394694 100644 --- a/sdks/ruby/docs/FaxResponseTransmission.md +++ b/sdks/ruby/docs/FaxResponseTransmission.md @@ -6,8 +6,8 @@ | Name | Type | Description | Notes | | ---- | ---- | ----------- | ----- | -| `recipient` | ```String``` | Fax Transmission Recipient | | -| `sender` | ```String``` | Fax Transmission Sender | | -| `status_code` | ```String``` | Fax Transmission Status Code | | +| `recipient`*_required_ | ```String``` | Fax Transmission Recipient | | +| `sender`*_required_ | ```String``` | Fax Transmission Sender | | +| `status_code`*_required_ | ```String``` | Fax Transmission Status Code | | | `sent_at` | ```Integer``` | Fax Transmission Sent Timestamp | | diff --git a/sdks/ruby/lib/dropbox-sign/models/fax_response.rb b/sdks/ruby/lib/dropbox-sign/models/fax_response.rb index fdc1187bd..a7c8847bf 100644 --- a/sdks/ruby/lib/dropbox-sign/models/fax_response.rb +++ b/sdks/ruby/lib/dropbox-sign/models/fax_response.rb @@ -48,7 +48,7 @@ class FaxResponse # Fax Sender Email # @return [String] - attr_accessor :from + attr_accessor :sender # Fax Transmissions List # @return [Array] @@ -68,7 +68,7 @@ def self.attribute_map :'message' => :'message', :'metadata' => :'metadata', :'created_at' => :'created_at', - :'from' => :'from', + :'sender' => :'sender', :'transmissions' => :'transmissions', :'files_url' => :'files_url' } @@ -89,7 +89,7 @@ def self.openapi_types :'message' => :'String', :'metadata' => :'Hash', :'created_at' => :'Integer', - :'from' => :'String', + :'sender' => :'String', :'transmissions' => :'Array', :'files_url' => :'String' } @@ -171,8 +171,8 @@ def initialize(attributes = {}) self.created_at = attributes[:'created_at'] end - if attributes.key?(:'from') - self.from = attributes[:'from'] + if attributes.key?(:'sender') + self.sender = attributes[:'sender'] end if attributes.key?(:'transmissions') @@ -218,8 +218,8 @@ def list_invalid_properties invalid_properties.push('invalid value for "created_at", created_at cannot be nil.') end - if @from.nil? - invalid_properties.push('invalid value for "from", from cannot be nil.') + if @sender.nil? + invalid_properties.push('invalid value for "sender", sender cannot be nil.') end if @transmissions.nil? @@ -243,7 +243,7 @@ def valid? return false if @message.nil? return false if @metadata.nil? return false if @created_at.nil? - return false if @from.nil? + return false if @sender.nil? return false if @transmissions.nil? return false if @files_url.nil? true @@ -261,7 +261,7 @@ def ==(o) message == o.message && metadata == o.metadata && created_at == o.created_at && - from == o.from && + sender == o.sender && transmissions == o.transmissions && files_url == o.files_url end @@ -275,7 +275,7 @@ def eql?(o) # 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 + [fax_id, title, original_title, subject, message, metadata, created_at, sender, transmissions, files_url].hash end # Builds the object from hash diff --git a/sdks/ruby/lib/dropbox-sign/models/fax_response_transmission.rb b/sdks/ruby/lib/dropbox-sign/models/fax_response_transmission.rb index c680dbb6d..a6c49bb3a 100644 --- a/sdks/ruby/lib/dropbox-sign/models/fax_response_transmission.rb +++ b/sdks/ruby/lib/dropbox-sign/models/fax_response_transmission.rb @@ -148,12 +148,27 @@ def initialize(attributes = {}) # @return Array for valid properties with the reasons def list_invalid_properties invalid_properties = Array.new + if @recipient.nil? + invalid_properties.push('invalid value for "recipient", recipient cannot be nil.') + end + + if @sender.nil? + invalid_properties.push('invalid value for "sender", sender cannot be nil.') + end + + if @status_code.nil? + invalid_properties.push('invalid value for "status_code", status_code 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 @recipient.nil? + return false if @sender.nil? + return false if @status_code.nil? status_code_validator = EnumAttributeValidator.new('String', ["success", "transmitting", "error_could_not_fax", "error_unknown", "error_busy", "error_no_answer", "error_disconnected", "error_bad_destination"]) return false unless status_code_validator.valid?(@status_code) true